# [Xy-pic] color in xymatrix diagram spreads throughout document

John G. Bullock john.bullock at yale.edu
Sat Oct 9 21:29:07 CEST 2010

Hello,

I am trying to color arrows in a diagram that I construct with Xy-pic
v3.82 and pdflatex v1.40.4.  I find that coloring curved arrows also
colors every subsequent object in my diagram -- and most subsequent
parts of my document to boot.  I've looked for solutions in the Xy-pic
documentation, but I haven't found any.  Can someone point me to what
I'm doing wrong?

Here is a minimal example:

\documentclass{article}
\usepackage{color}
\usepackage[all]{xy}
\begin{document}
\xymatrix{
X \ar@[red][r] & M\\
X \ar@[red]@/^/[r] & M\\
X \ar[r] & M
}
\end{document}

I want nothing to be red except the arrows in the first two lines of
the diagram.  The first line renders as expected: only the arrow is
red.  In the second line, the arrow is curved and red as expected, but
M is also red.  And in the third line, everything is red.

Thank you,
John