8

I have the following tikz picture in Beamer

\usetikzlibrary{fit,calc,positioning,matrix,decorations.pathmorphing}
\begin{tikzpicture}[scale=0.8,system/.style={draw,rectangle,rounded corners=3,minimum width=2cm,text width=1.8cm,text centered}]
    \node [system] (fe) {Feature Extraction};
    \node [system] (am) [right=of fe] {Acoustic Model};


    \draw[->] (fe) |- (am);
    \draw[<-,decorate,decoration={snake,pre length=6mm,segment length=2mm,amplitude=3mm}] (fe.west) -- ++(-2cm,0);

   \node<2-> [above=of fe.north] {Fast Fourier Tranform};
\end{tikzpicture}

As you can see I add a node in a second slide. However, the whole picture will jump when this is added.

How can I prevent my picture from jumping?

Peter Smit
  • 14,035

1 Answers1

7

The problem is due to the bounding box of the picture changing depending on whether or not that node is there. There are several ways to resolve this:

  1. Explicitly tell tikz what the bounding box is, thus ensuring that it is the same on both slides, using the \useasboundingbox or \path[use as bounding box] syntax. Pros: you get exactly what you ask for. Cons: you have to know exactly what to ask for.

  2. Make the extra stuff always there, but only visible on the second slide. There are a few ways of doing this; perhaps the simplest to wrap the whole node in a \visible<2->{...} rather than using \node<2->. (It would be nice if tikz commands took actions as well as bare overlay specifications, but this doesn't seem to be the case.) Another way is to put the node text in an overlay command, {\visible<2->{Fast Fourier Transform}}. Yet another way would be to place an empty node (or a coordinate) at the desired spot and then put the node with text on the next slide:

    \coordinate [above=of fe.north] (pt);
    \node<2-> at (pt) {Fast Fourier Transform};
    

    Though this could still lead to a jump, you'd probably want to position the textual node so that it was below the coordinate.

Andrew Stacey
  • 153,724
  • 43
  • 389
  • 751