1

I am trying to write Chinese in LaTeX with MikTeX 2.9, and at the moment I am using fontspec, something like the below. However, I have heard good things about xeCJK, and I am considering switching to it instead (not least to improve the looks of punctuation), however, I can't get it to work.

This is a document that works right now

   \documentclass[12pt]{scrartcl}

    \usepackage{fontspec}
    \setmainfont{SimSun}
    %\usepackage{xeCJK}

    \begin{document}
    %\begin{CJK}{UTF8}{SimSun}
    你好
    %\end{CJK}
    \end{document}

, however this document

\documentclass[12pt]{scrartcl}

%\usepackage{fontspec}
%\setmainfont{SimSun}
\usepackage{xeCJK}

\begin{document}
\begin{CJK}{UTF8}{SimSun}
你好
\end{CJK}
\end{document}

gives an ! Undefined control sequence <argument> \tipaencoding error.

Can anyone help me figure out what I am doing wrong?

2 Answers 2

1

\begin{CJK}{UTF8}{SimSun} \end{CJK} is CJK, which is not inherited by xeCJK(see bilingual documentation). More better way to handle Chinese is using ctex

Try

% !TEX program = xelatex
% !Mode:: "TeX:UTF-8"
%Save as UTF-8, run xelatex.

\documentclass[12pt]{scrartcl}

\usepackage{xeCJK}
\setmainfont{Calibri}
\setCJKmainfont{宋体}

\begin{document}
Hello, 你好。

\end{document} 
1
  • This returns the same error for me as the original code that was not working.
    – Carl Johan
    Jan 21, 2012 at 1:58
1

Well, you should at first update xunicode package to avoid the error. I suggest you updating all packages if possible.

What's more, as Ma Ming pointed, you wrongly used xeCJK package. I have several answers on this topic. eg.
How does one type Chinese in LaTeX?

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .