考虑以下 MWE:
\documentclass{beamer}
\begin{document}
\begin{frame}
\begin{itemize}[<+-|alert@+>]
\item Foo
\item Bar
\begin{quote}
God doesn't play dice with the world
\end{quote}
\item Hello
\item World
\end{itemize}
\end{frame}
\end{document}
得出的结果为:
正如您所注意到的,引用的文本被视为一个项目。对我来说,更自然的预期是,当第二个项目bar
被发现时,引用的文本也会被发现(并发出警报)。毕竟,bar
文本构成了一个项目。我的期望错了吗?我如何才能获得预期的行为?
顺便提一句:如果你quote
用替换center
那么预期的行为就会发生......
答案1
问题在于,quote
中的beamer
被定义为一个可感知覆盖的列表,因此您对itemize
环境的覆盖规范也会影响中\item
的(“隐藏”) quote
;这是中的定义beamerbaselocalstructure.sty
:
\newenvironment<>{quote}
{\actionenv#1%
\usebeamertemplate{quote begin}%
\usebeamerfont{quote}%
\usebeamercolor{quote}%
\list{}{\rightmargin \leftmargin}
\item\relax}
{\endlist\usebeamertemplate{quote end}\endactionenv}
如果你想要一个各方面都类似的环境quote
,但没有覆盖感知,你可以使用
\newenvironment{myquote}
{%
\usebeamertemplate{quote begin}%
\usebeamerfont{quote}%
\usebeamercolor{quote}%
\list{}{\rightmargin \leftmargin}
\item\relax}
{\endlist\usebeamertemplate{quote end}}
一个完整的例子
\documentclass{beamer}
\newenvironment{myquote}
{%
\usebeamertemplate{quote begin}%
\usebeamerfont{quote}%
\usebeamercolor{quote}%
\list{}{\rightmargin\leftmargin}
\item\relax}
{\endlist\usebeamertemplate{quote end}}
\begin{document}
\begin{frame}
\begin{itemize}[<+-|alert@+>]
\item Foo
\item Bar
\begin{quote}
God doesn't play dice with the world
\end{quote}
\item Hello
\item World
\end{itemize}
\begin{itemize}[<+-|alert@+>]
\item Foo
\item Bar
\begin{myquote}
God doesn't play dice with the world
\end{myquote}
\item Hello
\item World
\end{itemize}
\end{frame}
\end{document}
另一个选择是手动更正计数器beamerpauses
,可以使用quote
带有“点”修饰符的覆盖规范来完成<.->
\documentclass{beamer}
\begin{document}
\begin{frame}
\begin{itemize}[<+-|alert@+>]
\item Foo
\item Bar
\begin{quote}<.->
God doesn't play dice with the world
\end{quote}
\item Hello
\item World
\end{itemize}
\end{frame}
\end{document}
或者手动:
\documentclass{beamer}
\begin{document}
\begin{frame}
\begin{itemize}[<+-|alert@+>]
\item Foo
\item Bar\addtocounter{beamerpauses}{-1}
\begin{quote}
God doesn't play dice with the world
\end{quote}
\item Hello
\item World
\end{itemize}
\end{frame}
\end{document}