Building a tree
A very common type of hierarchical graph is a tree. Tree nodes have children. These are connected by edges and are usually displayed in rows when growing down, or in columns when growing horizontally.
We will draw a tree presenting possible math formula layouts.
How to do it...
We will use basic TikZ, without any extra package. Follow these steps:
Start with a document class:
\documentclass{article}
Load the
tikz
package:\usepackage{tikz}
Start the document:
\begin{document}
Begin with a TikZ picture, and specify some options for it:
\begin{tikzpicture}[sibling distance=10em, every node/.style = {shape=rectangle, rounded corners, draw, align=center, top color=white, bottom color=blue!20}]]
Draw a node and add children to it:
\node {Formulas} child { node {single-line} } child { node {multi-line} child { node {aligned at} child { node {relation sign} } child { node {several places} } child { node {center} } } child { node {first...