From af9838fd32f20f80c8e8af30aa0114abe1412160 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=BCnter=20Milde?= Date: Tue, 7 May 2019 23:37:30 +0200 Subject: [PATCH] Fix spurious \end{CJK} in LaTeX output. --- src/output_latex.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/output_latex.cpp b/src/output_latex.cpp index ab3760f9ed..60bc9f3d59 100644 --- a/src/output_latex.cpp +++ b/src/output_latex.cpp @@ -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())