# how to draw nodes with same size

I would like to make 12 nodes with same sized circles. Currently, the radius of a circle for single digit number and two digit numbers are different. Let r1 be the radius for single digit numbers. Let r2' be the radius for two digit numbers. How can I make all numbers to have circles with radius r1?

            \documentclass[11pt]{article}

\usepackage{tikz}
\usepackage[graphics, tightpage, active]{preview}
\setlength{\PreviewBorder}{2pt}
\PreviewEnvironment{tikzpicture}

\usepackage{graphicx}
\usepackage{subfigure}
\usepackage{amsmath}
\usepackage{amsfonts}

\usepackage{tikz}
\usetikzlibrary{positioning}

\begin{document}
\begin{tikzpicture}[scale=1.5]
\begin{scope}[auto, every node/.style={draw,circle},node distance=2cm]
% the vertices
\node(v1) at (0,0){1};
\node[above=of v1](v2){2};
\node[above=of v2](v3){3};
\node[right=of v1](v4){4};
\node[above=of v4](v5){5};
\node[above=of v5](v6){6};
\node[right=of v4](v7){7};
\node[above=of v7](v8){8};
\node[above=of v8](v9){9};
\node[right=of v7](v10){10};
\node[above=of v10](v11){11};
\node[above=of v11](v12){12};

\draw (v1)--(v2)
(v2)--(v3)
(v1)--(v4)
(v2)--(v5)
(v3)--(v6)
(v4)--(v7)
(v5)--(v8)
(v6)--(v9)
(v7)--(v10)
(v8)--(v11)
(v9)--(v12)
(v10)--(v11)
(v11)--(v12);

\end{scope}
\end{tikzpicture}
\end{document}

-
Clarification: You want the bigger nodes to have the same radius as the smaller ones? Is r1 actually given or do you want to get that from the small nodes? – Qrrbrbirlbel Jul 17 '13 at 22:22

you can specify a minimum size in style and if necessary restrict inner sep

 \documentclass[11pt,tikz,border=2pt]{standalone}
\usetikzlibrary{positioning}
\begin{document}
\begin{tikzpicture}[scale=1.5]
\begin{scope}[auto, every node/.style={draw,circle,minimum size=2em,inner sep=1},node distance=2cm]
% the vertices
\node(v1) at (0,0){1};
\node[above=of v1] (v2) {2};
\node[above=of v2] (v3) {3};
\node[right=of v1] (v4) {4};
\node[above=of v4] (v5) {5};
\node[above=of v5] (v6) {6};
\node[right=of v4] (v7) {7};
\node[above=of v7] (v8) {8};
\node[above=of v8] (v9) {9};
\node[right=of v7 ,] (v10) {10};
\node[above=of v10] (v11) {11};
\node[above=of v11,] (v12) {12};
\end{scope}
\end{tikzpicture}
\end{document}


-

The easiest way would be to use an invisible digit in the node and a label placed at the center with the actual text.

## Code

\documentclass[11pt,tikz,border=2pt]{standalone}
\usetikzlibrary{positioning}
\begin{document}
\begin{tikzpicture}[scale=1.5]
\begin{scope}[auto, every node/.style={draw,circle},node distance=2cm]
% the vertices
\node(v1) at (0,0){1};
\node[above=of v1] (v2) {2};
\node[above=of v2] (v3) {3};
\node[right=of v1] (v4) {4};
\node[above=of v4] (v5) {5};
\node[above=of v5] (v6) {6};
\node[right=of v4] (v7) {7};
\node[above=of v7] (v8) {8};
\node[above=of v8] (v9) {9};
\node[right=of v7 , label=center:10] (v10) {\phantom{0}};
\node[above=of v10, label=center:11] (v11) {\phantom{0}};
\node[above=of v11, label=center:12] (v12) {\phantom{0}};
\end{scope}
\end{tikzpicture}
\end{document}


## Output

-
As all digits have the same height you can also simply use \clap{} on the label text, like \node[above=of v11] (v12) {\clap{12}}; – Tom Bombadil Jul 18 '13 at 2:58
@TomBombadil Which definition of \clap do you use? The width of a single digit is still needed: \def\clap#1{\makebox[\widthof{0}]{#1}}. \clap from mathtools doesn’t give the best results. (In both cases, I added \fboxes around the text of nodes 9 to 12.) – Qrrbrbirlbel Jul 18 '13 at 3:22

I guess the easiest way is to make use of /tikz/minimum size

Just replace this line

\begin{scope}[auto, every node/.style={draw,circle},node distance=2cm]


with this

\begin{scope}[auto, every node/.style={draw,circle,minimum size=1cm},node distance=2cm]

-
...and of course inner sep as pointed out by @rpapa – sheß Jul 17 '13 at 22:53