Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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.

share|improve this question
add comment

1 Answer 1

up vote 7 down vote accepted

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}
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.