Version 1
Hi you could alter the macro which inserts the navigation list.
\documentclass{beamer}
\makeatletter
\def\insertsectionnavigation#1{%
\hbox to #1{%
\vbox{{\usebeamerfont{section in head/foot}\usebeamercolor[fg]{section in head/foot}%
\vskip0.5625ex%
\def\slideentry##1##2##3##4##5##6{}%
\def\sectionentry##1##2##3##4##5{%
\ifnum##5=\c@part%
\def\insertsectionhead{##2}%
\def\insertsectionheadnumber{##1}%
\def\insertpartheadnumber{##5}%
\setbox\beamer@tempbox=\hbox{%
\hyperlink{Navigation##3}{\hbox to #1{%
\hskip0.3cm%
\ifnum\c@section=##1%
{\usebeamertemplate{section in head/foot}}%
\else%
{%
\advance\c@section by -1 %
\ifnum##1 = \c@section%
\usebeamertemplate{section in head/foot shaded}%
\else%
\advance\c@section by 2 %
\ifnum##1 = \c@section%
\usebeamertemplate{section in head/foot shaded}%
\else
\fi
\fi
}%
\fi\hskip0.3cm}}}%
\ht\beamer@tempbox=1.6875ex\dp\beamer@tempbox=0.75ex%
\box\beamer@tempbox\fi}%
\dohead\vskip0.5625ex}}\hfil}}
\makeatother
\usetheme{Warsaw}
\usefonttheme[onlysmall]{structurebold}
\begin{document}
\section{Test 1}
\begin{frame} \end{frame}
\section{Test 2}
\begin{frame} \end{frame}
\section{Test 3}
\begin{frame} \end{frame}
\section{Test 4}
\begin{frame} \end{frame}
\section{Test 5}
\begin{frame} \end{frame}
\end{document}
Here two new conditionals are introduced, which check for the distance between the active section (stored in `\c@section`) and the printed sections.
The result is this:
![enter image description here][1]
Version 2
This version provides a better fit to the size of three lines. Please note, that the height of the colored beamer box is adjusted manually.
\documentclass{beamer}
\usetheme{Warsaw}
\usefonttheme[onlysmall]{structurebold}
\makeatletter
\newcount\c@p
\newcount\c@m
\def\insertsectionnavigation#1{%
\hbox to #1{%
\vbox{{\usebeamerfont{section in head/foot}\usebeamercolor[fg]{section in head/foot}%
\vskip0.5625ex%
\def\slideentry##1##2##3##4##5##6{}%
\def\sectionentry##1##2##3##4##5{%
\ifnum##5=\c@part%
\def\insertsectionhead{##2}%
\def\insertsectionheadnumber{##1}%
\def\insertpartheadnumber{##5}%
\c@p=\c@section%
\c@m=\c@section%
\advance\c@m by -1 %
\advance\c@p by 1 %
\ifnum\c@section=##1%
\setbox\beamer@tempbox=\hbox{%
\hyperlink{Navigation##3}{\hbox to #1{%
{\hskip0.3cm\usebeamertemplate{section in head/foot}\hskip0.3cm}}}}%
\else%
\ifnum##1=\c@m%
\setbox\beamer@tempbox=\hbox{%
\hyperlink{Navigation##3}{\hbox to #1{%
{\hskip0.3cm\usebeamertemplate{section in head/foot shaded}\hskip0.3cm}}}}
%
\else%
\ifnum##1=\c@p%
\setbox\beamer@tempbox=\hbox{%
\hyperlink{Navigation##3}{\hbox to #1{%
{\hskip0.3cm\usebeamertemplate{section in head/foot shaded}\hskip0.3cm}}}}%
%
\else%
%
\fi%
\fi%
%
\fi%%
%
\ht\beamer@tempbox=1.6875ex%
\dp\beamer@tempbox=0.75ex%
\box\beamer@tempbox\fi}%
\dohead\vskip0.5625ex}}\hfil}}
\setbeamertemplate{headline}%{split theme} % full manual adjustment
{%
\leavevmode%
\@tempdimb=3em%
\ifdim\@tempdimb>0pt%
\advance\@tempdimb by 1.825ex%
\begin{beamercolorbox}[wd=.5\paperwidth,ht=\@tempdimb]{section in head/foot}%
\vbox to\@tempdimb{\vfil\insertsectionnavigation{.5\paperwidth}\vfil}%
\end{beamercolorbox}%
\begin{beamercolorbox}[wd=.5\paperwidth,ht=\@tempdimb]{subsection in head/foot}%
\vbox to\@tempdimb{\vfil\insertsubsectionnavigation{.5\paperwidth}\vfil}%
\end{beamercolorbox}%
\fi%
}
\makeatother
\begin{document}
\section{Test 1}
\begin{frame} \end{frame}
\section{Test 2}
\begin{frame} \end{frame}
\section{Test 3}
\begin{frame} \end{frame}
\section{Test 4}
\begin{frame} \end{frame}
\section{Test 5}
\begin{frame} \end{frame}
\end{document}
Again the if structure picks the wanted entries. But in this case the box is only filled when needed. I also introduced two helper variables c@p
and c@m
to avoid too complicated grouping.
This renders to:
and the following frame will look like this:
Version 3
Now featuring three navigation elements at any time:
\documentclass{beamer}
\usetheme{Warsaw}
\usefonttheme[onlysmall]{structurebold}
\makeatletter
\newcount\c@p
\newcount\c@m
\newcount\c@pp
\newcount\c@mm
\def\insertsectionnavigation#1{%
\hbox to #1{%
\vbox{{\usebeamerfont{section in head/foot}\usebeamercolor[fg]{section in head/foot}%
\vskip0.5625ex%
\def\slideentry##1##2##3##4##5##6{}%
\def\sectionentry##1##2##3##4##5{%
\ifnum##5=\c@part%
\def\insertsectionhead{##2}%
\def\insertsectionheadnumber{##1}%
\def\insertpartheadnumber{##5}%
\c@p=\c@section%
\c@m=\c@section%
\c@pp=\c@section%
\c@mm=\c@section%
\advance\c@m by -1 %
\advance\c@p by 1 %
\advance\c@mm by -2 %
\advance\c@pp by 2 %
%
\ifnum \c@section=1
\ifnum\c@section=##1%
\setbox\beamer@tempbox=\hbox{%
\hyperlink{Navigation##3}{\hbox to #1{%
{\hskip0.3cm\usebeamertemplate{section in head/foot}\hskip0.3cm}}}}%
\else%
\ifnum##1=\c@p%
\setbox\beamer@tempbox=\hbox{%
\hyperlink{Navigation##3}{\hbox to #1{%
{\hskip0.3cm\usebeamertemplate{section in head/foot shaded}\hskip0.3cm}}}}
%
\else%
\ifnum##1=\c@pp%
\setbox\beamer@tempbox=\hbox{%
\hyperlink{Navigation##3}{\hbox to #1{%
{\hskip0.3cm\usebeamertemplate{section in head/foot shaded}\hskip0.3cm}}}}%
%
\else%
%
\fi%
\fi%
%
\fi%%
\else%
\ifnum \c@section=\beamer@sectionmax
\ifnum\c@section=##1%
\setbox\beamer@tempbox=\hbox{%
\hyperlink{Navigation##3}{\hbox to #1{%
{\hskip0.3cm\usebeamertemplate{section in head/foot}\hskip0.3cm}}}}%
\else%
\ifnum##1=\c@m%
\setbox\beamer@tempbox=\hbox{%
\hyperlink{Navigation##3}{\hbox to #1{%
{\hskip0.3cm\usebeamertemplate{section in head/foot shaded}\hskip0.3cm}}}}
%
\else%
\ifnum##1=\c@mm%
\setbox\beamer@tempbox=\hbox{%
\hyperlink{Navigation##3}{\hbox to #1{%
{\hskip0.3cm\usebeamertemplate{section in head/foot shaded}\hskip0.3cm}}}}%
%
\else%
%
\fi%
\fi%
%
\fi%%
\else%
\ifnum\c@section=##1%
\setbox\beamer@tempbox=\hbox{%
\hyperlink{Navigation##3}{\hbox to #1{%
{\hskip0.3cm\usebeamertemplate{section in head/foot}\hskip0.3cm}}}}%
\else%
\ifnum##1=\c@m%
\setbox\beamer@tempbox=\hbox{%
\hyperlink{Navigation##3}{\hbox to #1{%
{\hskip0.3cm\usebeamertemplate{section in head/foot shaded}\hskip0.3cm}}}}
%
\else%
\ifnum##1=\c@p%
\setbox\beamer@tempbox=\hbox{%
\hyperlink{Navigation##3}{\hbox to #1{%
{\hskip0.3cm\usebeamertemplate{section in head/foot shaded}\hskip0.3cm}}}}%
%
\else%
%
\fi%
\fi%
%
\fi%%
%
\fi
\fi
%
\ht\beamer@tempbox=1.6875ex%
\dp\beamer@tempbox=0.75ex%
\box\beamer@tempbox\fi}%
\dohead\vskip0.5625ex}}\hfil}}
\setbeamertemplate{headline}%{split theme} % full manual adjustment
{%
\leavevmode%
\@tempdimb=3em%
\ifdim\@tempdimb>0pt%
\advance\@tempdimb by 1.825ex%
\begin{beamercolorbox}[wd=.5\paperwidth,ht=\@tempdimb]{section in head/foot}%
\vbox to\@tempdimb{\vfil\insertsectionnavigation{.5\paperwidth}\vfil}%
\end{beamercolorbox}%
\begin{beamercolorbox}[wd=.5\paperwidth,ht=\@tempdimb]{subsection in head/foot}%
\vbox to\@tempdimb{\vfil\insertsubsectionnavigation{.5\paperwidth}\vfil}%
\end{beamercolorbox}%
\fi%
}
\makeatother
\begin{document}
\section{Test 1}
\begin{frame} \end{frame}
\section{Test 2}
\begin{frame} \end{frame}
\section{Test 3}
\begin{frame} \end{frame}
\section{Test 4}
\begin{frame} \end{frame}
\section{Test 5}
\begin{frame} \end{frame}
\end{document}
It important to say that his is hard coded. This applies on 3 elements only and is not quite versatile. What it does is easy: it checks if the current frame is the first or last and inserts the navigation accordingly.
I want to add that this kind of navigation is very reader unfriendly. One has to look very carefully to understand it.
The first slide would look like this:
The Dreden theme uses as outer theme miniframes
specifying that the footline is of type authorinstitutetitle
\useoutertheme[footline=authorinstitutetitle]{miniframes}
Thus, to insert the frame number (command \insertframenumber
) with respect to the total frame number (command \inserttotalframenumber
) we should take into account how the authorinstitutetitle
is defined:
\def\beamer@theme@footline@authorinstitutetitle{
\defbeamertemplate*{footline}{miniframes theme}
{%
\begin{beamercolorbox}[colsep=1.5pt]{upper separation line foot}
\end{beamercolorbox}
\begin{beamercolorbox}[ht=2.5ex,dp=1.125ex,%
leftskip=.3cm,rightskip=.3cm plus1fil]{author in head/foot}%
\leavevmode{\usebeamerfont{author in head/foot}\insertshortauthor}%
\hfill%
{\usebeamerfont{institute in head/foot}\usebeamercolor[fg]{institute in head/foot}\insertshortinstitute}%
\end{beamercolorbox}%
\begin{beamercolorbox}[ht=2.5ex,dp=1.125ex,%
leftskip=.3cm,rightskip=.3cm plus1fil]{title in head/foot}%
{\usebeamerfont{title in head/foot}\insertshorttitle}%
\end{beamercolorbox}%
\begin{beamercolorbox}[colsep=1.5pt]{lower separation line foot}
\end{beamercolorbox}
}
}
Now, in the lower right corner there's nothing thus it is possible to exploit the space in:
\begin{beamercolorbox}[ht=2.5ex,dp=1.125ex,%
leftskip=.3cm,rightskip=.3cm plus1fil]{title in head/foot}%
{\usebeamerfont{title in head/foot}\insertshorttitle}%
\end{beamercolorbox}%
by adding:
\begin{beamercolorbox}[ht=2.5ex,dp=1.125ex,%
leftskip=.3cm,rightskip=.3cm plus1fil]{title in head/foot}%
{\usebeamerfont{title in head/foot}\insertshorttitle}%
\hfill%
{\usebeamerfont{frame number}\usebeamercolor[fg]{frame number}\insertframenumber~\frameofframes~\inserttotalframenumber}
Notice that as separator between the frame numbers there's a command: \frameofframes
. It is defined as:
\newcommand{\frameofframes}{/}
\newcommand{\setframeofframes}[1]{\renewcommand{\frameofframes}{#1}}
This allows you to modify the standard representation (1/5
for example), with something else; for instance:
\setframeofframes{of}
will provide 1 of 5
.
The code:
\documentclass{beamer}
\usepackage{lmodern}
\usetheme{Dresden}
\author{My name}
\title{My presentation}
\institute{My institute}
\newcommand{\frameofframes}{/}
\newcommand{\setframeofframes}[1]{\renewcommand{\frameofframes}{#1}}
\setframeofframes{of}
\makeatletter
\setbeamertemplate{footline}
{%
\begin{beamercolorbox}[colsep=1.5pt]{upper separation line foot}
\end{beamercolorbox}
\begin{beamercolorbox}[ht=2.5ex,dp=1.125ex,%
leftskip=.3cm,rightskip=.3cm plus1fil]{author in head/foot}%
\leavevmode{\usebeamerfont{author in head/foot}\insertshortauthor}%
\hfill%
{\usebeamerfont{institute in head/foot}\usebeamercolor[fg]{institute in head/foot}\insertshortinstitute}%
\end{beamercolorbox}%
\begin{beamercolorbox}[ht=2.5ex,dp=1.125ex,%
leftskip=.3cm,rightskip=.3cm plus1fil]{title in head/foot}%
{\usebeamerfont{title in head/foot}\insertshorttitle}%
\hfill%
{\usebeamerfont{frame number}\usebeamercolor[fg]{frame number}\insertframenumber~\frameofframes~\inserttotalframenumber}
\end{beamercolorbox}%
\begin{beamercolorbox}[colsep=1.5pt]{lower separation line foot}
\end{beamercolorbox}
}
\makeatother
\begin{document}
\section{One}
\subsection{One-one}
\frame{\frametitle{X-one} bla bla bla}
\frame{\frametitle{X-one-a} bla bla bla}
\frame{\frametitle{X-one-b} bla bla bla}
\subsection{One-two}
\frame{\frametitle{X-one} bla bla bla}
\frame{\frametitle{X-one-a} bla bla bla}
\frame{\frametitle{X-one-b} bla bla bla}
\section{Two}
\subsection{Two-one}
\frame{\frametitle{X-one} bla bla bla}
\frame{\frametitle{X-one-a} bla bla bla}
\frame{\frametitle{X-one-b} bla bla bla}
\subsection{Two-two}
\frame{\frametitle{X-one} bla bla bla}
\frame{\frametitle{X-one-a} bla bla bla}
\frame{\frametitle{X-one-b} bla bla bla}
\section{Three}
\subsection{Three-one}
\frame{\frametitle{X-one} bla bla bla}
\frame{\frametitle{X-one-a} bla bla bla}
\frame{\frametitle{X-one-b} bla bla bla}
\subsection{Three-two}
\frame{\frametitle{X-one} bla bla bla}
\frame{\frametitle{X-one-a} bla bla bla}
\frame{\frametitle{X-one-b} bla bla bla}
\end{document}
One frame as result:
Best Answer
This is most likely a
beamer
bug, which was already reported, but closed as not reproducible. A workaround is to shift the frame title down as you suggested, which can be done by usingafter having loaded
Warsaw
andinfolines
.Example code