# How to position hole in an arrow in xypic

trying to draw a 3D commutative diagram here and getting really stuck trying to get the hole in one of the arrows in the right place, you should see which one I mean as there is only one crossover.

Here is my code:

\xymatrix{
&               &       &       &T(U_1 \cap U_2) \ar[ddr]^{(\sigma_2)_*} \ar[ddl]_{(\sigma_1)_*}    &       \\
&U_1 \cap U_2 \ar[ddr]^{\sigma_2} |!{[dd];[rr]}\hole \ar[ddl]_{\sigma_1} \ar@{-->}[urrr]^D &        &       &                   &       \\
&               &       &T(\CC \setminus \{ 0\}) \ar[rr]^{\textit{bundle transition}} & & T(\CC \setminus \{ 0\}) \\
\CC \setminus \{ 0\} \ar[rr]_{\textit{coordinate transition}} \ar@{-->}[urrr]^D & & \CC \setminus \{ 0\} \ar@{-->}[urrr]^D &            &   & \\}


Does anyone have any suggestions?

Also, if anyone can suggest any other ways to make this diagram look more 3D' I would be very grateful.

• MikTex doesn support xy-pic, and xypdf doesn't support \xymatrix. Feb 14, 2015 at 21:09
• @JohnKormylo Really? I don't think so. Feb 14, 2015 at 21:17
• @egreg Well, the package manager couldn't find xy-pic. Perhaps they use another name. Feb 15, 2015 at 16:53
• @JohnKormylo miktex.org/packages/xypic Feb 15, 2015 at 16:56
• @egreg Found it. I had to sychronize the package database, then discovered I already had it installed (xypic not xy-pic). Feb 15, 2015 at 22:09

I'd give a try to tikz-cd:

\documentclass{article}
\usepackage{amsmath,amssymb}
\usepackage{tikz-cd}

\begin{document}
$\begin{tikzcd}[row sep=3em,column sep=1em] &&&& T(U_1\cap U_2) \arrow[ddl,swap,"(\sigma_1)_*"] \arrow[ddr,"(\sigma_2)_*"] \\ & U_1\cap U_2 \arrow[ddl,swap,"\sigma_1"] \arrow[urrr,dashed,"D"] \\ &&& T(\mathbb{C}\setminus\{0\}) \arrow[rr,"\scriptscriptstyle\textit{bundle transition}"] && T(\mathbb{C}\setminus\{0\}) \\ \mathbb{C}\setminus\{0\} \arrow[urrr,dashed,"D"] \arrow[rr,swap,"\scriptscriptstyle\textit{coordinate transition}"] && \mathbb{C}\setminus\{0\} \arrow[urrr,dashed,"D"] \arrow[uul,leftarrow,crossing over,"\sigma_2"] \end{tikzcd}$
\end{document}


The trick is to draw the crossing over arrow later than the arrow it has to be crossed over (reversing the direction with leftarrow).

If you want the left triangle to be in the background, just change the arrow that must cross over:

\documentclass{article}
\usepackage{amsmath,amssymb}

\usepackage{tikz-cd}

\begin{document}
$\begin{tikzcd}[row sep=3em,column sep=1em] &&&& T(U_1\cap U_2) \arrow[ddl,swap,"(\sigma_1)_*"] \arrow[ddr,"(\sigma_2)_*"] \\ & U_1\cap U_2 \arrow[ddl,swap,"\sigma_1"] \arrow[ddr,"\sigma_2"] \arrow[urrr,dashed,"D"] \\ &&& T(\mathbb{C}\setminus\{0\}) \arrow[rr,"\scriptscriptstyle\textit{bundle transition}"] && T(\mathbb{C}\setminus\{0\}) \\ \mathbb{C}\setminus\{0\} \arrow[urrr,dashed,crossing over,"D"] \arrow[rr,swap,"\scriptscriptstyle\textit{coordinate transition}"] && \mathbb{C}\setminus\{0\} \arrow[urrr,dashed,"D"] \end{tikzcd}$
\end{document}


An alternative form where it may be easier to guess the 3D aspect, with the bigger triangle in front.

\documentclass{article}
\usepackage{amsmath,amssymb}

\usepackage{tikz-cd}

\begin{document}
$\begin{tikzcd}[row sep=3em,column sep=1em] & U_1\cap U_2 \arrow[ddl,swap,"\sigma_1"] \arrow[ddr,"\sigma_2"] \arrow[drrr,dashed,"D"] \\ &&&& T(U_1\cap U_2) \arrow[ddr,"(\sigma_2)_*"] \\ \mathbb{C}\setminus\{0\} \arrow[drrr,dashed,"D"] \arrow[rr,"\scriptscriptstyle\textit{coordinate transition}"] && \mathbb{C}\setminus\{0\} \arrow[drrr,dashed,"D"] \\ &&& T(\mathbb{C}\setminus\{0\}) \arrow[rr,swap,"\scriptscriptstyle\textit{bundle transition}"] \arrow[uur,leftarrow,crossing over,"(\sigma_1)_*"] && T(\mathbb{C}\setminus\{0\}) \end{tikzcd}$
\end{document}


• Thanks! Is there a way to get the dashed arrow crossing over? Feb 14, 2015 at 22:19
• @AerinmundFagelson Yes, of course: added. Feb 14, 2015 at 22:32
• cheers, might start using tikz :) Feb 14, 2015 at 23:16
• @AerinmundFagelson -- with the dashed arrow crossing over "in front", this looks not so much like 3d, but like one of m.c.escher's "impossible constructions". Feb 15, 2015 at 0:20
• @barbarabeeton Probably the background triangle should be higher than the “T-transformed” one. Feb 15, 2015 at 10:45

I, too, would opt for tikz-cd.

Anyway, this is a solution with xy-pic. Note that it works only with the latex -> dvips -> ps2pdf route.

\documentclass{article}
\usepackage{amsmath,amssymb}
\usepackage[dvips,all]{xy}
\usepackage{xcolor}

\newcommand{\CC}{\mathbb{C}}

\begin{document}
$\xymatrix{ & & & &T(U_1 \cap U_2) \ar[ddr]^{(\sigma_2)_*} \ar[ddl]_{(\sigma_1)_*} & \\ &U_1 \cap U_2 \ar[ddl]_{\sigma_1} \ar@{-->}[urrr]^D & & & & \\ & & &T(\CC \setminus \{ 0\}) \ar[rr]^{\textit{bundle transition}} & & T(\CC \setminus \{ 0\}) \\ \CC \setminus \{ 0\} \ar[rr]_{\textit{coordinate transition}} \ar@{-->}[urrr]^D & & \CC \setminus \{ 0\} \ar@*{[|(15)][white]}[uul]\ar@{<-}[uul]_{\sigma_2}\ar@{-->}[urrr]^D & & & \\}$

$\xymatrix{ & & & &T(U_1 \cap U_2) \ar[ddr]^{(\sigma_2)_*} \ar[ddl]_{(\sigma_1)_*} & \\ &U_1 \cap U_2 \ar[ddr]^{\sigma_2} \ar[ddl]_{\sigma_1} \ar@{-->}[urrr]^D & & & & \\ & & &T(\CC \setminus \{ 0\}) \ar[rr]^{\textit{bundle transition}} & & T(\CC \setminus \{ 0\}) \\ \CC \setminus \{ 0\} \ar[rr]_{\textit{coordinate transition}} \ar@*{[|(15)][white]}[urrr]\ar@{-->}[urrr]^D & & \CC \setminus \{ 0\} \ar@{-->}[urrr]^D & & & \\}$

\end{document}


The main idea is to draw a thicker white arrow over the underlying arrow, for example

\ar@*{[|(15)][white]}[urrr]


and then the visible arrow over that

\ar@{-->}[urrr]^D


The "break" command in your code (|!{[dd];[rr]}\hole) should instead be |!{[ddl];[rrd]}\hole, since you were hoping to "slide" along with last drawn line to the position where it intersects with another line(! command).

The [ddl];[rrd] part specifies the the start and end of the line that recently-drawn line intersects with: The start of the line is down, down, left from current cell, the end is right, right, down from current cell.

And finally, ask xy pic to place a \hole at the position with xymatrix extension command |`(break).