Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
cfr42 opened this issue Dec 14, 2023 · 0 comments
Open

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

cfr42 opened this issue Dec 14, 2023 · 0 comments

Comments

@cfr42
Copy link

cfr42 commented Dec 14, 2023

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}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant