[texhax] Clash between \emph and \xspace

Uwe Lueck uwe.lueck at web.de
Wed Nov 15 14:44:43 CET 2006


At 19:40 04.11.06, Michael Barr wrote:
> If you compile the following file:
> 
> \documentclass{article}
> \usepackage{xspace}
> \newcommand{\lin}{Lindel\"of\xspace}
> \begin{document}
> (property we call \emph{amply \lin})
> 
> (property we call {\it amply \lin})
> 
> (property we call {\it amply \lin\/})
> \end{document}
> 
> you will see Goldilocks spacing after ``Lindel\"of''.  Since the second is 
> one is much too close, you can see that it is not the case that \xspace 
> has added a space.  I assume that the problem is that both macros use 
> \futurelet.  Any suggestions?

What clash? (Try additional tests attached below.) 

What you see is, maybe, a clash between \it and \xspace, 
and as Martin points out, this is no surprise. 

You see that \emph and \xspace interact entirely properly 
(to my own surprise!). You are right, \xspace doesn't insert 
interword glue between Lindel\"of and the closing bracket 
-- if it did so, it would be a bug! It is the basic idea of xspace 
to check whether inserting a \space is appropriate. 

But note that I am using v1.12 (2006/05/08) of xspace.sty. 
Earlier versions of xspace were very simple; now it is very, 
very complex; I haven't yet understood it. 

Best, 

  Uwe. 

\documentclass{article} 
\usepackage{xspace} 
\newcommand{\lin}{Lindel\"of\xspace} 
\begin{document}

\emph{\lin}and others 

{\it \lin}and others

{\it \lin \/}and others

(property we call \emph{\lin})

(property we call {\it\lin})

(property we call {\it\lin\/})

\end{document}



More information about the texhax mailing list