Graphics, Figures & TablesDouble arrow in tikZ

Information and discussion about graphics, figures & tables in LaTeX documents.
yotama9
Posts: 61
Joined: Thu Sep 24, 2009 2:59 pm

Double arrow in tikZ

Post by yotama9 »

Hi guys.

I trying to create a diagram that describe the system I'm using.

I want the diagram to have double arrows but the only way I found was using the double command which create ugly arrowheads. Also, I couldn't find the way to apply using the \draw command.

I found a 2 years old thread in the forum which suggest using the implies style but this doesn't seems to work (maybe an updted version) .

any thought?

Yotam

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

User avatar
gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

Double arrow in tikZ

Post by gmedina »

Hi,

the shapes.arrows library offers you the double arrow shape that could be useful for you. Please, refer to the pgfmanual, section 39.5 Arrow Shapes.
1,1,2,3,5,8,13,21,34,55,89,144,233,...
yotama9
Posts: 61
Joined: Thu Sep 24, 2009 2:59 pm

Double arrow in tikZ

Post by yotama9 »

those are shapes of arrow. I need to use the arrows to connect between nodes. There is no writing on how to use the arrows to connect two dots in a certain distance.

Here is what I want:

Code: Select all

Code, edit and compile here:
\documentclass{article} % say
\usepackage{tikz}
\usetikzlibrary{arrows,decorations.pathmorphing,backgrounds,positioning,fit,matrix}
\begin{document}
\node (A) [rectangle] at(0,0){I am A};
\node (B) [rectangle] at(0,2){I am B};
\draw[->] (A.north) -- (B.south);
\begin{tikzpicture}
\end{tikzpicture}
\end{document}
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Yotam
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Double arrow in tikZ

Post by localghost »

yotama9 wrote:[...] I want the diagram to have double arrows but the only way I found was using the double command which create ugly arrowheads. Also, I couldn't find the way to apply using the \draw command. [...]
Why don't you just show the code of this diagram?
yotama9 wrote:[...] I found a 2 years old thread in the forum which suggest using the implies style but this doesn't seems to work (maybe an updted version). [...]
Why don't you just give the link to that thread?
yotama9 wrote:[...] I need to use the arrows to connect between nodes. There is no writing on how to use the arrows to connect two dots in a certain distance. [...]
This is very confusing. Of course the manual shows you how to use arrows.

Code: Select all

Code, edit and compile here:
\documentclass{minimal}
\usepackage{tikz}
\usetikzlibrary{arrows}
\begin{document}
\begin{tikzpicture}[>=stealth]
\node[draw,rectangle] (A) at (0,0) {I am A};
\node[draw,rectangle] (B) at (0,2) {I am B};
\draw[double,->] (A.north) -- (B.south);
\end{tikzpicture}
\end{document}
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
The tikzpicture environment accepts a list of optional arguments. Take a look at the tutorial in the package manual.

Perhaps you should explain clearly which part of the arrow shall be doubled. In the above code there is a proper double line for the arrow, but a single arrow tip.


Best regards
Thorsten
yotama9
Posts: 61
Joined: Thu Sep 24, 2009 2:59 pm

Double arrow in tikZ

Post by yotama9 »

This is my diagram.

Code: Select all

Code, edit and compile here:
\documentclass{article} % say
\usepackage{tikz}
\usetikzlibrary{arrows,decorations.pathmorphing,backgrounds,positioning,fit,matrix}
\begin{document}
\begin{tikzpicture}[
unit/.style={rectangle,fill=black!3,draw,thick,minimum size = 1cm, text width = 2.5cm, text badly ragged},
point/.style={circle,fill=black, minimum size = 1}
]
\node (mil) at (0,0) [unit] {Milenia X};
\node (tsun) at (0,-5) [unit] {Ti:Sapphire 1ps 680-1080 nm 82 MHz};
\node (split) at (0,-7.5) [point] [label=above right:beam splitter] {};
\node (pp) at (0,-10) [unit] {Pulse Picker};
\node (double) at (0,-15) [unit] {Second Harmonic Generator};
\node (sample) at (10,-15) [unit] {Sample};
\node (mono) at (10,-12.86) [unit] {double mono - chromator};
\node (multi) at (10,-10.72) [unit] {Multi Channel Plate};
\node (amp) at (10,-8.58) [unit] {Amplifier 1 - 2 GHz};
\node (CFD1) at (10,-6.44) [unit] {Constant Fraction Discriminator};
\node (tac) at (10,-4.3) [unit] {TAC};
\node (CFD2) at (5,-4.3) [unit] {Constant Fraction Discriminator};
\node (diode) at (5,-7.5) [unit] {Fast Photodiode 300ps};
\node (MCA) at (10,-2.14) [unit] {Multi Channel Analyser};
\node (pc) at (10,0) [unit] {Computer};
\node (image) at (4,-1) [unit, minimum size = 4cm, fill = blue!50] {Image};
\node (fix1) [right=of image] {};
\node (fix2) [above=of fix1, left=of pc]{};
\draw [->] (mil.south) -- (tsun.north);
\draw (tsun.south) -- (split.center);
\draw [->](split.south) -- (pp.north);
\draw [->](pp.south) -- (double.north);
\draw [->] (double.east) -- (sample.west);
\draw [->] (sample.north) -- (mono.south);
\draw [->] (mono.north) -- (multi.south);
\draw [->] (multi.north) -- (amp.south);
\draw [->] (amp.north) -- (CFD1.south);
\draw [->] (CFD1.north) -- (tac.south);
\draw [->] (tac.north) -- (MCA.south);
\draw [->] (MCA.north) -- (pc.south);
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
now, if I turn

Code: Select all

\draw [->] (mil.south) -- (tsun.north);
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Into:

Code: Select all

\draw [->,double] (mil.south) -- (tsun.north);
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
I get a line that is looking a little bit thicker and the arrow tip is looking bad. If I zoom in enough I can see that the line infact doubled. I tried to add something like "space = 1mm" without any effect (I don't remember the correct syntax but I used the right one).
This is the thread I have found:
http://www.latex-community.org/forum/vi ... ikz#p20038

Yotam
User avatar
frabjous
Posts: 2064
Joined: Fri Mar 06, 2009 12:20 am

Re: Double arrow in tikZ

Post by frabjous »

How exactly do you want it to look? You could try, e.g.:

\draw [very thick,double,double distance=3pt,->,>=stealth,shorten >=2pt] (mil.south) -- (tsun.north);

That'll draw a thick double line with a width of 3pt between the two lines, with a stealth arrow tip pointing at (tsun.north) which stops 2 points before the node.

But you can customize this to pretty much anything you want. Section 14.3 of the TikZ/PGF manual is very helpful here.
yotama9
Posts: 61
Joined: Thu Sep 24, 2009 2:59 pm

Re: Double arrow in tikZ

Post by yotama9 »

How did you find the documentation for the command?
I searched for the double arrow or the double line command and I only found examples were I use only one double.

Yotam
User avatar
frabjous
Posts: 2064
Joined: Fri Mar 06, 2009 12:20 am

Re: Double arrow in tikZ

Post by frabjous »

I don't really remember, but probably I saw "Double Lines and Bordered Lines" in the Table of Contents and looked at the appropriate section (14.3 as mentioned). I've read most of the PGF/manual in the past straight through, which may have helped too.

In any case, is it helpful to you at all?
yago
Posts: 29
Joined: Sat Dec 13, 2008 6:40 pm

Re: Double arrow in tikZ

Post by yago »

In the document pgfmanual.pdf you need to read carefully the nexts sections and tips:

14.3.4 Graphic Parameters: Arrow Tips (pag. 134)
14.3.5 Graphic Parameters: Double Lines and Bordered Lines (pag. 136)
22 Arrow Tips Library (pag.224)
39.5 Arrow Shapes (pag. 334)
58 Arrow Tips (pag. 466)
yotama9
Posts: 61
Joined: Thu Sep 24, 2009 2:59 pm

Re: Double arrow in tikZ

Post by yotama9 »

I will.

It will take me some time but I'll do it.

Thanks.
Post Reply