2

Everything I see says to use minimum size, but no matter what I do, the nodes with one digit and two digits are different sizes. Here is my code for reference.

    \begin{tikzpicture}[transform shape]
      \foreach \x in {1,...,16}{%
        \pgfmathparse{(\x-1)*360/16}
        \node[draw,circle,inner sep=0.09em,font=\scriptsize] (N-\x) at (\pgfmathresult:1cm) {$\x$};
      } 
      \foreach \x [count=\xi from 1] in {1,...,15}{%
        \foreach \y in {\x,...,16}{%
         \path (N-\x) edge[ultra thin,-] (N-\y);
      }
    }
    \end{tikzpicture}
6

You can set minimum width to be something that contains the numbers:

enter image description here

\node[draw,
      circle,
      inner sep = 0.09em,
      font = \scriptsize,
      minimum width = 15pt
     ] (N-\x) at (\pgfmathresult:2cm) {$\x$};

Or, you can calculate the width automatically by using \eqmakebox from the eqparbox package:

\node[draw,
      circle,
      inner sep = 0.09em,
      font = \scriptsize
     ] (N-\x) at (\pgfmathresult:2cm) {\eqmakebox[circlenode]{$\x$}};

The latter option requires at least two compilations in order to figure out what the maximum width is for all nodes tagged circlenode.

  • Your works are excellent. I'm voting the best answers. +1 – Sebastiano Oct 20 '17 at 9:03

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.