在 Tikz 手册第 53/1318 页中,有一个调整节点大小以获得一组圆形和正方形的示例,如下所示:
两个圆心之间的间距正好是 1 厘米。那么 inner sep=2 mm 的几何意义是什么?换句话说,结果图中的哪个尺寸是 2 毫米?下面是相应的代码:
\documentclass{standalone}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
[inner sep=2 mm,
place/.style={circle,draw=blue!50,fill=blue!20,thick},
transition/.style={rectangle,draw=black!50,fill=black!20,thick}]
\node at ( 0,2) [place] {};
\node at ( 0,1) [place] {};
\node at ( 0,0) [place] {};
\node at ( 1,1) [transition] {};
\node at (-1,1) [transition] {};
\end{tikzpicture}
\end{document}
答案1
内部分隔符是节点内容到其边界的距离。手册第 229 页对此进行了描述:
您的节点没有内容,因此对于矩形节点,2mm 是从节点中心到边界的距离。对于圆形节点,我认为是从中心到内接矩形的距离。
\documentclass{standalone}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
[inner sep=2 mm,
place/.style={circle,draw=blue!50,fill=blue!20,thick},
transition/.style={rectangle,draw=black!50,fill=black!20,thick}]
\node (a) at ( 0,2) [place] {};
\node at ( 0,1) [place] {};
\node at ( 0,0) [place] {};
\node (b) at ( 1,1) [transition] {};
\node at (-1,1) [transition] {};
\node [draw,minimum size=4mm, densely dotted] at (a.center) {};
\draw [|-|] (a.center) -- ++(2mm,0);
\draw [|-|] (b.center) -- ++(2mm,0);
\end{tikzpicture}
\end{document}