[XeTeX] Unicode-named macros in XeTeX
Ulrike Fischer
news3 at nililand.de
Thu Jan 13 16:14:26 CET 2011
Am Thu, 13 Jan 2011 15:43:00 +0100 schrieb Bogdan Butnaru:
> I’m writing a document using XeTeX (mainly for its ease of accessing
> TTF fonts) and with the package xunicode to allow me to type Unicode
> characters easily—for several reasons it’s considerably more
> convenient for me to have things like curly quotes and the various
> dashes typed directly rather than as \commands.
You don't need xunicode to type unicode chars directly. The purpose
of xunicode is to define commands like "a or \textendash so that
they behave correctly in an unicode environment.
>
> However, I’m not satisfied with the way em-dashes behave in this
> setup. I’d like to define a macro that does what I want (e.g. control
> spacing and line breaking around the dash), but I want to call by just
> typing an em-dash, i.e. just “—” instead of “\dash”.
You can make the em-dash active and define it:
\documentclass{article}
\catcode`\—\active
\def—{ whatever your want }
\begin{document}
text — blub
\end{document}
> (By the way, the *main* thing I want to do is allow line breaks after
> an em-dash, but not before; XeTeX doesn’t allow line breaks after an
> em-dash unless I specifically tell it to after each one. If there’s a
> significantly simpler way of achieving this please do let me know.)
\XeTeXdashbreakstate=1 should work.
see xetex-reference.pdf
--
Ulrike Fischer
More information about the XeTeX
mailing list