124

I created a presentation with Beamer, and I used Darmstadt theme.

But, this theme doesn't have the page number.

I know that I can insert the page number in Footline with:

\setbeamertemplate{footline}[frame number]

But, how can I insert the page number in "Navigation symbols", like this picture?

enter image description here

0

6 Answers 6

151

You can use something like

\addtobeamertemplate{navigation symbols}{}{%
    \usebeamerfont{footline}%
    \usebeamercolor[fg]{footline}%
    \hspace{1em}%
    \insertframenumber/\inserttotalframenumber
}

and use spaces, font and boxes to adjust the alignment of the numbers with the navigation symbols.

You can change the font/color just by altering the font/color for footline as in

\setbeamercolor{footline}{fg=blue}
\setbeamerfont{footline}{series=\bfseries}
6
  • 8
    Ok. But, this disable all icons in navigation bar. I modified your code to: \setbeamertemplate{navigation symbols}{% \insertslidenavigationsymbol \insertframenavigationsymbol \insertsubsectionnavigationsymbol \insertsectionnavigationsymbol \insertdocnavigationsymbol \insertbackfindforwardnavigationsymbol \hspace{1em}% \usebeamerfont{footline} \insertframenumber/\inserttotalframenumber% }
    – Anderson
    Oct 8, 2013 at 20:43
  • 2
    @Anderson see the updated code: if you use \addtobeamertemplate instead of \setbeamertemplate you keep the symbols
    – Bordaigorl
    Oct 8, 2013 at 21:49
  • 1
    I also just edited to suggest how to customise color and font (in a beamer idiomatic way)
    – Bordaigorl
    Oct 8, 2013 at 21:54
  • 8
    To fix the vertical alignment of the page number, I used: \raisebox{1.2pt}[0pt][0pt]{\insertframenumber/\inserttotalframenumber}.
    – Steve
    Oct 11, 2017 at 18:46
  • 1
    How do you avoid getting the frame numbers on the title page?
    – Mibi
    Jan 29, 2020 at 10:07
24

You can add the following code before \begin{document}:

\expandafter\def\expandafter\insertshorttitle\expandafter{%
  \insertshorttitle\hfill%
  \insertframenumber\,/\,\inserttotalframenumber}
3
  • So happy I found this comment. This does exactly what I needed, independent of the theme I use. My macro vocab however is small, and I'm stuck trying to merge it with another answer. My goal is to remove hyperref's linkcolor on \insertshorttitle in the footline in general, using something like \let\hyperlink\@secondoftwo. Is this an easy fix?
    – ddelange
    Apr 24, 2018 at 19:13
  • Consider my comment above solved!
    – ddelange
    Apr 24, 2018 at 19:47
  • Thanks for the answer, it worked! May I also ask you how can I flush it all the way right of the line? Thanks!
    – zyy
    Mar 4, 2019 at 23:45
12

Before \begin{document} you need to include:

\setbeamertemplate{sidebar right}{}
\setbeamertemplate{footline}{%
\hfill\usebeamertemplate***{navigation symbols}
\hspace{1cm}\insertframenumber{}/\inserttotalframenumber}

This should work to put the frame number beside the navigation bar, not sure how to put it inside of the navigation bar.

3
  • Ok. This works fine. But, I use "\logo" and "\setbeamertemplate{sidebar right}{}" disable the logo.
    – Anderson
    Oct 8, 2013 at 20:42
  • so if you add something like \logo{\includegraphics[scale=0.2]{imageName.jpg} } after the above code then you get no logo? Oct 8, 2013 at 20:51
  • Yes. My tex file has a \logo{\includegraphics[scale=.4]{logo-ic}} after your code, but don't show the logo.
    – Anderson
    Oct 8, 2013 at 21:01
8

Actually, I want to supplenment MaxGraves's answer! (but I don't have enough reputation, sorry about that!)

My result will put the "page/total page" rightside and inside the navigation bar, instead of outside.

Note: \addtobeamertemplate{⟨element name⟩}{⟨pre-text⟩}{⟨post-text⟩}, hence you have to notice which bracket you put "page/total page" in. In my case, using Frankfurt theme, which have default navigation bar, put the followings before \begin{document} will show my results as the bottom.

\addtobeamertemplate{navigation symbols}{}{ \hspace{1em}    \usebeamerfont{footline}%
    \insertframenumber / \inserttotalframenumber }

The reason I use \hspace{1em} \usebeamerfont{footline} is for good-looking, the front makes "page/total page" not too close to navigation bar, and the latter is just make it as big as I hope, more clearly, I think....

the result

1
  • This looks like a subset of the accept one. Would like to explain more? For example why you keep \usebeamerfont but not \usebeamercolor. And why are there so many useless spaces?
    – Symbol 1
    Jan 10, 2015 at 7:08
1
 \setbeamertemplate{navigation symbols}
{  \insertslidenavigationsymbol 
insertframenavigationsymbol   
\insertsubsectionnavigationsymbol  
  \insertsectionnavigationsymbol
  \insertdocnavigationsymbol  
  \insertbackfindforwardnavigationsymbol 
 \hspace{1em}  
\usebeamerfont{footline} 
   \insertframenumber/\inserttotalframenumber }
 \setcounter{page}{1} 
\pagenumbering{arabic} 
%add this code before begin doc 
\begin{document}
1
  • 2
    Welcome to TeX - LaTeX! This seems to be a duplicate (with a missing `\` typo) of code in Anderson's comment to Bordaigorl's answer. That comment resulted in an a cleaner updated answer. In any case, code only answers are best combined with some text explanation. Sep 29, 2015 at 6:46
1
\setbeamertemplate{page number in head/foot}[totalframenumber]
\beamertemplatenavigationsymbolsempty

\setbeamerfont{page number in head/foot}{size=\footnotesize}
2
  • 2
    Welcome to TeX.SE! Could you please extend your code snippet to a compilable and complete code?
    – user156344
    Mar 11, 2019 at 11:47
  • 2
    Because the Darmstadt theme does not show any footline by default, you'll also have to set the footline template to make this work. Mar 11, 2019 at 11:56

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .