From: Jürgen Spitzmüller Date: Sat, 27 Nov 2010 13:43:13 +0000 (+0000) Subject: Allow to use XeTeX and LuaTeX with tex fonts. X-Git-Tag: 2.0.0~1657 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=ff20f7ebe9cfd2190784c1791fe0b6f143274ed5;p=features.git Allow to use XeTeX and LuaTeX with tex fonts. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@36537 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/Buffer.cpp b/src/Buffer.cpp index 8b0248398a..72fa091087 100644 --- a/src/Buffer.cpp +++ b/src/Buffer.cpp @@ -3630,9 +3630,11 @@ vector Buffer::backends() const vector 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"); diff --git a/src/BufferParams.cpp b/src/BufferParams.cpp index 6e72a38c04..eda655b9d4 100644 --- a/src/BufferParams.cpp +++ b/src/BufferParams.cpp @@ -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";