I made a wide tree with Forest and I want use resizebox
to scale it down to match the text length. I noticed that the space on the left of the tree is oddly bigger, specially if compared to the space on the right. How I can fix it?
\documentclass{article}
\usepackage{graphicx}
\usepackage{forest}
\begin{document}
Some text
\begin{center}
\resizebox{\textwidth}{!}{
\fbox{
\begin{forest}
for tree = {l sep = 20 mm}
[Root
[A long label for a inner node
[A long label for a leaf]
[A long label for a leaf]
]
[A long label for a inner node
[A long label for a leaf]
[A long label for a leaf]
]
[A long label for a inner node
[A long label for a leaf]
[A long label for a leaf]
]
[A long label for a inner node
[A long label for a leaf]
[A long label for a leaf]
]
]
\end{forest}
}
}
\end{center}
other text.
\end{document}
\resizebox{\textwidth}{!}{SPACE \fbox{SPACE
but as far as I can see you are adding two at each end so that doesn't really account for the asymmetryforest
got updated, and used a pgf function that had spurious spaces in. Later the bug in the pgf function got fixed. So I think that if you have versions only before theforest
update or after the pgf update, you won't see these spaces. The simplest way to test this could be that Fabio tries out the patch under the link and checks whether the spaces go away.