]> git.lyx.org Git - lyx.git/blobdiff - src/output_latex.cpp
More no-math fonts
[lyx.git] / src / output_latex.cpp
index 3178ac599f7b3f99635621dda826bef624187cf8..92913afb4e92c1cf8f11f34c5d43284bccb0b6f8 100644 (file)
@@ -581,7 +581,8 @@ void TeXOnePar(Buffer const & buf,
                                        os << "\\L{";
                        }
                        // With CJK, the CJK tag has to be closed first (see below)
-                       if (runparams.encoding->package() != Encoding::CJK) {
+                       if (runparams.encoding->package() != Encoding::CJK
+                           && !par_lang.empty()) {
                                os << from_ascii(subst(
                                        lang_begin_command,
                                        "$$lang",
@@ -642,7 +643,8 @@ void TeXOnePar(Buffer const & buf,
                                        os << "%\n";
                                }
                                // With CJK, the CJK tag had to be closed first (see above)
-                               if (runparams.encoding->package() == Encoding::CJK) {
+                               if (runparams.encoding->package() == Encoding::CJK
+                                   && !par_lang.empty()) {
                                        os << from_ascii(subst(
                                                lang_begin_command,
                                                "$$lang",
@@ -764,7 +766,9 @@ void TeXOnePar(Buffer const & buf,
                   || (runparams.isLastPar && par_language->babel() != outer_language->babel()));
 
        if (closing_rtl_ltr_environment
-               || (runparams.isLastPar && par_language->babel() != outer_language->babel())) {
+           || (runparams.isLastPar
+               && ((!use_polyglossia && par_language->babel() != outer_language->babel())
+                   || (use_polyglossia && par_language->polyglossia() != outer_language->polyglossia())))) {
                // Since \selectlanguage write the language to the aux file,
                // we need to reset the language at the end of footnote or
                // float.