# How to use Chinese with lualatex?

Searching through tex.stackexchange.com, I've come to understand that xetex is currently the preferred engine for documents that include Chinese characters. In xetex, one simply uses the xeCJK or ctex packages and start including the characters in the body of the document. But it appears these two packages don't work with luatex.

So is it possible to include Chinese characters in a document using luatex? I cannot find a single example of this.

• You can include Chinese characters, but for a full fledged support of Chinese, I don't think there are good tools with LuaLaTeX. – egreg Jan 13 '15 at 18:54

Just use luatexja. The Chinese TeX community decide not to develop a new package but use luatexja, because the tools designed for Chinese and Japanese usually work the same.

The developer version of our ctex package will provide a Chinese customized interface for luatexja. Now you can use luatexja directly.

Here is an example:

% !TEX encoding = UTF-8
% !TEX program = lualatex
\documentclass{article}
\usepackage{luatexja-fontspec}
\setmainjfont{FandolSong}
\begin{document}

\end{document}


Note: fontspec alone is insufficient. You need proper line breaking, punctuation kerning and font switching features provided by luatexja.

very basic use would be

\documentclass{article}
\usepackage{fontspec}
\setmainfont{MS PGothic}
\begin{document}

\end{document}

• Maybe, for short Chinese inserts, \newfontfamily is better. – egreg Jan 13 '15 at 18:56
• Thanks. I understand there is a setCJKmainfont in xeCJK. Does this command exist in lualatex? I'd like to use separate fonts for English and Chinese if possible. – ana Jan 13 '15 at 19:33
• I understand I can use \newfontfamily but that would mean I have to explicitly indicate when to switch to a Chinese font. With setCJKmainfont it switches automatically. – ana Jan 13 '15 at 19:39
• @ana sorry I don't know too much about available CJK packages, I just wanted to demonstrate that basic typesetting of text was easy enough with fontspec package an luatex. – David Carlisle Jan 13 '15 at 19:57
• It won't work if you type more characters. The line break algorithm designed for western languages doesn't work for East Asian languages. – Leo Liu Jan 24 '15 at 15:33