From: Juergen Spitzmueller Date: Fri, 19 Jun 2015 17:02:35 +0000 (+0200) Subject: Refine lang nesting fix X-Git-Tag: 2.2.0alpha1~505 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=46aed6d2b90cafed93a6ee996ec72c09a6325f92;p=features.git Refine lang nesting fix --- diff --git a/src/output_latex.cpp b/src/output_latex.cpp index fdfe7f83e7..80cb990442 100644 --- a/src/output_latex.cpp +++ b/src/output_latex.cpp @@ -194,6 +194,8 @@ static TeXEnvironmentData prepareEnvironment(Buffer const & buf, } if (style.isEnvironment()) { + if (par_lang != doc_lang) + state->open_polyglossia_lang_ = par_lang; os << "\\begin{" << from_ascii(style.latexname()) << '}'; if (!style.latexargs().empty()) { OutputParams rp = runparams; @@ -969,10 +971,8 @@ void TeXOnePar(Buffer const & buf, unskip_newline = !localswitch; } } else if (!par_lang.empty()) { - // If we are in an environment, we have to close the language afterwards - if (style.isEnvironment()) - state->open_polyglossia_lang_ = par_lang; - else { + // If we are in an environment, we have to close the "outer" language afterwards + if (!style.isEnvironment() || state->open_polyglossia_lang_ != par_lang) { os << from_ascii(subst( lang_end_command, "$$lang",