]> git.lyx.org Git - features.git/commitdiff
Allow to use XeTeX and LuaTeX with tex fonts.
authorJürgen Spitzmüller <spitz@lyx.org>
Sat, 27 Nov 2010 13:43:13 +0000 (13:43 +0000)
committerJürgen Spitzmüller <spitz@lyx.org>
Sat, 27 Nov 2010 13:43:13 +0000 (13:43 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@36537 a592a061-630c-0410-9148-cb99ea01b6c8

src/Buffer.cpp
src/BufferParams.cpp

index 8b0248398a2b2833eb5ded3d5a5cc7a2aecf1416..72fa0910879ca9e34a759347b8ec25ea69d745fe 100644 (file)
@@ -3630,9 +3630,11 @@ vector<string> Buffer::backends() const
        vector<string> v;
        v.push_back(bufferFormat());
        // FIXME: Don't hardcode format names here, but use a flag
-       if (v.back() == "latex")
+       if (v.back() == "latex") {
                v.push_back("pdflatex");
-       else if (v.back() == "xetex")
+               v.push_back("luatex");
+               v.push_back("xetex");
+       } else if (v.back() == "xetex")
                v.push_back("luatex");
        v.push_back("xhtml");
        v.push_back("text");
index 6e72a38c04c3579e8bff22f0c5912db13fe1aad6..eda655b9d40bafe6469ed3154bf95ff99702aeac 100644 (file)
@@ -1339,7 +1339,11 @@ bool BufferParams::writeLaTeX(odocstream & os, LaTeXFeatures & features,
        texrow.newline();
        // end of \documentclass defs
 
-       if (useNonTeXFonts) {
+       // Fontspec must also be loaded if XeTeX is used with tex fonts
+       // (in order to prevent later loading which overrides the tex
+       // fonts)
+       if (features.runparams().flavor == OutputParams::XETEX
+           || useNonTeXFonts) {
                os << "\\usepackage{fontspec}\n";
                texrow.newline();
        }
@@ -1360,9 +1364,9 @@ bool BufferParams::writeLaTeX(odocstream & os, LaTeXFeatures & features,
        // set font encoding
        // for arabic_arabi and farsi we also need to load the LAE and
        // LFE encoding
-       // XeTeX and LuaTeX (isFullUnicode() flavor) work without fontenc
+       // XeTeX and LuaTeX (with OS fonts) work without fontenc
        if (font_encoding() != "default" && language->lang() != "japanese"
-           && !features.runparams().isFullUnicode() && !tclass.provides("fontenc")) {
+           && !useNonTeXFonts && !tclass.provides("fontenc")) {
                size_t fars = language_options.str().find("farsi");
                size_t arab = language_options.str().find("arabic");
                if (language->lang() == "arabic_arabi"
@@ -1891,16 +1895,13 @@ bool BufferParams::writeLaTeX(odocstream & os, LaTeXFeatures & features,
 
        os << lyxpreamble;
 
-       // these packages (xunicode, for that matter) need to be loaded at least
-       // after amsmath, amssymb, esint and the other packages that provide 
-       // special glyphs
+       // xunicode needs to be loaded at least after amsmath, amssymb,
+       // esint and the other packages that provide special glyphs
        if (features.runparams().flavor == OutputParams::XETEX) {
                os << "\\usepackage{xunicode}\n";
                texrow.newline();
-               os << "\\usepackage{xltxtra}\n";
-               texrow.newline();
        }
-       // Polyglossia must be loaded after xltxtra
+       // Polyglossia must be loaded last
        if (use_polyglossia) {
                // call the package
                os << "\\usepackage{polyglossia}\n";