Document ClassesBeamer, Frame Numbers without total number of pages

Information and discussion about specific document classes and how to create your own document classes.
Post Reply
mclaine
Posts: 9
Joined: Tue Jul 28, 2009 6:00 pm

Beamer, Frame Numbers without total number of pages

Post by mclaine »

Hi everybody,

I'm just working on my phd thesis presentation and wanted to add page (frame) numbers to my presentation.

I used \setbeamertemplate{footline}[frame number] which destroys my original footline, but this is exactly what I wanted. However, it prints the frame number in the format "frame numer/total number of frames". Is there any way to omit the total number of frames. I want it to be in this format: "frame number".

See my total settings below.

Best regards,

Christian

Code: Select all

\documentclass{beamer}

\mode<presentation> {
  \usetheme{Ilmenau}%
  \usecolortheme{beaver}
  \usefonttheme{professionalfonts}
  \useinnertheme{circles}
  \useoutertheme{split}
\setbeamercolor{title}{fg=black}
  \setbeamertemplate{navigation symbols}{}
  \setbeamercovered{transparent}
  \definecolor{rudi}{rgb}{0.71,0.02,0.03}  \definecolor{ocker}{rgb}{0.59,0.42,0.04}
  \setbeamercolor{frametitle}{fg=rudi}
  \setbeamertemplate{footline}[frame number]
\setbeamercolor*{section in head/foot}{fg=rudi,bg=white}
%\setbeamercolor*{subsection in head/foot}{fg=rudi,bg=black}
\setbeamercolor{structure}{fg=rudi}
}
Last edited by mclaine on Wed Nov 11, 2009 11:42 am, edited 1 time in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

Beamer, Frame Numbers without total number of pages

Post by gmedina »

Hi,

replace this line

Code: Select all

\setbeamertemplate{footline}[frame number]
with, for example,

Code: Select all

\setbeamertemplate{footline}{%
  \raisebox{5pt}{\makebox[\paperwidth]{\hfill\makebox[10pt]{\scriptsize\insertframenumber}}}}
Of course, make the necessary adjustments to suit your needs.
1,1,2,3,5,8,13,21,34,55,89,144,233,...
mclaine
Posts: 9
Joined: Tue Jul 28, 2009 6:00 pm

Re: Beamer, Frame Numbers without total number of pages

Post by mclaine »

Thanks a lot!

It works. You are my personal hero for today :-)

Best regards,

Christian
mclaine
Posts: 9
Joined: Tue Jul 28, 2009 6:00 pm

Re: Beamer, Frame Numbers without total number of pages

Post by mclaine »

Lol,

well now I have one additional question.

Is there any way not to count several frames?

In a first-best world, I'd like the counting to begin after the titlepage and there are some slides which contain no important (but necessary!) information, e.g.:

\begin{frame}
\vskip1.6cm \begin{center}{\huge Model}\end{center}
\end{frame}

Does anybody know if there is something that works like \begin{equation*} here?

Best regards,

Christian
User avatar
gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

Beamer, Frame Numbers without total number of pages

Post by gmedina »

Hi,

perhaps there's a shorter way of doing whay you expect. Anyway, the code below shows one possibility. I defined two commands: \numbered and \unnumbered

Simply add \numbered at the beginning of your document.

For those frames for which you want to suppress the numbering, use something like the following:

Code: Select all

{\unnumbered
\begin{frame}
... frame contents...
\end{frame}
}
If you want to change the numbering sequence, my example also shows how to proceed, changing the framenumber counter.

Code: Select all

\documentclass{beamer}

\usetheme{Ilmenau}%

\newcommand\numbered{\setbeamertemplate{footline}{%
  \raisebox{5pt}{\makebox[\paperwidth]{%
    \hfill\makebox[10pt]{%
      \scriptsize\insertframenumber}}}}}
\newcommand\unnumbered{\setbeamertemplate{footline}{}}

\begin{document}	
\numbered

\begin{frame}
 Test frame 1
\end{frame}

{\unnumbered\addtocounter{framenumber}{-1}
\begin{frame}
 Test frame 2
\end{frame}}

\begin{frame}
 Test frame 3
\end{frame}

\begin{frame}
 Test frame 4
\end{frame}

\end{document}
1,1,2,3,5,8,13,21,34,55,89,144,233,...
mclaine
Posts: 9
Joined: Tue Jul 28, 2009 6:00 pm

Re: Beamer, Frame Numbers without total number of pages

Post by mclaine »

You are a genius!

This works perfect and I am ashamed I did not come up with this idea myself.

Thanks a lot.
mclaine
Posts: 9
Joined: Tue Jul 28, 2009 6:00 pm

Beamer, Frame Numbers without total number of pages

Post by mclaine »

A short additional (final) remark:

I slightly changed your new commands to

Code: Select all

\newcommand\numbered{\setbeamertemplate{footline}{%
  \raisebox{5pt}{\makebox[\paperwidth]{%
    \hfill\makebox[10pt]{%
      \scriptsize\insertframenumber}}}}}

\newcommand\unnumbered{\setbeamertemplate{footline}{}\addtocounter{framenumber}{-1}}
which allows to be a little shorter for the particular frames:

Code: Select all

{\unnumbered
\begin{frame}
  text
\end{frame}}
Additionally, I also wanted to add a command that allows to assign the same frame number to one or more consecutive slides. This works with:

Code: Select all

\newcommand\numberedplusone{\setbeamertemplate{footline}{%
  \raisebox{5pt}{\makebox[\paperwidth]{%
    \hfill\makebox[10pt]{%
      \scriptsize\insertframenumber}}}}\addtocounter{framenumber}{-1}}
and

Code: Select all

{\numberedplusone
\begin{frame}
  text
\end{frame}}
respectively.
Post Reply