[XeTeX] hyphenating words with hyphen

Rembrandt Wolpert wolpert at uark.edu
Tue Oct 6 18:42:50 CEST 2009


> x-scaling the em-dash which is often two wide

I don't think the m-dash is "often too wide": it is defined by the length of
"m" in the particular font. I think you wanted to say that you don't like
the size of an m-dash and want an in-between-n-and-m-dash (now that's
something for hyphenation :-)). I'm not sure if this is good typographical
practice, though.

Rembrandt


On Tue, Oct 6, 2009 at 7:14 AM, Vadim Radionov <vadim.radionov at gmail.com>wrote:

> 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
> >
> >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://tug.org/pipermail/xetex/attachments/20091006/521088d5/attachment-0001.html>


More information about the XeTeX mailing list