如何使用相对定位将节点定位在多部分节点中某一部分的中心/边缘?
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{shapes.multipart}
\usetikzlibrary{positioning}
\begin{document}
\begin{tikzpicture}
\node[align=center,draw,shape=rectangle split,rectangle split horizontal,rectangle split parts=3, text width=2cm] (A) at (1.5,3)
{one\nodepart{two}two\nodepart{three}three};
\node[draw,shape=circle] (E) at (2.7,1) {$E$};
\node[draw,shape=circle] (C) at (3.7,1) {$C$};
\end{tikzpicture}
\end{document}
这是期望的结果:
答案1
你的意思是像这样吗?
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{shapes.multipart}
\usetikzlibrary{positioning}
\begin{document}
\begin{tikzpicture}
\node[align=center,draw,shape=rectangle split,rectangle split horizontal,rectangle split parts=3, text width=2cm] (A) at (1.5,3)
{$m$\nodepart{two}$0 \ldots 0$\nodepart{three}$r$};
\node[draw,shape=circle] (E) [below=of A.two split south] {$E$};
\node[draw,shape=circle] (C) [below=of A.three south] {$C$};
\end{tikzpicture}
\end{document}
TikZ 手册版本 2.10,第 453 页显示了垂直的锚点split rectangle
。您必须重新解释水平版本。