7

I was trying to use \only to dynamically show the some bullets. The problem is that the slides, "First and second" in the following example, will "jump" when I turn to the next page. How can I avoid it? I know if I change \only to \onslide, the slide will not jump. But unlike \only, \onslide has to reserve the space first.

\documentclass{beamer}
\begin{document}
\begin{frame}[plain]
    First and second.\\ % This line will jump while turning page.
    \only<1>{
        \begin{itemize}
            \item 1.a
            \item 1.b
        \end{itemize}
    }
    \only<2>{
        \begin{itemize}
            \item 2.a
            \item 2.b
            \item 2.c
        \end{itemize}
    }

\end{frame}
\end{document}
2

1 Answer 1

9

Use an overlayarea environment, designed specially to prevent those "jumps":

\documentclass{beamer}
\begin{document}
\begin{frame}[plain]

\begin{overlayarea}{\textwidth}{4cm}
    First and second.
    \only<1>{
        \begin{itemize}
            \item 1.a
            \item 1.b
        \end{itemize}
    }
    \only<2>{
        \begin{itemize}
            \item 2.a
            \item 2.b
            \item 2.c
        \end{itemize}
    }
\end{overlayarea}
\end{frame}

\end{document}

The result:

enter image description here

1
  • Alternatively, use \begin{overprint} ... \end{overprint}, it doesn't need height or width specification. See Beamer user guide for more information.
    – pcworld
    Aug 26, 2021 at 20:59

You must log in to answer this question.

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