From 78129d451179ecea9f56ad41f874419ccea22c91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrgen=20Spitzm=C3=BCller?= Date: Sat, 22 Nov 2008 16:43:06 +0000 Subject: [PATCH] * output_latex:cpp: - fix some CJK nesting issues. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/branches/BRANCH_1_6_X@27666 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/output_latex.cpp | 9 +++++---- status.16x | 2 ++ 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/output_latex.cpp b/src/output_latex.cpp index c83ad3bd02..893021349d 100644 --- a/src/output_latex.cpp +++ b/src/output_latex.cpp @@ -188,8 +188,9 @@ TeXEnvironment(Buffer const & buf, bool cjk_nested = false; if (par_language->encoding()->package() == Encoding::CJK && open_encoding_ != CJK && pit->isMultiLingual(bparams)) { - os << "\\begin{CJK}{" << from_ascii(par_language->encoding()->latexName()) - << "}{" << from_ascii(bparams.fontsCJK) << "}%\n"; + if (prev_par_language->encoding()->package() == Encoding::CJK) + os << "\\begin{CJK}{" << from_ascii(par_language->encoding()->latexName()) + << "}{" << from_ascii(bparams.fontsCJK) << "}%\n"; open_encoding_ = CJK; cjk_nested = true; texrow.newline(); @@ -668,8 +669,8 @@ TeXOnePar(Buffer const & buf, if (nextpit != paragraphs.end() && open_encoding_ == CJK && (nextpit->getParLanguage(bparams)->encoding()->package() != Encoding::CJK || nextpit->layout().isEnvironment() && nextpit->isMultiLingual(bparams)) - // in environments, CJK has to be closed later (nesting!) - && !style.isEnvironment()) { + // inbetween environments, CJK has to be closed later (nesting!) + && (!style.isEnvironment() || !nextpit->layout().isEnvironment())) { os << "\\end{CJK}\n"; open_encoding_ = none; } diff --git a/status.16x b/status.16x index 38f7cf0347..fbf9962341 100644 --- a/status.16x +++ b/status.16x @@ -69,6 +69,8 @@ What's new - Fix export to latex in the presence of an encoding switch (bug 5489). +- Fix nesting of \begin{CJK} and \end{CJK} with other environments. + - Fix export of straight quotes in Hebrew and Greek context.