# Tikz: Labeling objects and referencing them

According to the Tikz manual I can use "name=" to assign a label to the drawings, but when I do the following:

\begin{tikzpicture}
\draw [ blue, thick, name=e1]  (10pt,10pt)  ellipse   (50pt and 30pt);
\node (red,above) at (e1.north) {E1};
\end{tikzpicture}


I get an error message that e1 is not defined. What am I doing wrong?

My second question is where can I find a concise syntactical representation of Tikzs commands ?

Thanks for help, Artimess

-

You can only name nodes, not arbitrary parts of a drawing. In your example, if you wanted to be able to refer to the ellipse by name, you'd need to create it as a node instead of a plain ellipse. Try replacing your \draw command with this:

\node[draw=blue,ellipse,name=e1,minimum width=100pt,minimum height=60pt] at (10pt,10pt) {};


To address the second part of your question, I know of no better documentation of TikZ than the PGF manual itself. I've never heard of a short "cheat sheet" that briefly lists TikZ commands along with reminders of their syntax, if that's what you're looking for. Although it might be out there somewhere, at least for the most commonly used ones. You could probably create such a quick reference by extracting lines from the PGF documentation.

-