# Avoiding jumping frames in beamer

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?

-

Wrap your code fragment inside the overlayarea environment.

-

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}

-

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

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

-
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

It seems that encapsulating the content of each step in textblocks often solves the problem of jumping frames. This is an example for a frame:

\begin{frame}
\only<1->
{
\begin{textblock*}{100mm}(10mm,0.2\textheight)
% first content
\end{textblock*}
}
\only<2->
{
\begin{textblock*}{100mm}(10mm,0.5\textheight)
% second content
\end{textblock*}
}
\end{frame}

-
Welcome to TeX.SX. Please provide a full example, instead some fragments. Another reason of jumping frames could be omitted % characters ;-) –  Christian Hupfer May 8 at 15:45
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.8221163749694824, "perplexity": 4656.791661358716}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2015-22/segments/1432207929956.54/warc/CC-MAIN-20150521113209-00275-ip-10-180-206-219.ec2.internal.warc.gz"}