我想要:
- 显示全宽图像
- 单击后,从左上角开始将一张小尺寸图像放置在特定位置,并显示另一张全宽图像
- 重复此过程,直到显示所有四幅图像
- 以四幅图像组成的网格垂直和水平居中结束
我面临的问题是:
- 随着网格中第三幅图像(左下角)的显示,网格图像的位置会发生变化
我正在寻找的可能的改进是:
- 当我从全宽图像转到“概览”幻灯片时,过渡应该像将图像缩放到该位置一样
- 比我用过的代码更好吗?
以下是 MWE。
\documentclass[xcolor=dvipsnames,english,professionalfonts,smaller]{beamer}
\usetheme{Madrid}
\usepackage{graphicx}
\usepackage{parskip}
\usepackage{mwe}
\graphicspath{{.}{./image}}
\begin{document}
\setlength{\parskip}{\bigskipamount}
\begin{frame}{Title Text}
\only <+ | handout:0> {\hfil \fbox{\includegraphics[width={\textwidth}]{example-image-16x9}}}
\only <+ | handout:0> {\fbox{\includegraphics[width={.470\textwidth}]{example-image-16x9}} \hfill}
\only <. | handout:0> {\phantom{\fbox{\includegraphics[width={.470\textwidth}]{example-image-16x9}}} \\ \vspace{.09in}}
\only <. | handout:0> {\phantom{\fbox{\includegraphics[width={.470\textwidth}]{example-image-16x9}}} \hfill}
\only <. | handout:0> {\phantom{\fbox{\includegraphics[width={.470\textwidth}]{example-image-16x9}}}}
\transduration<.>{.01}
\only <+ | handout:0> {\fbox{\includegraphics[width={\textwidth}]{example-image-16x9}}}
\only <+ | handout:0> {\fbox{\includegraphics[width={.470\textwidth}]{example-image-16x9}} \hfill}
\only <. | handout:0> {\fbox{\includegraphics[width={.470\textwidth}]{example-image-16x9}} \\ \vspace{.09in}}
\only <. | handout:0> {\phantom{\fbox{\includegraphics[width={.470\textwidth}]{example-image-16x9}}} \hfill}
\only <. | handout:0> {\phantom{\fbox{\includegraphics[width={.470\textwidth}]{example-image-16x9}}}}
\transduration<.>{.01}
\only <+ | handout:0> {\fbox{\includegraphics[width={\textwidth}]{example-image-16x9}}}
\only <+ | handout:0> {\fbox{\includegraphics[width={.470\textwidth}]{example-image-16x9}} \hfill}
\only <. | handout:0> {\fbox{\includegraphics[width={.470\textwidth}]{example-image-16x9}} \\ \vspace{.09in}}
\only <. | handout:0> {\fbox{\includegraphics[width={.470\textwidth}]{example-image-16x9}} \hfill}
\only <. | handout:0> {\phantom{\fbox{\includegraphics[width={.470\textwidth}]{example-image-16x9}}}}
\transduration<.>{.01}
\only <+ | handout:0> {\fbox{\includegraphics[width={\textwidth}]{example-image-16x9}}}
\only <+ | handout:0> {\fbox{\includegraphics[width={.470\textwidth}]{example-image-16x9}} \hfill}
\only <. | handout:0> {\fbox{\includegraphics[width={.470\textwidth}]{example-image-16x9}} \\ \vspace{.09in}}
\only <. | handout:0> {\fbox{\includegraphics[width={.470\textwidth}]{example-image-16x9}} \hfill}
\only <. | handout:0> {\fbox{\includegraphics[width={.470\textwidth}]{example-image-16x9}}}
\end{frame}
\end{document}
答案1
听起来像是您想要实现的补间动画(在动画缩放的帧之间插入)。 动画包可用于此类任务(需要 Adobe Reader)。
编辑:改进的动画时间线;tween.txt
重新编译之前删除该文档。
\documentclass{beamer}
%animation timeline
\begin{filecontents*}{tween.txt}
*::0
::1
::2
::3x0 %keep small image
::7
::6
::5
*::4 %click to continue,
::5
::6
::7x0
::11
::10
::9
*::8
::9
::10
::11x0
::15
::14
::13
*::12
::13
::14
*::15x0
::2
::1
\end{filecontents*}
\usepackage{mwe}
\usepackage{animate}
\newsavebox\imgx
\newsavebox\imga
\newsavebox\imgb
\newsavebox\imgc
\newlength\fullwidth
\setlength\fullwidth{0.9\textwidth}%
\savebox\imgx{\includegraphics[width=\fullwidth]{example-image}}%
\savebox\imga{\includegraphics[width=\fullwidth]{example-image-a}}%
\savebox\imgb{\includegraphics[width=\fullwidth]{example-image-b}}%
\savebox\imgc{\includegraphics[width=\fullwidth]{example-image-c}}%
\begin{document}
\begin{frame}{Animated zoom-out}\centering
\begin{animateinline}[timeline=tween.txt,loop]{12} %animation frame rate
%tween x
\multiframe{4}{rScale=1+-0.17}{%
\vbox to 0.75\fullwidth {%
\hbox to \fullwidth {%
\scalebox{\rScale}{\usebox\imgx}%
\hss%
}%
\vss%
}%
}%
\newframe
%tween a
\multiframe{4}{rScale=1+-0.17}{%
\vbox to 0.75\fullwidth {%
\hbox to \fullwidth {%
\hss%
\scalebox{\rScale}{\usebox\imga}%
}%
\vss%
}%
}%
\newframe
%tween b
\multiframe{4}{rScale=1+-0.17}{%
\vbox to 0.75\fullwidth {%
\vss%
\hbox to \fullwidth {%
\scalebox{\rScale}{\usebox\imgb}%
\hss%
}%
}%
}%
\newframe
%tween c
\multiframe{4}{rScale=1+-0.17}{%
\vbox to 0.75\fullwidth {%
\vss%
\hbox to \fullwidth {%
\hss%
\scalebox{\rScale}{\usebox\imgc}%
}%
}%
}%
\end{animateinline}
\end{frame}
\end{document}