Is there a way to introduce parts of a tikzpicture with \pause or similar in Beamer without resorting to incrementally redrawing the tikzpicture over multiple frames?

Intercalating TikZ draw commands with \pause commands creates new frames, but introduces (or in my case, using \setbeamercovered{highly dynamic}, fades in) the entire tikzpicture, which sort of makes sense, as the interior of a tikzpicture is not the normal environment for \pause commands.


1 Answer 1


The easiest way to do this that I have found is to provide overlay specifications to the elements of the picture. The basic commands, \path, \draw, \node and so forth are all overlay-aware. The one thing to be ware of is that the bounding box might jump around a bit as different parts of the drawing are put in or taken out. However, once you're aware of that then it's easy to fix. Either specify the bounding box at the start (using the \useasboundingbox) or litter your drawing with lots of \coordinates which are there all the time but only use them on specific slides.

Here's a fairly detailed example with the \useasboundingbox technique.


\useasboundingbox (-5.2,-3.1) rectangle (5.2,3.1);
\fill[gray!25] (-5.2,-3.1) rectangle (-0.2,3.1);
\draw[ultra thick,red] (-5,0) -- (-0.4,0);
\draw[ultra thick] (-2.7,-3) -- (-2.7,3);
\foreach \t in {-1.5,-1.4,...,1.5} {
\pgfmathsetmacro{\m}{1 - \l}
\draw[color=currentcolor] (-5,\t) -- (-0.4,\t);
\foreach \t in {1.6,1.7,...,3} {
\pgfmathsetmacro{\m}{1 - \l}
\draw<.(4)->[color=currentcolor] (-5,\t) -- (-0.4,\t);
\draw<.(4)->[color=currentcolor] (-5,-\t) -- (-0.4,-\t);
\fill<.(2)->[gray!25] (5.2,-3.1) rectangle (0.2,3.1);
\draw<.(2)->[ultra thick,red] (5,0) -- (0.4,0);
\draw<.(2)->[ultra thick] (2.7,-3) -- (2.7,3);
\foreach \t in {-2,-1.9,...,2} {
\pgfmathsetmacro{\m}{1 - \l}
\draw<.(3)->[color=currentcolor] (2.7,0) -- +(\x,\y);


\visible<2->{\(z \mapsto e^{z}\)}


First frame:

first frame of exponential

Last frame:

last frame of exponential

(If there's a specific situation that you need help figuring out, either edit the question to include the code or ask a new question about it.)

  • My current method is essentially analogous to yours, except that I'm redrawing the tikzpicture with added material on new frames. I see that the reason why my pause was not working was because I was attempting to uncover an addplot, whereas it works perfectly well for my \draw elements as evinced by John Kitzmiller's example in the question Aaron linked. Anyhow, thanks for the example as \useasboundingbox is useful to me. Mar 21, 2011 at 10:08

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.