I'm completely new to tikz
and try to draw a tree structure.
I have tried different options, but could not modify it as I wanted it to look like.
It currently looks like that:
Tikz code
\documentclass{article}
\usepackage{tikz}
\usepackage{tikz-qtree}
\usetikzlibrary{trees} % this is to allow the fork right path
\usepackage[utf8]{inputenc}
\begin{document}
\begin{tikzpicture}[grow'=right,sibling distance=0.1cm]
\tikzstyle{level 1} = [level distance=3cm, text width = 2cm]
\tikzstyle{level 2} = [level distance=3cm, text width = 2cm]
\tikzstyle{level 3} = [level distance=3cm, text width = 2cm]
\Tree
[
[.{Pressen}
[.{uniaxiales Pressen} ]
[.{isostatisches Pressen} ]
[.{Vibrationspressen} ]
[.{Stampfen} ]
]
[.{Plastisches Formen}
[.{Extrudieren} ]
[.{Drehen} ]
]
[.Gießen
[.{Schlickergießen} ]
[.{Druckgießen} ]
[.{Spritzgießen} ]
[.{Foliengießen} ]
]
]
\end{tikzpicture}
\end{document}
The resulting pdf output:
(red line drawn by hand, see below)
I'd like to achieve the following
- linebreak in node "Plastisches Formen"
- edges not straight but horizontal/vertical – like sketched in red for one edge
- text of each level aligned left
- is it possible to adjust the level distances automatically to the width of the largest node in the level, so that I do not have to set "level distance" by hand?
Best Answer
If
forest
is an option:2nd version:
I'm not sure to understand what all nodes "raggedright" means, but may be option
align=right
does it.The other comment about aligning all same level nodes can be done with
tier/.pgfmath=level()
option.