[Tex/LaTex] Tikz fails creating an ellipse


I found that I cannot creating ellipse with Tikz 3.0.1a for the following example

   \node(a) [ellipse,draw] {};

with error message:

Package pgfkeys Error: I do not know the key '/tikz/ellipse' and I am going 
to ignore it. Perhaps you misspelled it. \node(a) [ellipse,draw]

while the following code works well

  \draw (0,0) ellipse [x radius=20pt, y radius=10pt];

Do I miss something here?

Best Answer

If you want an ellipse-shaped node, you need to load tikz shapes.geometric library. Only circle, rectangle and coordinate are defined initially. See section 67 p 693 of the manual.

Please note that though Hirak's answer provides ways to obtain ellipses, some comments can be formulated

  • \draw ... ellipse is an ellipse-shaped path not a node
  • scaling tikzpictures can lead to great modifications in a graphic and should be done carefully
  • the shapes library is provided in the latest versions of pgf-tikz for compatibility reasons, it has been superseded by the shapes.geometric and shapes.misc libraries.
Related Question