[XeTeX] No-Break Space

BPJ bpj at melroch.se
Wed Mar 2 17:29:13 CET 2011


2011-03-02 17:04, enrico.gregorio at univr.it skrev:
> BPJ wrote:
>
>> I just realized that the solution to a problem I've had may lurk
>> here: I've been using interpuncts U+00B7 inside some words, and
>> XeTeX won't hyphenate those words.  However it's not only that I
>> want them hyphenated -- I don't want them hyphenated too close
>> to the interpunct!  Never closer than two ordinary letters and
>> preferably more if possible.  When there are many of those words
>> it gets quite annoying to insert soft hyphens by hand.
>
> You can try with
>
> \newunicodechar{·}{·\nobreak\hspace{0pt}}
>
> Thus the MIDDLE DOT will typeset itself, there will no line break
> after it and the \hspace{0pt} allows the following word to be
> hyphenated. You can't control the number of letters before the
> hyphen, but (Xe)TeX is generally not abundant with hyphens.
>
> Note that you can use the defined character in the second argument
> as itself, this is a felicitous consequence of the implementation of
> \newunicodechar. :)

Thanks, I'll try it.  What about *before* the dot?
Will \newunicodechar{·}{\hspace{0pt}\nobreak·\nobreak\hspace{0pt}}
do the trick? Although most dots appear after prefixes some
don't, and some prefixes are long too.

\bpj


More information about the XeTeX mailing list