3

I want to draw a commutative diagram with xy-pic package similar to the figure shown below. The two arrows from C to D and vice versa should pass under the rectangle ABEF, be separated by a distance, and be horizontal. The problem is that I can not make the segments of these two arrows to be horizontal, rather they are tilted as shown.

enter image description here

The figure is generated by this code:

\begin{equation*}
     \xymatrix@!=3.5pc{
     & A \ar[dd] \ar[r] & B \ar[dd] & \\
     C \ar@<2ex>'[r]'[rr][rrr] &&& D  \ar@{->}@<2ex>'[l]'[ll][lll] \\
     & E \ar[r] & F &
     }
\end{equation*}

When the two arrows are placed exactly on each other (that is, zero distance) both are horizontal and there is no problem.

However, when I make a distance between them, they will not stay horizontal and each segment of arrow tilts. In above code I used 2ex distance between arrows to exaggerate the problem. Though, I originally intend to use smaller distances. How can I fix this? Thanks.

4

You can also get crossing arrows by putting a small gap in the arrow to be broken by breaking the arrow with the special label \hole. To see a discussion and examples, take a look at the AMS-LaTeX primer "Getting up and running with AMS-LaTeX"amshelp.pdf, at https://ctan.org/tex-archive/info/amslatex/primer?lang=en, section 8.6 (More crossing arrows). For your particular question:

\documentclass{amsart}
\usepackage[all,cmtip]{xy}

\begin{document}
\begin{equation*}
     \xymatrix@!=3.5pc{
     & A \ar[dd] \ar[r] & B \ar[dd] & \\
     C 
     \ar@<2ex>|!{[ru];[rd]}{\hole}|!{[rru];[rrd]}{\hole}[rrr]
     &&& D
     \ar@<2ex>|!{[lu];[ld]}{\hole}|!{[llu];[lld]}{\hole}[lll]\\
     & E \ar[r] & F &
     }
\end{equation*}
\end{document}

produces desired diagram

  • 1
    Amazing! (I would have thought this is too tough for xy, so +1.) – user121799 May 31 at 3:50
  • @marmot Thanks; I do admit that the tikz-cd approach is overall cleaner and more intuitive. – Phil Hirschhorn May 31 at 3:57
  • I guess it is always a matter what one is more familiar with. I think your solution is simple and good, and answers the question, which is on xy. – user121799 May 31 at 3:59
2

Just for fun: a tikz-cd realization.

\documentclass{article}
\usepackage{tikz-cd}
\begin{document}
\begin{tikzcd}[column sep=2em,row sep=2em]
 & A \arrow[r]  & B  & \\
 C \arrow[rrr,yshift=0.65ex]& & & \arrow[lll,yshift=-0.65ex] D\\
 & E \arrow[r] \arrow[uu,<-,crossing over] & F \arrow[uu,<-,crossing over]& \\
\end{tikzcd}
\end{document}

enter image description here

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.