commit 15df033bcec5aa65cdb26b7f31b9082f3f7e05da
Author: Juergen Spitzmueller <[email protected]>
Date: Sun Apr 29 13:18:05 2018 +0200
PassThru paragraphs have latex_language; consider this when checking
previous language
Fixes: #10793.
---
src/output_latex.cpp | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/output_latex.cpp b/src/output_latex.cpp
index c36ed25..25ec597 100644
--- a/src/output_latex.cpp
+++ b/src/output_latex.cpp
@@ -790,6 +790,9 @@ void TeXOnePar(Buffer const & buf,
// environment with nesting depth greater than (or equal to, but with
// a different layout) the current one. If there is no previous
// paragraph, the previous language is the outer language.
+ // Note further that we take the outer language also if the prior par
+ // is PassThru, since in that case it has latex_language, and all
secondary
+ // languages have been closed (#10793).
bool const use_prev_env_language = state->prev_env_language_ != 0
&& priorpar
&& priorpar->layout().isEnvironment()
@@ -797,12 +800,11 @@ void TeXOnePar(Buffer const & buf,
|| (priorpar->getDepth() == par.getDepth()
&& priorpar->layout() != par.layout()));
Language const * const prev_language =
- (pit != 0)
+ (priorpar && !priorpar->isPassThru())
? (use_prev_env_language ? state->prev_env_language_
: priorpar->getParLanguage(bparams))
: outer_language;
-
bool const use_polyglossia = runparams.use_polyglossia;
string const par_lang = use_polyglossia ?
getPolyglossiaEnvName(par_language): par_language->babel();