13 February 2010
[Click to cite this article]
[hide academic citations]
AMA citation:
Jiang W. Howto Use Unicode / Chinese (CJK) Encoding in LyX. Stone Studio. 2010. Available at: http://wei-jiang.com/programming/latex/howto-use-unicode-chinese-cjk-encoding-in-lyx. Accessed July 31, 2010.
APA citation:
Jiang, Wei. (2010). Howto Use Unicode / Chinese (CJK) Encoding in LyX. Retrieved July 31, 2010, from Stone Studio Web site, http://wei-jiang.com/programming/latex/howto-use-unicode-chinese-cjk-encoding-in-lyx
Chicago citation:
Jiang, Wei, "Howto Use Unicode / Chinese (CJK) Encoding in LyX", Stone Studio, posted February 13, 2010, http://wei-jiang.com/programming/latex/howto-use-unicode-chinese-cjk-encoding-in-lyx (accessed July 31, 2010).
Harvard citation:
Jiang, W 2010, Howto Use Unicode / Chinese (CJK) Encoding in LyX, Stone Studio. Retrieved July 31, 2010, from <http://wei-jiang.com/programming/latex/howto-use-unicode-chinese-cjk-encoding-in-lyx>
MLA citation:
Jiang, Wei. "Howto Use Unicode / Chinese (CJK) Encoding in LyX." Stone Studio. 13 Feb. 2010. 31 Jul. 2010 <http://wei-jiang.com/programming/latex/howto-use-unicode-chinese-cjk-encoding-in-lyx>
Thank you for your interest.
Previously I showed how to use unicode in LyX / XeTex, it works but rather complicated. I found a much simple way of doing such thing, and now I can easily write Chinese together with English in LyX.
Step 1: Identify Fonts
Inspect your CJK installation and look for "tfm" ("tex font metric") files. These files indicate that you already have some Chinese fonts that LaTeX can use. In my system, in the directory “C:\Program Files (x86)\MiKTeX 2.8\fonts\tfm\arphic" I found many files with names like this: gbsnlp01.tfm. That indicates that the font "gbsn" is available to latex (take the first 4 letters of the tfm file name).
Step 2: Configure LyX
- In Document/Settings/Language, change the language to Chinese (simplified, in my case) and leave the encoding as the Language Default
- In the Document/Settings/Fonts panel, change the CJK box to include a font you found (gbsn, in my case).
That’s all, this is how the output loos like
现在可以再LyX里轻松的写中文了. 关于字体我想会因系统有些不同, 我现在对排版出来的结果还是挺满意的.
如果你发现什么好看的字体请告诉我.
Reference:
http://wiki.lyx.org/LyX/Unicode