Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I am using beamer and I have a slide in an Appendix section. I hyper-reference it with a button. The Appendix does not appear as a section itself. The Appendix material is at the end of the code. I would like all of this to remain.

When I click on the button on Slide 2, it brings me to the Appendix slide. The Appendix Slide says p. 3. Even though the it is linked from Section 2.

Would it be possible to do either of the following two?

  1. Have the appendix slide be the same from which it is buttoned. In this case, say 2/3.
  2. Have the appendix slide have no page number. Just be blank.

The following code should illustrate the point.

\documentclass[professionalfont]{beamer}
\mode<presentation>
\usetheme{Warsaw}
\usetheme{CambridgeUS}
\usepackage{booktabs}
\begin{document}

\section{Section}
\subsection{}

\frame
{
\frametitle{Slide Title}
Slide 1
\hspace{0.01cm}\hyperlink{eaa<1>}{\beamergotobutton{Literature}}
}

\frame
{
\frametitle{Slide Title}
Slide 2
\hspace{0.01cm}\hyperlink{eab<1>}{\beamergotobutton{Literature}}
}

\frame
{
\frametitle{Slide Title}
Slide 3
}

\section*{}

\addtocounter{framenumber}{-1}
\frame[label=eaa]
{
\frametitle{Appendix Material}
Appendix Material here for Slide 1.
{
{\tiny

\hfill\Acrobatmenu{GoBack}{\beamerreturnbutton{}}

}}
}


\addtocounter{framenumber}{-1}
\frame[label=eab]
{
\frametitle{Appendix Material}
Appendix Material here for Slide 2.
{
{\tiny

\hfill\Acrobatmenu{GoBack}{\beamerreturnbutton{}}

}}
}

\end{document}

I would very much appreciate your help.

share|improve this question

2 Answers 2

up vote 12 down vote accepted

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:

enter image description here

\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

  1. 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.
  2. 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>}.
share|improve this answer
    
I can't get that code to compile. :( Your original code compiles. It excludes the page number in the Appendix like you designed. However, this new code does not seem to work. I would be very grateful if you could please help with that. –  J G Feb 11 '12 at 18:33
    
@JG: You probably did not copy the entire code. In the preamble I define a new counter: \newcounter{captureframe}. Did you include that? If you did and you still cannot compile the code, please report the error that you receive, since it compiles fine on my end. –  Werner Feb 11 '12 at 18:47
    
Here is the error. It stops compiling at this point. LaTeX Font Warning: Font shape `OT1/cmss/m/n' in size <4> not available (Font) size <5> substituted on input line 15. SyncTeX warning: Synchronization was disabled from the command line with -synctex=0 Changing the value of \synctex has no effect.[1{C:/Documents and Settings/Local Settings/Application Data/MiKTeX/2.9 /pdftex/config/pdftex.map}] [2] > \insertframenumber=macro: ->\@arabic \c@framenumber . l.24 \show\insertframenumber ? –  J G Feb 11 '12 at 19:05
    
@JG: I've updated my answer to correct for the missing font size (using lmodern). There was also a \show\insertframenumber left from the initial debugging procedure which has been removed. Note that I only received warnings, which is not the same as errors. See the revision history for the exact changes to the answer. –  Werner Feb 12 '12 at 0:18
    
The code compiles, and it is absolutely brilliant! Brilliant!! However, I cannot understand how I would replicate it. Suppose I had a second frame in the Appendix say for Slide 1. How would I get that frame to say 1/3 but this appendix one to say 2/3. –  J G Feb 12 '12 at 0:29

Thid is only a solution for an empty pagecounter for the appendix: Define an empty footline for the appendix:

[ ... ]
\section*{}

\setbeamertemplate{footline}{}

\begin{frame}[label=eab]
\frametitle{Appendix Material}
Appendix Material here.
{\tiny\hfill\Acrobatmenu{GoBack}{\beamerreturnbutton{}}}
\end{frame}

\addtocounter{framenumber}{-1}
\end{document}

if you want the same style of the footnote then redefine it:

\documentclass{beamer}
\usepackage{etoolbox}
\usetheme{CambridgeUS}

\def\resetFootline#1{}

\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*{}

\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~~(\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}\hspace*{2ex} 
  \end{beamercolorbox}}\vskip0pt}

\begin{frame}[label=eab]
\frametitle{Appendix Material}
Appendix Material here.
{\tiny\hfill\Acrobatmenu{GoBack}{\beamerreturnbutton{}}}
\end{frame}

\addtocounter{framenumber}{-1}
\end{document}
share|improve this answer
    
@ Herbert. I am very curious about your answer. I don't know if the OP understands it. But I cannot. Is it like the answer above that it deletes the page number? Does it set the page number to be the pages from which it is referenced (e.g. page 2 per the OP's question and example)? –  Jes Feb 11 '12 at 14:33
    
@Jes: The redefinition of the footline template does not have a \insertframenumber{} / \inserttotalframenumber construct in it, so # / ## is not displayed in the footer. For example, see How can I remove the institute from the author footline on beamer? that shows a similar footline construction with # / ##. –  Werner Feb 11 '12 at 15:11
    
@Werner. I don't understand what you mean. In any event, I cannot tell which of these codes would set the slide number to be 2 in the appendix. Both seem to set them to be blank, which is an option I'd be ok with. My preferred option is to set it at page 2. Please let me know if I'm mistaken. –  J G Feb 11 '12 at 18:41
    
@JG: Herbert's code removes the slide numbering and that's that. The linked post in the my other comment just shows the comparison of creating a footline template that has the slide numbering in it. If you compare the two, you'll see the one has \insertframenumber{} / \inserttotalframenumber and the other (this one) doesn't. –  Werner Feb 11 '12 at 18:50
    
@Hebert. Wonderful answer. Thank you very much for taking the time to help! –  J G Feb 12 '12 at 3:54

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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