7

double line arrow

I want to be able to do something similar as above in PGF/TikZ. Is it possible? If yes, I would like to know how. I found the following code in the PGF manual for printing arrow tips over double line

\documentclass[a4paper]{article}
\usepackage{tikz}
\usetikzlibrary{arrows}

\begin{document}
   \begin{tikzpicture}
       \pgfsetlinewidth{10 pt}
       \pgfsetinnerlinewidth{2 pt}
       \draw [-implies] (90pt,1640pt) -- ++(1cm,0);
   \end{tikzpicture}
\end{document}

but it seems to use only the inside line and the arrows are still centered. I tried using the standalone class, but it does not show properly, and hence I used article class.

1 Answer 1

7

Result

I cheated a bit. First I draw the double line with big arrow tip, then I draw on top a second thinner and single line over the bottom line, at carefully adjusted distance, with the smaller arrow tip.

Tweaking with line widths and distances is tricky, since you have to adjust also the position of the second line. Also depending on the arrow tips, different values for shorten > and shorten < could be neccesary.

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{calc}
\def\drawDoubleThing#1#2{
\draw[double, double distance=.6mm, line width=.4mm, ->] (#1) -- (#2);
\draw[line width=.2mm, ->, shorten >=-1pt, shorten <=5pt] 
  ($(#2)!.5mm!90:(#1)$) -- ($(#1)!.5mm!-90:(#2)$);
}
\begin{document}
\begin{tikzpicture}[>=stealth]
  \coordinate (A) at (0,0);
  \coordinate (B) at (5,0);
  \coordinate (C) at (0,.5);
  \coordinate (D) at (5,2);
  \drawDoubleThing{A}{B}
  \drawDoubleThing{C}{D}
\end{tikzpicture}
\end{document}

You must log in to answer this question.