I'm using the beamer package to create a presentation. Additionally I'd like to have a handout containing more information (as presentation slides should not contain much text). For this I use the article mode.
In order to allow my audience to take notes on their handouts, it would be helpful to have frame numbers on the handout. I accomplished this using the following code:
\mode<article>{
\renewcommand{\frametitle}[1]{\subsubsection*{#1 [Slide \insertframenumber]}}
}
This works perfectly well unless you insert section start frames using
\AtBeginSection[] % nothing for \section*{}
{
\begin{frame}
\begin{center}
\structure{\Huge \insertsection}
\end{center}
\end{frame}
}
The problem is that \AtBeginSection
doesn't work in article mode. The additional frames are not inserted and thus the frame numbering gets wrong.
So I did the following to fix this:
\mode<article>{ % repair frame numbers in article mode as there are no section start frames
\newcommand*\oldsectionmacro{}%
\let\oldsectionmacro\section%
\renewcommand*\section{%
\addtocounter{framenumber}{1}\oldsectionmacro}%
}
This works unless there is a \section*
. In this case the frame number is incremented but shouldn't as there is no section start frame. I could avoid using \section*
but there are also some implicit ones (table of contents, bibliography, ...).
Currently I correct this manually (see below) and it works for now but I don't like it. Is there a better way of doing so? Can I rewrite \section*
or have an \AtBeginSection
for article mode or insert the frame numbers in a different way?
Here is a small example to play around with:
\documentclass[a4paper]{scrartcl} % problem doesn't change if I use article instead
\usepackage{beamerarticle}
%\documentclass{beamer}
\usepackage[utf8]{inputenc}
\setbeamertemplate{footline}[frame number]
\mode<article>{
% frame number in frametitle
\renewcommand{\frametitle}[1]{\subsubsection*{#1 [Slide \insertframenumber]}}
}
% section start frame
% this has no effect in article mode
\AtBeginSection[] % nothing for \section*{}
{
\begin{frame}
\begin{center}
\structure{\Huge \insertsection}
\end{center}
\end{frame}
}
\mode<article>{ % repair frame numbers in article mode as there are no section start frames
\newcommand*\oldsectionmacro{}%
\let\oldsectionmacro\section%
\renewcommand*\section{%
\addtocounter{framenumber}{1}\oldsectionmacro}%
%
% \newcommand*\oldtocmacro{}%
% \let\oldtocmacro\tableofcontents%
% \renewcommand*\tableofcontents{%
% \addtocounter{framenumber}{-1}\oldtocmacro}
}
\begin{document}
\begin{frame}
\tableofcontents
\end{frame}
\section{Section 1}
\begin{frame}
\frametitle{Frame A}
Frame A
\end{frame}
\section{Section 2}
%\section*{Section Star}
\begin{frame}
\frametitle{Frame B}
Frame B
\end{frame}
\end{document}