Featured Post

We've moved to tex.my!

It’s been great writing on Blogger.com, but we’ve decided to move to a new platform, thanks to some valuable help from a great, great friend...

Sunday, June 3, 2012

More Ways to Typeset CJK

Rather a long time ago, I wrote about how to typeset CJK (Chinese, Japanese and Korean) in pdfLaTeX, using the CJK and ctex packages. However, the font choices are rather limited. With CJK, you have only the wadalab (3 Japanese fonts) and arphic (2 Simplified Chinese fonts, 2 Traditional Chinese fonts) packages and 1 Korean font. If you have access to Windows fonts, the ctex packages further configures 6 Chinese fonts shipped with Windows for use in pdfLaTeX (may also work with dvi output, but I didn’t test).

More Fonts in XƎLaTeX: xeCJK

If you’re willing to use XƎLaTeX, the xeCJK package makes it a breeze to typeset CJK, using any font (TTF or OTF) installed on your operating system. The following uses Chinese fonts typically found on a Mac:


% Sets font for Roman text.
% There are also \setsansfont, \setmonofont.
% See fontspec documentation.


% Traditional Chinese typesetting has no "bold" nor "italic".
% 黑体 ("blackbody") and 楷体 ("regular script") fonts are
% used instead.

\setCJKsansfont{Hiragino Sans GB}


The fonts are identified by their names as displayed in your OS' font manager application. Here’s the output:

More Fonts in pdfLaTeX: zhmCJK

If you absolutely need to use pdfLaTeX instead of XƎLaTeX, the new zhmCJK package is useful for introducing more CJK font choices into you documents. It’s not included in MikTeX nor TeXLive, however; so you will have to download it from CTAN and install manually: read the instructions carefully.

The zhmCJK packages make use of the premise that all CJK fonts share the same metrics (note that this is not true for Japanese half-width characters! Use ptex if you have serious needs for Japanese typesetting), and can therefore create the NFSS font definition and actual font mappings dynamically. The consequence is that zhmCJK can use TrueType CJK fonts to generate PDF output with pdfTeX or with the dvipdfmx driver. Here’s an example:

\setCJKmainfont[BoldFont=simhei.ttf, ItalicFont=simkai.ttf]{HanNomA.ttf}


You will need to pass the file name of the TTF font, which must have no space characters and only ASCII characters. And for LaTeX to find the TTF files, you need to do one of the following:
  • Set OSFONTDIR in texmf.cnf
  • Move or symlink the TTF file in TEXMF/fonts/truetype
  • Move or symlink the TTF file in the same directory as your document.


  1. Here is my way to typesetting in Japanese, using cjk package and Cyberbit TTF font.



    \LaTeX CJK using UTF8 (Unicode) and Cyberbit TTF font.

    1. One more thing, we need to use text in UTF8/Unicode

      Thank you.

  2. I just published a screencast on YouTube.. :)