[Tex/LaTex] problem about typesetting Chinese characters in Latex

cjklanguagespackages

I found the post How does one type Chinese in LaTeX? about how to typeset Chinese in Latex. I just encountered the same problem, and my questions are:

1.To type Chinese or Japanese, I have to have some particular packages (such as CJK/XeCJK) installed, don't I?

2.I'm confused by the first solution in that post, it looks like this:

% UTF-8 encoding
% Compile with latex+dvipdfmx, pdflatex or xelatex
% XeLaTeX is recommanded
% Some Chinese fonts should be installed in your system (SimSun, SimHei, FangSong, KaiTi)
\documentclass[UTF8]{ctexart}
\begin{document}
文章内容。
\end{document}

The above solution just uses a class ctexart without any particular packages, and I tried to replace ctexart with article, it failed. So I wonder what is special about ctexart which can display Chinese without any add-on packages?

Best Answer

  1. The following works pretty well in both LuaLaTeX and XeTeX without any special packages. fontspec (which I don't count among special packages) simply uses the SimSun font from Windows's font directory (as suggested in the code you're providing).

    \documentclass{article}
    \usepackage{fontspec}
    \setmainfont{SimSun}
    \begin{document}
    文章内容。
    \end{document}
    

    enter image description here

  2. ctexart simply loads the packages it needs, see LianTze Lim's comment.