0

I'm looking for a method to change the content of an alertbox in beamer when the user moves to the next frame.

A solution is of course to generate two frames:

\documentclass{beamer}
\begin{document}
\begin{frame}
\begin{alertblock}{Foo}
Bar1
\end{alertblock}
\end{frame}
\begin{frame}
\begin{alertblock}{Foo}
This is a very long text that should be displayed on two or more lines, as a result, the alertblock will enlarge and thus cause the audience to focus more on the box than the content that is of course the important part of the presentation.
\end{alertblock}
\end{frame}
\end{document}

The problem with this approach is however that if Bar2 has not the same vertical span width as Bar1, the box is repositioned resulting in an ugly visual effect.

As a result in the first slide, an alertblock is displayed containing Bar1 but already has the size to show This is a very..., in the second slide This is a very... is displayed starting at the top-left of the alertblock.

3
  • 1
    You should use one alertblock and then include overlay specifications for the contents. As in \begin{alertblock}{Foo} \onslide<1>{Bar1} \par \onslide<2>{Bar2} \end{alertblock}, say. Perhaps a more concrete example highlighting your problem would help.
    – Werner
    May 6, 2014 at 18:52
  • The problem with this approach is that Bar2 is placed below Bar1 May 6, 2014 at 19:07
  • 1
    Use the overlayarea environment to specify the area that should be kept the same. As such, I think the following is a duplicate: Avoiding jumping frames in beamer
    – Werner
    May 6, 2014 at 19:10

0

Browse other questions tagged .