* load CJKutf8 package, if available, for CJK documents in utf8 encoding

(first part of fix to bug 5386)

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@28142 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Jürgen Spitzmüller 2009-01-14 09:26:13 +00:00
parent 03264aab68
commit ef6be5f499
3 changed files with 47 additions and 4 deletions

View File

@ -234,6 +234,7 @@
\TestPackage{bm}
\TestPackage{booktabs}
\TestPackage{braille}
\TestPackage{CJKutf8}
\TestPackage{color} % this one should be there if graphics.sty is there.
\TestPackage{covington}
\TestPackage{csquotes}

View File

@ -1,5 +1,5 @@
#LyX 1.6.2svn created this file. For more info see http://www.lyx.org/
\lyxformat 345
#LyX 2.0.0svn created this file. For more info see http://www.lyx.org/
\lyxformat 347
\begin_document
\begin_header
\textclass article
@ -3949,6 +3949,40 @@ bibtopic
is used to split BibTeX created bibliographies into sections.
\end_layout
\begin_layout Subsection
CJKutf8
\end_layout
\begin_layout Description
Found:
\begin_inset Info
type "package"
arg "CJKutf8"
\end_inset
\end_layout
\begin_layout Description
CTAN:
\family typewriter
language/chinese/CJK/
\end_layout
\begin_layout Description
Notes: The package
\family sans
CJKutf8
\family default
(part of the
\family sans
CJK
\family default
bundle) merges base LaTeX's and CJK's UTF-8 support.
It is needed to produce proper output with the combination of CJK, utf-8
encoding, and hyperref.
\end_layout
\begin_layout Subsection
dvipost
\end_layout

View File

@ -2168,6 +2168,10 @@ void BufferParams::writeEncodingPreamble(odocstream & os,
texrow.newline();
}
if (package == Encoding::CJK || features.mustProvide("CJK")) {
if (language->encoding()->name() == "utf8-cjk"
&& features.isAvailable("CJKutf8"))
os << "\\usepackage{CJKutf8}\n";
else
os << "\\usepackage{CJK}\n";
texrow.newline();
}
@ -2185,6 +2189,10 @@ void BufferParams::writeEncodingPreamble(odocstream & os,
texrow.newline();
break;
case Encoding::CJK:
if (encoding().name() == "utf8-cjk"
&& features.isAvailable("CJKutf8"))
os << "\\usepackage{CJKutf8}\n";
else
os << "\\usepackage{CJK}\n";
texrow.newline();
break;