CJK+XeLaTeX with LyX 

Nihao(你好),CJK+XeLaTeX with LyX

1 Simple

It is simple to make an immediate LyX file with CJK characters by compiling it with XeLaTeX:

1). Document \Rightarrow Settings \Rightarrow Fonts \Rightarrow Click Use non-TeX fonts.

2). Choose any fonts you want to replace Roman, Sans Serif and Typewriter.

3). Then compile the .lyx file with XeLaTeX.

In LyX 2.0.3 (by the time this short tutorial is made), the corresponding button on its toolbar might go dim after just one press. I don’t know what’s happenning, but you can dismiss the bug by using the menu instead:

1). View \Rightarrow Update (other formats), and then,

2). View \Rightarrow View (other formats).

2 Extension

However, the above is not a good way to handle the CJK problems, since once you switch the fonts of your text into non-TeX ones, some western characters migh not be well supported by those CJK fonts.

An ideal way is to specify some specific fonts just for CJK characters instead of switching all your fonts to one non-TeX font.

One choice might be using the xeCJK package by adding the following two lines into the document’s preamble:



And then, just compile the file with XeLaTeX; nothing more. Done!