# how to join lines in a diagram using tikz?

\documentclass{article}
\usepackage{tikz}

\tikzset{
box/.style={draw,fill=white,rectangle,minimum size=2.5cm,align=center},
diatostealth/.style={draw,{Diamond}-{Stealth}}
}

\begin{document}
\begin{tikzpicture}

\node[box](a){a};
\node[box, below left=1.5cm of a](b){b};
\node[box, below right=1.5cm of a](c){c};

% the arrows
\path[diatostealth] (a.south) -- (b.north){};
\path[diatostealth] (a.south) -- (c.north){};

\end{tikzpicture}
\end{document}


This is what I have currently.

This is what I am trying to achieve.

• While code snippets are useful in explanations, it is always best to compose a fully compilable MWE that illustrates the problem including the \documentclass and the appropriate packages so that those trying to help don't have to recreate it. – Peter Grill Dec 4 '14 at 22:08

You can use intermediate coordinates. So the line on the left can be achieved by:

\path[diatostealth, thick]
(a.south)
-- ++(0,-0.5cm)
-| (b.north)
;


means:

• start at (a.south).
• the ++ means the coordinate which is -0.5cm below the last point,
• the -| means to draw a horizontal and then ventical line to the point (b.north).

## Code:

\documentclass{article}
\usepackage{tikz}

\tikzset{
box/.style={draw,fill=white,rectangle,minimum size=2.5cm,align=center},
diatostealth/.style={draw,{Diamond}-{Stealth}}
}

\begin{document}
\begin{tikzpicture}

\node[box](a){a};
\node[box, below left=1.5cm of a](b){b};
\node[box, below right=1.5cm of a](c){c};

% the arrows
\path[diatostealth, thick]
(a.south)
-- ++(0,-0.5cm)
-| (b.north)
;
\path[diatostealth, thick]
(a.south)
-- ++(0,-0.5cm)
-| (c.north){};

\end{tikzpicture}
\end{document}


If it looks like a tree, it should be a forest...

\documentclass[tikz,border=12pt,mult,varwidth]{standalone}
\usepackage{forest,amssymb}

\begin{document}

\tikzset{
}

\begin{forest}
for tree={
draw,
parent anchor=south,
child anchor=north,
fill=white,
minimum width=20pt,
text height=7.5pt,
font=\sffamily,
edge path={
\noexpand\path [-{Stealth[]}, \forestoption{edge}] (!u.parent anchor) node [inner sep=0pt, anchor=north, outer sep=0pt, scale=.5] {$\blacklozenge$} -- +(0,-5pt) -| (.child anchor)\forestoption{edge label};
},
}
[a
[b]
[c]
]
\end{forest}


• If it looks like a tree, it should be in a forest! – user11232 Dec 5 '14 at 10:10
• @HarishKumar Yes... ;) But ironically, it is exceedingly difficult to include two or more trees in a forest of this kind :(. – cfr Dec 5 '14 at 15:53