[Tex/LaTex] How replace beamer graphics by itemize

beameroverlays

In a Beamer frame with two "pages" (the second one appearing after mouse click) I have:

  • On first page an itemize environment with 3 \item followed by a picture added with includegraphics
  • On second page the same itemize environment with the same 3 \item and I want to replace the picture by a 4th \item

My problem is about how keep the same position and size of all elements in the two pages. I am able to replace my graphics by a 4th item using <1> on the include graphics and <2> on the 4th itemize but the layout of the frame changes between the two pages. How can I avoid that ?

Best Answer

You can use \overlayarea:

\overlayarea{<width>}{<height>}

A simple example:

\documentclass{beamer}

\begin{document}

\begin{frame}

\begin{overlayarea}{\textwidth}{6cm}
\begin{itemize}
\item<1-> First item.
\item<1-> Second item.
\item<1-> Third item.

\only<1>{\includegraphics[height=4cm]{example-image-a}}
\item<2> Fourth item.
\end{itemize}
\end{overlayarea}
\end{frame}

\end{document}

enter image description here