]> git.lyx.org Git - lyx.git/blobdiff - src/BufferParams.cpp
Typos.
[lyx.git] / src / BufferParams.cpp
index 438d606067057423ddc1924242ad9b25a91ea19f..329104080606030dc45eebe5babc22be89d34612 100644 (file)
@@ -1030,19 +1030,20 @@ bool BufferParams::writeLaTeX(odocstream & os, LaTeXFeatures & features,
                // http://www.mail-archive.com/lyx-devel@lists.lyx.org/msg129417.html
                size_t viet = language_options.str().find("vietnam");
                // viet = string::npos when not found
+               // the same is for all other languages that are not directly supported by
+               // babel, but where LaTeX-packages add babel support.
+               // this is currently the case for Latvian, Lithuanian, and Mongolian
+               size_t latvian = language_options.str().find("latvian");
+               size_t lithu = language_options.str().find("lithuanian");
+               size_t mongo = language_options.str().find("mongolian");
                // if Japanese is used, babel must directly be loaded
                // with language options, not in the class options, see
                // http://bugzilla.lyx.org/show_bug.cgi?id=4597#c4
                size_t japan = language_options.str().find("japanese");
-               // if Latvian or Lithuanian is used, babel must directly be loaded
-               // with language options, not in the class options, see
-               // http://bugzilla.lyx.org/show_bug.cgi?id=5323
-               size_t latvian = language_options.str().find("latvian");
-               size_t lithu = language_options.str().find("lithuanian");
-               if (lyxrc.language_global_options
-                       && !language_options.str().empty()
+               if (lyxrc.language_global_options && !language_options.str().empty()
                        && viet == string::npos && japan == string::npos
-                       && latvian == string::npos && lithu == string::npos)
+                       && latvian == string::npos && lithu == string::npos
+                       && mongo == string::npos)
                        clsoptions << language_options.str() << ',';
        }
 
@@ -1294,7 +1295,7 @@ bool BufferParams::writeLaTeX(odocstream & os, LaTeXFeatures & features,
        // PDF support.
        // * Hyperref manual: "Make sure it comes last of your loaded
        //   packages, to give it a fighting chance of not being over-written,
-       //   since its job is to redefine many LATEX commands."
+       //   since its job is to redefine many LaTeX commands."
        // * Email from Heiko Oberdiek: "It is usually better to load babel
        //   before hyperref. Then hyperref has a chance to detect babel.
        // * Has to be loaded before the "LyX specific LaTeX commands" to
@@ -1872,18 +1873,19 @@ string BufferParams::babelCall(string const & lang_opts) const
        // http://www.mail-archive.com/lyx-devel@lists.lyx.org/msg129417.html
        size_t viet = lang_opts.find("vietnam");
        // viet = string::npos when not found
+       // the same is for all other languages that are not directly supported by
+       // babel, but where LaTeX-packages add babel support.
+       // this is currently the case for Latvian, Lithuanian, and Mongolian
+       size_t latvian = lang_opts.find("latvian");
+       size_t lithu = lang_opts.find("lithuanian");
+       size_t mongo = lang_opts.find("mongolian");
        // If Japanese is used, babel must directly be loaded with the
        // language options, see
        // http://bugzilla.lyx.org/show_bug.cgi?id=4597#c4
        size_t japan = lang_opts.find("japanese");
-       // If Latvian or Lithuanian is used, babel must directly be loaded with
-       // the language options, see
-       // http://bugzilla.lyx.org/show_bug.cgi?id=5323
-       size_t latvian = lang_opts.find("latvian");
-       size_t lithu = lang_opts.find("lithuanian");
        if (!lyxrc.language_global_options || viet != string::npos
                || japan != string::npos || latvian != string::npos
-               || lithu != string::npos)
+               || lithu != string::npos || mongo != string::npos)
                return "\\usepackage[" + lang_opts + "]{babel}";
        return lang_pack;
 }