# TikZ node label distance depends on length when using tikzstyle

When I include circle in the every node style, the distance from the label to the node depends on the length of the label:

\documentclass{standalone}
\usepackage{tikz}

\begin{document}
\begin{tikzpicture}
\tikzstyle{every node}=[circle]
\node at (0,0) [label={A},draw,fill] {};
\node at (2,2) [label={BBBBB},draw,fill] {};
\node at (5,5) [label={CCCCCCCCCC},draw,fill] {};
\end{tikzpicture}

\end{document}


When I delete the tikzstyle and add circle to the options for the individual nodes, this goes away:

\documentclass{standalone}
\usepackage{tikz}

\begin{document}
\begin{tikzpicture}
\node at (0,0) [circle,label={A},draw,fill] {};
\node at (2,2) [circle,label={BBBBB},draw,fill] {};
\node at (4,4) [circle,label={CCCCCCCCCC},draw,fill] {};
\end{tikzpicture}

\end{document}


What's going on here and how can I avoid it, so I can keep circle in the node style?

Labels are also nodes. So TiKZ is setting each label in a circle. Since larger labels need larger circles, those labels are set further away from the labelled node. You can avoid this by explicitly specifying the usual rectangular shape for labels:

\documentclass[tikz]{standalone}
\begin{document}
\begin{tikzpicture}
[
every node/.append style={circle},
every label/.append style={rectangle},
]
\node at (0,0) [label={A},draw,fill] {};
\node at (2,2) [label={BBBBB},draw,fill] {};
\node at (5,5) [label={CCCCCCCCCC},draw,fill] {};
\end{tikzpicture}
\end{document}


• Perfect -- thanks for the fix, and the explanation. – LarrySnyder610 Oct 20 '14 at 2:28