[Tex/LaTex] One navigation bullet per subsection with subsection=false in custom beamer theme

beamermini-framesnavigation

I'm using the miniframes theme in beamer, and I need it customized as follows: The idea is to have a single line of bullets. For each section, I want one bullet per subsection, instead of one bullet for every frame (this is because I have too many frames and the bullets overflow to the next section). However, I need the subsection option in false, as I don't want the subsection title to appear in the header.

I tried the answer provided here: How to remove some pages from the navigation bullets in Beamer? and it worked almost perfect. The only problem I have is that when the subsection has more than one frame, from the second onwards the bullet is not highlighted (it is only shown as bold), so the audience loses track of where we are.

So, my question is, is there any way that I can still highlight the current subsection bullet for the frames following the first one of every subsection? Or an easier way to show only one bullet per subsection without activating the subsection option?

I hope I made myself clear..Here is a minimal working example of my current code. It shows the problem described above, in which the bullet for a second (or third) frame in the same subsection doesn't show highlighted.

\documentclass[compress]{beamer}
\useoutertheme[subsection=false]{miniframes}
\makeatletter
\let\beamer@writeslidentry@miniframeson=\beamer@writeslidentry
\def\beamer@writeslidentry@miniframesoff{%
\expandafter\beamer@ifempty\expandafter{\beamer@framestartpage}{}% does not happen normally
  {%else
    \clearpage\beamer@notesactions%
  }
}
\newcommand*{\miniframeson}{\let\beamer@writeslidentry= \beamer@writeslidentry@miniframeson}
\newcommand*{\miniframesoff}{\let\beamer@writeslidentry=\beamer@writeslidentry@miniframesoff}
\makeatother

\section{S1}
\subsection{SS1}
  \frame{1}
\miniframesoff
  \frame{2}
  \frame{3}

\miniframeson
\subsection{SS2}
  \frame{1}
\miniframesoff
  \frame{2}
  \frame{3}
\end{document}

Best Answer

This patch modifies the default mini frame navigation to show one mini frame per subsection instead of one for each slide. The mini frame is highlighted throughout the whole subsection:

\documentclass[compress]{beamer}

\useoutertheme[subsection=false]{miniframes}
\usepackage{etoolbox}
\makeatletter
\patchcmd{\slideentry}{\advance\beamer@xpos by1\relax}{}{}{}
\def\beamer@subsectionentry#1#2#3#4#5{\advance\beamer@xpos by1\relax}%
\makeatother

\begin{document}
\section{S1}
\subsection{SS1}
  \frame{1}
  \frame{2}
  \frame{3}

\subsection{SS2}
  \frame{1}
  \frame{2}
  \frame{3}
\end{document}

The code is vaguely similar to the one in Beamer infolines outer theme with miniframe bullets only for the current section: The internal commands responsible for generating the mini frames are patched so that the x-position of the mini frames isn't increased for each slide, but only for each subsection.

The resulting headline, showing only one mini frame for each subsection:

headline showing one mini frame for each subsection, with the second one highlighted