# Help with arrow formation in TikZ flowchart [duplicate]

I'm trying to create a simple flowchart (it's actually an archaeological diagram called a Harris Matrix) using TikZ. Below is the code for a small part of the finished diagram which illustrates the problem I'm having. In the current chart the line from the node labeled 7 goes downwards and then touches the node labeled 9 on the right side. What I would like to do is have the line still go downwards from node 7, go to the left, and then go downwards again to touch node 9 on the top. Thanks for any help, I'm quite new to TikZ.

What I have now:

\documentclass{article}

\usepackage{tikz}
\usetikzlibrary{shapes,arrows}

\begin{document}

\tikzstyle{block} = [rectangle, draw, text centered]
\tikzstyle{line} = [draw]

$\begin{tikzpicture} \node [block] (g) {7}; \node [block, below left of = g] (h) {9}; \node [block, below right of = g] (i) {12}; \path [line] (g) |- (h); \path [line] (g) |- (i); \end{tikzpicture}$

\end{document}

-

## marked as duplicate by Qrrbrbirlbel, Gonzalo Medina, Werner, Torbjørn T., T. VerronApr 23 '13 at 5:20

One possibility using the let syntax:

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{calc,shapes,arrows}

\begin{document}

\tikzset{
block/.style={rectangle, draw, text centered},
line/.style={draw}
}

$\begin{tikzpicture} \node [block] (g) {7}; \node [block, below left of = g] (h) {9}; \node [block, below right of = g] (i) {12}; \path[line] let \p1=(g.south), \p2=(h.north) in (g.south) -- +(0,0.5*\y2-0.5*\y1) -| (h.north); \path [line] let \p1=(g.south), \p2=(i.north) in (g.south) -- +(0,0.5*\y2-0.5*\y1) -| (i.north); \end{tikzpicture}$

\end{document}


One could also do some manual adjustment, but this could produce undesired results if the wrong shift is used:

\documentclass{article}

\usepackage{tikz}
\usetikzlibrary{calc,shapes,arrows}

\begin{document}

\tikzset{
block/.style={rectangle, draw, text centered},
line/.style={draw}
}

$\begin{tikzpicture} \node [block] (g) {7}; \node [block, below left of = g] (h) {9}; \node [block, below right of = g] (i) {12}; \path[line] (g.south) -- +(0,-3pt) -| (h.north); \path[line] (g.south) -- +(0,-3pt) -| (i.north); \end{tikzpicture}$

\end{document}

-