Beamerpauses 計數器在覆蓋層內的環境之間重置?

Beamerpauses 計數器在覆蓋層內的環境之間重置?

我正在閱讀這個問題的答案將疊印與枚舉區塊混合

[我重新複製了程式碼,因此您不必點擊連結]

\documentclass{beamer}
\usetheme{Warsaw}

\begin{document}

\begin{frame}{Test}
  \begin{center}
  text before
  \pause
  \begin{overlayarea}{\textwidth}{3.3cm}
    \only<2-3>{%
        \begin{block}{Some title here}
        \begin{enumerate}[<+->]
        \item One
        \item Two
        \end{enumerate}
        \end{block}}
    \only<4-7>{%
    \begin{block}{Some title here}
        \begin{enumerate}[<+(2)->]
        \item CHicken
        \item Duck
        \item Rooster
        \end{enumerate}
        \end{block}}
  \end{overlayarea}
  text after
  \end{center}
\end{frame}

\end{document}

我注意到在第二個環境中的預設增量覆蓋規範中使用了括號之間的數字enumerate。 (參見 的存在[<+(2)->])只有這樣,環境中第二個編號清單的項目才會overlayarea逐漸被發現。

為什麼需要這個?似乎暗示環境beamerpauses之間已重置enumerate?或者它是在環境only中的命令之間重置的嗎overlay

這不是一種令人厭惡的行為嗎?因為就好像你應該跟蹤自己的光束暫停一樣。那麼的用處[<+->]就失去了,不是嗎?

答案1

透過檢查以下簡單範例可以解釋這種明顯奇怪的現象:

\documentclass{beamer}

\newcommand\showpauses{The value of beamerpauses at this point in slide \insertpagenumber\ is: \thebeamerpauses}

\begin{document}

\begin{frame}{Test}
\only<1-2>{\par\showpauses%
\begin{enumerate}[<+->]
  \item One \showpauses
  \item Two \showpauses
\end{enumerate}
}
\only<3>{\par\showpauses}
\end{frame}

\end{document}

beamerpauses處理完文件後,您將看到一個三張投影片的簡報,顯示不同階段的計數器值。

到第二張投影片為止,一切都如預期進行:在enumerate第二張投影片的結尾, 的值為beamerpauses3;然而,在第三張投影片上,beamerpauses1.為什麼會發生這樣的事?嗯,因為 的覆蓋規範\only1-2,所以一切發生在投影片 1 和 2 的情況將只發生在這些投影片上;特別是,beamerpauses由枚舉產生的步進將產生影響僅有的對於幻燈片一和二。在不受 影響的第三張投影片中,\only計數器beamerpauses將具有先前的值。

這是否表示有什麼問題beamer?我不這麼認為;畢竟, 的預期含義\only是將事物置於其範圍內僅有的對於指定的幻燈片。

如果您使用<1->(或<1-3>) 來代替<1-2>上面的範例,如

\documentclass{beamer}

\newcommand\showpauses{The value of beamerpauses at this point in slide \insertpagenumber\ is: \thebeamerpauses}

\begin{document}

\begin{frame}{Test}
\only<1->{\par\showpauses%
\begin{enumerate}[<+->]
  \item One \showpauses
  \item Two \showpauses
\end{enumerate}
}
\only<3>{\par\showpauses}
\end{frame}

您將看到現在在第三張投影片上計數器的值為 3,因為第三張投影片位於 的範圍內\only

原始範例中計數器的「骯髒」手動增量僅是由於OP想要實現的特殊效果。也許可以透過另一種方式實現相同的效果,而無需人工幹預?

相關內容