[Tex/LaTex] Coloring arrows in \xymatrix

arrowscolorxy-pic

Is there a way to color certain (but not all) arrows using \xymatrix? I wish the following ignorant attempt would work!!

\usepackage{xypic,color}
\begin{document}
\[
\xymatrix
{
X\ar[r]\color{red}{\ar[d]} & Y\\
Z
}
\]
\end{document}

Best Answer

Specify the color option to the xy package. Then you could apply a color style by @[color].

For example:

\documentclass{article}
\usepackage{color}
\usepackage[color,matrix,arrow]{xy}
\begin{document}
\[
\xymatrix
{
X\ar[r] \ar@[red][d] & Y\\   Z
}
\]
\end{document}

alt text

Note: load xy, not xypic which produces at least a warning. To be able to provide options specifically for each package, write one \usepackage for each package. Perhaps use the enhanced package xcolor instead of color.

Related Question