I've written myself a custom style for forest, to get trees looking the way I'd like them to. The idea of the style is to keep the branches at a fixed angle, and automatically handle empty nodes "correctly" -- that is, to align lines symmetrically for empty head nodes and continue with unbroken lines for empty non-head nodes. The trouble is that the style I've written gives me the desired output, but also sometimes (unpredictably to me) gives me errors that are beyond my ability to troubleshoot.
The desired output looks more or less like this (although the branch for c is a tad short):

The style looks like this (with some code annotation to make things clearer):
default/.style={baseline, % align tree properly to example numbering
for tree={ %give every node in the tree these properties
parent anchor=south, child anchor=north, % make lines go from bottom of parent to top of child properly
calign=fixed edge angles,calign angle=60, % make all lines have the same angle
delay={ % do this stuff after processing how many nodes you have:
where content={} % for all nodes with empty content...
{if n children={0} % if they are heads...
{content=\strut} % ...insert a strut;
{shape=coordinate, % if they are not heads, make them points...
for parent={for children={l*=0.8}} % <<If commented out, errors ensue!
%for parent={for children={align=north,l*=0.8}} % <<If commented in, errors ensue!
}
}
{ % for all nodes with non-empty content:
if n children={0} % if they are heads...
{ align=center } % allow line breaking; note that trying to allow line breaking for all nodes adds some weird extra space below the node text, and when TiKZ tries to put this extra space into the point nodes stuff explodes
{} % otherwise do nothing
}
},
},
}
The style as it is compiles without error. However, if I comment out the line that starts with for parent, or add in something like align=north (as in the commented-out line above), I get errors -- but only for larger trees.
For instance, the following small tree compiles just fine regardless of what I do:
\begin{forest}
default
[a
[b]
[ [c] [d]
]
]
\end{forest}
But the following slightly larger tree gives me a dimension too large error if I omit the for parent line, and a dividing-by-zero error if I add in align=north.
\begin{forest}
default
[a
[b]
[ [c]
[ [d] [e]
]
]
]
\end{forest}
What exactly is resulting in these errors? I'm uncomfortable with the fact that I can't predict what will break, and I feel like maybe if my style is so fragile I'm doing something wrong. Any ideas? (Am I being clear?)




align=north. At least, that's what I get. – cfr Dec 04 '15 at 13:56forest. – rcraioveanu Dec 04 '15 at 14:59