TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have drawn an ellipse:

\node (elli) [ellipse, minimum height=3cm,minimum width=2cm, draw] {};

I would like to write some elements in it as the figure below shows. The position of the elements do not need to be precise, but I want them to be inside the ellipse.

Does anyone know how to do it?

enter image description here

share|improve this question
up vote 2 down vote accepted

You can use the fit library to fit an ellipse node around some other nodes. The syntax is fit={(<node1>) (<node2>) ...}. To randomly place some nodes, you can use xshift=rnd*<length> and yshift=rnd*<length>. The random numbers change every minute, so to keep your results reproducible, you should fix the random seed using pgfmathsetseed=<integer>:





    random position/.style={
\node (a) [random position] {1};
\node (b) [random position] {5};
\node (c) [random position] {7};
\node (d) [random position] {11};
\node (e) [random position] {$\cdots$};
\node [draw,ellipse,fit={(a) (b) (c) (d) (e)}] {};

share|improve this answer

Your Answer


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.