]> git.lyx.org Git - lyx.git/blobdiff - src/LaTeXFeatures.cpp
Merge branch 'master' of git.lyx.org:lyx
[lyx.git] / src / LaTeXFeatures.cpp
index 7960ad2625be6c7b5abf50cd1d2cac495209be78..bbc76d18523eb714573fdc7dc874e90baf90e8e5 100644 (file)
@@ -277,6 +277,42 @@ static docstring const lyxref_def = from_ascii(
                "  {\\def\\RSlemtxt{lemma~}\\newref{lem}{name = \\RSlemtxt}}\n" 
                "  {}\n");
 
+// Make sure the columns are also outputed as rtl
+static docstring const rtloutputdblcol_def = from_ascii(
+       "\\def\\@outputdblcol{%\n"
+       "  \\if@firstcolumn\n"
+       "    \\global \\@firstcolumnfalse\n"
+       "    \\global \\setbox\\@leftcolumn \\box\\@outputbox\n"
+       "  \\else\n"
+       "    \\global \\@firstcolumntrue\n"
+       "    \\setbox\\@outputbox \\vbox {%\n"
+       "      \\hb@xt@\\textwidth {%\n"
+       "      \\kern\\textwidth \\kern-\\columnwidth %**\n"
+       "      \\hb@xt@\\columnwidth {%\n"
+       "         \\box\\@leftcolumn \\hss}%\n"
+       "      \\kern-\\textwidth %**\n"
+       "      \\hfil\n"
+       "      {\\normalcolor\\vrule \\@width\\columnseprule}%\n"
+       "      \\hfil\n"
+       "      \\kern-\\textwidth  %**\n"
+       "      \\hb@xt@\\columnwidth {%\n"
+       "         \\box\\@outputbox \\hss}%\n"
+       "      \\kern-\\columnwidth \\kern\\textwidth %**\n"
+       "    }%\n"
+       "  }%\n"
+       "  \\@combinedblfloats\n"
+       "  \\@outputpage\n"
+       "  \\begingroup\n"
+       "  \\@dblfloatplacement\n"
+       "  \\@startdblcolumn\n"
+       "  \\@whilesw\\if@fcolmade \\fi\n"
+       "  {\\@outputpage\n"
+       "    \\@startdblcolumn}%\n"
+       "  \\endgroup\n"
+       "  \\fi\n"
+       "}\n"
+       "\\@mparswitchtrue\n");
+
 
 /////////////////////////////////////////////////////////////////////
 //
@@ -438,19 +474,34 @@ bool LaTeXFeatures::isRequired(string const & name) const
 
 bool LaTeXFeatures::isProvided(string const & name) const
 {
+       if (params_.useNonTeXFonts)
+               return params_.documentClass().provides(name);
+
        bool const ot1 = (params_.font_encoding() == "default"
                || params_.font_encoding() == "OT1");
        bool const complete = (params_.fonts_sans == "default")
                && (params_.fonts_typewriter == "default");
+       bool const nomath = (params_.fonts_math == "default");
        return params_.documentClass().provides(name)
                || theLaTeXFonts().getLaTeXFont(
-                       from_ascii(params_.fonts_roman)).provides(name, ot1, complete)
+                       from_ascii(params_.fonts_roman)).provides(name, ot1,
+                                                                 complete,
+                                                                 nomath)
                || theLaTeXFonts().getLaTeXFont(
-                       from_ascii(params_.fonts_sans)).provides(name, ot1, complete)
+                       from_ascii(params_.fonts_sans)).provides(name, ot1,
+                                                                complete,
+                                                                nomath)
                || theLaTeXFonts().getLaTeXFont(
-                       from_ascii(params_.fonts_typewriter)).provides(name, ot1, complete);
+                       from_ascii(params_.fonts_typewriter)).provides(name, ot1,
+                                                                      complete,
+                                                                      nomath)
+               || theLaTeXFonts().getLaTeXFont(
+                       from_ascii(params_.fonts_math)).provides(name, ot1,
+                                                                      complete,
+                                                                      nomath);
 }
 
+
 bool LaTeXFeatures::mustProvide(string const & name) const
 {
        return isRequired(name) && !isProvided(name);
@@ -1065,6 +1116,9 @@ docstring const LaTeXFeatures::getMacros() const
        if (mustProvide("ct-none"))
                macros << changetracking_none_def;
 
+       if (mustProvide("rtloutputdblcol"))
+               macros << rtloutputdblcol_def;
+
        return macros.str();
 }
 
@@ -1227,6 +1281,7 @@ docstring const LaTeXFeatures::getTClassHTMLStyles() const
 
 
 namespace {
+
 docstring const getFloatI18nPreamble(docstring const & type,
                        docstring const & name, Language const * lang,
                        Encoding const & enc, bool const polyglossia)