A simple tree with a style for all nodes.
A tree is a very common type of hierarchical graph. Tree nodes have children. These are connected by edges and are usually displayed in rows when growing down or in columns when growing horizontally.
Full explanation in Chapter 9, Creating Graphics: Growing a tree
Edit and compile if you like:
% A simple Tree % Author: Stefan Kottwitz % https://www.packtpub.com/hardware-and-creative/latex-cookbook \documentclass[border=10pt]{standalone} \usepackage{tikz} \begin{document} \begin{tikzpicture}[sibling distance=10em, every node/.style = {shape=rectangle, rounded corners, draw, align=center, top color=white, bottom color=blue!20}]] \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 left,\\centered,\\last right} } }; \end{tikzpicture} \end{document}
Click to download: tree.tex • tree.pdfOpen in Overleaf: tree.tex
See also: Original Source by Stefan Kottwitz
Note: The copyright belongs to the blog author and the blog. For the license, please see the linked original source blog.
Leave a Reply
You must be logged in to post a comment.