3

So, the following question was sent to the beamer mailing list, and after spending over an hour trying to answer what I thought would be a trivial question, I figured I might as well put the answer here. (I'm going to feel very silly if this turns out to be a duplicate.) The idea is that you start with something like this:

\documentclass{beamer}
\let\Tiny\tiny
\setbeamertemplate{navigation symbols}{}
\begin{document}
\frame{
\begin{itemize}
\only<1> {
\item Foo
\item Bar
}
\only<2> {
\item I replace Foo
\item I replace Bar
\item I am new!
}
\end{itemize}
}
\end{document}

Now, since they are of different sizes, this makes the itemize jump around on the slide. We need some grouping of the items that reserves space for the contents of the largest group.

5

It is definitely possible to use only one itemize environment in this case. You could simply replace Foo and Bar using the \alt command. In my opinion the resulting code is also easier to read. Here is an example:

\documentclass{beamer}
\setbeamertemplate{navigation symbols}{}
\begin{document}
\frame{
\begin{itemize}
\item\alt<1>{Foo}{I replace Foo}
\item\alt<1>{Bar}{I replace Bar}
\item<2> I am new!
\end{itemize}
}
\end{document}

OUTPUT:

beamer_overlay_itemize

  • You are right, this is way better! – Mark Apr 20 '16 at 18:20
4

It turns out that this works:

\documentclass{beamer}
\let\Tiny\tiny
\setbeamertemplate{navigation symbols}{}
\begin{document}
\frame{
\begin{overprint}
\onslide<1>
\begin{itemize}
\item Foo
\item Bar
\end{itemize}
\onslide<2>
\begin{itemize}
\item I replace Foo
\item I replace Bar
\item I am new!
\end{itemize}
\end{overprint}
}
\end{document}

This looks pretty simple (to me). What's surprising is the other simple looking solutions that fail. (For instance, just try doing this using a single itemize environment.)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.