2

I currently have the following:

\begin{forest}
for tree={
draw,
minimum height=2cm,
anchor=north,
align=center,
child anchor=north
},
[{Size 5}, align=center, name=SS
[{Size 1 \\ Size 2\\ Size 3}]
[{Size 6 \\ Size 9 \\ Size 10}] 
]
\end{forest}

\tikz \node[draw,circle, text width=3cm,align=center]{Un-tested shoes: \\ Size 4 \\ Size    5 \\ Size 7 \\ Size 8};

This results in a tree, under which there is a circular node. However, I would like to place the node to the right of the tree.

Any idea as to how I may do this?

Thank you.

1

Don't leave a blank line (this tantamounts to starting a new paragraph for the tikzpicture):

\documentclass{article}
\usepackage{forest}

\begin{document}

\begin{forest}
for tree={
draw,
minimum height=2cm,
anchor=north,
align=center,
child anchor=north
},
[{Size 5}, align=center, name=SS
[{Size 1 \\ Size 2\\ Size 3}]
[{Size 6 \\ Size 9 \\ Size 10}] 
]
\end{forest}\quad
\tikz\node[draw,circle, text width=3cm,align=center]
{Un-tested shoes: \\ Size 4 \\ Size    5 \\ Size 7 \\ Size 8};


\end{document}

enter image description here

However, you don't need two separate constructs to achieve what you want. You can assign a name to some node in the forest and then use this name to place the desired new element using the at (<name>) synatx and appropriate anchors:

\documentclass{article}
\usepackage{forest}

\begin{document}

\begin{forest}
for tree={
draw,
minimum height=2cm,
anchor=north,
align=center,
child anchor=north
},
[{Size 5}, align=center, name=SS
[{Size 1 \\ Size 2\\ Size 3}]
[{Size 6 \\ Size 9 \\ Size 10},name=aux] 
]
\node[draw,circle, text width=3cm,align=center,anchor=south west]
  at ([xshift=1cm]aux.east)
  {Un-tested shoes: \\ Size 4 \\ Size    5 \\ Size 7 \\ Size 8};
\end{forest}


\end{document}

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy