# Centering figures in itemize environment in beamer

I need to make a presentation in ppt with following format: First item is written as “First, first, first, first, first, first, first, first, first, first” Second item is written as “Second, second, second, second, second, second, second, second, second, second” second, second,” After this I need to put a figure In the next slide, the figure should disappear and write the third item “Third, third, third, third, third, third, third, third, third, third, third, third,” After this I want to put one more figure In the next slide, this figure should be removed and write “Fourth, fourth, fourth, fourth, fourth, fourth, fourth, fourth, fourth, fourth, fourth” And so on… Accordingly, I have written the code:

\documentclass[usenames,dvipsnames]{beamer}
\usepackage{amsmath,xcolor,color}
\title{its a long title}
\author[My name]{My name\\ \vspace{0.5cm} Under somebody\\ \vspace{0.5cm} for some random thought}
\date{}
\begin{document}
\begin{frame}
\titlepage
\end{frame}
\begin{frame}{\centerline{Some frame title}}
\begin{overlayarea}{\textwidth}{0.85\textheight}
\begin{itemize}
\pause
\item<1-> First, first, first, first, first, first, first, first, first, first
\pause
\item<2-> Second, second, second, second, second, second, second, second, second, second
\pause
\only<3-4>{

\bigskip\centering{
\begin{center}
\includegraphics[scale=0.4]{example-image-a}
\end{center}}}
\pause
\item<5-> Third, third, third, third, third, third, third, third, third, third, third, third,
\pause
\only<6>{

\bigskip\centering{
\begin{center}\includegraphics[scale=0.4]{example-image-b}
\end{center}}}
\pause
\item Fourth, fourth, fourth, fourth, fourth, fourth, fourth, fourth, fourth, fourth, fourth
\pause
\item Fifth, fifth, fifth, fifth, fifth, fifth, fifth, fifth, fifth, fifth, fifth, fifth, fifth, fifth
\end{itemize}

\end{overlayarea}
\end{frame}
\end{document}


I took help from this post

But, I want that figures to be centered and filled in whole slide as one can make in PowerPoint:

How to accomplish this in latex?

I would make a frame with only the itemization and interrupt it with the frames with images. This can be done fairly automatically:

\documentclass[xcolor={usenames,dvipsnames}]{beamer}
%\usepackage{amsmath,xcolor,color}

\title{its a long title}
\author[My name]{My name\\ \vspace{0.5cm} Under somebody\\ \vspace{0.5cm} for some random thought}
\date{}

\setbeamertemplate{frametitle}[default][center]

\begin{document}

\begin{frame}
\titlepage
\end{frame}

\begin{frame}<-2>[label=foo]
\frametitle{Some frame title}
\begin{itemize}[<+->]
\item First, first, first, first, first, first, first, first, first, first
\item Second, second, second, second, second, second, second, second, second, second
\item Third, third, third, third, third, third, third, third, third, third, third, third,
\item Fourth, fourth, fourth, fourth, fourth, fourth, fourth, fourth, fourth, fourth, fourth
\item Fifth, fifth, fifth, fifth, fifth, fifth, fifth, fifth, fifth, fifth, fifth, fifth, fifth, fifth
\end{itemize}
\end{frame}

\begin{frame}
\includegraphics[width=\textwidth]{example-image}
\end{frame}

\againframe<3>{foo}

\begin{frame}
\includegraphics[width=\textwidth]{example-image-a}
\end{frame}

\againframe<4-5>{foo}

\end{document}


Unrelated to the problem:

• but instead of manually messing with the argument of the frametitle, I would use \setbeamertemplate{frametitle}[default][center] to centre them

• you don't need to load xcolor and color because beamer already loads it for you.

• if you already create overlays with \item<1-> etc. it is not necessary to additionally add \pause commands

• better use xcolor={usenames,dvipsnames} as documentclass option

• \centering is a switch and does not take an argument. The correct syntax should be {\centering ....}.

• Either \centering or the center environment are superfluous. I'd keep the first because the center environment adds additional vertical spacing

• Many thanks for giving answer to my query. As far as first comment is concerned, I had put it in this way because I want the title of only one slide to be centered. Thanks for all other nice suggestions... – sreeraj t Mar 13 '19 at 3:36