[XeTeX] Need some input about \newcommand to create alias

Joe Pleso joe.pleso at gmail.com
Sat Nov 28 05:36:35 CET 2009


try \codeux\ to fix the spacing issue.

On Fri, Nov 27, 2009 at 10:23 PM, Maxim Cournoyer <maxim.cournoyer at gmail.com
> wrote:

>  Dear XeTeX fidels,
>
> In my first document written with XeTeX, I wanted to do an alias for the
> abbreviation CO_2 (carbon dioxyde), but had two difficulties.
>
> My first one was to try to use something like this :
> %\newcommand{\co2}{CO$_2$}
> The problem was that it seems we cannot use "numbers" in the command name,
> such as the '2' in \co2. Is there a way to circumvent this?
>
> Another weird issue I ran into was, after changing  \co2 to something more
> wordy as \codeux, my actual replacement would delete all trailing space. Let
> me explain by an example :
> ex : The traffic in developed nations  is the cause to an average of 26% of
> the \codeux emissions.
>
> Results : The traffic in developed nations  is the cause to an average of
> 26% of the CO_2emissions.
>
> Note the lack of a space character between the _2 subscript and emissions.
> Using CO$_2$ straight in my text solved the problem, surprisingly. Is there
> an explanation for this? What should I do to prevent this from happening?
>
> Cheers.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://tug.org/pipermail/xetex/attachments/20091127/27c4dc9b/attachment-0001.html>


More information about the XeTeX mailing list