2

I have four images aligned in one slide and I want to show one picture at a time.

I was able to show the text using the code below

\begin{frame}
\frametitle{Table of Contents}
\begin{itemize}
\item<1-> Introduction
\item<2-> Algorithm for reducing finite automata
\item<3-> Reliability models
\item<4-> Reduction steps
\item<5-> References
\item<6-> Conclusion
\end{itemize}
\end{frame}

In the same way I want to show the images.

I have aligned the images as follows

\begin{frame}
\vcenteredhbox{\includegraphics[width=5cm,height=5cm,keepaspectratio]{pc5.jpg}}
\vcenteredhbox{\includegraphics[width=5cm,height=5cm,keepaspectratio]{pc6.jpg}}
\vcenteredhbox{\includegraphics[width=5cm,height=5cm,keepaspectratio]{pc8.jpg}}
\vcenteredhbox{\includegraphics[width=5cm,height=5cm,keepaspectratio]{pc7.jpg}}
\end{frame}
Martin Scharrer
  • 262,582
Nyfer
  • 277

2 Answers2

6

Maybe with \alt and \phantom, assuming you used the custom definition for \vcenteredhbox, that I found here.

\documentclass{beamer}
\usepackage{graphicx}

\newcommand*{\vcenteredhbox}[1]{\begingroup
\setbox0=\hbox{#1}\parbox{\wd0}{\box0}\endgroup}


\newcommand{\thepic}{\includegraphics[width=5cm,height=5cm,keepaspectratio]{pic.png}}

\begin{document}


\begin{frame}
 \vcenteredhbox{\thepic}
 \vcenteredhbox{\alt<2->{\thepic}{\phantom{\thepic}}}
 \vcenteredhbox{\alt<3->{\thepic}{\phantom{\thepic}}}
 \vcenteredhbox{\alt<4->{\thepic}{\phantom{\thepic}}}
\end{frame}

\end{document}

enter image description here

jens_bo
  • 1,752
1

Maybe just uncover would be sufficient.

\documentclass[demo]{beamer}

\newcommand*{\vcenteredhbox}[1]{#1}

\begin{document}


\begin{frame}
\vcenteredhbox{\includegraphics[width=5cm,height=5cm,keepaspectratio]{pc5.jpg}}
\uncover<2->{\vcenteredhbox{\includegraphics[width=5cm,height=5cm,keepaspectratio]{pc6.jpg}}}
\uncover<3->{\vcenteredhbox{\includegraphics[width=5cm,height=5cm,keepaspectratio]{pc8.jpg}}}
\uncover<4->{\vcenteredhbox{\includegraphics[width=5cm,height=5cm,keepaspectratio]{pc7.jpg}}}
\end{frame}

\end{document}

enter image description here

bloodworks
  • 10,178