8

In the Tik Z & PGF Manual for Version 2.10-CVS, page 130/880 there is an example to create a pair of a circle and an ellipse as below:

enter image description here

Below is the code I used:

\documentclass{standalone}
\usepackage{tikz}

\begin{document}
\begin{tikzpicture}
\path (0,0) node(a) [ellipse,rotate=10,draw] {An ellipse}
(3,-1) node(b) [circle,draw] {A circle};
\draw[thick] (node cs:name=a) -- (node cs:name=b);
\end{tikzpicture}

\end{document}

However I got an error as below: ! Package pgfkeys Error: I do not know the key '/tikz/ellipse' and I am going t o ignore it. Perhaps you misspelled it. Do you know how to fix this? Thanks for your support in advance.

  • 3
    why don't you use the latest version 3.1.5b ? ctan.org/pkg/pgf?lang=en – Black Mild Jul 13 at 0:25
  • Yes you are right. I got the latest manual in your link. Thanks! – Aria Jul 13 at 0:30
12

When using ellipse as a node shape, you need to load the shapes.geometric tikz library. You can do that by adding \usetikzlibrary{shapes.geometric} in your preamble (usually immediately) after \usepackage{tikz}. Note that you don't need shapes.geometric to draw an ellipse, only to use it as a node shape like in your example. If you use several shapes.xxx libraries, you can simply write \usetikzlibrary{shapes} instead of listing them one by one.

| improve this answer | |
  • 2
    @Étienne, welcome to TeX.SE! excellent answer by the way! +1 – M. Al Jumaily Jul 13 at 3:16
11

As supplement to the Étienne answer:

  • Tik Z & PGF Manual for Version 2.10-CVS is obsolete for years, I strongly recommend to use the recent version of the package as well as its manual.
  • Actual version of TikZ manual is 3.1.5b (January 8, 2020), where your example is on page 141.
  • Shapes Library is described in chapter 72 Shape Library starting at page 785, where in section 72 Shape Library is stated:

In addition to the standard shapes rectangle, circle and coordinate, there exist a number of additional shapes defined in different shape libraries. Most of these shapes have been contributed by Mark Wibrow. In the present section, these shapes are described. Note that the library shapes is provided for compatibility only. Please include sublibraries like shapes.geometric or shapes.misc directly.

  • Geometric shapes are described in section 72.3 Geometric Shapes on page 786.
  • For ellipse shape see pages 787 -- 788.
| improve this answer | |
  • Yes thank you so much. I downloaded the newest TikZ manual. – Aria Jul 13 at 3:30
  • 4
    @Aria, I suggest you to upgrade the TikZ package too! – Zarko Jul 13 at 7:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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