我想用包含列表的自定义框架将 Beamer 演示文稿中的部分分开enumerate
。但是,使用带有的叠加规范会item
在每个部分的开头插入多个框架。作为初学者,我不明白如何修改代码这里来适应我的需要。
\documentclass{beamer}
\usetheme{Darmstadt}
\AtBeginSection[]{
\begin{frame}
\begin{block}{What have we learned?}
\begin{enumerate}
\item<2->{Beamer can insert slides at the beginning of sections}
\item<3->{But overlays force it to repeat all the overlays each time}
\end{enumerate}
\end{block}
\end{frame}
}
\begin{document}
\section{First section}
\begin{frame}
A slide with only the question should appear before this section
\end{frame}
\section{Second section}
\begin{frame}
Now, we should have seen the first item
\end{frame}
\section{Third section}
\begin{frame}
All items from AtBeginSection should be displayed before this slide
\end{frame}
\end{document}
分隔框应具有与目录中的章节标题不同的文本。如何才能在列表项数量不断增加的情况下实现自动章节分隔?
答案1
这做了类似的事情。(当列表为空时,更容易明确添加一张幻灯片。)列表通过以下方式构建:这些方法,然后你可以使用
\appenditem{<item>}
当下一部分开始时,将出现包含所有项目的列表。
\documentclass{beamer}
\usetheme{Darmstadt}
\usepackage{xparse}
\ExplSyntaxOn
\NewDocumentCommand{\appendto}{mm}
{
\tl_put_right:Nn #1 { #2 }
}
\NewDocumentCommand{\clear}{m}
{
\tl_clear_new:N #1
}
\ExplSyntaxOff
\clear\mylist
\newcommand{\appenditem}[1]{\appendto\mylist{\item<+-> #1}}
\begin{document}
\begin{frame}
\begin{block}{What have we learned?}
\end{block}
\end{frame}
\section{First section}
\begin{frame}
A slide with only the question should appear before this section
\end{frame}
\AtBeginSection[]{\begin{frame}\begin{block}{What have we learned?}
\begin{enumerate}%
\mylist
\end{enumerate}
\end{block}
\end{frame}}
\appenditem{Beamer can insert slides at the beginning of sections}
\section{Second section}
\begin{frame}
Now, we should have seen the first item
\end{frame}
\appenditem{But overlays force it to repeat all the overlays each time}
\section{Third section}
\begin{frame}
All items from AtBeginSection should be displayed before this slide
\end{frame}
\end{document}