On 2015-11-06, Guenter Milde wrote: > On 2015-11-06, Guenter Milde wrote: >> On 2015-11-06, Kornel Benko wrote: >>> Am Donnerstag, 5. November 2015 um 20:12:53, schrieb Guenter Milde >>> <mi...@users.sf.net> >>> ...
>>>> pass "LaTeXFeatures & features" as argument >>>> and test for "features.runparams().flavor == OutputParams::XETEX" >>>> (cf. BufferParams::writeEncodingPreamble(). ... >>> I'd say this is the right way. But I wonder why BufferParams class does >>> not have access to features. I tried this way, but: after changing Encoding const & BufferParams::encoding() const to expect the "flavor" as argument, I started changing the 18+ calls to params.encoding() realizing that in most cases the "flavor" is not (yet) known: >> The export target and "flavour" is only known after a user request to export >> the document. and runparams is an instance of OutputParams and instantiating OutputParams requires passing the encoding - so we have a "hen and egg" problem! > Another way out would be to disable XeTeX export unless either the > inputencoding is set to ASCII or the font-set to non-TeX-fonts. I tried to implement this, but the export buttons are not greyed out: diff --git a/src/BufferParams.cpp b/src/BufferParams.cpp index a73194d..c6efac8 100644 @@ -2348,6 +2348,8 @@ vector<Format const *> BufferParams::exportableFormats(bool only_viewable) const excludes.insert("latex"); excludes.insert("pdflatex"); } + else if (encoding().latexName() != "ascii") + excludes.insert("xetex"); // XeTeX with TeX fonts requires ASCII encoding vector<Format const *> result = theConverters().getReachable(backs[0], only_viewable, true, excludes); for (vector<string>::const_iterator it = backs.begin() + 1; @@ -2388,10 +2390,12 @@ vector<string> BufferParams::backends() const } v.push_back("luatex"); v.push_back("dviluatex"); - v.push_back("xetex"); + if (!useNonTeXFonts && encoding().latexName() != "ascii") + v.push_back("xetex"); } else if (buffmt == "xetex") { v.push_back("xetex"); // FIXME: need to test all languages (bug 8205) + // FIXME: polyglossia now also works with luatex if (!language || !language->isPolyglossiaExclusive()) { v.push_back("luatex"); v.push_back("dviluatex"); What is missing? Also, luainputenc fails with more than one encoding in a document (see http://www.lyx.org/trac/ticket/9740), so we should disable LuaTeX with TeX-fonts and inputenc="auto". Günter