Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Option to create an appendix with proper frame number counting #12

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 59 additions & 5 deletions beamerthemetudo.sty
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,15 @@
\newif\if@showtotalframes\@showtotalframesfalse
\DeclareOption{showtotalframes}{\@showtotalframestrue}

\newif\if@showframes\@showframesfalse
\DeclareOption{showframes}{\@showframestrue}

\newif\if@showappendixframes\@showappendixframesfalse
\DeclareOption{showappendixframes}{\@showappendixframestrue}

\newcounter{insideappendix}
\newcommand*\appendixfootline{\section{}\setcounter{insideappendix}{1}}

\newif\if@dark\@darkfalse
\DeclareOption{dark}{\@darktrue}
\ProcessOptions
Expand Down Expand Up @@ -103,7 +112,50 @@

\setbeamertemplate{footline}
{%
\ifnum\insertframenumber=1%
\ifnum\theinsideappendix=0%
\ifnum\insertframenumber=1%
\else%
\leavevmode%
\begin{beamercolorbox}[
wd=\footerleftwidth,
ht=4ex,
dp=10pt,
leftskip=\beamer@leftmargin,
]{author in head/foot}%
{\usebeamerfont{author in head/foot}\insertshortauthor}%
\ifx\beamer@shortdate\empty\else%
~|~{\usebeamerfont{date in head/foot}\insertshortdate}%
\fi%
\end{beamercolorbox}%
\begin{beamercolorbox}[
wd=\footercenterwidth,
ht=3ex,
dp=10pt,
center,
]{section in head/foot}%
\ifx\insertsection\empty%
\else%
\usebeamerfont{section in head/foot}\insertsection%
\ifx\insertsubsection\empty%
\else%
:~\usebeamerfont{subsection in head/foot}\insertsubsection%
\fi
\fi%
\end{beamercolorbox}%
\begin{beamercolorbox}[
wd=\footerrightwidth,
ht=4ex,
dp=10pt,
]{frame}%
\if@showframes%
\raggedleft%
\usebeamerfont{framenumber}\insertframenumber%
\if@showtotalframes%
~/~\inserttotalframenumber%
\fi%
\fi%
\end{beamercolorbox}%
\fi%
\else%
\leavevmode%
\begin{beamercolorbox}[
Expand Down Expand Up @@ -137,10 +189,12 @@
ht=4ex,
dp=10pt,
]{frame}%
\raggedleft%
\usebeamerfont{framenumber}\insertframenumber%
\if@showtotalframes%
~/~\inserttotalframenumber%
\if@showappendixframes%
\raggedleft%
\usebeamerfont{framenumber}\insertframenumber%
\if@showtotalframes%
~/~\inserttotalframenumber%
\fi%
\fi%
\end{beamercolorbox}%
\fi%
Expand Down
15 changes: 15 additions & 0 deletions example.tex
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,14 @@
\usepackage{hyperref}
\usepackage{bookmark}

\usepackage{appendixnumberbeamer}

% load the theme after all packages

\usetheme[
showtotalframes, % show total number of frames in the footline
showframes, % show number of frames in the footline
showappendixframes, % show number of frames in the footline of the appendix
% dark, % optional dark theme, uncomment to use
]{tudo}

Expand Down Expand Up @@ -91,4 +95,15 @@ \section{Fonts}
\nabla \times \symbf{B} &= μ_0 \symbf{j} + μ_0 ε_0 \partial_t \symbf{E} &
\end{align*}
\end{frame}

\appendix
\appendixfootline

\begin{frame}{Appendix}
This is the first appendix page.
\end{frame}

\begin{frame}{Appendix}
This is the second appendix page.
\end{frame}
\end{document}