Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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

share|improve this question
add comment

2 Answers 2

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.

share|improve this answer
add comment

It is not a precise answer to your second question, but did you try the TeXample website? It contains a lot of examples (including source code) for doing all sorts of nice things with TikZ. In my experience, the TikZ manual can be a bit overwhelming at first glance. So if you are looking for doing something specific, you may be better off with adapting an example from this site.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.