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

Arne Schröder arne.schroeder at gmail.com
Mon Nov 14 02:15:08 CET 2011

Hi there,

in my TeX-document, I would like to include a diagram in which there is
underlined text. I also want this diagram to be centered. So far I used
xy-pic very nicely and centered all diagrams, using $and$. However,
underlining in combination with \CompileMatrices seems to cause problems.

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:

\documentclass{scrreprt}
> \usepackage[matrix]{xy}
>
> \CompileMatrices
>
> \begin{document}
>
> $> \begin{xy} > \xymatrix{ > \underline{bla} > } > \end{xy} >$
>
> \end{document}
>

Do you know whether I have done something wrong? Is there a known
workaround?

`