[Xy-pic] Problem with centered xy-pic-diagram with underlined content

Ross Moore ross.moore at mq.edu.au
Mon Nov 14 02:34:13 CET 2011


On 14/11/2011, at 12:15 PM, Arne Schröder wrote:

> I made up a sample-file which fails with the error message "You can't use `spacefactor' in math mode \xy@{}{\leave@}", marking line 13:
> 

Just put \relax immediately inside the cell where
the problem occurs.

> \documentclass{scrreprt}
> \usepackage[matrix]{xy}
> 
> \CompileMatrices
> 
> \begin{document}
> 
> \[
> \begin{xy}
> \xymatrix{
\relax
>   \underline{bla}
> }
> \end{xy}
> \]
> 
> \end{document}
> 
> Do you know whether I have done something wrong?

It is a known issue with \xymatrix  and some other kinds
of alignment environments.

TeX has to expand any macro that comes as the 1st thing
in a cell, to see whether  \omit  appears.
When it is a complicated non-robust macro, this can lead
to an error in parsing.

> Is there a known workaround?

Just put \relax to inhibit further expansion.

> Thanks in advance,
> 
> Arne Schröder


Hope this helps,

	Ross

------------------------------------------------------------------------
Ross Moore                                       ross.moore at mq.edu.au 
Mathematics Department                           office: E7A-419      
Macquarie University                             tel: +61 (0)2 9850 8955
Sydney, Australia  2109                          fax: +61 (0)2 9850 8114
------------------------------------------------------------------------






More information about the xy-pic mailing list