13 February 2010 View Comments

Howto Use Unicode / Chinese (CJK) Encoding in LyX


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

  1. In Document/Settings/Language, change the language to Chinese (simplified, in my case) and leave the encoding as the Language Default
  2. In the Document/Settings/Fonts panel, change the CJK box to include a font you found (gbsn, in my case).

lyx_cjk_1

lyx_cjk_2

That’s all, this is how the output loos like

现在可以再LyX里轻松的写中文了. 关于字体我想会因系统有些不同, 我现在对排版出来的结果还是挺满意的.

如果你发现什么好看的字体请告诉我.

lyx_cjk_ouput

Reference:

http://wiki.lyx.org/LyX/Unicode

Tags: ,
blog comments powered by Disqus