# Package pgf Error: No shape named X is known

I can't get this document to compile:

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{snakes,arrows,shapes}
\begin{document}
\begin{tikzpicture}[>=latex',line join=bevel,]

\definecolor{strokecol}{rgb}{0.0,0.0,0.0};
\pgfsetstrokecolor{strokecol}
\draw (140.1bp,19bp) node {310e} edge [loop below]  ();
\definecolor{strokecol}{rgb}{0.0,0.0,0.0};
\pgfsetstrokecolor{strokecol}
\draw (28bp,55.424bp) node {311r} edge [loop left]  ();

%

%%circles around nodes
%31-, 310e and 311r
%fail here
\draw (311r) -- (310e);
\end{tikzpicture}
\end{document}
%


It fails when I add that last draw command, saying Package pgf Error: No shape named 311r is known., and another with "310e" instead of "311r". I just need to be able to draw lines with nodes as the anchors. Can anyone tell me what I am doing wrong?

-
Try ... node (310e) {} ... instead. Note the round brackets and braces. – Werner Jan 3 '12 at 6:35
yes you forgot to name the nodes – Alain Matthes Jan 3 '12 at 6:52
@Altermundus: Please write up an answer for this, since I lack the tikz skill to do it properly. – Werner Jan 3 '12 at 7:53

As said in comments you have to name the nodes, this means all you need to is

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{snakes,arrows,shapes}
\begin{document}
\begin{tikzpicture}[>=latex',line join=bevel,]

\definecolor{strokecol}{rgb}{0.0,0.0,0.0};
\pgfsetstrokecolor{strokecol}
\draw (140.1bp,19bp) node(310e) {310e} edge [loop below]  ();
\definecolor{strokecol}{rgb}{0.0,0.0,0.0};
\pgfsetstrokecolor{strokecol}
\draw (28bp,55.424bp) node(311r) {311r} edge [loop left]  ();

%%circles around nodes
%31-, 310e and 311r
%fail here
\draw (311r) -- (310e);
\end{tikzpicture}
\end{document}


Anyway, your code looks interesting, because of the unnecessary pgfsetstrokecolor, definecolor and the exact positions. Are you sure you need them? Maybe \usetikzlibrary{positioning} will help you (16.5.3 Advanced Placement Options in the tikz/pgf manual).

-
The code was generated by dot2tex[fauskes.net/code/dot2tex/], and I had a hard time following it myself. Thanks for your help! – Nate Glenn Jan 3 '12 at 19:40
You will get much better results (code and output) if you take a look at the tikz/pgf manual. The manual is really good. – someonr Jan 3 '12 at 19:46
It looks quite good, but it's 700 pages... Do you know of a condensed one? – Nate Glenn Jan 4 '12 at 17:16