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.

Sometimes I want an element on a frame to change in steps. I do this by

\only<2>{  
...  
}  
\only<3>{  
...  
}  

etc.

But this causes the frame to jump due to different sizes of the included content. How can this be avoided?

share|improve this question

3 Answers 3

up vote 28 down vote accepted

Wrap your code fragment inside the overlayarea environment.

share|improve this answer

This issue is addressed in the beamer manual in section 9.5 Dynamically Changing Text or Images, p.85 for v.3.10.

You need to use either the overlayarea environment which is "more flexible but less user friendly" or the overprint environment.

\begin{overlayarea}{⟨area width⟩}{⟨area height⟩}
  ⟨environment contents⟩
\end{overlayarea}

\begin{overprint}[⟨area width⟩]
  ⟨environment contents⟩
\end{overprint}

You then need to use \onslide<⟨num⟩> instead of \only<⟨num⟩>{...}. The numbers must be disjoint.

Example:

\begin{overprint}
  % on every slide (not sure if it is officially supported)
  \onslide<1>
  % on first slide
  \onslide<2>
  % on slide two
  \onslide<3>
  % on slide three
  % etc.
\end{overprint}
share|improve this answer

Use a command phantom to build a same size of the elements.

\only<2>{
...
}
\only<2>{
\phantom{xxxx}
}
\only<3>{
xxxx
}
share|improve this answer
1  
This can result in movement of common items. Using overprint as suggested in other answers avoids this problem. –  Liam Feb 1 '13 at 22:45

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.