LyX CJK set-up based on XeTeX and xeCJK
I have recently been playing around with LyX and XeTeX, a Unicode extension for TeX, to find a set-up that allows me to switch easily between various East Asian languages without entering LaTeX code. With the help of a few friends, the xeCJK manual and Richard Heck over at the LyX Mailing List, I was able to define LyX Text Styles for Chinese (Simplified and Traditional text), Japanese and Korean that can be selected via the context menu right from within LyX itself, allowing me to focus on the content of my writing and leaving the worrying about Unihan issues to someone else.
I decided to leave the file as it is and not go through the settings step-by-step, since this would make a rather lengthy post. Interested users can study the file depending on their familiarity with LyX and LaTeX, e.g. novice users may use it as a template for their own documents, whereas more experienced users may find if useful to study CJK set-ups for LaTeX or LyX Local Layouts. In any case, here are the files:
- lyx-cjk.lyx – The actual LyX document
- lyx-cjk.tex – The corresponding LaTeX code
- lyx-cjk.pdf – The compiled PDF
Note that this document uses the Microsoft default serif CJK fonts (SimSun and PMingLiU, MS Mincho and Batang), so make sure you have them installed before compiling. Depending on your needs, you may prefer a free alternative (e.g. AR PL UMing CN and AR PL UMing TW, Kochi Mincho, Unbatang), or the more modern-looking sans-serif Windows 7/Vista default fonts: Microsoft YaHei, Microsoft JhengHei, Meiryo, Malgun Gothic. Fonts are defined in the Document Preamble (Document –> Settings –> Preamble).