]> git.lyx.org Git - features.git/commitdiff
BufferParams.cpp: babel must be loaded even when there is no given language parameter...
authorUwe Stöhr <uwestoehr@web.de>
Tue, 9 Oct 2007 23:03:14 +0000 (23:03 +0000)
committerUwe Stöhr <uwestoehr@web.de>
Tue, 9 Oct 2007 23:03:14 +0000 (23:03 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@20880 a592a061-630c-0410-9148-cb99ea01b6c8

src/BufferParams.cpp

index 6f2e3ed3a9dbc18801e7beba3fa5b6842c9ac77d..2f1886b5e4f4569b7ecf682afeeb832c74d83ad6 100644 (file)
@@ -901,7 +901,8 @@ bool BufferParams::writeLaTeX(odocstream & os, LaTeXFeatures & features,
                        language_options << language->babel();
                }
                // when Vietnamese is used, babel must directly be loaded with the
-               // language options, not in the class options
+               // language options, not in the class options, see
+               // http://www.mail-archive.com/lyx-devel@lists.lyx.org/msg129417.html
                int viet = language_options.str().find("vietnam");
                // viet = string::npos when not found
                if (lyxrc.language_global_options && !language_options.str().empty()
@@ -1134,8 +1135,12 @@ bool BufferParams::writeLaTeX(odocstream & os, LaTeXFeatures & features,
        // translate the word "Index" to the German "Stichwortverzeichnis".
        // For more infos why this place was chosen, see
        // http://www.mail-archive.com/lyx-devel@lists.lyx.org/msg128425.html
-       // if you encounter problem, you can shift babel to its old place behind
-       // the user-defined preamble
+       // If you encounter problems, you can shift babel to its old place behind
+       // the user-defined preamble. But in this case you must change the Vietnamese
+       // support from currently "\usepackage[vietnamese]{babel}" to:
+       // \usepackage{vietnamese}
+       // \usepackage{babel}
+       // because vietnamese must be loaded before hyperref
        if (use_babel && !features.isRequired("jurabib")) {
                // FIXME UNICODE
                lyxpreamble += from_utf8(babelCall(language_options.str())) + '\n';
@@ -1558,10 +1563,13 @@ string const BufferParams::babelCall(string const & lang_opts) const
        // suppress the babel call when there is no babel language defined
        // for the document language in the lib/languages file and if no
        // other languages are used (lang_opts is then empty)
-       if (lang_opts.empty())
+       // exception is the language "japanese-plain" where babel is needed anyway
+       // see http://www.mail-archive.com/lyx-devel@lists.lyx.org/msg129680.html
+       if (lang_opts.empty() && language->lang() != "japanese-plain")
                return string();
        // when Vietnamese is used, babel must directly be loaded with the
-       // language options
+       // language options, see
+       // http://www.mail-archive.com/lyx-devel@lists.lyx.org/msg129417.html
        int viet = lang_opts.find("vietnam");
        // viet = string::npos when not found
        if (!lyxrc.language_global_options || viet != string::npos)