I have an xymatrix in which two arrows cross each other, say

\xymatrix{ \ar[dr] &  \\ \ar[ur] & }

and I would like one arrow to cross over the other. I also want to to be able to do this without using knots; the reason is that I want to draw some diagrams where the arrows just intersect and some diagrams where they don't, and I'd prefer that they have a uniform look to them.

There is an example of how to do this in the xy-pic user's guide, but 1) I don't quite understand it, and 2) it seems to require that I thread a single arrow through multiple entries. I don't want to have to do that; I really just want two arrows, one of which crosses over the other.

I tried to give the "under" arrow an empty label, but that didn't work. Any ideas?

| improve this question | | | | |

It's not so hard.

Dig a hole:

\xymatrix{ \ar[dr]|\hole &  \\ \ar[ur] & }

Calculate the intersection point and dig a hole:

\xymatrix{ \ar[drr]|!{[d];[r]}\hole & & \\ \ar[ur] & & }

enter image description here

| improve this answer | | | | |
  • @Stefan: Then use \xymatrix{ \ar[drr]|!{[d];[r]}\hole & & \\ \ar[ur] & & } – Leo Liu Feb 5 '11 at 20:44
  • Sorry I removed my comment regarding manual adjustment right before you added yours. It's good to have a |!{...} notation example here now. – Stefan Kottwitz Feb 5 '11 at 20:51
  • Great, thanks! Quick follow-up question: the diagonal arrows are showing up weirdly aliased in my PDF reader (Foxit). Is this a problem with my reader or should I be tweaking a TeX setting or what? – Qiaochu Yuan Feb 5 '11 at 22:31
  • 2
    @Qiaochu: Try \usepackage{xypdf}. – Leo Liu Feb 6 '11 at 4:32

There's a general trick, no matter if xy-pic or let's say TikZ is used. It also works with bent arrows, naturally.

  1. Draw the arrow which shall cross below
  2. Draw the arrow which shall cross above, but thick and in background color
  3. Draw the arrow which shall cross above again, but normally

For example:

\xymatrix{ \ar[dr]& \\ \ar@*{[|(6)][white]}[ur]\ar[ur] & }

For line styles and color a capable driver is required. I used dvips.

enter image description here

| improve this answer | | | | |
  • In TikZ, it's OK. However, I don't think it is needed in Xy-pic. – Leo Liu Feb 5 '11 at 20:27
  • @Leo: this way I don't need to take care where to put an empty break by \hole, such as in complex drawings with many arrows crossing, possibly even bent. – Stefan Kottwitz Feb 5 '11 at 20:35
  • That's still not necessary. See "Exercise 6" of xyguide. – Leo Liu Feb 5 '11 at 20:42
  • @Leo: I see what you mean, using the crossing notation. – Stefan Kottwitz Feb 5 '11 at 20:46

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.