[XeTeX] Unicode-named macros in XeTeX

Bogdan Butnaru bogdanb+xetex at gmail.com
Thu Jan 13 16:11:36 CET 2011


On Thu, Jan 13, 2011 at 16:01, Arthur Reutenauer
<arthur.reutenauer at normalesup.org> wrote:
>> Can't help with the "How to type one"
>  That's not what Bogdan means with “to generate”; he means to actually
> insert the character in the text stream, since one might worry that when
> typing a character actually calls a macro that is supposed to insert
> that same character into the text, the macro would be called
> recursively.  A legitimate concern; but fortunately that doesn't happen.

Right on both: that’s what I worried about, and it works without
problems. For the benefit of others who Google about my problem, this
is the solution I picked:

\def\myEmDash{\unskip\nobreak\thinspace—\allowbreak\thinspace\ignorespaces}
\catcode `\— = \active
\let — = \myEmDash

I would imagine that it doesn’t go recursive because at the point
where \myEmDash is defined, the — character was not active. Though
from what I’ve seen of TeX’s internals I would also imagine I’m wrong
in several different ways.

On Thu, Jan 13, 2011 at 16:05, John Was <john.was at ntlworld.com> wrote:
> Sorry if I'm missing something, but can't you simply put
>
> \XeTeXdashbreakstate 1
>
> at the start of your document?  That tells XeTeX that line-breaks are
> permitted after dashes.

Yes John, thank you, that was what I meant by “significantly simpler
way of achieving this”; I imagined something like this might exist but
my Google-fu failed me.

I think I like the thin spaces enough that I’ll go with the more
complex solution for now, but it’s  good to know about this one.

Thank you everyone!
-- Bogdan Butnaru



More information about the XeTeX mailing list