假设我在一条水平线上有四幅图像。我想在第二行的固定位置叠加一些图像(假设是 Share0 和 Share2)。它应该看起来像移动的风格。我可以在 powerpoint 中使用动画来实现。我如何在 beamer 中做到这一点?
我尝试使用以下代码执行此操作但失败了:
\begin{frame}{series of images}
\begin{center}
\begin{overprint}
\only<2>{\includegraphics[scale=0.40]{image1.pdf}}
\hspace{-0.17em}\only<3>{\includegraphics[scale=0.40]{image2.pdf}}
\hspace{-0.34em}\only<4>{\includegraphics[scale=0.40]{image3.pdf}}
\hspace{-0.17em}\only<5>{\includegraphics[scale=0.40]{image4.pdf}}
\only<2-5>{\mbox{\structure{Figure:} something}}
\end{overprint}
\end{center}
\end{frame}
答案1
图像移动的手动动画示例:
\documentclass{beamer}
\usepackage{tikz}
\begin{document}
\begin{frame}
\transduration<0-30>{0.1}
\begin{tikzpicture}[remember picture, overlay]
\foreach \x in{0,...,30}{
\node[] at (1.5+0.1333333*\x,2.-0.2*\x) {\includegraphics<+>[width=3cm]{example-image}};
\node[] at (5.5,2.) {\includegraphics<.>[width=3cm]{example-image-b}};
\node[] at (9.5-0.1333333*\x,2.-0.2*\x) {\includegraphics<.>[width=3cm]{example-image-a}};
}
\end{tikzpicture}
\end{frame}
\end{document}