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}
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}
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}

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.
\usepackage[color,matrix,arrow,pdf]{xy}. And, especially if xy complains about an unknown option: update xy-pic to 3.8 or above. I'm using xy 3.8.4. – Stefan Kottwitz Dec 13 '10 at 21:33pdflatexworks, apart from the color. Compiling vialatexanddvipsgives the color (when specifying the dvips driver). So there are two options: update xy or compile the old-fashioned way. – Caramdir Dec 13 '10 at 22:43\xymatrix{A\ar@{-->}[r]&B}
but I want a red arrow. Now, if I type
\xymatrix{&A\ar@{-->}[red][r]&B}
no arrow appears. If I type
\xymatrix{&A\ar@[red]{-->}[r]&B} the arrow is not red and changes directions. How can I solve this?
– Ana Aug 05 '21 at 05:25