3

I posted this question in stack overflow, but didn't get an answer, I'm trying here to see if I have better luck.

I'm trying to include some Chinese characters in a LaTeX document. I've tried several methods suggested on the web (CJK, XeLaTeX, etc.) and the best results are that some characters are correctly displayed whereas others are replaced by symbols. This is a minimal working example:

% !TEX program = XeLaTeX
% !TEX encoding = UTF-16
\documentclass[UTF8,nofonts]{ctexart}
\setCJKmainfont[BoldFont=FandolSong-Bold.otf,ItalicFont=FandolKai-Regular.otf]{FandolSong-Regular.otf}
\setCJKsansfont[BoldFont=FandolHei-Bold.otf]{FandolHei-Regular.otf}
\setCJKmonofont{FandolFang-Regular.otf}

\begin{document} 
 Honshu He (红水河) 
 Yongbei (邕北) 
\end{document}

This yields this output (copied from the resulting PDF file):

Honshu He (7EA2??) Yongbei (9095?)

Another minimal example with xeCJK (the results ore similar to those using CJK):

\documentclass[UTF8, nofonts, mathptmx, 12pt, onecolumn]{article}
\usepackage{xeCJK}
\setCJKmainfont{SimSun}
\begin{document} 
 Honshu He (红水河) 
 Yongbei (邕北) 
\end{document}

This time the output is better:

Honshu He (7EA2 水河) Yongbei (9095 北)

I'm in a Mac OS 10.9.5, running TeXLive2-14 (Intel 64), and using TeXShop Version 3.48.1 as the editor. I'm running out of ideas on how to make this work, and your help is greatly appreciated.

julovi
  • 33

1 Answers1

1

This is OS X 10.9.5, MacTeX 2014, TeXshop 3.36.1.

I tested both of your MEW, and both of them worked well on my Mac. Please check the following list:

  • Your manuscript is stored as UTF-8 encoding;
  • You are using XeLaTeX as compiler;
  • Fandol series and SimSun could be found in the Font Book (字体册).

Be aware that fonts that were installed by MacTeX are not loaded by the Font Book automatically. That is, if you want to use these fonts, for example the Fandol series, you'll have to make hard links for those fonts to ~/Library/Fonts/font-filename.

Ch'en Meng
  • 3,843
  • 1
  • 19
  • 45
  • The problem was that the manuscript wasn't being saved in UTF-8, although the Texshop settings were saying so, I openend the file in textwrangler and found that it was being saved as Western (Mac OS Roman). Thank you Ch'en Meng for your answer! – julovi Jan 09 '15 at 05:54
  • @julovi That's my pleasure. Congs and happy TeXing! – Ch'en Meng Jan 09 '15 at 07:32