5

I am trying to make a diagram with arrows between arrows.

Here is how it currently looks:

enter image description here

with code:

\begin{tikzcd}
& a \arrow[ld, "Rei"', no head, ""{name=r1}] \arrow[rd, "Rei", no head, ""{name=r2}] &                                \\
b \arrow["Neu"', no head, loop, distance=2em, in=305, out=235] &
& c \arrow[d, "PosRes", no head] \\
&                                                           & d
& \arrow[no head, from=r1, to=r2, dashed]
\end{tikzcd}

I would like that dashed line to be straight. It appears to me that this happens because the arrow is "pointing" to the label of the right-most "Rei" arrow. I would like it to point to the center of it, so that the line is straight. However, I cannot find how to do this. Is there a general way to specify that the "arrow between arrows" should point to the center of each arrow (rather than the labels)? If not, what would be a good way to achieve this?

2
  • 1
    You might like q.uiver.app, a very nice (free, online) commutative diagram editor that has that feature and can export tikz code
    – Nathaniel
    Feb 5 at 12:50
  • 1
    @Nathaniel that is splendid, thank you so much! I used another tool to create this which did not support arrows between arrows. Thank you so much :)
    – olinarr
    Feb 5 at 13:06
5

You could specify the to coordinate as the point on the same height as r1, but below r2. Additionally you can use shorten > (and shorten <, if needed) to adjust the length. Something like to=r1-|r2, shorten >=0.5em.

enter image description here

\documentclass{article}

\usepackage{tikz-cd}

\begin{document}
\begin{tikzcd}
& a \arrow[ld, "Rei"', no head, ""{name=r1}] \arrow[rd, "Rei", no head, ""{name=r2}] &                                \\
b \arrow["Neu"', no head, loop, distance=2em, in=305, out=235] &
& c \arrow[d, "PosRes", no head] \\
&                                                           & d
& \arrow[no head, from=r1, to=r1-|r2, dashed,shorten >=0.5em]
\end{tikzcd}
\end{document}
5

Almost the same as @gernot answer (+1, he beat me for a minute, but my code is wee bit shorter):

\documentclass{standalone}
\usepackage{tikz-cd}

\begin{document}
    \begin{tikzcd}[arrows=-]
    & a \arrow[ld, "\mathrm{Rei}"', ""{name=r1}] 
        \arrow[rd, "\mathrm{Rei}" , ""{name=r2}] 
        &                                \\
b \arrow["\mathrm{Neu}"', loop, distance=2em, in=305, out=235] 
    &
        & c \arrow[d, "\mathrm{PosRes}"] \\
    &   & d
        & \arrow[from=r1, to=r2 |-r1, dashed, shorten >=0.5em]
    \end{tikzcd}
\end{document}

enter image description here

2
  • +1 to everybody...but is it possible to use xy package? No I think. :-) You are very closer to 200k :-)
    – Sebastiano
    Feb 4 at 20:22
  • 1
    @Sebastiano, thank you very much. I'm not familiar with xy, so regarding it I don't know. Yeh, 200 k is close ;-)
    – Zarko
    Feb 4 at 20:38
4

My code it is off-topic with the tag, but also the forgotten package can do the same code like tikz-cd. Here there is my MWE:

\documentclass[a4paper,12pt]{article}
\usepackage{mathtools}
\usepackage[all]{xy}
\begin{document}
\xymatrix@R=3pc@C=4pc{\ar @{} [dr] |{\hspace{2.1cm} -------}
& a \ar@{-}[dl]_{\mathrm{Rei}} \ar@{-}[dr]^{\mathrm{Rei}}& \\
b \ar@{-}@(dl,dr)_{\mathrm{Neu}}& & c \ar@{-}[d]^{\mathrm{Pos\,Res}}\\
 &  & d
}
\end{document}

The line are right...if you make a zoom you get the straight lines.

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.