]> git.lyx.org Git - lyx.git/blobdiff - src/BufferParams.cpp
Fix typo.
[lyx.git] / src / BufferParams.cpp
index 9d121cb4f410dc3a322521ee58024de9e085558f..a8c0a497dfecde1bf574d8de975616af5367aab5 100644 (file)
@@ -1582,7 +1582,8 @@ bool BufferParams::writeLaTeX(otexstream & os, LaTeXFeatures & features,
                os << from_ascii(ams);
 
        if (useNonTeXFonts) {
-               os << "\\usepackage{fontspec}\n";
+               if (!features.isProvided("fontspec"))
+                       os << "\\usepackage{fontspec}\n";
                if (features.mustProvide("unicode-math")
                    && features.isAvailable("unicode-math"))
                        os << "\\usepackage{unicode-math}\n";
@@ -2047,7 +2048,7 @@ bool BufferParams::writeLaTeX(otexstream & os, LaTeXFeatures & features,
        // koma's own caption commands are used instead of caption. We
        // use \PassOptionsToPackage here because the user could have
        // already loaded subfig in the preamble.
-       if (features.isRequired("subfig")) {
+       if (features.mustProvide("subfig")) {
                atlyxpreamble += "\\@ifundefined{showcaptionsetup}{}{%\n"
                        " \\PassOptionsToPackage{caption=false}{subfig}}\n"
                        "\\usepackage{subfig}\n";
@@ -2108,7 +2109,7 @@ bool BufferParams::writeLaTeX(otexstream & os, LaTeXFeatures & features,
        }
        if (features.isRequired("bicaption"))
                lyxpreamble += "\\usepackage{bicaption}\n";
-       if (!listings_params.empty() || features.isRequired("listings"))
+       if (!listings_params.empty() || features.mustProvide("listings"))
                lyxpreamble += "\\usepackage{listings}\n";
        if (!listings_params.empty()) {
                lyxpreamble += "\\lstset{";
@@ -2122,6 +2123,7 @@ bool BufferParams::writeLaTeX(otexstream & os, LaTeXFeatures & features,
 
        // xunicode needs to be loaded at least after amsmath, amssymb,
        // esint and the other packages that provide special glyphs
+       // The package only supports XeTeX currently.
        if (features.runparams().flavor == OutputParams::XETEX
            && useNonTeXFonts)
                lyxpreamble += "\\usepackage{xunicode}\n";
@@ -2343,7 +2345,10 @@ string BufferParams::bufferFormat() const
        string format = documentClass().outputFormat();
        if (format == "latex") {
                if (useNonTeXFonts)
-                       return "xetex"; // actually "xetex or luatex"
+                       // FIXME: In this context, this means "xetex or luatex"
+                       // with fontspec. We cannot differentiate further here.
+                       // But maybe use a more appropriate string.
+                       return "xetex";
                if (encoding().package() == Encoding::japanese)
                        return "platex";
        }
@@ -2413,11 +2418,8 @@ vector<string> BufferParams::backends() const
                v.push_back("xetex");
        } else if (buffmt == "xetex") {
                v.push_back("xetex");
-               // FIXME: need to test all languages (bug 8205)
-               if (!language || !language->isPolyglossiaExclusive()) {
-                       v.push_back("luatex");
-                       v.push_back("dviluatex");
-               }
+               v.push_back("luatex");
+               v.push_back("dviluatex");
        } else
                v.push_back(buffmt);
 
@@ -2966,8 +2968,8 @@ void BufferParams::writeEncodingPreamble(otexstream & os,
        // XeTeX/LuaTeX: (see also #9740)
        // With Unicode fonts we use utf8-plain without encoding package.
        // With TeX fonts, we cannot use utf8-plain, but "inputenc" fails.
-       // XeTeX must use ASCII encoding, for LuaTeX, we load
-       // "luainputenc" (see below).
+       // XeTeX must use ASCII encoding (see Buffer.cpp),
+       //  for LuaTeX, we load "luainputenc" (see below).
        if (useNonTeXFonts || features.runparams().flavor == OutputParams::XETEX)
                return;