# Simple tree

> A root with two children and four leaves, using TikZ's child syntax with default styling. A Trees example with its LaTeX source.

A Trees example in the TeXeR TikZ library: https://texer.org/library/trees/simple-tree

Package: [Trees](https://texer.org/library/trees.md), on CTAN at https://ctan.org/pkg/pgf.

Tags: tree, hierarchy

## Source

```latex
\begin{tikzpicture}[
  level distance=12mm,
  level 1/.style={sibling distance=30mm},
  level 2/.style={sibling distance=15mm},
]
  \node {Root}
  child { node {A}
    child { node {A1} }
    child { node {A2} }
  }
  child { node {B}
    child { node {B1} }
    child { node {B2} }
  };
\end{tikzpicture}
```

## As a complete document

The same example in a document that compiles on its own with pdfLaTeX:

```latex
\documentclass[margin=3mm]{standalone}
\usepackage{tikz}
\usepackage{xcolor}
\usepackage{amsmath}
\usepackage{amssymb}

\begin{document}
\begin{tikzpicture}[
  level distance=12mm,
  level 1/.style={sibling distance=30mm},
  level 2/.style={sibling distance=15mm},
]
  \node {Root}
  child { node {A}
    child { node {A1} }
    child { node {A2} }
  }
  child { node {B}
    child { node {B1} }
    child { node {B2} }
  };
\end{tikzpicture}
\end{document}
```
