[texhax] TeX commands as abbreviations

Morten Høgholm morten.hoegholm at gmail.com
Thu Nov 1 15:18:02 CET 2007


On Thu, 01 Nov 2007 15:04:34 +0100, martin f krafft wrote:


> For instance, with
>
>   \newcommand{\foreign}[1] {\emph{#1}}
>   \newcommand{\vs}[1] {\foreign{vs.}\xspace}
>
> "Variance \vs process theory" becomes "Variance vs. rocess theory".
> Properly spaced, but it still eats a character.
>
> I thus went to the source and found that \xspace consumes the next
> character and does nothing if it's not in the exception list. Should
> it not push the character back onto the stream?

It only peeks at the character. You have defined \vs to be a macro taking  
one argument... Which it then does.
-- 
Morten


More information about the texhax mailing list