3

I am making a beamer presentation in which I need to remove a figure completely and then replace it with items in an itemize list. However, when I remove an image completely, there is a blank space between the first and the third point (second point after removal of item 2, which contains the figures). How can I get rid of that space? Below is my frame.

\begin{frame}
\frametitle{Title}
\begin{block}{Block 1}

    \begin{overlayarea}{\textwidth}{0.85\textheight}
        \begin{itemize}
            \item<1-> Item 1.
            \item<2-4> Item 2.
            \begin{figure}
                \includegraphics<2> [width=6.5cm, height=2.5cm]{image 1}
                \includegraphics<3> [width=6.5cm, height=2.5cm]{image 2}
                \includegraphics<4> [width=6.5cm, height=2.5cm]{image 3}
            \end{figure}
            \item<5> Item 3
            \only<5> ABCD
            \item<5> Item 4         
        \end{itemize}
    \end{overlayarea}
\end{block}
\end{frame}

I tried placing the figure environment in a only<2-4> . But that doesn't help either.

migrated from stackoverflow.com Jul 14 '15 at 2:59

This question came from our site for professional and enthusiast programmers.

4

You can place the second item (and associated content) inside \only<2-4>:

enter image description here

\documentclass{beamer}
\begin{document}
\begin{frame}
  \frametitle{Title}
  \begin{block}{Block 1}
    \begin{overlayarea}{\textwidth}{0.85\textheight}
      \begin{itemize}
        \item<1-> Item 1.
        \only<2-4>{\item Item 2.

          \bigskip\centering

          \includegraphics<2> [width=6.5cm, height=2.5cm]{example-image-a}
          \includegraphics<3> [width=6.5cm, height=2.5cm]{example-image-b}
          \includegraphics<4> [width=6.5cm, height=2.5cm]{example-image-c}
        }
        \item<5> Item 3
          \only<5> ABCD
        \item<5> Item 4         
      \end{itemize}
    \end{overlayarea}
  \end{block}

\end{frame}

\end{document}
1

Try to comment or remove \begin{figure} and \end{figure}: this way the blank space due to the floating environment disappear. Then, the only blank space before

\item<5> Item 3

\only<5> ABCD

\item<5> Item 4

is that due to the line of text in the item:

\item<2-4> Item 2

(and this is coherent with <1->, <2-4>, <5>).

Addendum: minimal example using \centering (please notice the blank line just before).

\documentclass[english,12pt]{beamer}

\begin{document}

\begin{frame}
\frametitle{Title}
\begin{block}{Block 1}
    \begin{overlayarea}{\textwidth}{0.85\textheight}
        \begin{itemize}
            \item<1-> Item 1.
            \item<2-4> Item 2. %% blank line follows

                \centering
                \includegraphics<2> [width=6.5cm, height=2.5cm]{image 1}
                \includegraphics<3> [width=6.5cm, height=2.5cm]{image 2}
                \includegraphics<4> [width=6.5cm, height=2.5cm]{image 3}
            \item<5> Item 3
            \only<5> ABCD
            \item<5> Item 4         
        \end{itemize}
    \end{overlayarea}
\end{block}
\end{frame}

\end{document}

This way, the images appear to be horizontally centered within the block.

  • But then the problem is that the figures are not in the center of the slide. I added figure to ensure that figures are in the center of the slide. – user3575732 Jul 8 '15 at 23:39
  • Updated, have a look. Also, you may prefer <1> to <1->. – MattAllegro Jul 9 '15 at 23:42

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.