[XeTeX] Unexplained behavior
Paul Isambert
zappathustra at free.fr
Sat Jan 15 20:01:38 CET 2011
Le 15/01/2011 19:44, Bogdan Butnaru a écrit :
> Hello! I encounter funny behavior when compiling a document; small
> example below my signature. If you look very carefully, the line that
> begins with \sepdash is typset slightly farther away from the line
> above it than the other two lines are.
>
> I have a custom macro for typesetting em-dashes with a bit of space;
> it’s longer than the one in the example, but this is the shortest that
> still exhibits the problem. Note that if a simple em-dash is used, or
> if the spaced one is not at the start of a line, the line is not
> spaced more than usual. The extra space is subtle, but I’m typesetting
> a document with an exact number of lines on the page and it complained
> of an underfull vbox.
>
> I’m very curious why this happens; nothing I know about TeX suggests
> what’s the problem. (I’d also like a solution if possible, but it’s
> not that much of a big deal, I can use a different macro to
> work-around the problem.)
\thinspace is a \kern, which adapts to the mode it is in. What you want
is an horizontal space, but what happens is a vertical one, because the
\kern occurs in vertical mode (TeX is between paragraph at the time when
\sepdash occur, and between paragraph you're basically in vertical
mode). You have to begin the \sepdash macro with \leavevmode, so TeX
switches to horinzontal mode and typesets a horizontal space.
Best,
Paul
More information about the XeTeX
mailing list