Load the CJK package if requested

The package was not loaded if a the main language was not CJK, the main encoding was non-default and the document had a secondary CJK language.
This commit is contained in:
Juergen Spitzmueller 2013-12-01 10:57:13 +01:00
parent 7033b15793
commit b3a8abffc7

View File

@ -2847,6 +2847,15 @@ void BufferParams::writeEncodingPreamble(otexstream & os,
os << "\\usepackage{CJK}\n";
break;
}
// Load the CJK package if needed by a secondary language.
// If the main encoding is some variant of UTF8, use CJKutf8.
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";
}
}
}