This patch fixes a problem reported in bug 4337: the CJK package is not loaded 
automatically if a CJK language is chosen in a non-CJK document.

I'll apply to branch and trunk soon, since the patch looks straightforward to 
me.

Jürgen
Index: src/LaTeXFeatures.cpp
===================================================================
--- src/LaTeXFeatures.cpp	(Revision 21642)
+++ src/LaTeXFeatures.cpp	(Arbeitskopie)
@@ -354,6 +354,10 @@
 {
 	if (!lang->babel().empty())
 		UsedLanguages_.insert(lang);
+	// CJK languages do not have a babel name.
+	// They use the CJK package
+	if (lang->encoding()->package() == Encoding::CJK)
+		require("CJK");
 }
 
 
Index: src/BufferParams.cpp
===================================================================
--- src/BufferParams.cpp	(Revision 21642)
+++ src/BufferParams.cpp	(Arbeitskopie)
@@ -1406,7 +1406,7 @@
 			os << "]{inputenc}\n";
 			texrow.newline();
 		}
-		if (package == Encoding::CJK) {
+		if (package == Encoding::CJK || features.mustProvide("CJK")) {
 			os << "\\usepackage{CJK}\n";
 			texrow.newline();
 		}

Reply via email to