
我想在節點的邊界上放置一些子節點。這就是我所擁有的:
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{positioning}
\begin{document}
\begin{tikzpicture}
\node[rectangle, draw, inner sep=10pt] (Foo) {Foo};
\node[rectangle, draw, fill=white, left=3pt of Foo.south] {\tiny S};
\node[rectangle, draw, fill=white, right=3pt of Foo.south] {\tiny T};
\end{tikzpicture}
\end{document}
這很好地產生了:
但現在我想使用橢圓作為形狀:
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{positioning,shapes}
\begin{document}
\begin{tikzpicture}
\node[ellipse, draw, inner sep=10pt] (Foo) {Foo};
\node[ellipse, draw, fill=white, left=3pt of Foo.south] {\tiny S};
\node[ellipse, draw, fill=white, right=3pt of Foo.south] {\tiny T};
\end{tikzpicture}
\end{document}
而且,毫不奇怪,子節點不再放置在邊界上,而是放置在稍低的位置(但它們仍然足夠大,可以覆蓋基本節點):
如何將這些子節點精確地放置在基本節點的邊界上?
答案1
您可以將它們明確地放置在形狀邊框上,而不是定位,因為您希望它們是這樣的:
\node[ellipse, draw, fill=white] at (Foo.-70) {\tiny T};
就足夠了。如果需要,您可以用於shift=(<x amount>,<y amount>)
微調。