tikz.dev / forest Manual

Forest

Reference

3.15 Relative node names

  • ⟨relative node name⟩=[⟨forest node name⟩][

  • !⟨nodewalk⟩]

    ⟨relative node name⟩ refers to the Forest node at the end of the ⟨nodewalk⟩ starting at node named ⟨forest node name⟩. If ⟨forest node name⟩ is omitted, the walk starts at the current node. If ⟨nodewalk⟩ is omitted, the “walk” ends at the start node. (Thus, an empty ⟨relative node name⟩ refers to the current node.)

    The ⟨nodewalk⟩ inherits its history from the outer nodewalk (if there is one). Its every-step keylist is empty.

Relative node names can be used in the following contexts:

  • Forest’s pgfmath option functions (§3.18) take a relative node name as their argument, e.g. content("!u") and content("!parent") refer to the content of the parent node.

  • An option of a non-current node can be set by ⟨relative node name⟩.⟨option name⟩=⟨value⟩, see §3.6.1.

  • The forest coordinate system, both explicit and implicit; see §3.16.