1

I have a problem creating a flowchart with tikzpicture. I want it to look like this:

enter image description here

this is how far I got it – using some example that I found:

\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}

The Problem is the overlapping boxes and that it looks too symmetrical and therefore becomes to broad. Also it would be very good, if the size of the boxes would adjust automatically to the amount of text that is in it. I hope that the code is not to bad...

1

After short playing with sibling distance and changed width of two nodes, I obtain the following tree:

enter image description here

This image can be further improved. The code for above graph is:

\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}
  • Thank you very much. The \usetikzlibrary{trees} was doing the trick apparently? It just needs some refinement but this looks already very good! – PeterStrawson Mar 24 '16 at 18:30
  • Library trees is needed only for [edge from parent fork down]. All other additions (marked as new) are available without it. – Zarko Mar 24 '16 at 19:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.