I would like to have only three sections and three subsections shown at all time in the headline.
For the sections I have a code (not mine) that works, however it doesn't work for the subsections and I don't understand the language enough to solve it on my own..
For the section it is working with the following code:
\documentclass[xcolor={dvipsnames},aspectratio=169]{beamer}
\geometry{paperwidth=192mm,paperheight=108mm}
\mode<presentation>
{
\usetheme{Warsaw}
\usefonttheme{structurebold}
\setbeamertemplate{navigation symbols}{\insertframenumber/\inserttotalframenumber}
}
\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}{
\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%
}
\makeatletter
\newenvironment{withoutheadline}{
\setbeamertemplate{headline}[default]
\def\beamer@entrycode{\vspace*{-\headheight}}
}{}
\makeatother
\AtBeginSection[]{
\begin{frame}<beamer>
\addtocounter{framenumber}{-1}
\frametitle{Overview}
\tableofcontents[currentsection]
\end{frame}
}
\begin{document}
\section{Section 1}
\begin{frame}{Frame 1}
\end{frame}
\section{Section 2}
\section{Section 3}
\subsection{Sub 1}
\begin{frame}{Frame 1}
\end{frame}
\subsection{Sub 2}
\begin{frame}{Frame 2}
\end{frame}
\subsection{Sub 3}
\begin{frame}{Frame 3}
\end{frame}
\subsection{Sub 4}
\begin{frame}{Frame 4}
\end{frame}
\subsection{Sub 5}
\begin{frame}{Frame 5}
\end{frame}
\section{Section 4}
\section{Section 5}
\end{document}
Keeps 3 sections and rolls when going to the 4th.

Keeps 3 subsections but only show those 3 even when going on the 4th.
