# Simplified and Traditional Chinese characters in CJK

I am using CJK package to create a tex file based on a traditional Chinese doc file. Sometimes other people may mistakenly type some simplified Chinese Characters in the doc file. I realize some simplified Chinese characters do not show in a traditional Chinese environment:

\begin{CJK}{UTF8}{bsmi}
...
\end{CJK}


Is there a way to get simplified Chinese characters generated in a similar environment with CJK package?

For some limitations, I have to use pdflatex.

You could switch to a different engine, in this case xelatex, which I think makes it easier to handle fonts and also other languages. In the case of languages like Chinese, Japanese and Korean, you can load the appropriately named xeCJK package.

When using xelatex, you can load the fontspec package and then use \setmainfont{} to set the document font. By the same token, with the previously named package, you can also load the command \setCJKmainfont{} and load a font specifically for your language, for example I used Heiti TC, where the T stands for Traditional (there's also Heiti SC). But you could use any font that is designed for Traditional Chinese.

Here's what it looks like with a Chinese Lorem Ipsum, although I cannot post the body code with the Chinese part, because it's blocked and I cannot post it.

And here's the code

\documentclass[12pt]{article}
\usepackage[a4paper, margin=2cm]{geometry}
\usepackage{fontspec}
\usepackage{xeCJK}

\setCJKmainfont{Heiti TC}

\begin{document}
...
\end{document}

• Thanks, I know xelatex can do better but because of some limitation, I have to use pdflatex. Are there any methods to process them in pdflatex?
– Joe
Dec 30, 2015 at 5:29

Strictly speaking, \begin{CJK}{UTF8}{bsmi} is not a "traditional Chinese" environment. It does not show simplified chinese characters because the font here, bsmi, contains only traditional Chinese characters. To typeset simplified Chinese, one has to load corresponding font, such as gbsn. (This time, traditional Chinese characters are not shown.)

Why not use the ctex package? You'd only need to load the package and type away...

# MWE

\documentclass{article}
\usepackage{lipsum}
\usepackage[UTF8]{ctex}
\begin{document}
\lipsum[1]

\end{document}


# Output

• Does it work with pdflatex? I tried in Mac but seems not working
– Joe
Feb 25, 2016 at 3:58
• @Joe: Yes, it does. What error message are you getting? Feb 25, 2016 at 4:29
• /usr/local/texlive/2015/texmf-dist/tex/latex/ctex/fontset/ctex-fontset-fandol.def:96: !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! [ }] pdfTeX error: pdflatex (file cyberb9a): Font cyberb9a at 632 not found Check the TeX log file for more information I use ST2 and Mac.
– Joe
Feb 25, 2016 at 4:51
• @Joe: So it seems to be a problem related to fonts. You may want to post a question with a minimal working example about this. That way it's easier to detect the problems. Feb 25, 2016 at 6:53

Why not mend the problem rather than the symptom? Pipe the file through opencc (package opencc-tools on Fedora) before running LaTeX:

$cat source.tex | opencc > source.proper.tex$ latex source.proper.tex

• Welcome to TeX.SX! Mar 16, 2018 at 6:29