Possible Duplicate:
Drawing a directory listing a la the tree command in TikZ
Is there a way to configure the trees drawn by TikZ to have child nodes at the same level listed below each other? Basically, I want something similar to the output of the tree command in a Command Prompt.
\documentclass{article}
\usepackage{tikz}
\begin{document}
\section*{TikZ tree}
\begin{tikzpicture}
\node {toplevel}
child { node {Foo}
child { node {foo} }
child { node {bar} }
child { node {baz} }
}
child { node {Bar}
child { node {foo} }
child { node {bar} }
child { node {baz} }
}
child { node {Baz}
child { node {foo} }
child { node {bar} }
child { node {baz} }
};
\end{tikzpicture}
\section*{Desired tree structure}
\begin{verbatim}
toplevel
|-- Foo
| |-- foo
| |-- bar
| `-- baz
|-- Bar
| |-- foo
| |-- bar
| `-- baz
`-- Baz
|-- foo
|-- bar
`-- baz
\end{verbatim}
\end{document}
dirtreepackage which is designed for these sorts of trees. In which case Making a (simple) directory tree is a duplicate. – Alan Munn Nov 09 '11 at 12:20sibling distanceorlevel distanceas a function of\tikznumberofchildrenand\tikznumberofcurrentchild. – Martin Heller Nov 09 '11 at 15:35