The original LaTeX do not have good support for Chinese. With the development of LaTeX, we can now easily use Chinese in LaTeX document. In this post, I would like to introduce several ways to work with Chinese in LaTeX.

Use CTeX

Use ctexart documentclass

The CTeX group has developed multiple document classes and packages to deal with the particular need of Chinese typesetting.

If you have a long article mainly written in Chinese, you should choose ctexart document class. An MWE is shown below:



When using the ctexart documentclass, you should also add \usepackage[T1]{fontenc}. Otherwise, some of the characters will be shown incorrectly.

Use ctex package

Or you can use the ctex package instead:


You can compile it with latex, pdflatex, xelatex or lualatex. xelatex is recommed from the author of this class.

Use xeCJK with xelatex

If you only need to type a few Chinese character, you can go with xeCJK package and compile the document with xelatex. A MWE is shown below:

Click to check the code.
% this file can be compiled with xelatex command
\documentclass[12pt, a4paper]{article}
\usepackage[slantfont, boldfont]{xeCJK}

% set up English font
\setmainfont{Microsoft YaHei}
\setsansfont{Comic Sans MS}
\setmonofont{Courier New}

% set up Chinese font, the font must be valid on your system
\setCJKmainfont{Microsoft YaHei}
\setCJKmonofont{Source Code Pro}

% correct line break for chinese
\XeTeXlinebreaklocale "zh"
\XeTeXlinebreakskip = 0pt plus 1pt

\texttt{Stray birds of summer come to my window to sing and fly away}. \\
\textsf{And yellow leaves of autumn, which have no songs}, \\
\textrm{flutter and fall there with a sign}.\\
\hfill \emph{RabindranathTagore}
\hfill \emph{罗宾德拉纳特·泰戈尔}

For Chinese, the command \setCJKmainfont{} are used to set up the font used by main text, which is also used by \textrm{} command. \setCJKmonofont{} is used to set up the font used by \texttt{}. \setCJKsansfont{} is used to set up the font used by \textsf{}.

So how to find a valid Chinese font to use in these command? If you have installed TeX Live, it is easy to do. Just use the following command in your console:

fc-list :lang=zh

It will list all the fonts on your system which support Chinese. A sample output is as follows:

You can pick the font you like or experiment with different fonts to choose the one you want.

The above example is based on a number of posts, but I have removed several package since they are now redundant.