I'm searching for a way to have orthogonal edges (only going horizontal and vertical) by default when I draw a tree. I can't seem to find a way to set this as the default style (without having to add edges with path each time).
\documentclass{article}
\usepackage{tikz}
%%% <
\usepackage{verbatim}
\usepackage[active,tightpage]{preview}
\PreviewEnvironment{tikzpicture}
\setlength\PreviewBorder{10pt}%
%%% >
\usetikzlibrary{arrows,shapes,positioning,shadows,trees}
\begin{document}
\begin{tikzpicture}
\tikzstyle{every node}=[draw, rectangle, fill=gray!20]
\node {root}
child {node {left}}
child {node {right}
child {node {child}}
child {node {child}}
};
\end{tikzpicture}
\end{document}
I have included an example of the edges I'm searching for. There is not need for labels on the edges.
edge from parent fork down
? – Claudio Fiandrino Mar 6 '13 at 14:17(node A) -| (node B)
for drawing from node A to node B first horizontal, then vertical, or|-
for the opposite? – Lionel MANSUY Mar 6 '13 at 14:20