# [Xy-pic] Math fonts

Ross Moore ross at ics.mq.edu.au
Tue May 6 22:00:05 CEST 2003


On Tue, 6 May 2003, Michael Abbott wrote:

> > For example when running LaTeX on the command
> > $\xymatrix{ \mathbb{R} \ar[r]^{d} & \mathbb{R} }$
> >
> > I get the following error (twice):
> >
> > ! You can't use \spacefactor' in math mode.
> > \@ ->\spacefactor
> >                    \@m
> > l.19 \xy@{\save }{\save@ }
> >                            %

That looks like something is being expanded too soon,
within the \xymatrix.

What other packages are being loaded ?
Something may have redined the $...$  environment
to look for an optional argument, hence expanding \xymatrix
at an inappropriate time.

Try the following programmer tricks:

$\relax \xymatrix{ \mathbb{R} \ar[r]^{d} & \mathbb{R} }$

and

\DeclareRobustCommand{\RR}{\mathbb{R}}    % best in the preamble

$\xymatrix{ \RR \ar[r]^{d} & \RR }$

Hope this helps,

Ross Moore

>
> This is very odd: when I try the same test in my document it works fine.
>
> Can you try finding the smallest document which reproduces the problem?
> It's most likely that something else you're including is throwing things
> off.
>
> Certainly the following works for me:
>
>
> \documentclass{article}
> \usepackage[matrix,arrow]{xy}
> \usepackage{amssymb} % For \mathbb
> \begin{document}
> $\xymatrix{ \mathbb{R} \ar[r]^{d} & \mathbb{R} }$
> \end{document}
>
>
> See what you need to add to get the behaviour you see.
> _______________________________________________
> Xy-pic mailing list
> http://tug.org/mailman/listinfo/xy-pic
>
`