3
\documentclass{beamer}
\begin{document}
\begin{frame}{Motivations}
\begin{itemize}
    \item Let's look at picture a and picture b
\end{itemize}
\begin{overlayarea}{\textwidth}{4cm}
    \only<1>{
        \begin{figure}
            \includegraphics[height=4cm]{a.png}
        \end{figure}
    }
    \only<2>{
        \begin{figure}
            \includegraphics[height=4cm]{b.png}
        \end{figure}
    }
    \only<3->{
        %\begin{itemize}    
            \item Basically, picture a and picture b show a cat.
            \item The pictures are taken from different angles.
        %\end{itemize}
    }
\end{overlayarea}
\end{frame}
\end{document}

In this presentation, I first show "Let's look at picture a and picture b", then present picture a and b one at a time. Finally on page 3 I uncover text that summarizes the pictures and hide the pictures.

The above code does not compile. I think \item does not work in the overlayarea env.

If I uncomment \begin{itemize}, the code mainly works except the distance between items are not identical.

enter image description here

How do I make the 3 items look like in a single list, and avoid text wobbling?

I read Chapter 9.5 Dynamically Changing Text or Images of beamer manual, but didn't find useful hints.

I tried to \setlength\topsep{0pt} \setlength\partopsep{0pt} from How do I remove white space above itemize command in beamer using enumitem but it doesn't seem to work.

It's safe to assume the last 2 items are shorter than pic.

1 Answer 1

1

Your code doesn't build because you end your itemize environment after the first \item, yet you continue to use \item outside of the environment.

If you move \end{itemize} to the end of your list, a space appears between your \items because of the overlay environment. One way to avoid this is to start the overlay environment first and put your itemize environment inside it.

\documentclass{beamer}
\begin{document}
\begin{frame}{Motivations}
\begin{overlayarea}{\textwidth}{4cm}
\begin{itemize}
    \item Let's look at picture a and picture b
    \only<1>{%
        \begin{figure}
            \includegraphics[height=4cm]{example-image-a}
        \end{figure}%
    }
    \only<2>{%
        \begin{figure}
            \includegraphics[height=4cm]{example-image-b}
        \end{figure}%
    }
    \only<3->{%
            \item Basically, picture a and picture b show a cat.
            \item The pictures are taken from different angles.
    }
\end{itemize}
\end{overlayarea}
\end{frame}
\end{document}

two frames showing picture in list

1
  • Your solution is kind of wonderful. It's safe to assume the last 2 items are shorter than pic. But in your solution I have to estimate the height of "Let's look at picture a and picture b", since the height of pic is 4cm, the height of overlayarea should be 4cm plus something.
    – Gqqnbig
    Commented Nov 26, 2020 at 7:13

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .