]> git.lyx.org Git - lyx.git/blobdiff - src/LaTeXFeatures.cpp
Output end of math environments at the beginning of a new line,
[lyx.git] / src / LaTeXFeatures.cpp
index 94745c344f751e94ac9e862e81012215b43b6711..8820e1c412bca088e5654ab6645523ba2b161217 100644 (file)
@@ -257,6 +257,9 @@ static docstring const ogonek_def = from_ascii(
        "\\newcommand{\\ogonek}[1]{\\mathpalette\\doogonek{#1}}\n");
 
 static docstring const lyxref_def = from_ascii(
+               "\\RS@ifundefined{subref}\n"
+               "  {\\def\\RSsubtxt{section~}\\newref{sub}{name = \\RSsubtxt}}\n" 
+               "  {}\n"
                "\\RS@ifundefined{thmref}\n"
                "  {\\def\\RSthmtxt{theorem~}\\newref{thm}{name = \\RSthmtxt}}\n" 
                "  {}\n"
@@ -919,7 +922,7 @@ docstring const LaTeXFeatures::getMacros() const
                macros << changetracking_dvipost_def;
        
        if (mustProvide("ct-xcolor-ulem")) {
-               int const prec = macros.precision(2);
+               streamsize const prec = macros.precision(2);
        
                RGBColor cadd = rgbFromHexName(lcolor.getX11Name(Color_addedtext));
                macros << "\\providecolor{lyxadded}{rgb}{"
@@ -944,22 +947,53 @@ docstring const LaTeXFeatures::getMacros() const
 }
 
 
-string const LaTeXFeatures::getBabelOptions() const
+string const LaTeXFeatures::getBabelPresettings() const
+{
+       ostringstream tmp;
+
+       LanguageList::const_iterator it  = UsedLanguages_.begin();
+       LanguageList::const_iterator end = UsedLanguages_.end();
+       for (; it != end; ++it)
+               if (!(*it)->babel_presettings().empty())
+                       tmp << (*it)->babel_presettings() << '\n';
+       if (!params_.language->babel_presettings().empty())
+               tmp << params_.language->babel_presettings() << '\n';
+
+       return tmp.str();
+}
+
+
+string const LaTeXFeatures::getBabelPostsettings() const
 {
        ostringstream tmp;
 
        LanguageList::const_iterator it  = UsedLanguages_.begin();
-       LanguageList::const_iterator end =  UsedLanguages_.end();
+       LanguageList::const_iterator end = UsedLanguages_.end();
        for (; it != end; ++it)
-               if (!(*it)->latex_options().empty())
-                       tmp << (*it)->latex_options() << '\n';
-       if (!params_.language->latex_options().empty())
-               tmp << params_.language->latex_options() << '\n';
+               if (!(*it)->babel_postsettings().empty())
+                       tmp << (*it)->babel_postsettings() << '\n';
+       if (!params_.language->babel_postsettings().empty())
+               tmp << params_.language->babel_postsettings() << '\n';
 
        return tmp.str();
 }
 
 
+bool LaTeXFeatures::needBabelLangOptions() const
+{
+       if (!lyxrc.language_global_options || params_.language->asBabelOptions())
+               return true;
+
+       LanguageList::const_iterator it  = UsedLanguages_.begin();
+       LanguageList::const_iterator end = UsedLanguages_.end();
+       for (; it != end; ++it)
+               if ((*it)->asBabelOptions())
+                       return true;
+
+       return false;
+}
+
+
 docstring const LaTeXFeatures::getTClassPreamble() const
 {
        // the text class specific preamble