![Crie fluxograma com caixas de tamanhos diferentes](https://rvso.com/image/330733/Crie%20fluxograma%20com%20caixas%20de%20tamanhos%20diferentes.png)
Estou com um problema ao criar um fluxograma com o tikzpicture. Eu quero que fique assim:
foi assim que cheguei - usando alguns exemplos que encontrei:
\documentclass[border=10pt]{standalone}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[ngerman]{babel}
\usepackage{verbatim}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}[sibling distance=25em,
every node/.style = {shape=rectangle, rounded corners,
draw, align=center,
top color=white, bottom color=white}]]
\node {Absicht}
child {node {absichtliche Handlung}
child {node {Wie viele Handlungen? \\ Wissen ohne Beobachtung}}
child {node {Warum-Frage}
child {node {Zurückweisung}
child {node {»Ich wusste nicht...«}}
child {node {»Ich tat es\\ unwillkürlich«}}}
child {node{Beantwortung}
child {node {»Einfach so!«}}
child {node {Motive \\(sind keine mentalen Ursachen.)}
child {node {Motive im Allgemeinen}}
child {node {rückwärtsschauende Motive}}
child {node {vorwärtsschauende Motive}}}}}}
child {node{Ausdruck der Absicht}};
\end{tikzpicture}
\end{document}
O problema são as caixas sobrepostas e parece muito simétrico e, portanto, torna-se muito amplo. Também seria muito bom se o tamanho das caixas se ajustasse automaticamente à quantidade de texto que contém. Espero que o código não seja tão ruim ...
Responder1
Depois de brincar um pouco com a distância entre irmãos e alterar a largura de dois nós, obtenho a seguinte árvore:
Esta imagem pode ser melhorada ainda mais. O código do gráfico acima é:
\documentclass[border=10pt,
tikz]{standalone}
\usetikzlibrary{trees}% <-- new
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\begin{document}
\begin{tikzpicture}[
every node/.style = {shape=rectangle, rounded corners,
draw, align=center, fill=white},
level 1/.style = {sibling distance = 12em},% <-- new
level 2/.style = {sibling distance = 12em},% <-- new
level 3/.style = {sibling distance = 20em},% <-- new
level 4/.style = {sibling distance = 11em},% <-- new
]
\node {Absicht}
[edge from parent fork down]
child {node {absichtliche Handlung}
child {node {Wie viele Handlungen? \\ Wissen ohne Beobachtung}}
child {node {Warum-Frage}
child {node {Zurückweisung}
child {node {»Ich wusste nicht...«}}
child {node {»Ich tat es\\ unwillkürlich«}}}
child {node{Beantwortung}
child {node {»Einfach so!«}}
child {node {Motive \\(sind keine mentalen Ursachen.)}
child {node {Motive im Allgemeinen}}
child {node {rückwärtsschauende\\ Motive}}% <-- changed
child {node {vorwärtsschauende\\ Motive}} % <-- changed
}}}}
child {node{Ausdruck der Absicht}};
\end{tikzpicture}
\end{document}