# CJK spacing suddenly no longer works

I have been using CJK script in my documents successfully for some time, but today it suddenly stopped working properly. I did update some packages through TeX Live today, and recently I reinstalled a CJK font that I regularly use. However, even when I switch to a CJK font that I haven't touched and that worked fine before—as in the example below—it doesn't compile properly. The problem is the spacing following CJK punctuation marks; the space is either transformed into white boxes with black borders, or come out as XX.XXpt (with X being numerals), depending on the font. Does anybody know what I'm doing wrong? Thank you so much!

Document:

\documentclass[utf8,12pt,letterpaper]{report}
\usepackage{setspace}
\usepackage{xltxtra}
\usepackage[fallback]{xeCJK}
\usepackage{fontspec}
\usepackage{xeCJK}

\setmainfont[Ligatures={Common,TeX},Numbers={OldStyle}]{LinLibertineO}
\setCJKmainfont{HanaMinA}
\setCJKfallbackfamilyfont{\CJKrmdefault}{NanumMyeongjo}
\XeTeXlinebreaklocale "zh"
\XeTeXlinebreakskip = 0pt plus 1pt
\usepackage[french,german,american]{babel}
\usepackage{csquotes}

\title{Title}
\author{Author}
\date{\today}
\begin{document}
\maketitle
\tableofcontents

Some English, with punctuation.

\end{document}


Overfull \hbox (65.9998pt too wide) in paragraph at lines 24--26
\EU1/HanaMinA(0)/m/n/12 ÂØ´ ‰∏Ä Èªû ‰∏≠ Êñá„ÄÇ| minus4.0082pt ÂèØ ‰∏ç ÂèØ ‰ª•Ôº
ü| minus1.58507pt


Does that have anything to do with it?

I read through the full log but I didn't see any /error/ messages there, and I think it is too long for me to post here.

I would really appreciate any help I could get.

-

This issue is caused by the realscripts package which is loaded by xltxtra. There are some following code at the end of the realscripts package.

% Until these are available in expl3:
%    \begin{macrocode}
\cs_set:Nn \dim_max:nn {
\dim_compare:nTF {#1>#2} {#1} {#2}
}
\cs_set:Nn \dim_min:nn {
\dim_compare:nTF {#2>#1} {#1} {#2}
}
%    \end{macrocode}


Both \dim_max:nn and \dim_min:nn had been available in expl3 some times ago. They are redefined by realscripts again. But this revision is not appropriate since it dosn't leave neither the calculation result of the maximum or minimum value in the input stream. It undermines our work eventually.

-
Is there something lacking at the expl3 end here? – Joseph Wright Nov 27 '12 at 13:03
No. expl3 is very fine. This issue is introduced entirely by realscripts. \dim_max:nn in realscripts should be wrapped by \dim_eval:n for the correct result. – Qing Lee Nov 27 '12 at 13:52
@Qing Lee I've tried to put that string of code in the preamble, but it fails to compile. Do you know what I'm doing wrong? – Mårten Nov 30 '12 at 3:25
@QingLee Or actually, I might have misunderstood completely; How do I use this to resolve the issue of spacing when writing in CJK? – Mårten Nov 30 '12 at 4:25
Sorry for the slow action on this; I've now uploaded a new version to CTAN. Should be available shortly. – Will Robertson Feb 27 '13 at 11:14