1

I would like to separate my sections in a beamer presentation with a custom frame that contains an enumerate list. However, using overlay specifications with item inserts multiple frames at the beginning of each section. Being a beginner, I do not understand how to modify the code here to adjust it to my needs.

\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}

The separator frames should have a different text to section titles in TOC. How can I achieve an automated section separation with a growing number of listed items?

nya
  • 113

1 Answers1

2

This does something of that sort. (When the list is empty, it is easier to add one slide explicitly.) A list is built with these methods, and you can add an item to the list with

\appenditem{<item>}

When the next section starts, a list with all items appears.

\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}

enter image description here