tikz.dev / forest Manual

Forest

Past, present and future

6.2 Known bugs

If you find a bug (there are bound to be some …), please contact me at saso.zivanovic@guest.arnes.si.

6.2.1 System requirements

This package requires and e. If you use something else: sorry.

The requirement for might be dropped in the future, when I get some time and energy for a code-cleanup (read: to remedy the consequences of my bad programming practices and general disorganization).

The requirement for e will probably stay. If nothing else, Forest is heavy on boxes: every node requires its own … and consequently, I have freely used e constructs in the code …

6.2.2 PGF internals

Forest relies on some details of PGF implementation, like the name of the “not yet positioned” nodes. Thus, a new bug might appear with the development of PGF. If you notice one, please let me know.

6.2.3 Edges cutting through sibling nodes

In the following example, the R–B edge crosses the AAA node, although ignore edge is set to the default false.

(107)

Compiled output

\begin{forest}
calign=first
[R[AAAAAAAAAA\\AAAAAAAAAA\\AAAAAAAAAA,align=center,base=bottom][B]]
\end{forest}

This happens because s-distances between the adjacent children are computed before child alignment (which is obviously the correct order in the general case), but child alignment non-linearly influences the edges. Observe that the with a different value of calign, the problem does not arise.

(108)

Compiled output

\begin{forest}
calign=last
[R[AAAAAAAAAA\\AAAAAAAAAA\\AAAAAAAAAA,align=center,base=bottom][B]]
\end{forest}

While it would be possible to fix the situation after child alignment (at least for some child alignment methods), I have decided against that, since the distances between siblings would soon become too large. If the AAA node in the example above was large enough, B could easily be pushed off the paper. The bottomline is, please use manual adjustment to fix such situations.

6.2.4 Orphans

If the l coordinates of adjacent children are too different (as a result of manual adjustment or tier alignment), the packing algorithm might have nothing so say about the desired distance between them: in this sense, node C below is an “orphan.”

(109)

Compiled output

\begin{forest}
for tree={s sep=0,draw},
[R[A][B][C,l*=2][D][E]]
\end{forest}

To prevent orphans from ending up just anywhere, I have decided to vertically align them with their preceding sibling — although I’m not certain that’s really the best solution. In other words, you can rely that the sequence of s-coordinates of siblings is non-decreasing.

The decision also influences a similar situation illustrated below. The packing algorithm puts node E immediately next to B (i.e. under C): however, the monotonicity-retaining mechanism then vertically aligns it with its preceding sibling, D.

(110)

Compiled output

\begin{forest}
for tree={s sep=0,draw},
[R[A[B,tier=bottom]][C][D][E,tier=bottom]]
\end{forest}

Obviously, both examples also create the situation of an edge crossing some sibling node(s). Again, I don’t think anything sensible can be done about this, in general.