# Double arrow in TikZ?

I'm trying to draw two arrows between nodes as follows:

A ------> B
<--/---


The arrows should be parallel, in opposite directions but not on top of each other. (I can bend the arrows but that's not what I'm after.)

What's the cleanest way to do this in TikZ? And can I have just one of the arrows "struck out" as in the example?

-
For the "strike out", take a look at the answers to the question: tex.stackexchange.com/q/3161/86 –  Loop Space May 12 '11 at 18:26

Here is an idea that might answer both your questions. It uses yshift to move the start and end points of the two paths up/down by 5pt. The result could be further improved by shifting the start/end points along the x axis in order for the paths to really be in contact with the nodes' circles.

A custom TikZ style is used to add a strike-through marking at the middle of the second path. This could be parameterized further to allow moving the marking to any position on the path etc.

I cannot tell whether this is the most elegant solution though.

\documentclass{minimal}

\usepackage{tikz}

\usetikzlibrary{decorations,decorations.markings}

\tikzset{
strike through/.style={
postaction=decorate,
decoration={
markings,
mark=at position 0.5 with {
\draw[-] (-5pt,-5pt) -- (5pt, 5pt);
}
}
}
}

\begin{document}
\begin{tikzpicture}
\node[draw,circle] (foo) at (0,0) { foo };
\node[draw,circle] (bar) at (4,0) { bar };

\draw[>=latex,->]                ([yshift= 5pt] foo.east) -- ([yshift= 5pt] bar.west);
\draw[>=latex,<-,strike through] ([yshift=-5pt] foo.east) -- ([yshift=-5pt] bar.west);
\end{tikzpicture}
\end{document}


Here is how it looks like:

-
Note that you can apply simple shifts on coordinates by using the yshift, xshift or shift options on the coordinate: ([yshift=2pt]foo.east) instead of ($(foo.east) + (0, 2pt)$). This is often not known. It does not require the calc library. –  Martin Scharrer May 12 '11 at 16:16
Interesting, I didn't know that syntax. I tried yshift in the arguments to \draw as well as after -- (also tried edge instead of --) but neither of them worked. Thanks for the hint. –  Jannis Pohlmann May 12 '11 at 16:21
@Jannis: If you operate on named coordinates instead of direct ones, you further need transform canvas. –  Andrey Vihrov May 12 '11 at 16:22
@Andrey: Ah, alright. –  Jannis Pohlmann May 12 '11 at 16:24
@Andrey: It seems to be an issue if you use the node name without an anchor, because then the border anchor is taken which depends on the position of the target coordinate. That's basically the difference between (A) and (A.center). It seems to work without transform canvas if you use an anchor like (A.west). –  Martin Scharrer May 12 '11 at 18:12

With PSTricks. Unfortunately, no option to change the radius of \circlenode to be uniform.

\documentclass[pstricks,border=12pt]{standalone}
\usepackage{pst-node}
\psset{arrows=->,arrowinset=0}
\begin{document}
\begin{pspicture}[showgrid](5,2)
\rput(1,1){\circlenode{Left}{left}}
\rput(4,1){\circlenode{Right}{right}}
\ncline[offset=5pt]{Left}{Right}
\ncline[offset=5pt]{Right}{Left}
\ncput{\psline[arrows=-](5pt;45)(5pt;-135)}
\end{pspicture}
\end{document}

-