Beginning in the late Spring of 2011, I have been using a few lines of code regularly in all my documents, making it possible to produce documents with regular Roman text, IPA, and all (or nearly all) of the Unicode CJK planes. The MWE below illustrates the xeCJK code block I have been using:
%!TEX TS-program = xelatex
%!TEX encoding = UTF-8 Unicode
\documentclass{article}
\usepackage[fallback]{xeCJK}[2011/05/01] % ver 2.3.19
\setromanfont{TeX Gyre Termes}
\setsansfont[Scale=MatchLowercase]{Doulos SIL}
\setCJKmainfont{HAN NOM A}
\setCJKfallbackfamilyfont{rm}{HAN NOM B}
\begin{document}
Plain Roman script is here.
And some IPA: [\textsf{ɕy̆an₃₄ ʈʂʅ₄₄ jɵu̯₅₂ ɕy̆an₃₄}]
最後一句:玄之又𤣥
\end{document}
The last character of the Chinese text (𤣥) is in the HAN NOM B font and not in HAN NOM A, and the \setCJKfallbackfamilyfont
command works splendidly to make it appear as needed. In TeXShop, on TeXLive 2011, this code block has worked perfectly, but since upgrading to TeXLive 2012 I get a persistent error Missing number, treated as zero
if more than a single Chinese character appears in a line. Is there something I have to do to my xeCJK code block to fix this?
A little experiment shows that the problem arises when two CJK characters appear consecutively. If separated on the same line by Roman characters, the error is not reported and the document appears to compile correctly.
I am currently on Mac OS 10.6.8 with TeXLive 2011 and Mac OS 10.8.2 with TeXLive 2012. But I have tried pairing the TeXLive and OS X versions the other way and the problem persists where TeXLive 2012 is in use. Current package versions:
TeXLive 2011:
xeCJK.sty 2011/05/01 2.3.19
fontspec.sty 2011/02/26 v2.1f
fontspec-patches.sty 2011/02/26 v2.1f
expl3.sty 2011/04/09 v2222
TeXLive 2012:
xeCJK 2012/10/27 v3.0.10
fontspec 2012/05/06 v2.2b
fontspec-patches 2012/05/06 v2.2b
expl3 2012/11/21 v4332