Refine lang nesting fix

This commit is contained in:
Juergen Spitzmueller 2015-06-19 19:02:35 +02:00
parent b2e4989212
commit 46aed6d2b9

View File

@ -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",