# Beamer — changing the title in the navigation bar dynamically

Is there a way to change the title of the entire presentation in the navigation bar dynamically?

Now:

Needed:

All 6 of 6 circles should be shown in navigation bar, not only 3 of 6 for current section!

Here is my code:

\documentclass{beamer}

\usepackage[utf8]{inputenc}
\usepackage[ngerman]{babel}
\usepackage{ucs}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{graphicx}
\usepackage{color}
\usepackage{mathpazo}
\usepackage{tikz}
\usepackage{pgfplots}

\useinnertheme{default}
\usefonttheme{serif}

\setbeamerfont{title like}{shape=\scshape}
\setbeamerfont{frametitle}{shape=\scshape}
\setbeamercolor*{normal text}{fg=black, bg=white}
\setbeamercolor*{example text}{fg=black}
\setbeamercolor*{structure}{fg=black}
\setbeamercolor*{palette tertiary}{fg=black, bg=black!5}
\setbeamercolor*{palette quaternary}{fg=black, bg=black!5}

\begin{document}

% The miniframe circles should not be splitted in two groups (if possible)

\section*{Title 1} % <-- Only this title should be visible in the first section
\subsection*{}

\begin{frame}\end{frame}
\begin{frame}\end{frame}
\begin{frame}\end{frame}

\section*{Title 2} % <-- ...and only this title in the second section
\subsection*{}

\begin{frame}\end{frame}
\begin{frame}\end{frame}
\begin{frame}\end{frame}

\end{document}


The simple way to do so is probably to set the title of the presentation equal to subsection title — is this possible?

You can use the following code somewhere between \documentclass{beamer} and \begin{document}:

\usepackage{etoolbox}
\makeatletter
\beamer@compresstrue
\apptocmd{\partentry}{\beamer@xpos=0\relax}{}{}
\def\sectionentry#1#2#3#4#5{% section number, section title, page
\ifnum#5=\c@part%
{%
\ifnum\c@section=#1%
\fi}%
}%
\fi\ignorespaces}
\makeatother


The tricks used to get all the mini frames while displaying only the current section title are similar to what was used in Beamer infolines outer theme with miniframe bullets only for the current section:

• For simplicity, all mini frames are displayed in one line using the compress option:

\beamer@compresstrue

• Remove the filling space to left align the navigation bar:

\patchcmd{\insertnavigation}{\hskip-1.875ex plus-1fill}{}{}{}

• Reset the mini frames position at the start of each part, as this will not be done at the beginning of each section any more to create a continuous line of mini frames:

\apptocmd{\partentry}{\beamer@xpos=0\relax}{}{}

• Rewrite the \sectionentry macro to not reset the mini frames position and to only show the current section title. The important thing here is to wrap the title in \rlap so that it does not take up any space, otherwise there would be a gap in the line of mini frames:

\def\sectionentry#1#2#3#4#5{...}