1

I'd like to use xy to draw a diagram with coloured parallel lines. A previous question dealt with making xy create coloured lines, but the first xymatrix produces a mess rather than a coloured version of the second xymatrix.

  \documentclass{article}
\usepackage{color}
\usepackage[color,matrix,arrow]{xy}
\begin{document}
\[
\xymatrix
{
X\ar[r] \ar@<+.5ex>[d] & Y\\   
Z\ar@<+.5ex>[u]
}
\]
\[
\xymatrix
{
X\ar[r] \ar@[red]<+.5ex>[d] & Y\\   Z\ar@[red]<+.5ex>[u]
}
\]

enter image description here

Abijah
  • 475
  • 3
  • 11

1 Answers1

1

You're forgetting an additional @:

\documentclass{article}
\usepackage{color}
\usepackage[color,matrix,arrow]{xy}
\begin{document}
\[
\xymatrix
{
X\ar[r] \ar@[red]@<+.5ex>[d] & Y\\   Z\ar@[red]@<+.5ex>[u]
}
\]
\end{document}

enter image description here

For completeness, a tikz-cd version.

\documentclass{article}
\usepackage{tikz-cd}

\begin{document}
\[
\begin{tikzcd}
  X \arrow[r] \arrow[d,red,shift left] & Y\\
  Z \arrow[u,red,shift left]
\end{tikzcd}
\]
\end{document}

enter image description here

egreg
  • 1,121,712