1

I am using the beamer class for a presentation and I want to include additional material for some contents as appendices.

MWE:

\documentclass{beamer}
\usepackage{appendixnumberbeamer}
\usetheme{Frankfurt}
\usecolortheme{beaver}
\useinnertheme{rounded}
\setbeamertemplate{footline}
{
\leavevmode%
\hbox{\begin{beamercolorbox}[wd=.3\paperwidth,ht=2.5ex,dp=1.125ex]{author in head/foot}%
\usebeamerfont{author in head/foot}\centering\insertshortauthor%
\end{beamercolorbox}%
\begin{beamercolorbox}[wd=.6\paperwidth,ht=2.5ex,dp=1.125ex]{institute in head/foot}%
\usebeamerfont{institute in head/foot}\centering\insertshorttitle%
\end{beamercolorbox}%
\begin{beamercolorbox}[wd=.1\paperwidth,ht=2.5ex,dp=1.125ex,leftskip=.3cm ,rightskip=.3cm plus1fil]{title in head/foot}%
\usebeamerfont{title in head/foot}\hfill\insertframenumber/\inserttotalframenumber%
\end{beamercolorbox}}%
\vskip0pt%
}%
\begin{document}
\begin{frame}
Content 1
\end{frame}
\begin{frame}
Content 2
\end{frame}
\begin{frame}
Content 3
\end{frame}
\begin{frame}
Content 3
\end{frame}
\appendix
\begin{frame}
additional material for content 1
\end{frame}
\begin{frame}
additional material for content 1
\end{frame}
\begin{frame}
additional material for content 1
\end{frame}
\begin{frame}
additional material for content 2
\end{frame}
\begin{frame}
additional material for content 2
\end{frame}
\begin{frame}
additional material for content 2
\end{frame}
\begin{frame}
additional material for content 2
\end{frame}
\begin{frame}
additional material for content 2
\end{frame}
\end{document}

How can I get LaTeX to number each of the appendices indivudally? Using multiple \appendix commands does not work (the number of pages is not displayed correctly).

  • Normally appendices are treated as sections (beamer class supports sections). – John Kormylo May 10 '17 at 15:13
  • Where should the number of the appendix be shown? What do you expect the framennumbering to be? – user36296 May 10 '17 at 16:09
  • I want the additional material for content 1 to be numbered 1/3, 2/3, 3/3 and the additional material for content 2 to be numbered 1/5, 2/5, 3/5, 4/5, 5/5 – Martin May 11 '17 at 7:52
1

Based on https://tex.stackexchange.com/a/285383/36296 and https://tex.stackexchange.com/a/303757/36296

\documentclass{beamer}
\usepackage{appendixnumberbeamer}
\usetheme{Frankfurt}
\usecolortheme{beaver}
\useinnertheme{rounded}
\setbeamertemplate{footline}
{
\leavevmode%
\hbox{\begin{beamercolorbox}[wd=.3\paperwidth,ht=2.5ex,dp=1.125ex]{author in head/foot}%
\usebeamerfont{author in head/foot}\centering\insertshortauthor%
\end{beamercolorbox}%
\begin{beamercolorbox}[wd=.6\paperwidth,ht=2.5ex,dp=1.125ex]{institute in head/foot}%
\usebeamerfont{institute in head/foot}\centering\insertshorttitle%
\end{beamercolorbox}%
\begin{beamercolorbox}[wd=.1\paperwidth,ht=2.5ex,dp=1.125ex,leftskip=.3cm ,rightskip=.3cm plus1fil]{title in head/foot}%
\usebeamerfont{title in head/foot}\hfill\insertframenumber/\inserttotalframenumber%
\end{beamercolorbox}}%
\vskip0pt%
}%


\makeatletter
\newcount\beamer@sectionstartframe
\beamer@sectionstartframe=1
\apptocmd{\beamer@section}{\addtocontents{nav}{\protect\headcommand{%
            \protect\beamer@sectionframes{\the\beamer@sectionstartframe}{\the\c@framenumber}}}}{}{}
\apptocmd{\beamer@section}{\beamer@sectionstartframe=\c@framenumber\advance\beamer@sectionstartframe by1\relax}{}{}
\AtEndDocument{\immediate\write\@auxout{\string\@writefile{nav}%
        {\noexpand\headcommand{\noexpand\beamer@sectionframes{\the\beamer@sectionstartframe}{\the\c@framenumber}}}}}{}{}
\def\beamer@startframeofsection{1}
\def\beamer@endframeofsection{1}
\def\beamer@sectionframes#1#2{%
    \ifnum\c@framenumber<#1%
    \else%
    \ifnum\c@framenumber>#2%
    \else%
    \gdef\beamer@startframeofsection{#1}%
    \gdef\beamer@endframeofsection{#2}%
    \fi%
    \fi%
}
\newcommand\insertsectionstartframe{\beamer@startframeofsection}
\newcommand\insertsectionendframe{\beamer@endframeofsection}
\makeatother

\usepackage{tikz}
\usetikzlibrary{calc}

\def\inserttotalsectionframenumber{%
    \pgfmathparse{(\insertsectionendframe-\insertsectionstartframe+1)}%
    \pgfmathprintnumber[fixed,precision=2]{\pgfmathresult}%
}

\def\insertsectionframenumber{%
    \pgfmathparse{(\insertframenumber-\insertsectionstartframe+1)}%
    \pgfmathprintnumber[fixed,precision=2]{\pgfmathresult}%
}

\defbeamertemplate{footline}{page number appendix}
{
\leavevmode%
\hbox{\begin{beamercolorbox}[wd=.3\paperwidth,ht=2.5ex,dp=1.125ex]{author in head/foot}%
\usebeamerfont{author in head/foot}\centering\insertshortauthor%
\end{beamercolorbox}%
\begin{beamercolorbox}[wd=.6\paperwidth,ht=2.5ex,dp=1.125ex]{institute in head/foot}%
\usebeamerfont{institute in head/foot}\centering\insertshorttitle%
\end{beamercolorbox}%
\begin{beamercolorbox}[wd=.1\paperwidth,ht=2.5ex,dp=1.125ex,leftskip=.3cm ,rightskip=.3cm plus1fil]{title in head/foot}%
\usebeamerfont{title in head/foot}\hfill%
\insertsectionframenumber/\inserttotalsectionframenumber
\end{beamercolorbox}}%
\vskip0pt%
}

\makeatletter
\g@addto@macro\appendix{%
    \setbeamertemplate{footline}[page number appendix]%
}
\makeatother


\begin{document}
\begin{frame}
Content 1
\end{frame}
\begin{frame}
Content 2
\end{frame}
\begin{frame}
Content 3
\end{frame}
\begin{frame}
Content 3
\end{frame}
\appendix
\section[]{add. Content 1}
\begin{frame}
additional material for content 1
\end{frame}
\begin{frame}
additional material for content 1
\end{frame}
\begin{frame}
additional material for content 1
\end{frame}
\section[]{add. Content 2}
\begin{frame}
additional material for content 2
\end{frame}
\begin{frame}
additional material for content 2
\end{frame}
\begin{frame}
additional material for content 2
\end{frame}
\begin{frame}
additional material for content 2
\end{frame}
\begin{frame}
additional material for content 2
\end{frame}
\end{document}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.