[texhax] Macro problem after updating xspace

Uwe Lueck uwe.lueck at web.de
Thu Sep 21 20:34:45 CEST 2006


Sorry, my proposal in my previous posting on "updating xspace" 
was seriously flawed, it must be

    \newcommand{\yspace}{% 
      \relax \ifmmode \else \expandafter \xspace \fi}

so \xspace tests what comes after \yspace, not the \fi. 
(I was hungry and had to rush to a supermarket before closing. 
 I hope I can send this before Philipp Taylor's pointing out ;-).)  
This time I have tested the proposal. 
Below is an example that doesn't use \yspace 
but modifies \xspace such that it has (almost) no effect 
in math mode. Perhaps I will suggest this to be done in 
xspace.sty indeed. 

What I wrote before on which package's update caused the problem 
indeed meant that I suspect that no update was the reason, 
rather you would have encountered the same problem 
with your use of \upsilon and \bm before updating -- if you had tried ...

Hope this helps,

Uwe.

% Example: 
\documentclass{article}
\usepackage{bm,xspace}
\let\nomathxspace\xspace 
\renewcommand{\xspace}{% 
  \relax \ifmmode \else \expandafter \nomathxspace \fi }
\newcommand{\withxspace}{x\xspace}  
\begin{document}
So: \withxspace. \withxspace aha. $\bm{\withxspace}$.
\end{document}


More information about the texhax mailing list