[LyX/master] With polyglossia, do not output global language end if we have no global language begin

Juergen Spitzmueller <[email protected]>
Newsgroups gmane.editors.lyx.cvs
Message-ID <[email protected]>
commit d50da8817bbe814e9d0213f3d7b3e3606aee2f0f
Author: Juergen Spitzmueller <[email protected]>
Date:   Thu Mar 19 12:12:16 2026 +0100

    With polyglossia, do not output global language end if we have no global language begin
---
 src/output_latex.cpp | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/output_latex.cpp b/src/output_latex.cpp
index 33f7cd47c9..dd0ba5db88 100644
--- a/src/output_latex.cpp
+++ b/src/output_latex.cpp
@@ -1846,10 +1846,12 @@ void latexParagraphs(Buffer const & buf,
 
 	// if "auto end" is switched off, explicitly close the language at the end
 	// but only if the last par is in a babel or polyglossia language
+	// and with polyglossia only of "auto_begin" is also off
 	Language const * const lastpar_language =
 			paragraphs.at(lastpit).getParLanguage(bparams);
-		lastpar_language->encoding()->package() != Encoding::CJK) {
-	if (maintext && !is_child && !lyxrc.language_auto_end && !mainlang.empty() &&
+	if (maintext && !is_child && !lyxrc.language_auto_end && !mainlang.empty()
+	    && lastpar_language->encoding()->package() != Encoding::CJK
+	    && (!lyxrc.language_auto_begin || !runparams.use_polyglossia)) {
 		os << from_utf8(subst(lang_end_command,
 					"$$lang",
 					mainlang))
-- 
lyx-cvs mailing list
[email protected]
https://lists.lyx.org/mailman/listinfo/lyx-cvs
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.