Fix spurious \end{CJK} in LaTeX output.

This commit is contained in:
Günter Milde 2019-05-07 23:37:30 +02:00
parent 46119b3564
commit af9838fd32

View File

@ -305,8 +305,10 @@ static TeXEnvironmentData prepareEnvironment(Buffer const & buf,
// in multilingual environments, the CJK tags have to be nested properly
data.cjk_nested = false;
if (data.par_language->encoding()->package() == Encoding::CJK &&
state->open_encoding_ != CJK && pit->isMultiLingual(bparams)) {
if (!bparams.useNonTeXFonts && (bparams.inputenc == "auto-legacy"
|| bparams.inputenc == "auto-legacy-plain")
&& data.par_language->encoding()->package() == Encoding::CJK
&& state->open_encoding_ != CJK && pit->isMultiLingual(bparams)) {
if (prev_par_language->encoding()->package() == Encoding::CJK) {
os << "\\begin{CJK}{"
<< from_ascii(data.par_language->encoding()->latexName())