39

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.

2
  • 1
    Welcome to the site, Minirogue. Jun 4, 2013 at 18:43
  • I think this thread is not fully covered. At least, the output of the accepted answer is not nice enough. Dec 28, 2016 at 17:43

1 Answer 1

40

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

5
  • I think I may want to modify some of this to my preferences, but this is exactly what I was looking for. Thanks!
    – Minirogue
    Jun 5, 2013 at 16:17
  • 1
    I tried to just use \AtBeginSection{\frame{\sectionpage}}, I get a ! Missing \endgroup inserted. at the very end of the document. Do you have an idea what is causing this or should I ask a full question? Jul 24, 2014 at 17:11
  • 6
    Is there a way to remove the "Section X" over title and have just the actual section title? Jul 22, 2015 at 13:00
  • 3
    Yes, on the code above just delete this part: \begin{centering} {\usebeamerfont{subsubsection name}\usebeamercolor[fg] {subsubsection name}\subsubsectionname~\insertsubsubsectionnumber} \vskip1em\par
    – blmayer
    Jan 15, 2016 at 3:43
  • @BrianMayer I cannot reproduce your proposal. It is a just reproduction of diobonas proposal. - - Please, post a full answer if you think you can answer Luis' question. Dec 28, 2016 at 17:42

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .