# Forest package and weird bracket behaviour

I am using forest package to write some algebra with planar trees. However, when I combine automatically sized brackets with my forest picture, the bracket size and position is completely wrong: it goes all the way below the forest. How do I get the adequately sized and positioned brackets?

\documentclass{article}
\usepackage[utf8]{inputenc}

\usepackage{forest}

\begin{document}
$$\left ( \begin{forest} for tree = {grow'=90,circle, fill, minimum width = 4pt, inner sep = 0pt, s sep = 13pt} [{},phantom [{},name = one [[]] [[][]] ] [{},name = two [[]] [[]] ] ] \draw[black] (one) -- (two); \end{forest}, \begin{forest} for tree = {grow'=90,circle, fill, minimum width = 4pt, inner sep = 0pt, s sep = 13pt} [{},phantom [{},name = one [[]] [[][]] ] [{},name = two [[]] [[]] ] [{},name = three [ [][]]] [{},name = four [ [] [] []] [[]] ] ] \draw[black] (one) -- (two) -- (three) -- (four); \end{forest} \right )$$

\end{document}


Do not use $$...$$ but use $...$ instead. You need to center the tree vertically, which can be done with \vcenter.

\documentclass{article}
\usepackage[utf8]{inputenc}

\usepackage{forest}

\begin{document}
$\left (\vcenter{\hbox{\begin{forest} for tree = {grow'=90,circle, fill, minimum width = 4pt, inner sep = 0pt, s sep = 13pt} [{},phantom [{},name = one [[]] [[][]] ] [{},name = two [[]] [[]] ] ] \draw[black] (one) -- (two); \end{forest}, \begin{forest} for tree = {grow'=90,circle, fill, minimum width = 4pt, inner sep = 0pt, s sep = 13pt} [{},phantom [{},name = one [[]] [[][]] ] [{},name = two [[]] [[]] ] [{},name = three [ [][]]] [{},name = four [ [] [] []] [[]] ] ] \draw[black] (one) -- (two) -- (three) -- (four); \end{forest}}} \right )$

\end{document}


• Yes, now this looks fine! Thank you very much. – Dasha Poliakova Nov 12 '20 at 19:09