4

I am using xy matrix and I would to curve an arrow over other arrows in a diagram, at the same time as setting some of these curved arrows to equal and changing their colour. This is what I have so far:

\usepackage[all]{xy}

    \xymatrix{
    &&H(Z) \ar@/^2.0pc/[rr]^{F(f^{op} \circ g^{op})} \ar[r]^{H^{*}(g^{op})} & H(Y) \ar@{=}[dl] \ar[r]^{H^{*}(f^{op})} & H(X) \ar@{=}[dl] \ar@/^2.0pc/[ddll]\\
    & H(Z) \ar@{=}[ur] & H(Y) \ar[u]_{G(g^{op})} & H(X) \ar@{=}[dl] \ar[u]_{G(f^{op})}\\
    H(Z) \ar[r]^{H^{*}(g^{op})} \ar@{=}[ur]  &H(Y) \ar@{=}[ur] \ar[r]^{H^{*}(f^{op})}  \ar[u]_{G(g^{op})} &H(X)   \ar[u]_{G(f^{op})} \ar@/^2.0pc/[uu]^{G(f^{op} \circ g^{op})}  \\
    }

I would like the larger curved arrows to be red, with the curved arrow in the bottom right hand corner of the diagram to be an = arrow as in ar@{=}[ddll].

5

Here's a possible solution using the color option for the xy package and the xcolor package:

\documentclass{article}
\usepackage{xcolor}
\usepackage[all,color]{xy}

\begin{document}

\xymatrix{
& & H(Z) \ar@/^2.0pc/@[red][rr]^{F(f^{op} \circ g^{op})} \ar[r]^{H^{*}(g^{op})} 
  & H(Y) \ar@{=}[dl] \ar[r]^{H^{*}(f^{op})} 
  & H(X) \ar@{=}[dl] \ar@/^2.0pc/@{=>}@[red][ddll] \\
& H(Z) \ar@{=}[ur] 
  & H(Y) \ar[u]_{G(g^{op})} 
  & H(X) \ar@{=}[dl] \ar[u]_{G(f^{op})} \\
H(Z) \ar[r]_{H^{*}(g^{op})} \ar@{=}[ur] 
  & H(Y) \ar@{=}[ur] \ar[r]_{H^{*}(f^{op})}  \ar[u]_{G(g^{op})}
  & H(X)  \ar[u]_{G(f^{op})} 
  \ar@/^2.0pc/@[red][uu]^{G(f^{op} \circ g^{op})}
}

\end{document}

The above code will produce the following result (I only focused my answer on the problems mentioned in the question; the layout of the diagram has to be improved to avoid overlapping elements):

enter image description here

Changing the column spacing, overlapping element are prevented:

\documentclass{article}
\usepackage{xcolor}
\usepackage[all,color]{xy}

\begin{document}

\xymatrix@C=2cm{
& & H(Z) \ar@/^2.0pc/@[red][rr]^{F(f^{op} \circ g^{op})} \ar[r]^{H^{*}(g^{op})} 
  & H(Y) \ar@{=}[dl] \ar[r]^{H^{*}(f^{op})} 
  & H(X) \ar@{=}[dl] \ar@/^2.0pc/@{=>}@[red][ddll] \\
& H(Z) \ar@{=}[ur] 
  & H(Y) \ar[u]_{G(g^{op})} 
  & H(X) \ar@{=}[dl] \ar[u]_{G(f^{op})} \\
H(Z) \ar[r]_{H^{*}(g^{op})} \ar@{=}[ur] 
  & H(Y) \ar@{=}[ur] \ar[r]_{H^{*}(f^{op})}  \ar[u]_{G(g^{op})}
  & H(X)  \ar[u]_{G(f^{op})} 
  \ar@/^2.0pc/@[red][uu]^{G(f^{op} \circ g^{op})}
}

\end{document}

enter image description here

As a side note, a package that could be of interest for you is tikz-cd.

3
  • 4
    Any sufficiently advanced xymatrix code is indistinguishable from complicated regex. – Seamus Jul 17 '12 at 22:19
  • @Seamus: xymatrix code is a lot more readable if you start a new line for every node, and when an arrow is particularly messy put it on a new line as well. – Phil Hirschhorn Jul 18 '12 at 4:33
  • @PhilHirschhorn you're right. I used your suggestion to improve the example code readability. Thanks. – Gonzalo Medina Jul 18 '12 at 16:30

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.