[XeTeX] Mysterious nonzero lastskip

Jonathan Kew jfkthame at googlemail.com
Wed Dec 2 01:28:10 CET 2009


On 1 Dec 2009, at 22:33, Vadim Radionov wrote:

> Dear all,
>
> Can you explain me the strange behaviour of this short TeX script:
>
> % -*- tex-command: "xelatex" -*-
> \documentclass{minimal}
> \usepackage{xltxtra}
>
> \let\dash—
> \catcode`\—=\active
> \def—{\ifdim\lastskip>0pt\message{!!!}\showthe\lastskip\fi\dash}
>
> \begin{document}
> This is a test.—
> \end{document}
>
> In my case (XeTeX, Version 3.1415926-2.2-0.9994.1 (Web2C 7.5.6);  
> xltxtra 2008/07/29 v0.4) it executes the TRUE clause of \if with  
> message, but shows zero lastskip there.  But when I add a soft  
> hyphen in "te\-st", \if condition changes to FALSE, hence no message.
>
> Without xltxtra, no message in both cases (with or without soft  
> hyphen).

This seems wrong to me. Simplifying a bit by eliminating packages, and  
using only ASCII characters:

   \documentclass{minimal}
   \usepackage[EU1]{fontenc}

   \let\star*
   \catcode`\*=\active
   \def*{\ifdim\lastskip>0pt\message{!!!}\showthe\lastskip\fi\star}

   \begin{document}
   This is a test*
   \end{document}

still shows the same peculiar behavior; removing [EU1] eliminates it.

Inserting \relax before \ifdim, as Ross suggested, fixes the problem;  
but I don't yet understand why it's happening.

JK



More information about the XeTeX mailing list