4

My documents usually contain an equal amount of Chinese and English. Here is my preamble, which I found in a manual somewhere:

\documentclass{ctexbook}
\setmainfont{Minion Pro}
\setCJKmainfont[BoldFont=Adobe Heiti Std, ItalicFont=Adobe Kaiti Std, SmallCapsFont=*]{Adobe Song Std}
\begin{document}
    你好
    hello
\end{document}

This simple setup seems to give me the Minion Pro font when typing English, and the other fonts when typing Chinese.

When I type any zhuyin fuhao (注音符号), however, the 4 tone marks ("ˊ", "ˇ", "ˋ", and "˙") appear as square boxes. If I set \setmainfont{Adobe Song Std} (which means that the Minion Pro font is never used) the tone marks render fine. This suggests to me that it is trying using the Minion Pro font to render them (in the above document), but Minion Pro does not have these characters.

  • How can I make sure these four symbols are always rendered using the correct CJK fonts?

1 Answer 1

3
+150

Just use \xeCJKsetcharclass to set the characters as class 1:

\documentclass{ctexbook}
\xeCJKsetcharclass{`\ˊ}{`\ˊ}{1}
\xeCJKsetcharclass{`\ˇ}{`\ˇ}{1}
\xeCJKsetcharclass{`\ˋ}{`\ˋ}{1}
\xeCJKsetcharclass{`\˙}{`\˙}{1}
\begin{document}
山明水秀啊(ㄕㄢㄇㄧㄥˊㄕㄨㄟˇㄒㄧㄡˋㄚ˙)
\end{document}

Note that \xeCJKsetcharclass accepts two numbers as a character code range in the first two arguments. \xeCJKsetcharclass{`\ˊ}{`\ˊ}{1} is the same as \XeTeXcharclass`\ˊ=1.

You must log in to answer this question.

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