[Tex/LaTex] Tikz: How to label a circled node to the left without collisions

labelsnodes

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?

Best Answer

One way to fix this is to load the positioning library

enter image description here

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}
Related Question