I’m using \(\LaTeX\) for a quite long time. And for the most of time, I used it to typeset English materials. And since it gives me a way of writing non-ASCII characters using pure ASCII characters, I really enjoy it.

Recently I’m starting to use ctexart in order to typeset Chinese texts. And I found that there are many configurations I needed to tune in order to get the right effects (which one isn’t?). Well, actually it’s not a fair opinion to say to ctexart. It has simplified the entire workflow already. At least, I can use all the standard packages without a single problem.

You can find a complete documentation from here.

Select The Right Compiler

In principle, on major Linux distributions and Windows, you can use most of compiling sequence to work with ctexart. However, the way of OSX handling fonts is a nightmare. This particular situation made me to use XeLaTeX instead. Honestly, I don’t have any hard feeling of using XeLaTeX, I’m just feeling more comfortable when I use LaTeX or PDFLaTeX as my default compiling sequence.

Configure Fonts on OSX

1\setCJKmainfont[BoldFont=STHeiti, ItalicFont=STKaiti]{STSong}

Define a Custom Framed Box

 5    \refstepcounter{faqbox}
 6    \begin{mdframed}[
 7        frametitle={FAQ \thefaqbox\ #1},
 8        skipabove=\baselineskip plus 2pt minus 1pt,
 9        skipbelow=\baselineskip plus 2pt minus 1pt,
10        linewidth=0.5pt,
11        frametitlerule=true,
12        frametitlebackgroundcolor=gray!30
13    ]
15    \end{mdframed}

Custom Chapter Display Style

You can use titlesec to redefine the specific style of your chapter’s style.

 2{\chapter} % command
 3[display] % shape
 4{\bfseries\Large} % format
 5{第 \ {\Huge\thechapter} 章} % label
 6{0.5ex} % sep
 8    \rule{\textwidth}{1pt}
 9    \vspace{1ex}
10    %\centering
11} % before-code
15] % after-code