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'm creating a beamer presentation, in which I use TikZ.

I am making a figure, on which I would like to highlight something (using \only<> command). My figure contains an ellipse that is decorated with random steps:

\node[ellipse,minimum width=1cm,black!30,decorate,decoration={random steps,segment length=0.2cm,amplitude=.1cm}] {}; 
\node (n) at (0,0) {A};
\node (n) at (0,0) {B};

The ellipse is rendered in differenlty. How can I make it to render the same? or what other decoration can I use to get a similar effect to random steps?

share|improve this question
Welcome to TeX.SX! You can highlight code using the braces ({}) button over the edit window, or with backticks (`) for inline code. – Count Zero Sep 7 '12 at 15:25
Welcome to TeX.SX. It is always preferable to post complete minimal working examples rather than code snippets because this helps people to answer you. – Claudio Fiandrino Sep 7 '12 at 15:30
up vote 14 down vote accepted

The problem was due to the seed: if you add \pgfmathsetseed{<integer number>} before the first \node the seed used to generate random numbers is reset in each slide, forcing the path to be the same.

Here's a complete example (I took some liberty with the size of the shape):



\begin{frame}{Title frame}
\node[thick,draw,ellipse,minimum width=3cm,minimum height=1.5cm,black!30,decorate,decoration={random steps,segment length=0.3cm,amplitude=.3cm}] {}; 
\node (n) at (0,0) {A};
\node (n) at (0,0) {B};



enter image description here

share|improve this answer
thanks, works excellent! – jfu Sep 7 '12 at 15:53
Glad of having helped you. I would courteously suggest for the future to upvote all answers you find useful, including those to others' questions and to check/accept the best answers to your own questions by clicking the green tick on the left-hand side of the answer. – Claudio Fiandrino Sep 7 '12 at 15:57
I'd love to upvote, but I don't have enough reputation yet :) – jfu Sep 7 '12 at 16:07
No problems: my comment should be intended as good recommendation for new users. :) – Claudio Fiandrino Sep 7 '12 at 16:10

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.