Beamer - “仅”内“发现”

Beamer - “仅”内“发现”

uncover我在里面嵌套了一个only,但它没有按预期工作。我的文档的标题是:

\documentclass[8pt]{beamer}

\mode<presentation>{\usetheme{Warsaw}}
\setbeamertemplate{navigation symbols}{}

\usepackage{empheq}
\usepackage{tikz}
\usetikzlibrary{shapes,arrows,backgrounds}

有问题的框架如下:

\begin{frame}[label=review]
\frametitle{A review of the steps}
\setbeamercovered{transparent}
\begin{columns}
\column{0.4\linewidth}
\begin{enumerate}[<+->]
\item \alert<1>{Supernova detection.}
\item \alert<2>{Spectroscopic confirmation.}
\item \alert<3,6>{Multi-band photometry.}
\item \alert<4,6>{Parameter extraction.}
\item \alert<5,6>{Hubble diagram fit.}
\end{enumerate}
\column{0.7\linewidth}
\begin{center}
  \begin{tikzpicture}%[show background grid]
    \node[anchor=south west,inner sep=0] (step1) at (0,0) {\includegraphics[width=0.18\linewidth]{figures/pedagogy/03D4ag-zoom1.png}};
    \begin{scope}[x={(step1.south east)},y={(step1.north west)}]
      \draw<1>[red] (0,0) rectangle (1,1);
    \end{scope}
  \end{tikzpicture}
  \begin{tikzpicture}%[show background grid]
    \node[anchor=south west,inner sep=0] (step2) at (0,0) {\includegraphics[width=0.18\linewidth]{figures/guypres/1994D_spectrum.pdf}};
    \begin{scope}[x={(step2.south east)},y={(step2.north west)}]
      \draw<2>[red] (0,0) rectangle (1,1);
    \end{scope}
  \end{tikzpicture}
  \begin{tikzpicture}%[show background grid]
    \node[anchor=south west,inner sep=0] (step3) at (0,0) {\includegraphics[width=0.18\linewidth]{figures/03D4ag-lc.png}};
    \begin{scope}[x={(step3.south east)},y={(step3.north west)}]
      \draw<3>[red] (0,0) rectangle (1,1);
    \end{scope}
  \end{tikzpicture}
  \begin{tikzpicture}%[show background grid]
    \node[anchor=south west,inner sep=0] (step4) at (0,0) {\includegraphics[width=0.18\linewidth]{figures/03D4ag-lc-model.png}};
    \begin{scope}[x={(step4.south east)},y={(step4.north west)}]
      \draw<4>[red] (0,0) rectangle (1,1);
    \end{scope}
  \end{tikzpicture}
  \begin{tikzpicture}%[show background grid]
    \node[anchor=south west,inner sep=0] (step5) at (0,0) {\includegraphics[width=0.18\linewidth]{figures/pedagogy/hubblediagram.png}};
    \begin{scope}[x={(step5.south east)},y={(step5.north west)}]
      \draw<5>[red] (0,0) rectangle (1,1);
    \end{scope}
  \end{tikzpicture}
\end{center}
\end{columns}

\begin{overlayarea}{\textwidth}{\textheight}
\only<1>{
  \begin{center}
    \includegraphics[width=0.4\textwidth]{figures/pedagogy/03D4ag-zoom1.png}
    \hspace{0.2cm}
    \includegraphics[width=0.4\textwidth]{figures/pedagogy/03D4ag-zoom3.png}
  \end{center}
}
\only<2>{
  \begin{center}
    \includegraphics[width=0.7\textwidth]{figures/guypres/1994D_spectrum.pdf}
  \end{center}
}
\only<3-4>{
  \begin{center}
    \includegraphics[width=0.4\textwidth]{figures/03D4ag-lc.png}
    \hspace{0.2cm}
    \uncover<4>{
      \includegraphics[width=0.4\textwidth]{figures/03D4ag-lc-model.png}
    }
  \end{center}
}
\only<5>{
  \begin{center}
    \includegraphics[width=0.7\textwidth]{figures/pedagogy/hubblediagram.png}
  \end{center}
}
\end{overlayarea}

\end{frame}

我期望的行为是 03D4ag-lc.png 将显示在幻灯片 3 上,而 03D4ag-lc-model.png 将出现在幻灯片 4 上,而不会取代 03D4ag-lc.png。相反,03D4ag-lc-model.png 似乎完全忽略了该uncover命令,并且出现在两张幻灯片上。这是正常的吗?如果是,那么实现我在这里的目标的正确方法是什么?

答案1

transparent在您的代码中,您正在通过宏设置覆盖的效果\setbeamercovered{transparent}

正如 @JosephWright 所说,透明度对导入的图像不起作用,因此当您尝试使用以下方式发现导入的图像时,根本没有任何覆盖效果:

\uncover<4>{
  \includegraphics[width=0.4\textwidth]{figures/03D4ag-lc-model.png}
}

要隐藏图像,您需要使用以下方法重新设置透明效果

\setbeamercovered{invisible}

我建议把规范放在你的overlayarea以便它不会覆盖框架其余部分中的第一个设置。

您可能还想查看 Beamer 手册的第 17.6 节。

相关内容