Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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?

share|improve this question
    
When posting code, please also specify any particular packages or (as in this case) tikz libraries. The \documentclass{beamer} \usepackage{tikz} was guessable, but I had to dig to figure out which tikzlibraries you were loading. Thanks! –  Loop Space Dec 6 '10 at 8:37
    
@Andrew Sorry for forgetting that, I'll add them still... –  Peter Smit Dec 6 '10 at 8:42
    
Phew! And I didn't guess all of those! –  Loop Space Dec 6 '10 at 13:30
    
Hmm, I'm now seeing that not all off them I'm actually using in this figure. Anyway, this were the libraries I included. –  Peter Smit Dec 6 '10 at 15:13

1 Answer 1

up vote 6 down vote accepted

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.

share|improve this answer
    
Thanks for your excellent answer (as always!) –  Peter Smit Dec 6 '10 at 8:44

Your Answer

 
discard

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.