From e0c6872cf40896c7be36b11dcc744620f10adf1d Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Mon, 2 Sep 2019 13:46:59 +0900 Subject: Initial commit --- .../beamer-contrib/appendixnumberbeamer/README.md | 14 +++++ .../beamer-contrib/appendixnumberbeamer/VERSION | 1 + .../appendixnumberbeamer/appendixnumberbeamer.sty | 67 ++++++++++++++++++++++ 3 files changed, 82 insertions(+) create mode 100644 macros/latex/contrib/beamer-contrib/appendixnumberbeamer/README.md create mode 100644 macros/latex/contrib/beamer-contrib/appendixnumberbeamer/VERSION create mode 100644 macros/latex/contrib/beamer-contrib/appendixnumberbeamer/appendixnumberbeamer.sty (limited to 'macros/latex/contrib/beamer-contrib/appendixnumberbeamer') diff --git a/macros/latex/contrib/beamer-contrib/appendixnumberbeamer/README.md b/macros/latex/contrib/beamer-contrib/appendixnumberbeamer/README.md new file mode 100644 index 0000000000..e3c9320750 --- /dev/null +++ b/macros/latex/contrib/beamer-contrib/appendixnumberbeamer/README.md @@ -0,0 +1,14 @@ +# appendixnumberbeamer.sty + +This package fixes the frame numbering in `beamer` when using an appendix +such that the slides of the appendix are not counted in the total frame +number of the main part of the document. The total frame number counter +is reset to 0 when entering the appendix. + +The standard usage is to include `\usepackage{appendixnumberbeamer}` in +the preamble and then declare the beginning of the appendix as usual +using the `\appendix` command. + +This package is also available from +http://www.ctan.org/pkg/appendixnumberbeamer and is included in the +TeXLive and MiKTeX distributions \ No newline at end of file diff --git a/macros/latex/contrib/beamer-contrib/appendixnumberbeamer/VERSION b/macros/latex/contrib/beamer-contrib/appendixnumberbeamer/VERSION new file mode 100644 index 0000000000..5625e59da8 --- /dev/null +++ b/macros/latex/contrib/beamer-contrib/appendixnumberbeamer/VERSION @@ -0,0 +1 @@ +1.2 diff --git a/macros/latex/contrib/beamer-contrib/appendixnumberbeamer/appendixnumberbeamer.sty b/macros/latex/contrib/beamer-contrib/appendixnumberbeamer/appendixnumberbeamer.sty new file mode 100644 index 0000000000..00986f87d5 --- /dev/null +++ b/macros/latex/contrib/beamer-contrib/appendixnumberbeamer/appendixnumberbeamer.sty @@ -0,0 +1,67 @@ +% vim:ft=plaintex: +% +% Written and (C) by Jérôme Lelong +% 2007 - 2018 +% +% Patch from Sebastian Friedl to fix issue #1 +% for Beamer >= 3.48. +% +% This program is free software; you can redistribute it and/or modify it +% under the terms of the GNU General Public License as published by the +% Free Software Foundation; either version 3 of the License, or (at your +% option) any later version. +% +% This program is distributed in the hope that it will be useful, but +% WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +% General Public License for more details. +% +% You should have received a copy of the GNU General Public License along +% with this program. If not, see . +% +% This small piece of code fixes the frame numbering in beamer when using +% an appendix such that the slides of the appendix are not counted in the +% total framenumber of the main part of the document. The total +% framenumber counter is reset to 0 and starts counting again when +% entering the appendix. +% +% Usage: \usepackage{appendixnumberbeamer} +% and declare the appendix as usual using the \appendix command. + + +\makeatletter + + +\gdef\appendixtotalframenumber{0} +\def\mainend{-1} +\let\appendixorig\appendix + +% Redefine the \appendix command: +% - Reset the framenumber counter +% - Freeze the total framenumber for this first part of the document +\def\appendix{ + \xdef\mainend{\theframenumber} + \immediate\write\@auxout{\string\global\string\@namedef{mainendframenumber}{\mainend}} + \appendixorig + \headcommand{\gdef\inserttotalframenumber{\appendixtotalframenumber}}% + \setcounter{framenumber}{0} +} + +% To be called at the end of the document to fix the total framenumber in the +% main document and in the appendix. +\def\pageatend{ + \xdef\appendixend{\theframenumber} + \ifnum\mainend>0% + \immediate\write\@auxout{\string\global\string\@namedef{appendixtotalframenumber}{\appendixend}}% + \immediate\write\@auxout{\string\global\string\@namedef{inserttotalframenumber}{\mainend}}% + \immediate\write\@auxout{\string\@writefile{nav}{\noexpand \headcommand{% + \noexpand\gdef\noexpand\inserttotalframenumber{\mainend}}}}% + \immediate\write\@auxout{\string\@writefile{nav}{\noexpand \headcommand{% + \noexpand\gdef\noexpand\appendixtotalframenumber{\appendixend}}}}% + \else + \fi +} + + +\AtEndDocument{\pageatend} +\makeatother -- cgit v1.2.3