That's right, the beamer
package only calculates the height of the headline once, at the beginning of the document. The macro responsible for this task is called \beamer@calculateheadfoot
, and is defined in beamerbaseframecomponents.sty
(ll. 161-182). If the head of your headline changes in the course of the presentation (which doesn't sound like a terribly good idea to my mind, BTW), you'll have to issue this command manually.
This can be done for example by adding it to the internal macro \beamer@@@@frame
: Like this, the head of head- and footlines etc. are recalculated each time a frame is being built:
\usepackage{etoolbox}
\makeatletter
\pretocmd{\beamer@@@@frame}{%
\addtocounter{framenumber}{1}%
\beamer@calculateheadfoot%
\addtocounter{framenumber}{-1}}{}{}
\makeatother
Add this code snippet to your document or your theme file. (The manual change of framenumber
is necessary to get the correct headline as beamer
hasn't stepped the counter at this point.)
Minimal example:
\documentclass{beamer}
% To make a compilable example, these definitions are necessary - you can replace them by your own
\colorlet{LightBlue}{blue}
\colorlet{DarkGray}{gray}
\setbeamercolor{linemid}{bg=green}
\newlength{\headerheight}
\setlength{\headerheight}{10pt}
\makeatletter
\setbeamertemplate{headline}
{ \ifnum\c@framenumber>1
\leavevmode%
\hbox{%
\begin{beamercolorbox}[wd=\paperwidth,ht=\headerheight,dp=0pt]{}%
\ifx\insertsection\@empty
\else
{
{\usebeamerfont{headsection}\hspace{1em} \color{LightBlue}\insertsection}
\ifx\insertsubsection\@empty
\else
{\hspace{0.5em}$\vert$ \hspace{0.5em}{\usebeamerfont{headsubsection}\color{DarkGray}\insertsubsection}}%
\fi
}
\fi
\end{beamercolorbox}%
} %
\vskip0pt%
\else
\hbox{%
\begin{beamercolorbox}[wd=\paperwidth,ht=20pt,dp=0pt]{linemid}
\end{beamercolorbox}%
}
\fi
}
% Recalculate the head of head- and footlines for each frame
% (http://tex.stackexchange.com/a/61788/3323)
\usepackage{etoolbox}
\makeatletter
\pretocmd{\beamer@@@@frame}{%
\addtocounter{framenumber}{1}%
\beamer@calculateheadfoot%
\addtocounter{framenumber}{-1}}{}{}
\makeatother
\begin{document}
\section{section}
\subsection{subsection}
\frame{Title page with special headline}
\frame{Normal frame}
\frame{Normal frame 2}
\end{document}
bloodworks gives the simplest solution. However, if you want to retain exactly the formatting for the title page, but just not have the page number information, then you can redefine the footline
template just for that frame as follows:
\documentclass {beamer}
\mode<beamer>{\usetheme{Madrid}}
\title[Test Title]{Test}
\begin{document}
\bgroup
\makeatletter
\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\expandafter\beamer@ifempty\expandafter{\beamer@shortinstitute}{}{~~(\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}
% \insertframenumber{} / \inserttotalframenumber\hspace*{2ex}
\hspace*{6ex}
\end{beamercolorbox}}%
\vskip0pt%
}
\makeatother
\begin{frame}
\titlepage
\end{frame}
\egroup
\setcounter{framenumber}{0}
\begin{frame}
\frametitle{First test frame}
\begin{itemize}
\item Item 1
\item item 2
\end{itemize}
\end{frame}
\begin{frame} More \end{frame}
\end{document}
The code makes a local group around the first frame via \bgroup / \endgroup
and then contains a copy of the footline
template from beamerouterthemeinfolines.sty
with the insertion of "frame numuber / total framenumber" commented out and replaced by an appropriate amount of horisontal space.
Had not been for the " / " between these numbers you could just have set the commands \insertframenumber
and \inserttotalframenumber
to insert a single space each in this group.
After discussion with bloodworks, one may prefer to package the above up in to a macro \mytitleframe
as below. Such a definition could then be moved to a private style file.
\documentclass{beamer}
\mode<beamer>{\usetheme{Madrid}}
\makeatletter
\def\mytitleframe{\bgroup
\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\expandafter\beamer@ifempty\expandafter{\beamer@shortinstitute}{}{~~(\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}
% \insertframenumber{} / \inserttotalframenumber\hspace*{2ex}
\hspace*{6ex}
\end{beamercolorbox}}%
\vskip0pt%
}
\maketitle
\egroup
\addtocounter{framenumber}{-1}
}
\makeatother
\title[Test Title]{Test}
\begin{document}
\mytitleframe
\begin{frame}
\frametitle{First test frame}
\begin{itemize}
\item Item 1
\item item 2
\end{itemize}
\end{frame}
\begin{frame} More \end{frame}
\end{document}
Best Answer
You want to say
However
noframenumbering
is not an option that removes the continuation numbers from these slides. For that you should adjust the beamer template forframetitle continuation
:either globally or restricted to a group for the particular frame: