Jürgen Spitzmüller wrote:
> > So my question: What is the bug? Is the bug that the file makes a pdf?
> > Or is it a bug that it doesn't do it anymore if an enter is made?
> 
> The problem is due to a wrong language/encoding setting in you document.

On a closer look, I actually encountered a bug: The CJK package is not loaded 
(if requested by a secondary language) if the main encoding has been changed. 
The attached patch fixes it. It also assures "CJKutf8" is loaded if the main 
encoding is (some variant of) utf8 (currently, it was only loaded if the main 
language was a CJK lang and the encoding was set to cjk-utf8).

Objections?

Regards,
Jürgen
diff --git a/src/BufferParams.cpp b/src/BufferParams.cpp
index 55c2fa1..3b641e9 100644
--- a/src/BufferParams.cpp
+++ b/src/BufferParams.cpp
@@ -2821,7 +2821,7 @@ void BufferParams::writeEncodingPreamble(otexstream & os,
 			os << "]{inputenc}\n";
 		}
 		if (package == Encoding::CJK || features.mustProvide("CJK")) {
-			if (language->encoding()->name() == "utf8-cjk"
+			if (language->encoding()->iconvName() == "UTF-8"
 			    && LaTeXFeatures::isAvailable("CJKutf8"))
 				os << "\\usepackage{CJKutf8}\n";
 			else
@@ -2847,6 +2847,14 @@ void BufferParams::writeEncodingPreamble(otexstream & os,
 				os << "\\usepackage{CJK}\n";
 			break;
 		}
+		// load the CJK package if needed by a secondary language
+		if (encoding().package() != Encoding::CJK && features.mustProvide("CJK")) {
+			if (encoding().iconvName() == "UTF-8"
+			    && LaTeXFeatures::isAvailable("CJKutf8"))
+				os << "\\usepackage{CJKutf8}\n";
+			else
+				os << "\\usepackage{CJK}\n";
+		}
 	}
 }
 

Reply via email to