Merge pull request #190 from rchurchley/subsection-page

Add support for subsections
This commit is contained in:
Matthias Vogelgesang 2016-03-09 10:22:06 +01:00
commit 6b70b210b5
2 changed files with 75 additions and 24 deletions

View File

@ -356,6 +356,12 @@ The list of options is structured as shown in the following example.
disables the section page.
}
\DescribeOption{subsectionpage}{none, simple, progressbar}{none}{
Optionally adds a slide at the start of each subsection. If enabled with
the |simple| or |progressbar| options, the style of the |section page| will
be updated to match the style of the |subsection page|.
}
\subsubsection{Outer theme}

View File

@ -57,14 +57,31 @@
% \subsubsection{Options}
%
% \begin{macro}{sectionpage}
% The |sectionpage| option defines the behaviour of the sectionpage.
% Optionally add a slide marking the beginning of each section.
% \begin{macrocode}
\pgfkeys{
/metropolis/inner/sectionpage/.cd,
.is choice,
none/.code=\metropolis@sectionpage@none,
simple/.code=\metropolis@sectionpage@simple,
progressbar/.code=\metropolis@sectionpage@progressbar,
none/.code=\metropolis@disablesectionpage,
simple/.code={\metropolis@enablesectionpage
\setbeamertemplate{section page}[simple]},
progressbar/.code={\metropolis@enablesectionpage
\setbeamertemplate{section page}[progressbar]},
}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{sectionpage}
% Optionally add a slide marking the beginning of each subsection.
% \begin{macrocode}
\pgfkeys{
/metropolis/inner/subsectionpage/.cd,
.is choice,
none/.code=\metropolis@disablesubsectionpage,
simple/.code={\metropolis@enablesubsectionpage
\setbeamertemplate{section page}[simple]},
progressbar/.code={\metropolis@enablesubsectionpage
\setbeamertemplate{section page}[progressbar]},
}
% \end{macrocode}
% \end{macro}
@ -75,6 +92,7 @@
\newcommand{\metropolis@inner@setdefaults}{
\pgfkeys{/metropolis/inner/.cd,
sectionpage=progressbar,
subsectionpage=none
}
}
% \end{macrocode}
@ -234,26 +252,17 @@
% Template for the section title slide at the beginning of each section.
%
% \begin{macrocode}
\newcommand{\metropolis@sectionpage@none}{
\AtBeginSection{
% intenionally empty
}
}
\defbeamertemplate{section page}{simple}{
\centering
\usebeamercolor[fg]{section title}
\usebeamerfont{section title}
\insertsectionhead\\
}
\newcommand{\metropolis@sectionpage@simple}{
\setbeamertemplate{section page}[simple]
\AtBeginSection{
\ifbeamer@inframe
\sectionpage
\else
\frame[plain,c,noframenumbering]{\sectionpage}
\begin{center}
\usebeamercolor[fg]{section title}
\usebeamerfont{section title}
\insertsectionhead\par
\ifx\insertsubsection\@empty\else
\usebeamercolor[fg]{subsection title}
\usebeamerfont{subsection title}
\insertsubsection
\fi
}
\end{center}
}
\defbeamertemplate{section page}{progressbar}{
\centering
@ -263,12 +272,22 @@
\usebeamerfont{section title}
\insertsectionhead\\[-1ex]
\usebeamertemplate*{progress bar in section page}
\par
\ifx\insertsubsection\@empty\else%
\usebeamercolor[fg]{subsection title}%
\usebeamerfont{subsection title}%
\insertsubsection
\fi
\end{minipage}
\par
\vspace{\baselineskip}
}
\newcommand{\metropolis@sectionpage@progressbar}{
\setbeamertemplate{section page}[progressbar]
\newcommand{\metropolis@disablesectionpage}{
\AtBeginSection{
% intentionally empty
}
}
\newcommand{\metropolis@enablesectionpage}{
\AtBeginSection{
\ifbeamer@inframe
\sectionpage
@ -280,6 +299,32 @@
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{subsection page}
%
% Template for the subsection title slide that can optionally be added to
% at the beginning of each subsection.
%
% \begin{macrocode}
\setbeamertemplate{subsection page}{%
\usebeamertemplate*{section page}
}
\newcommand{\metropolis@disablesubsectionpage}{
\AtBeginSubsection{
% intentionally empty
}
}
\newcommand{\metropolis@enablesubsectionpage}{
\AtBeginSubsection{
\ifbeamer@inframe
\subsectionpage
\else
\frame[plain,c,noframenumbering]{\subsectionpage}
\fi
}
}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{progress bar in section page}
%
% Template for the progress bar displayed by default on the section page.