1

In the Tikz manual page 53/1318, there is an example to adjust the node size to get a group of circles and squares as below:

enter image description here

The spacing between the two centers of the circles is exactly 1 cm. So what is the geometrical meaning of inner sep=2 mm? In other words which dimension in the resulting figure is 2 mm? Below is the corresponding code:

\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

The inner sep is the distance from the contents of a node to its border. It is described on page 229 of the manual:

enter image description here

Your nodes have no content, so 2mm is the distance from the node center to the border for the rectangular nodes. For the circular nodes it is from the center to the inscribed rectangle, I believe.

enter image description here

\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}
1
  • Appreciate your great answer!
    – Aria
    Jul 20 '20 at 6:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.