[Tex/LaTex] How to insert page numbers on some frames produced by Beamer

beamerpage-numbering

I wonder how to insert the page numbers (say) on the top left-corner of the frames of my presentation file (excluding the first frame -namely the Title Frame- and the last one, namely the Thank-You Frame) – in a (PDF)LaTeX.

I have used the \documentclass{beamer} in the TeX file as follows.

\documentclass[
%
%pdf,
%noFooter,
%draft,
%nocolorBG,
%slideBW,
%colorBG,
%slideColor,
%ntnu
%winter
%autumn
]{beamer}

\usepackage{amsmath}
\usepackage{rotating}
\usepackage{graphicx}
\usepackage{multimedia}

\useinnertheme[shadow=true]{rounded}
\useoutertheme{shadow}
\usecolortheme{orchid}
\usecolortheme{whale}

\title[Title of the presentation]{Title of the presentation}
\author[Dept. of Mathematical Sciences, NTNU \hspace{1mm} Name]{Name}
\institute{\href{http://www.ntnu.no}
{Norwegian University of Science and Technology}}
\date{Month, Year}

\begin{document}

\newcommand{\dif}{\, \mathrm{d}}
\def\norml       {\mid\!\mid\!}
\def\normr       {\!\mid\!\mid}
\def\normel       {\mid\!\mid\!\mid\!}
\def\normer       {\!\mid\!\mid\!\mid}

\maketitle

\begin{frame}\frametitle{Frame Title}

\end{frame}

.....

\end{document}

Best Answer

  1. In order to display the frame number at the top left corner, you should add this to the preamble:

    \setbeamertemplate{headline}{\scriptsize{\vspace*{0.3cm}\hspace*{0.3cm}\insertframenumber}} 
    

Changing the measurements will result in different positions.

  1. If you want to hide the number in any frame, you should place the line

    \thispagestyle{empty}
    

    after the command to begin the frame.

  2. The only downside of this is that you'd have the numbering starting at the titlepage, so in case you hide it, your numbering would start from "2". To fix this, and restart numbering from the first actual frame, insert this line after the command to begin the frame (i. e., the frame you chose to be page one):

    \setcounter{framenumber}{1}
    

    OR: There's also a (much) simpler way to do something similar. There's command

    \useoutertheme{infolines}
    

    which will add author, title and page count at bottom of each frame. You can also try to modify the footline to display only the information you want.