Beamer – How to Automatically Generate Section Title Slides

beamersectioning

Is there a way to get beamer to automatically stick in a slide with a centered title whenever I use \section{title} or \subsection{title} or (heaven forbid) \subsubsection{title}? I'm hoping some package or command will do this for every time one of these commands is used, but I would settle for a \maketitle type command that would work within each section or subsection.

Best Answer

You can use the macros \AtBeginSection, \AtBeginSubsection and \AtBeginSubsubsection to automatically execute something at the beginning of each (sub)(sub)section. To create a title frame, beamer offers the commands \sectionpage and \subsectionpage. \subsubsectionpage is missing by default, but you can easily define it yourself:

\documentclass{beamer}

\usetheme{Ilmenau}

% Add support for \subsubsectionpage
\def\subsubsectionname{\translate{Subsubsection}}
\def\insertsubsubsectionnumber{\arabic{subsubsection}}
\setbeamertemplate{subsubsection page}
{
  \begin{centering}
    {\usebeamerfont{subsubsection name}\usebeamercolor[fg]{subsubsection name}\subsubsectionname~\insertsubsubsectionnumber}
    \vskip1em\par
    \begin{beamercolorbox}[sep=4pt,center]{part title}
      \usebeamerfont{subsubsection title}\insertsubsubsection\par
    \end{beamercolorbox}
  \end{centering}
}
\def\subsubsectionpage{\usebeamertemplate*{subsubsection page}}

\AtBeginSection{\frame{\sectionpage}}
\AtBeginSubsection{\frame{\subsectionpage}}
\AtBeginSubsubsection{\frame{\subsubsectionpage}}

\begin{document}
\section{Section 1}
\subsection{Subsection 1}
\frame{}\frame{}
\subsection{Subsection 2}
\subsubsection{Subsubsection 1}
\frame{}
\section{Section 2}
\frame{}
\end{document}

a \subsubsectionpage