I'm fairly new to tikz and TeX but I don't have a problem writing the code for the tree. I just would like to have a human readable tree. Here's a minimal expample of the tree without edge labels or options:
\begin{tikzpicture}
\tikzstyle{every node}=[draw,shape=circle,fill=black,inner sep=0pt,minimum size=2mm]
\tikzstyle{level 1}=[sibling distance =35mm,level distance=20mm]
\tikzstyle{level 2}=[sibling distance = 18mm,level distance=15mm]
\tikzstyle{level 3}=[sibling distance = 12mm,level distance=10mm]
\tikzstyle{level 4}=[sibling distance = 7mm]
\node {}
[grow=right]
child { node {}
child { node {} }
child { node {}
child { node {} }
child { node {}
child { node {} }
child { node {} } } } }
child { node {}
child { node {} }
child { node {} } };
\end{tikzpicture}
This is the same tree, just with additional options and edge labels:
\begin{tikzpicture}
\tikzstyle{every node}=[draw,shape=circle,fill=black,inner sep=0pt,minimum size=2mm]
\tikzstyle{level 1}=[sibling distance =28mm,level distance=15mm]
\tikzstyle{level 2}=[sibling distance = 18mm,level distance=15mm]
\tikzstyle{level 3}=[sibling distance = 12mm,level distance=15mm]
\tikzstyle{level 4}=[sibling distance = 7mm,level distance=15mm]
\node {}
[grow=right]
child { node {}
child { node {}
child[level distance=30mm] { node {} edge from parent node [below=1mm,fill=none,draw=none] { $1-w_i$ } }
child { node {}
child { node {} edge from parent node [below=0.02mm,fill=none,draw=none] { $1-g_i$ } }
child { node {} edge from parent node [above=1mm,fill=none,draw=none] { $g_i$ } }
edge from parent node [above=1mm,fill=none,draw=none] { $w_i$ } }
edge from parent node [below=1mm,fill=none,draw=none] { $1-a$ } }
child[level distance=45mm] { node {} edge from parent node [above=1mm,fill=none,draw=none] { $a$ } }
edge from parent node [below=1mm,fill=none,draw=none] { $1-c$ } }
child { node {}
child[level distance=45mm] { node {} edge from parent node [below=1mm,fill=none,draw=none] { $1-a$ } }
child[level distance=45mm] { node {} edge from parent node [above=1mm,fill=none,draw=none] { $a$ } }
edge from parent node [above=1mm,fill=none,draw=none] { $c$ } };
\end{tikzpicture}
It seems to me that the tree has now become barely readable. Especially, due to the syntax of tikz which requires me to insert the edge label at the end of a child node. It is very likely that I will hand this tree to someone else for further use and adaptation but I fear that the tree will be useless in this state. Finding an error or changing something seems very, very dangerous and error prone. In fact, after making an error it was usually easier for me to start a new tree than debug the existing one. However, I can't do that with a much larger tree.
So, here's my question: Could you suggest using macros, style definitions or anything else to simplify this tree and make it readable again?
One note: Since I'm under pressure I can't use a different package because I would like to finish this project within this week. So, learning new syntax is not efficient right now. However, please feel free to include recommendations for other users who might stumble upon this post.
Edit: If someone knows a way to write the syntax so that it becomes less obfuscated, I'd also be happy.
forestpackage seems to be the way to go (built on top of TikZ specifically for such purposes). If you feel adventurous download the CVS version of TikZ and use thegraphdrawinglibrary – percusse Nov 27 '13 at 12:08tikz-qtreeis not a good option here, however I attempted at an answer which does not use forest but is flexible enough for this example. – Bordaigorl Nov 28 '13 at 17:22