]> git.lyx.org Git - lyx.git/blobdiff - src/output_latex.cpp
Routines for calculating numerical labels for BibTeX citations.
[lyx.git] / src / output_latex.cpp
index d40874e041959b60141ff60b235caf823f5bfe80..440bb03c66c978a4ddcb3145de9da262f49bfaa9 100644 (file)
@@ -671,11 +671,18 @@ ParagraphList::const_iterator TeXOnePar(Buffer const & buf,
                // when the paragraph uses CJK, the language has to be closed earlier
                if (font.language()->encoding()->package() != Encoding::CJK) {
                        if (lyxrc.language_command_end.empty()) {
-                               if (!prev_language->babel().empty()) {
+                               // If this is a child, we should restore the
+                               // master language after the last paragraph.
+                               Language const * const current_language =
+                                       (nextpit == paragraphs.end()
+                                       && runparams.master_language)
+                                               ? runparams.master_language
+                                               : outer_language;
+                               if (!current_language->babel().empty()) {
                                        os << from_ascii(subst(
                                                lyxrc.language_command_begin,
                                                "$$lang",
-                                               prev_language->babel()));
+                                               current_language->babel()));
                                        pending_newline = true;
                                }
                        } else if (!par_language->babel().empty()) {