The forest manual defines two styles: sn edges and nice empty nodes. They are defined as:
sn edges/.style={for tree={parent anchor=south, child anchor=north}}
and
nice empty nodes/.style={for tree={calign=fixed edge angles},delay={where content={}{shape=coordinate,for parent={for children={anchor=north}}}{}} }
respectively.
When both of these styles are used with the following tree, I get the following error:
! Package PGF Math Error: You asked me to calculate `1/0.0', but I cannot divid
e any number by zero.
See the PGF Math package documentation for explanation.
Type H <return> for immediate help.
...
l.51 \end{forest}
Does anybody know what is going on? How can I fix this?
MWE
\documentclass{article}
\usepackage{forest}
\forestset{
sn edges/.style={for tree={parent anchor=south, child anchor=north}},
nice empty nodes/.style={for tree={calign=fixed edge angles},delay={where content={}{shape=coordinate,for parent={for children={anchor=north}}}{}}}
}
\begin{document}
\begin{forest} nice empty nodes, sn edges
[TP
[{the ball} ]
[
[T ]
[PrP
[{$<$the ball$>$} ]
[
[Pr ]
[VoiP
[{$<$the ball$>$} ]
[
[Voi ]
[AffP
[{to Mary} ]
[
[Aff ]
[ThP
[{$<$the ball$>$} ]
[
[Th ]
[AgP
[{by John} ]
[
[Ag ]
[$\surd$throw ]
]
]
]
]
]
]
]
]
]
]
]
]
\end{forest}
\end{document}
Update
Interestingly, it compiles without error if everything below the Aff leaf is deleted. That is, the following will compile:
\begin{forest} nice empty nodes, sn edges
[TP
[{the ball} ]
[
[T ]
[PrP
[{$<$the ball$>$} ]
[
[Pr ]
[VoiP
[{$<$the ball$>$} ]
[
[Voi ]
[AffP
[{to Mary} ]
[
[Aff ]
]
]
]
]
]
]
]
]
\end{forest}
delay? – percusse Oct 01 '14 at 17:53shape=coordinatetoshape=node? Then it throws an errorUnknown shape \`node.''If you change it toshape=rectangle`, though, it does fix the problem. That is, it will at least compile without an error, but then the tree doesn't look as I want it to look. The empty nodes show white space, rather than being connected to the next branches directly. – Adam Liter Oct 01 '14 at 17:59anchor=northto center at the end. That should do it. If it works then you don't need that style anyway. Coordinates only havecenteranchors. – percusse Oct 01 '14 at 18:00rectanglewith inner and outer sep set to 0pt, then it is almost right... – cfr Oct 16 '14 at 01:05outer ysepvalue until it no longer threw the error. For example, for this MWE it would be-0.550pt. If you zoom in a lot, you can see that the lines aren't quite parallel, but when I print it I can't see the gap. The value has to be tweaked differently depending on the font, font size, andcalign angle(e.g.,-0.455ptis best for Linux Libertine O at 12pt withcalign angle=60). – Jason Zentz Apr 17 '15 at 19:51