我在一张幻灯片中排列了四张图片,我想一次显示一张图片。
我能够使用下面的代码显示文本
\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}
我想以同样的方式展示图像。
我已经将图像对齐如下
\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}
答案1
也许与\alt
和\phantom
,假设你使用了自定义定义\vcenteredhbox
,我发现这里。
\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}
答案2
或许就uncover
足够了。
\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}