Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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?

share|improve this question
add comment

2 Answers 2

\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} 
share|improve this answer
    
This returns the same error for me as the original code that was not working. –  Carl Johan Jan 21 '12 at 1:58
add comment

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?

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.