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

  • Your document is not complete... – user31729 Feb 10 '18 at 21:35
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

  • Thanks, what does the second @ signify? – Abijah Feb 10 '18 at 22:07
  • @Abijah You need one before the <+0.5ex> specification. – egreg Feb 10 '18 at 22:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.