Skip to content

Packing a node only works when s=0 for first child #10

@cfr42

Description

@cfr42

Confirmation of bug by Sašo Živanović at https://tex.stackexchange.com/questions/382769/how-can-i-get-correct-spacing-when-reusing-forest-trees-and-when-calign-is-cente#comment947335_382769:

I can confirm this is a bug: packing a node only works when s=0 for the first child. I'll investigate when (and why) this bug was introduced. Until then, a less horrible hack: ;-) set s=0 for "Individual Contributor 1" in the preamble of the second tree, e.g. for group={name=m1,first}{s=0}. (As it doesn't hurt to set s of other nodes (before packing), one could also set s=0 for all nodes in the "combined" tree, like for name={m1}{for tree={s=0}}.

Minimal example from https://tex.stackexchange.com/q/382769/:

\documentclass[border=10pt,multi,tikz]{standalone}
\usepackage{forest}
\begin{document}
\forestset{
  default preamble={
    for tree={
      align=center,
      child anchor=parent,
      draw,
    },
  },
}

\Forest*{
  [Manager 1, name=m1
    [Individual\\Contributor 1]
    [Individual\\Contributor 2]
    [Individual\\Contributor 3]
    [Individual\\Contributor 4]
    [Individual\\Contributor 5]
    [Individual\\Contributor 6]
  ]
}


\Forest*{
    [, replace by=m1]
}

\end{document}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions