# Tikz: How do you label a circled node to the left without collisions?

I'm trying to label a circled node in Tikz with some text to the left. The problem is it is colliding with the circle.

For example I have something like:

\begin{tikzpicture}
\node[draw,circle] at (0,0) {A};
\node[left] at (0,0) {010101};
\end{tikzpicture}


This causes the binary to overlap the node A. What is the best way to fix this?

-

One way to fix this is to load the positioning library

Note that in the code below I have named your first node as nameofnode and then positioned the text in relation to it by using left=of nameofnode.

\documentclass{standalone}

\usepackage{tikz}
\usetikzlibrary{positioning}

\begin{document}
\begin{tikzpicture}
\node[draw,circle](nameofnode) at (0,0) {A};
\node[left=of nameofnode] {010101};
\end{tikzpicture}

\end{document}

-
Thanks! I'm trying to work out how to get the binary label a bit closer now. – Andrew Oct 31 '12 at 16:24
@Andrew Try left=<distance> of nameofnode and vary <distance>. – Loop Space Oct 31 '12 at 16:26
@AndrewStacey perfect, I was just about to say that :) – cmhughes Oct 31 '12 at 16:27
OK, thanks again! – Andrew Oct 31 '12 at 16:29

Instead of placing the text node at via coordinates, you could name the circle node and place it to the left of the named circled node:

## Code:

\documentclass[border=2pt]{standalone}
\usepackage{tikz}

\begin{document}
\begin{tikzpicture}
\node[draw,circle] (CircleNode) at (0,0)  {A};
\node[left] at (CircleNode.west) {010101};
\end{tikzpicture}

\end{document}

-

An even easier version is using the label option for nodes:

\documentclass{article}
\usepackage{tikz}

\begin{document}
\begin{tikzpicture}
\node[draw,circle,label=left:010101] (CircleNode) at (0,0)  {A};
\end{tikzpicture}
\end{document}


It looks just like Peter Grill's solution.

-