0

I want to create tree where a node itself can have multiple trees.It should look something like this:

Goal Tree

What I have tried so far:

\begin{center}
\begin{forest}
label tree,
[A
  [{B
   [C][D]}
   {E
   [F][G]},
   align=center
  ]
]
\end{forest}
\end{center}

First Try

\begin{center}
\begin{forest}
label tree,
[A
  [B
   [C][D]
   E
   [F][G],
   align=center
  ]
]
\end{forest}
\end{center}

Second Try

My Question is the goal tree even possible with the forest package since it is strictly speaking not a tree, or does anybody know how to create such a tree with another package like tikz-tree?

3

1 Answer 1

2

enter image description here

Between nodes F and G is inserted empty nde with options coordinate and no edge which child is node B with childs C and D:

\documentclass[margin=3mm]{standalone}
\usepackage{forest}

\begin{document}
    \begin{forest}
for tree = {inner sep=2pt,
            s sep=3mm,
            l sep=2mm
            }
[A
    [E
        [F]
        [,coordinate, no edge
            [B
                [C]
                [D]
            ]
        ]
        [G]
    ]
]
    \end{forest}
\end{document}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .