The XeLaTeX Japanese examples I find on TeX.sx seem to have this issue in common on my system. I'm running MacTeX 2011, fully updated at the time of writing. The following sample
%!TEX TS-program = xelatex
\documentclass{standalone}
\usepackage{xeCJK}
\usepackage{ruby}
\setCJKmainfont{Hiragino Mincho Pro}
\begin{document}
\ruby{学}{がく}\ruby{生}{せい}
\end{document}
gives me this output
I checked Font Book, and the font in the example is present (this happens whatever font I try). In an ideal world I'd like to use Japanese with furigana (ruby text). Is there something wrong with my code, or something not quite right with MacTeX on this system?
Best Answer
It's an encoding issue. Tell TeXShop to use unicode, either through the preferences or a TeXShop directive shown in the following:
I've also changed the value of
\rubysep
to make the spacing a little better.