From: Juergen Spitzmueller Date: Wed, 22 Feb 2017 10:26:02 +0000 (+0100) Subject: xunicode (only) needs to be loaded for tipa emulation. X-Git-Tag: 2.3.0alpha1~337 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=b6a7530ba22c7cacda9c3392057cc04975fe7f5f;p=lyx.git xunicode (only) needs to be loaded for tipa emulation. Previous fontspec loaded xunicode internally, for recent version, this is no longer desired. However, we still need it for tipa emulation. We use fontspec's trick to bypass XeTeX test with LuaTeX. --- diff --git a/src/BufferParams.cpp b/src/BufferParams.cpp index a4c3a80dc1..a725068792 100644 --- a/src/BufferParams.cpp +++ b/src/BufferParams.cpp @@ -2176,12 +2176,19 @@ bool BufferParams::writeLaTeX(otexstream & os, LaTeXFeatures & features, os << "}\n"; } - // xunicode needs to be loaded at least after amsmath, amssymb, + // xunicode only needs to be loaded if tipa is used + // (the rest is obsoleted by the new TU encoding). + // It 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) + if (features.mustProvide("tipa") && useNonTeXFonts) { + // The package officially only supports XeTeX, but also works + // with LuaTeX. Thus we work around its XeTeX test. + if (features.runparams().flavor != OutputParams::XETEX) { + os << "% Pretend to xunicode that we are XeTeX\n" + << "\\def\\XeTeXpicfile{}\n"; + } os << "\\usepackage{xunicode}\n"; + } // Polyglossia must be loaded last ... if (use_polyglossia) {