mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-23 02:14:50 +00:00
Simplify BufferParams::bufferFormat()
The differentiation of "xetex" and "platex" is not needed here, is ambiguous and confusing (see #10013). The code that relies on it can/should get its information otherwise. Furthermore, polyglossia-exclusive languages now also work with LuaTeX, since we support LuaTeX + polyglossia.
This commit is contained in:
parent
1f6e2c323e
commit
ad9887da9c
@ -2350,17 +2350,7 @@ bool BufferParams::addLayoutModule(string const & modName)
|
|||||||
|
|
||||||
string BufferParams::bufferFormat() const
|
string BufferParams::bufferFormat() const
|
||||||
{
|
{
|
||||||
string format = documentClass().outputFormat();
|
return documentClass().outputFormat();
|
||||||
if (format == "latex") {
|
|
||||||
if (useNonTeXFonts)
|
|
||||||
// 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";
|
|
||||||
}
|
|
||||||
return format;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -2421,16 +2411,9 @@ vector<string> BufferParams::backends() const
|
|||||||
v.push_back("pdflatex");
|
v.push_back("pdflatex");
|
||||||
v.push_back("latex");
|
v.push_back("latex");
|
||||||
}
|
}
|
||||||
|
v.push_back("xetex");
|
||||||
v.push_back("luatex");
|
v.push_back("luatex");
|
||||||
v.push_back("dviluatex");
|
v.push_back("dviluatex");
|
||||||
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");
|
|
||||||
}
|
|
||||||
} else
|
} else
|
||||||
v.push_back(buffmt);
|
v.push_back(buffmt);
|
||||||
|
|
||||||
|
@ -339,7 +339,9 @@ bool Converters::convert(Buffer const * buffer,
|
|||||||
runparams.flavor = getFlavor(edgepath, buffer);
|
runparams.flavor = getFlavor(edgepath, buffer);
|
||||||
|
|
||||||
if (buffer) {
|
if (buffer) {
|
||||||
runparams.use_japanese = buffer->params().bufferFormat() == "platex";
|
runparams.use_japanese =
|
||||||
|
buffer->params().bufferFormat() == "latex"
|
||||||
|
&& buffer->params().encoding().package() == Encoding::japanese;
|
||||||
runparams.use_indices = buffer->params().use_indices;
|
runparams.use_indices = buffer->params().use_indices;
|
||||||
runparams.bibtex_command = (buffer->params().bibtex_command == "default") ?
|
runparams.bibtex_command = (buffer->params().bibtex_command == "default") ?
|
||||||
string() : buffer->params().bibtex_command;
|
string() : buffer->params().bibtex_command;
|
||||||
|
@ -44,11 +44,9 @@ string const guiErrorType(string const & s)
|
|||||||
return N_("DocBook");
|
return N_("DocBook");
|
||||||
else if (s == "literate")
|
else if (s == "literate")
|
||||||
return N_("Literate");
|
return N_("Literate");
|
||||||
else if (s == "platex")
|
else if (s == "latex")
|
||||||
return N_("pLaTeX");
|
// This covers all LaTeX variants
|
||||||
else if (s == "latex" || "xetex")
|
// (LaTeX, PDFLaTeX, XeTeX, LuaTeX, pLaTeX)
|
||||||
// All LaTeX variants except pLaTeX
|
|
||||||
// (LaTeX, PDFLaTeX, XeTeX, LuaTeX)
|
|
||||||
return N_("LaTeX");
|
return N_("LaTeX");
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
@ -127,7 +127,7 @@ void InsetListings::latex(otexstream & os, OutputParams const & runparams) const
|
|||||||
// glyphs, except if full-unicode aware backends
|
// glyphs, except if full-unicode aware backends
|
||||||
// such as XeTeX or LuaTeX are used, and with pLaTeX.
|
// such as XeTeX or LuaTeX are used, and with pLaTeX.
|
||||||
bool const multibyte_possible = runparams.isFullUnicode()
|
bool const multibyte_possible = runparams.isFullUnicode()
|
||||||
|| (buffer().params().bufferFormat() == "platex"
|
|| (buffer().params().encoding().package() == Encoding::japanese
|
||||||
&& runparams.encoding->package() == Encoding::japanese);
|
&& runparams.encoding->package() == Encoding::japanese);
|
||||||
|
|
||||||
if (!multibyte_possible && !runparams.encoding->hasFixedWidth()) {
|
if (!multibyte_possible && !runparams.encoding->hasFixedWidth()) {
|
||||||
|
Loading…
Reference in New Issue
Block a user