ノードをツリーの右側に配置する

ノードをツリーの右側に配置する

現在、以下のものを所有しています:

\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};

結果として、円形のノードがあるツリーが作成されます。ただし、ノードをツリーの右側に配置したいと思います。

これをどうやって行うか、何かアイデアはありますか?

ありがとう。

答え1

空白行を残さないでください (これは、新しい段落を開始することに相当します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}

ここに画像の説明を入力してください

ただし、目的を達成するために 2 つの別々の構造は必要ありません。 内のいずれかのノードに名前を割り当てforest、その名前を使用して、構文と適切なアンカーを使用して目的の新しい要素を配置できますat (<name>)

\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}

ここに画像の説明を入力してください

関連情報