Atualmente tenho o seguinte:
\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};
Isso resulta em uma árvore, sob a qual existe um nó circular. No entanto, gostaria de colocar o nó à direita da árvore.
Alguma idéia de como posso fazer isso?
Obrigado.
Responder1
Não deixe uma linha em branco (isso equivale a iniciar um novo parágrafo para o 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}
No entanto, você não precisa de duas construções separadas para conseguir o que deseja. Você pode atribuir um nome a algum nó no forest
e então usar esse nome para colocar o novo elemento desejado usando o at (<name>)
synatx e as âncoras apropriadas:
\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}