[texhax] Macro problem after updating xspace

Uwe Lück uwe.lueck at web.de
Sun Sep 24 15:55:00 CEST 2006

The problem with \xspace and \bm has been well-known to
the authors of bm and xspace, and the bm documentation
("strange failures") addresses it (in a general way).
The bm documentation recommends to put code into curly
braces if that code makes \bm go crazy.

HTH -- Uwe.

>Date: Thu, 21 Sep 2006 22:20:20 +0100
>From: David Carlisle <david at dcarlisle.demon.co.uk>
>User-Agent: Mozilla Thunderbird 0.9 (Windows/20041103)
>X-Accept-Language: en-us, en
>To:  uwe.lueck at web.de
>CC:  bugs at latex-project.org
>Subject: Re: tools/3888: \bm (from bm.sty) overrides \protect
>Sender: david at dcarlisle.demon.co.uk
>>I consider this a bug since short math things (involving \bm) may appear 
>>in section titles and may involve some assigning macros.
>bm needs to get "into" the definition of commands in order to find out 
>what fonts are being used, and to switch to bold.
>The mechanism used is inherently unsafe as the latex \protect mechanism 
>wasn't really designed to allow this, however bm
>is designed to work for a range of cases that at least cover the main font 
>If you put complicated code directly inside bm then it may fail , and 
>\protect doesn't  recover in this case,. As noted in the doc, you should 
>always be able to
>surround the code with an extra {..} as bm never goes into brace groups 
>(it uses a different mechanism for groups, essentially that of amslatex 
>% \subsection{Strange failures}
>% In order to get the correct spacing, |\bm| has to `investigate' the
>% definition of the commands in its argument. It is possible that
>% some strange constructions could `confuse' this investigation.
>% If this happens then \LaTeX\ will almost certainly stop with a strange
>% error. This should not happen with any of the math symbols
>% defined in the base \LaTeX\ or AMS distributions, or any commands
>% defined in terms of those symbols using normal \LaTeX\ math
>% constructs. However if some command does fail to work inside |\bm|
>% you should always be able to surround it with an extra set of braces
>% |\bm{{\cmd}}| rather than |\bm{\cmd}|. |\bm| will not then attempt
>% to set the correct spacing, so you may need to set it explicitly,
>% for instance, for a relation, |\bm{\mathrel{\cmd}}|.
>So, sorry I think I need to put this down as an unfortunate but probably 
>unavoidable feature rather than a bug,

More information about the texhax mailing list