I leave my original answer. Some possible changes according to the edit in the question are listed below. A little piece to cover all the details of the question is still missing and explained in the last section.
Original answer
I tried to find a solution within the following design principles:
- No changes in the files
include.tex
, deck_1.tex
, deck_1_slides.tex
, such that the individual slide sets remain unchanged.
- Usage of high-level commands, when possible.
- Usage of as few additional packages as possible. In my solution only
nameref
is needed.
This led to the following solution (the full code and the image of the "Grand TOC" are posted below):
- The changes are all made in a main file named
handout.tex
, there the slide files (e.g. deck_1_slide.tex
) are loaded with included with input
I use the part
option of \tableofcontents
in the beamer
class. Therefore I redifined \subtitle
\let\origSubtitle\subtitle
\renewcommand{\subtitle}[1]{%
\origSubtitle{#1}%
\stepcounter{chapter} \part{\thechapter}%
\labelname{#1} \label{chapter:\thechapter}}
To change the numbering style I adjusted the beamertemplate footline
. (In the example code below I adapted it to the outer theme infolines
.)
- Since this numbering style can not be used at the beginning for the "Grand TOC" `footline``is changed locally once more.
To get the desired numbering in the table of contents I used the short sectiontitle ability. Hence the redefinition of \section
\makeatletter
\let\origSection\section
\def\section#1{\stepcounter{framenumber} \origSection[#1]{#1 \dotfill \ \insertpartnumber{} / \arabic{framenumber}} \addtocounter{framenumber}{-1}}
\makeatother
Finally I define a new command \grandtoc
which take the "part"-number as input, to set the "Grand TOC".
Full code (deck_2.tex
and deck_2_slides.tex
have the same form as there counterparts deck_1.tex
and deck_1_slides.tex
):
% handout.tex
\input{include.tex}
% Outher theme to have running numbers at the bottom
\useoutertheme{infolines}
\institute{Institute}
\date{yyyy-mm-dd}
\usepackage{nameref} % new package
\makeatletter
\newcommand{\labelname}[1]{\def\@currentlabelname{#1}}
\makeatother
\newcounter{chapter}
% redefinition fo subtitle
\let\origSubtitle\subtitle
\renewcommand{\subtitle}[1]{%
\origSubtitle{#1}%
\stepcounter{chapter} \part{\thechapter}%
\labelname{#1} \label{chapter:\thechapter}}
\makeatletter
\setbeamertemplate{footline}
{
\leavevmode%
\hbox{%
\begin{beamercolorbox}[wd=.333333\paperwidth,ht=2.25ex,dp=1ex,center]{author in head/foot}%
\usebeamerfont{author in head/foot}\insertshortauthor~~\beamer@ifempty{\insertshortinstitute}{}{(\insertshortinstitute)}
\end{beamercolorbox}%
\begin{beamercolorbox}[wd=.333333\paperwidth,ht=2.25ex,dp=1ex,center]{title in head/foot}%
\usebeamerfont{title in head/foot}\insertshorttitle
\end{beamercolorbox}%
\begin{beamercolorbox}[wd=.333333\paperwidth,ht=2.25ex,dp=1ex,right]{date in head/foot}%
\usebeamerfont{date in head/foot}\insertshortdate{}\hspace*{2em}
\insertpartnumber{} / \insertframenumber\hspace*{2ex}
\end{beamercolorbox}}%
\vskip0pt%
}
\makeatother
\AtBeginPart{\setcounter{framenumber}{0}}
% redinition of section
\makeatletter
\let\origSection\section
\def\section#1{\stepcounter{framenumber} \origSection[#1]{#1 \dotfill \ \insertpartnumber{} / \arabic{framenumber}} \addtocounter{framenumber}{-1}}
\makeatother
\newcommand{\grandtoc}[1]
{%
{\usebeamercolor[fg]{structure} \nameref{chapter:#1}}%
\tableofcontents[part=#1,sectionsstyle=show,subsectionstyle=hide]%
}
\begin{document}
{
\makeatletter
\setbeamertemplate{footline}
{
\leavevmode%
\hbox{%
\begin{beamercolorbox}[wd=.333333\paperwidth,ht=2.25ex,dp=1ex,center]{author in head/foot}%
\usebeamerfont{author in head/foot}\insertshortauthor~~\beamer@ifempty{\insertshortinstitute}{}{(\insertshortinstitute)}
\end{beamercolorbox}%
\begin{beamercolorbox}[wd=.333333\paperwidth,ht=2.25ex,dp=1ex,center]{title in head/foot}%
\usebeamerfont{title in head/foot}\insertshorttitle
\end{beamercolorbox}%
\begin{beamercolorbox}[wd=.333333\paperwidth,ht=2.25ex,dp=1ex,right]{date in head/foot}%
\usebeamerfont{date in head/foot}\insertshortdate{}\hspace*{2em}
\end{beamercolorbox}}%
\vskip0pt%
}
\makeatother
\begin{frame}
\titlepage
\end{frame}
\begin{frame}
\frametitle{Grand TOC}
\grandtoc{1}
\grandtoc{2}
\end{frame}
}
\input{deck_1_slides.tex}
\input{deck_2_slides.tex}
\end{document}
This results in the following "Grand TOC":

Changes (to be made to answer the edited question)
To do not reset the framenumber for a new part delete the line \AtBeginPart{\setcounter{framenumber}{0}}
.
To reset the section number for each part include (following this)
\makeatletter
\AtBeginPart{%
\beamer@tocsectionnumber=0\relax
\setcounter{section}{0}
}
\makeatother
Attention: You can only have one active \AtBeginPart
. To reset the framenumber and the section number, merge them together.
To have (almost) the desired numbering style of the "Grand TOC" replace the redefinition of \section
and the definition of \grandtoc
with
% redinition of section
\makeatletter
\let\origSection\section
\def\section#1{\stepcounter{framenumber} \origSection[#1]{#1 \hfill \ \insertpartnumber{} -- \arabic{framenumber}} \addtocounter{framenumber}{-1}}
\makeatother
\newcommand{\grandtoc}[1]
{%
{\usebeamercolor[fg]{structure} #1 \nameref{chapter:#1}}%
\setbeamertemplate{section in toc}{#1.\inserttocsectionnumber~\inserttocsection}
\tableofcontents[part=#1,sectionsstyle=show,subsectionstyle=hide]%
}
To have the "Deck TOC" formatted accordingly do the following (in contrast to my design principles - but I have no other idea):
- Add
\newcommand{\grandtoc}[1]{\tableofcontents}
and \renewcommand{\thepart}{0}
to the preamble of every deck_n.tex
.
- Replace in every
deck_n_slides.tex
\tableofcontents
with \grandtoc{\thepart}
With this two command the style of compiling a single deck will not be altered, but for the book, the "Deck TOC" is redefined.
With these changes the "Grand TOC" now looks as follows.

What is still missing
For the TOC there is no framenumber shown for the start of the different parts. The main reason therefore is, that with my solution the part title is not stored in the .toc
-file but typeset directly. To include really the parts into the .toc
, one might use ideas from here. However, I assume,that this would lead to major necessary changes in other parts of the solution presented. Additionally, the difficulty described above is the reason, why title of parts are not aligned properly.
pgfpages
package might help you. Check this link.a-lecture
folder in yourLaTeX
distribution contains a nice example mixing abeamer
presentation and its printed (book) version. (links point to CTAN corresponding folder and files)\input{lsp_include.tex}
should be\input{include.tex}
, where\input{include.tex}
is your first code snippet. (2) If I compile it I have no running number at the bottom. Do you use a specific outer theme (infolines
for example)?