我正在尝试在一个框架中交替显示两个图形和文本。(如果我只交替显示一个图形和文本,或者两个图形,我就可以让它工作。)这是我尝试过的方法——不起作用。下面的代码交替显示两个图形,但框架在显示其余项目之前结束。
我做错了什么? 有什么优雅的方法吗?
\documentclass{beamer}
\begin{document}
% use top alignment so that the first item does not move
\begin{frame}[t]{My frame}
\begin{itemize}
\item Show first item in all slides (don't move it!)
\alt<1-2>{
\only<1>{
\includegraphics[height=.75\textheight]{figureA}
{\scriptsize Figure A in slide 1 only}
}
\only<2>{
\includegraphics[height=.75\textheight]{figureB}
{\scriptsize Figure B in slide 2 only}
}
}{
\item<3-> This item in slides 3 and 4
\item<4-> This item in slide 4, and good bye
}
\end{itemize}
\end{frame}
\end{document}
答案1
我只需要做\item<1-4>
第一项。当然一定有更简洁的方法,我仍然很好奇如何做。
\documentclass{beamer}
\begin{document}
% use top alignment so that the first item does not move
\begin{frame}[t]{My frame}
\begin{itemize}
\item<1-4> Show first item in all slides (don't move it!)
\alt<1-2>{
\only<1>{
\includegraphics[height=.75\textheight]{figureA}
{\scriptsize Figure A in slide 1 only}
}
\only<2>{
\includegraphics[height=.75\textheight]{figureB}
{\scriptsize Figure B in slide 2 only}
}
}{
\item<3-> This item in slides 3 and 4
\item<4-> This item in slide 4, and good bye
}
\end{itemize}
\end{frame}
\end{document}