[XeTeX] avoiding line break after dash

David Carlisle d.p.carlisle at gmail.com
Mon Dec 8 10:18:39 CET 2014

On 8 December 2014 at 04:18, Mike Maxwell <maxwell at umiacs.umd.edu> wrote:
> On 12/7/2014 7:14 PM, David Carlisle wrote:
>> If adding markup rather than a general setting is acceptable you can use
>> \mbox{-}abcd
> I see that this works--I had not expected it to, so I didn't even try.  What
> I did try was
>    \mbox{-abcd}
> which certainly worked, but had other drawbacks for my particular situation.
> Why does putting the leading dash inside a box prevent a line break between
> it and the following word?

TeX only adds the discretionary break after explicit hyphens if it's
in outer hmode, not
in inner hmode inside an h (m) box. (even if it did add a
discretionary after the - there
it would be inside the box so not a breakpoint unless the box was
subsequently unboxed.)

I was going to say that the \XeTeXdashbreakstate =0 suggestion looked
cleaner except
when I tried it on your test file it didn't work??

More information about the XeTeX mailing list