[XeTeX] hyphenating words with hyphen

Vadim Radionov vadim.radionov at gmail.com
Tue Oct 6 14:14:14 CEST 2009


Thank you, Jonathan,

That was my obvious typo -- i mixed up these two token lists.  This
way it works
fine!

Yours,

Vadim

PS.  Another problem I've tried to solve with  \XeTeXinterchartoks is
x-scaling the em-dash which is often two wide (and copyright sometimes
prohibits changing the font itself).   So I can put

\newXeTeXintercharclass\cyrdash
\XeTeXcharclass `\—\cyrdash
\XeTeXinterchartoks 0 \cyrdash = {\nobreak\hskip.125em\scalebox{.75}[1]}
\XeTeXinterchartoks \cyrdash 0 = {\hskip.125em}

leaving no spaces around the dash. But unfortunately this does not
work in the very beinning of the paragraph.



On Tue, Oct 6, 2009 at 3:47 PM, Jonathan Kew <jfkthame at googlemail.com> wrote:
> On 6 Oct 2009, at 00:11, Vadim Radionov wrote:
>
>> Dear all,
>>
>> I'm missing this important detail in the manuals: what is the natural
>> way to get words with hyphen hyphenated in other places than that
>> hyphen?
>>
>> I tried
>>
>> \XeTeXinterchartokenstate 1
>>
>> \XeTeXcharclass `\- 150
>> \XeTeXinterchartoks 150 0 = {\nobreak\hskip0pt}
>> \XeTeXinterchartoks 0 150 = {\hskip0pt}
>>
>> and it works almost well -- except for, surprisingly, allowing a break
>> *before* the hyphen.
>
> That's not surprising: before the hyphen (class transition from 0->150), you
> have an \hskip. After it (150->0), you have \nobreak\hskip, so you won't get
> a break there -- though you might get one anyway because of the
> discretionary node that's automatically inserted after the hyphen.
>
> I think you want
>
>> \XeTeXinterchartoks 0 150 = {\nobreak\hskip0pt}
>
> to ensure that the \hskip before the hyphen is never taken as a possible
> breakpoint.
>
> (BTW, it would be better to use \newXeTeXintercharclass rather than picking
> an arbitrary number...)
>
> JK
>
>


More information about the XeTeX mailing list