Here's one way to remove the slide numbering from the Appendix slide, via the etoolbox
package. The idea being that you replace the insertion of the frame in the footline
template with a \phantom
version of itself:
\documentclass{beamer}% http://ctan.org/pkg/beamer
\usepackage{lmodern}% http://ctan.org/pkg/lm
\usepackage{etoolbox}% http://ctan.org/pkg/etoolbox
\mode<presentation>
\usetheme{Warsaw}
\usetheme{CambridgeUS}
\begin{document}
\section{Section}
\subsection{}
\begin{frame}
\frametitle{Slide Title}
Slide 1
\end{frame}
\begin{frame}
\frametitle{Slide Title}
Slide 2
\hspace{0.01cm}\hyperlink{eab<1>}{\beamergotobutton{Literature}}
\end{frame}
\begin{frame}
\frametitle{Slide Title}
Slide 3
\end{frame}
\section*{}
% Remove <frame #> / <total frame #> from footline template
\makeatletter
\patchcmd{\beamer@@tmpl@footline}% <cmd>
{\insertframenumber{} / \inserttotalframenumber}% <search>
{\phantom{\insertframenumber{} / \inserttotalframenumber}}% <replace>
{}% <success>
{}% <failure>
\makeatother
\begin{frame}[label=eab]
\frametitle{Appendix Material}
Appendix Material here.
{\tiny\hfill\Acrobatmenu{GoBack}{\beamerreturnbutton{}}}
\end{frame}
\addtocounter{framenumber}{-1}% Correct total frame count
\end{document}
The beamer
footline
template is stored in beamer@@tmpl@footline
. It's just easier replacing (or patching) the necessary commands rather than redefining it all over again.
A similar approach can be used to repeat the frame number of some other slide. One way is to "capture" the frame number in a different counter, and then patch the footline
to display that number rather than the regular framenumber
counter (via \insertframenumber
). Here is a complete minimal example:
\documentclass{beamer}% http://ctan.org/pkg/beamer
\usepackage{lmodern}% http://ctan.org/pkg/lmodern
\usepackage{etoolbox}% http://ctan.org/pkg/etoolbox
\newcounter{captureframe}
\mode<presentation>
\usetheme{Warsaw}
\usetheme{CambridgeUS}
\begin{document}
\section{Section}
\subsection{}
\begin{frame}
\frametitle{Slide Title}
Slide 1
\end{frame}
\begin{frame}
\frametitle{Slide Title}
Slide 2
\hspace{0.01cm}\hyperlink{eab<1>}{\beamergotobutton{Literature}}
\end{frame}
\setcounter{captureframe}{\value{framenumber}}% Store/capture current frame
\begin{frame}
\frametitle{Slide Title}
Slide 3
\end{frame}
\section*{}
% Replace <frame #> in footline template
\makeatletter
\patchcmd{\beamer@@tmpl@footline}% <cmd>
{\insertframenumber}% <search>
{\thecaptureframe}% <replace>
{}% <success>
{}% <failure>
\makeatother
\begin{frame}[label=eab]
\frametitle{Appendix Material}
Appendix Material here.
{\tiny\hfill\Acrobatmenu{GoBack}{\beamerreturnbutton{}}}
\end{frame}
\addtocounter{framenumber}{-1}% Correct total frame count
\end{document}
The frame number is captured via
\setcounter{captureframe}{\value{framenumber}}
after defining the new counter captureframe
. In the patch to the footline
template, \insertframenumber
is replaced with \thecaptureframe
(which defaults to an \arabic
presentation of the counter).
Both of the above solutions will impact all slides/frames following the patch. So, if a modification should be made temporarily, some more work is required (but is not difficult).
Based on certain assumptions, an elementary method using macros (that does not require etoolbox
) can be established to reference slides. The assumptions are
- There is a clear separation between "frontmatter" and "backmatter" slides. The former contain slides that could be "referenced" while the latter contains the "referenced" slides.
- Manual usage of certain macros are required before every "backmatter" slide in order to maintain an accurate count of the total frame number.
Here is an MWE:
\documentclass{beamer}% http://ctan.org/pkg/beamer
\usepackage{lmodern}% http://ctan.org/pkg/lmodern
\makeatletter
\newcommand{\saveframenumber}[1]{%
\expandafter\edef\csname r@#1\endcsname{\theframenumber}% Store frame number
}
\newcommand{\useframenumber}[1]{%
\addtocounter{framenumber}{-1}% Decrease framenumber counter
\renewcommand{\insertframenumber}{%
\csname r@#1\endcsname%
}%
}
\makeatother
\newcommand{\restoreframenumberdefault}{%
\renewcommand{\insertframenumber}{%
\arabic{framenumber}%
}%
}
\mode<presentation>
\usetheme{Warsaw}
\usetheme{CambridgeUS}
\begin{document}
\section{Section}
\subsection{}
\begin{frame}
\frametitle{Slide Title}
Slide 1
\end{frame}
\begin{frame}
\frametitle{Slide Title}
Slide 2
\hspace{0.01cm}\hyperlink{eab<1>}{\beamergotobutton{Literature}}
\end{frame}
\saveframenumber{myslide}% Save this slide number as <myslide>
\begin{frame}
\frametitle{Slide Title}
Slide 3
\end{frame}
\section*{}
\useframenumber{myslide}% Use the same number as on <myslide>
\begin{frame}[label=eab]
\frametitle{Appendix Material}
Appendix Material here.
{\tiny\hfill\Acrobatmenu{GoBack}{\beamerreturnbutton{}}}
\end{frame}
\end{document}
The usage is:
- After a slide that you want to reference in the "backmatter", you place
\saveframenumber{<name>}
. This stores the value of the current frame in \r@<name>
.
- Before every "backmatter" slide that uses the "referenced" slide in the "frontmatter", you place
\useframenumber{<name>}
.
You do need to tell beamer
what you want to appear in each frame of the handout
version. You can use \onslide
specifications to do this so that you do not need to modify the existing overlay specifications at all. (I'm not sure this is what you want - probably not.)
The following code modifies your MWE so that, in presentation
mode, there would actually be 10 slides within the frame. These are then placed on slides 1 or 2 of the handout
. This is a waste of code: if you only want to show slide 5 and slide 10, you do not need two \againframe
but only one. But, anyway, with the two:
\documentclass[handout]{beamer}
\begin{document}
\begin{frame}<1-| handout:0>[label=foo]{My only frame}
\begin{enumerate}[<+->]% or whatever you like for presentation mode
\onslide<1-| handout:1-2>
\item Item \arabic{enumi}
\item Item \arabic{enumi}
\item Item \arabic{enumi}
\item Item \arabic{enumi}
\item Item \arabic{enumi}
\onslide<1-| handout:2>
\item Item \arabic{enumi}
\item Item \arabic{enumi}
\item Item \arabic{enumi}
\item Item \arabic{enumi}
\item Item \arabic{enumi}
\end{enumerate}
\end{frame}
\againframe<0| handout:1>{foo}
\againframe<0| handout:2>{foo}
\end{document}
More efficiently with only one repeat:
\documentclass[handout]{beamer}
\begin{document}
\begin{frame}<1-| handout:1>[label=foo]{My only frame}
\begin{enumerate}[<+->]% or whatever you like for presentation mode
\onslide<1-| handout:1-2>
\item Item \arabic{enumi}
\item Item \arabic{enumi}
\item Item \arabic{enumi}
\item Item \arabic{enumi}
\item Item \arabic{enumi}
\onslide<1-| handout:2>
\item Item \arabic{enumi}
\item Item \arabic{enumi}
\item Item \arabic{enumi}
\item Item \arabic{enumi}
\item Item \arabic{enumi}
\end{enumerate}
\end{frame}
\againframe<0| handout:2>{foo}
\end{document}
I'm not sure how this could apply to article
mode since then there are no frames or slides.
Best Answer
Here's one possibility:
The result:
The template in which to add the information about the slide number has to be carefully chosen; in some "late" templates (such as
navigation symbols
,footline
) the value for the slide number gets affected by the overlays specification, so I had to use an "early" template such asframetitle
and used TikZ to place the numbers in the desired location.The code needs two or three runs to stabilize.