4

I have this diagram I'm doing with xypic, and I want to make bent arrows going from the top to the bottom of the diagram. So I re-learn the syntax for bending around entries. THen I decide I want those arrows dotted. So I add the extra commands and end up with this:

\documentclass[a4paper]{report}
\usepackage{amsmath,amssymb,amsfonts}
\usepackage[all]{xy}

\begin{document}
\[\xymatrix{
 & & M(\omega)\ar@{-}@/_.1pc/[ddr]\ar@{-}@/_.1pc/[dl] & \\
 & M \ar@{-}@/_.1pc/[ddr] & & \\
 & & & K(\omega)\ar@{-}@/_.1pc/[dl] & \\
 & & K\ar@{..>}`[urr]`[uuur]_1[uuu]\ar@{..>}`[ull]`[uuul]^2[uuu]
}\]
\end{document}

I finally get to typeset and… WHAT?

enter image description here

Why are those turns not dotted and is there a way to get them dotted like the rest of the arrow shaft?

  • Related: tex.stackexchange.com/q/151273 Off-topic: please load the cmtip option of xy as it will fix the measly arrow heads. – LaRiFaRi May 22 '15 at 8:35
  • But shouldn't [all] load that option @LaRiFaRi? WHat does all mean if an option is not loaded? – MickG May 22 '15 at 8:48
  • an absolutely legitimate question and I have no idea at all. Well, a guess: Could be that all is loading all the existent packages of xy. Don't know their names but maybe xymatrix, xy-pic, 2cells... just out of head. Possibly developed separately and bundled by \usepackage[all]{xy}. [cmtip] is more an option, literally, and is therefore optional. – LaRiFaRi May 22 '15 at 8:55
  • all probably loads the default xy tip. Since there are various tips (xy, cm, eu and lu are documented here), all loads the default xy tip. Btw, the maintainers of this page should be notified lots of links there are broken because of an extra /xy which should not be there :). – MickG May 22 '15 at 9:02
  • 1
    @LaRiFaRi I followed your example and deleted my comments. Posting this to let you know 1) The links are now almost all fixed; 2) The CTAN version of xy-pic is out of date (!); 3) See my answer for a couple of xy solution, one suggested by Kris and available only with the latest xy version, one which I came up with myself by looking up @() in the xyguide, as an attempt to fix Kris's solution which naturally didn't work with my TL 2014 version 3.8.9. PS If anyone wants to read those comments, I saved a screenshot :). – MickG May 22 '15 at 17:04
1

I fear, this is not possible. Please see here dotted or colored arc in \xymatrix (not a great reference as I was the only to answer and did not score impressive points with that... :-) )

However, I recommend switching to here. Please see my MWE:

% arara: pdflatex

\documentclass[a4paper]{report}
\usepackage{tikz-cd}

\begin{document}
\[
\begin{tikzcd}[column sep={2cm,between origins},row sep={1.5cm,between origins}] % can be left away, but it makes the rectangle parallel
    & & M(\omega)\arrow[dash]{dl}\arrow[dash]{ddr} & \\
    & M\arrow[dash]{ddr}  & & \\
    & & & K(\omega)\arrow[dash]{dl} & \\
    & & 
    K
    \arrow[dotted, rounded corners, to path={-- ([xshift=-2.8cm]\tikztostart.west) \tikztonodes  |- (\tikztotarget)}]{uuu}[near end,swap]{2} % rounded corners=10 if you want the same as with xy
    \arrow[dotted, rounded corners, to path={-- ([xshift=2.8cm]\tikztostart.east) \tikztonodes  |- (\tikztotarget)}]{uuu}[near end]{1}
    &
\end{tikzcd}
\]
\end{document}

enter image description here


I was not able to set the labels onto the middle of the arrows (or had not enough time...). Please see the manual and other post on how to use \tikztonodes correctly. It could be that you will need to set two phantom nodes here.

  • I guess I'll keep my undotted arcs for now and learn tikz-cd this summer. It seems it is time to ditch xy, as it is the second time I get advised towards tikz-cd :). Thx. – MickG May 22 '15 at 9:03
  • @MickG You are very welcome. tikz-cd is easy and well documented. So I would do that step for sure. Good look. – LaRiFaRi May 22 '15 at 9:13
2

Easy fix 1

An alternate solution sticking to xypic is the following:

\documentclass[a4paper]{report}
\usepackage{amsmath,amssymb,amsfonts}
\usepackage[all]{xy}

\begin{document}

\[\xymatrix{
 & & M(\omega)\ar@{-}@/_.1pc/[ddr]\ar@{-}@/_.1pc/[dl] & \\
 & M \ar@{-}@/_.1pc/[ddr] & & \\
 & & & K(\omega)\ar@{-}@/_.1pc/[dl] & \\
 & & K
           \ar@{..>}@(ur,dr)_1 [uuu]
           \ar@{..>}@(ul,dl)^2 [uuu]
}\]
\end{document}

Yielding:

enter image description here

The look is rather different, but for this single diagram it will do fine. However, this is only a partial solution, since in other contexts I might want to tweak around with those curved arrows, and at present I have no idea how to do that, and the answerer here seems not to know either.

"Easy" fix 2

Another solution with xypic, as Kris told me by mail, is the following:

\documentclass[a4paper]{report}
\usepackage{amsmath,amssymb,amsfonts}
\usepackage[all]{xy}

\begin{document}

\[\xymatrix{
 & & M(\omega)\ar@{-}@/_.1pc/[ddr]\ar@{-}@/_.1pc/[dl] & \\
 & M \ar@{-}@/_.1pc/[ddr] & & \\
 & & & K(\omega)\ar@{-}@/_.1pc/[dl] & \\
 & & K
           \ar@{..>}@(r2pc,r2pc)_1 [uuu]
           \ar@{..>}@(l2pc,l2pc)^2 [uuu]
}\]
\end{document}

However, this only works from version 3.9 up, that is only with 3.9, since that is the latest version. Unfortunately, neither TL 2014 nor CTAN have that version, and they both have 3.8.9, which gives the following nasty result:

enter image description here

In Kris's own words:

The "3pc" are the width indicators for the curve that only 3.9 can handle - 3.8 just echoes them.

With the latest update newly downloaded from sourceforge, the result of this solution becomes:

enter image description here

I will soon experiment with the lengths in the parentheses to see how much tweaking I can do with the loop. This is actually documented on page 42 here, uh-oh, no, that is the old documentation, but on page 42 of the newer one from sourceforge you find the same table as in the older one, but with the <dimen> possibility too, explained in 24p on page 43. Lots of tweaking can be done with this, as I have seen. I won't post examples because I don't know which of the many to choose, and they are too many :).

Source change -- still not known, will hear from Kris again :)

There seems to be a possible change in the source that would allow auto-dotting of bends. This is what Kristoffer Rose told me by mail, and I am going to try that. When I manage this, I will edit this answer to include that change. UPDATE Kris says:

To get involved in Xy-pic development you (1) checkout the source from SourceForge, (2) "make xysource.pdf", (3) study the "kernel" and "arrows" sections of the code (easiest in xysource.pdf). The fix will be to the place in the xyarrow.doc code where it currently uses a \cir primitive to do the turns, where you will want it to use a \crv primitive instead if that is loaded and the connection style is non-solid... (I was serious that this is a courageous enterprise)!

Now I have downloaded xy-pic from sourceforge, xysource.pdf is already present, but I looked through xyarrow.tex and found no \cir, only \CIR or \cir@… where … represents something I don't remember. The non-dotted bends are reported as a Bug in xysource. I couldn't find any \cir alone in the arrows section, only \cir…. I think I will now concentrate on my exams and come back to this thing in summer.

Note

The exchange with Kris also had the purpose of informing him of the broken links on this page. They are now mostly fixed, with a couple removed and one still broken. Will inform Kris in next mail. So if anyone has experienced the broken links, you can go back and find them fixed :).

  • Thanks for your efforts. Keep me updated, when the auto-dotting starts working. – LaRiFaRi May 22 '15 at 18:52
  • Just emailed Kris asking how to get that auto-dotting implemented. Waiting for an answer. :) – MickG May 23 '15 at 10:42

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.