]> git.lyx.org Git - features.git/commitdiff
* load CJKutf8 package, if available, for CJK documents in utf8 encoding
authorJürgen Spitzmüller <spitz@lyx.org>
Wed, 14 Jan 2009 09:26:13 +0000 (09:26 +0000)
committerJürgen Spitzmüller <spitz@lyx.org>
Wed, 14 Jan 2009 09:26:13 +0000 (09:26 +0000)
  (first part of fix to bug 5386)

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@28142 a592a061-630c-0410-9148-cb99ea01b6c8

lib/chkconfig.ltx
lib/doc/LaTeXConfig.lyx
src/BufferParams.cpp

index 19b62e53c4b27fb0c1d9a8e9add74f64fa7a832f..fcac24b89c79a3eec6668160b57717a3ff8f123a 100644 (file)
 \TestPackage{bm}
 \TestPackage{booktabs}
 \TestPackage{braille}
+\TestPackage{CJKutf8}
 \TestPackage{color} % this one should be there if graphics.sty is there.
 \TestPackage{covington}
 \TestPackage{csquotes}
index e6f4e71c82f17bf4ff3fef7cc57061af9c8dccf1..18fcf661d21f1918c0cf333eaaa6f91a3e7340f4 100644 (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
index 08b07c3ba57dd513a62ca3591d72842b44afa729..4d52968de7fcbf537551af8e41e87746c01b2005 100644 (file)
@@ -2168,7 +2168,11 @@ void BufferParams::writeEncodingPreamble(odocstream & os,
                        texrow.newline();
                }
                if (package == Encoding::CJK || features.mustProvide("CJK")) {
-                       os << "\\usepackage{CJK}\n";
+                       if (language->encoding()->name() == "utf8-cjk"
+                           && features.isAvailable("CJKutf8"))
+                               os << "\\usepackage{CJKutf8}\n";
+                       else
+                               os << "\\usepackage{CJK}\n";
                        texrow.newline();
                }
        } else if (inputenc != "default") {
@@ -2185,7 +2189,11 @@ void BufferParams::writeEncodingPreamble(odocstream & os,
                        texrow.newline();
                        break;
                case Encoding::CJK:
-                       os << "\\usepackage{CJK}\n";
+                       if (encoding().name() == "utf8-cjk"
+                           && features.isAvailable("CJKutf8"))
+                               os << "\\usepackage{CJKutf8}\n";
+                       else
+                               os << "\\usepackage{CJK}\n";
                        texrow.newline();
                        break;
                }