在beamer
使用叠加的幻灯片中,我希望两个在itemize
环境中顺序显示三个项目,并分别在左侧、中间和右侧出现相应的图形。
在下面的 MWE 中,我使用三个minipage
s 分隔\hfill
图形,这导致中间的图形跳来跳去。我怎样才能让第二个<2->
图形保持与幻灯片相同的位置<3->
?
\documentclass[10pt,table]{beamer}
\usepackage{mwe} % <-- for dummy images
\begin{document}
\begin{frame}
\frametitle{Plots: Data, Model, Data + Model}
Example: Linear model--- Prestige $\sim$ Income + Education + Type
\begin{itemize*}
\item <1->Data plot: \alert{marginal} relation of Income on Prestige
\item <2->Model (effect) plot: \alert{conditional} fitted values, controlling for other variables
\item <3->Data + Model plot: Effect of Income (model) + \alert{partial residuals} (data)
\end{itemize*}
\vspace{1ex}
% three figs side-by-side
\begin{minipage}[c]{.33\textwidth}
\includegraphics<1->[width=1\linewidth,clip]{example-image-a}
\end{minipage}%
\hfill
\begin{minipage}[c]{.33\textwidth}
\includegraphics<2->[width=1\linewidth,clip]{example-image-b}
\end{minipage}%
\hfill
\begin{minipage}[c]{.33\textwidth}
\includegraphics<3->[width=1\linewidth,clip]{example-image-c}
\end{minipage}
\end{frame}
\end{document}
答案1
\phantom
在第一张和第二张幻灯片上使用经过授权的第三张图片:
\documentclass[10pt,table]{beamer}
\usepackage{mwe} % <-- for dummy images
\begin{document}
\begin{frame}
\frametitle{Plots: Data, Model, Data + Model}
Example: Linear model--- Prestige $\sim$ Income + Education + Type
\begin{itemize}
\item <1->Data plot: \alert{marginal} relation of Income on Prestige
\item <2->Model (effect) plot: \alert{conditional} fitted values, controlling for other variables
\item <3->Data + Model plot: Effect of Income (model) + \alert{partial residuals} (data)
\end{itemize}
\vspace{1ex}
% three figs side-by-side
\begin{minipage}[c]{.33\textwidth}
\includegraphics<1->[width=1\linewidth,clip]{example-image-a}
\end{minipage}%
\hfill
\begin{minipage}[c]{.33\textwidth}
\includegraphics<2->[width=1\linewidth,clip]{example-image-b}
\end{minipage}%
\hfill
\alt<3>{%
\begin{minipage}[c]{.33\textwidth}
\includegraphics<3->[width=1\linewidth,clip]{example-image-c}
\end{minipage}}{%
\begin{minipage}[c]{.33\textwidth}
\phantom{\includegraphics[width=1\linewidth,clip]{example-image-c}}
\end{minipage}}
\end{frame}
\end{document}
结果动画: