Thu, 18 Apr 2019 15:48:00 +0900

Showing CJK with XeLaTeX

Display CJK Characters in LaTeX

There are many ways to display CJK (Chinese, Japanese, Koren) characters in Latex. However, many of them does not support rarely used characters.

For example, I tried to use the package CJKutf8 with pdflatex. It does show most characters correctly, but not those characters not included in fonts.

After trying different settings I found a way to show CJK character by using XǝLaTeX and specifying font to use with the package fontspec. It is usually used to specify fonts, and I found it working perfectly with CJK characters as long as they are in the font on computer.

Notice that Fontspec does not work with pdflatex (It needs XǝLaTeX because it supports unicode). I saved my file in UTF8 encoding, and I haven’t try any other codings.

How to Display CJK in Latex:

1. Add package by \usepackage{fontspec} . This should be installed with most distributions.

2. Before where CJK character appears, add \fontspec{}

3. Enjoy typing CJK.

4. Build with XǝLaTeX.

With this method, you can use any fonts on OS. One font series I recommend is the Adobe Source fonts. They are free to download and use whether in commercial or non-commercial. https://github.com/adobe-fonts

You can install them with one line of code using homebrew!