Beamer 中的块叠加

Beamer 中的块叠加

blocks在幻灯片中列出了几项:

\begin{block}{block 1}
  block 1
\end{block}
\begin{block}{block 2}
  block 2
\end{block}
\begin{block}{block 2}
  block 2
\end{block}

有人知道如何将它们叠加以便通过单击鼠标左键逐块显示它们吗?

答案1

三种方式(取决于您希望它们如何出现,可能还有其他可能性):

\documentclass{beamer}

\begin{document}
\begin{frame}
\onslide<+->{\begin{block}{block 1}
  block 1
\end{block}}
\onslide<+->{\begin{block}{block 2}
  block 2
\end{block}}
\onslide<+->{\begin{block}{block 3}
  block 3
\end{block}}
\end{frame}

\begin{frame}
\only<1>{\begin{block}{block 1}
  block 1
\end{block}}
\only<2>{\begin{block}{block 2}
  block 2
\end{block}}
\only<3>{\begin{block}{block 3}
  block 3
\end{block}}
\end{frame}

\begin{frame}
\begin{block}{block 1}
  block 1
\end{block}\pause
\begin{block}{block 2}
  block 2
\end{block}\pause
\begin{block}{block 3}
  block 3
\end{block}
\end{frame}

\end{document}

答案2

还有一个较短的版本,它利用了 beamer 块的覆盖感知:\begin{block}<only@1>{title}......

梅威瑟:

\documentclass{beamer}

\usetheme{Warsaw}

\begin{document}
    
\begin{frame}
\begin{block}<only@1->{block 1}
  block 1
\end{block}
\begin{block}<2->{block 2}
  block 2
\end{block}
\begin{block}<3->{block 2}
  block 2
\end{block}

\end{frame} 
    
\end{document}

在此处输入图片描述

相关内容