在我的beamer
演示中,我想在figure
环境中动态切换图像。更准确地说,我的图形包含 9 个 3x3 呈现的子浮点数,每个子浮点数都应该在演示期间在两幅图像之间切换。
为了避免不同元素之间出现一些“倾斜”,我认为在overlayarea
每个子浮点数内部使用一个是个好主意。
遗憾的是,在环境中使用时figure
,覆盖区域似乎表现得非常奇怪:我放入其中的每件东西都会出现外部这overlayarea
?
这是一个非常简短的例子:
\documentclass[9pt, aspectratio=43]{beamer}
\usepackage [francais]{babel}
\usepackage [T1]{fontenc}
\usepackage [utf8]{inputenc}
\usepackage[position=top]{subfig}
\usepackage{pdfpages}
\begin{document}
\begin{frame}
%% This works fine : 123 appears INSIDE the overlayarea
\fbox{\begin{overlayarea}{3cm}{2cm}
\fbox{123}
\end{overlayarea}}
%% This looks odd : 456 appears OUTSIDE the overlayarea
\begin{figure}
\fbox{\begin{overlayarea}{3cm}{2cm}
\fbox{456}
\end{overlayarea}}
\end{figure}
\end{frame}
\end{document}
也许我误用了这个环境?
答案1
我不明白 OP 代码发生了什么,但据我了解,Donut 想要的另一种构造可能是tabular
每个图像对具有相同的固定大小。
\documentclass[9pt, aspectratio=43]{beamer}
\usepackage [francais]{babel}
\usepackage [T1]{fontenc}
\usepackage [utf8]{inputenc}
\usepackage[position=top]{subfig}
\usepackage{pdfpages}
\begin{document}
\begin{frame}
%% This works fine : 123 appears INSIDE the overlayarea
%\fbox{\begin{overlayarea}{3cm}{2cm}
%\fbox{123}
%\end{overlayarea}}
%% This looks odd : 456 appears OUTSIDE the overlayarea
\begin{figure}
\begin{tabular}{ccc}
\only<1>{\includegraphics[width=3cm, height=2cm]{example-image-a}}%
\only<2>{\includegraphics[width=3cm, height=2cm]{example-image-b}}
&
\only<1>{\includegraphics[width=3cm, height=2cm]{example-image-a}}%
\only<2>{\includegraphics[width=3cm, height=2cm]{example-image-b}}
&
\only<1>{\includegraphics[width=3cm, height=2cm]{example-image-a}}%
\only<2>{\includegraphics[width=3cm, height=2cm]{example-image-b}}
\\
\only<1>{\includegraphics[width=3cm, height=2cm]{example-image-a}}%
\only<2>{\includegraphics[width=3cm, height=2cm]{example-image-b}}
&
\only<1>{\includegraphics[width=3cm, height=2cm]{example-image-a}}%
\only<2>{\includegraphics[width=3cm, height=2cm]{example-image-b}}
&
\only<1>{\includegraphics[width=3cm, height=2cm]{example-image-a}}%
\only<2>{\includegraphics[width=3cm, height=2cm]{example-image-b}}
\end{tabular}%
\end{figure}
\end{frame}
\end{document}