Use bullets from mini-frames in sidebar outer theme

I would like to reproduce the individual "bullets" you have under section names in the "mini-frames" outer theme under the subsection names in the navigation sidebar created in the "sidebar" outer theme.
From another question, Multiple navigation dots in Beamer for one frame, I found out that the code that produces each mini-frame is from the function \slideentry.
What I have done so far is to modify the navigation command in the sidebar outertheme, \insertverticalnavigation (beamerbasenavigation.sty, lines 548-627) such that it no longer redefines \slideentry to be blank (line 572). This would give, for a example, a MWE as:

            \documentclass[compress]{beamer}
\useoutertheme[right,width=50pt,height=25pt]{sidebar}
\usetheme{Copenhagen}
\makeatletter

\vbox{%
\def\sectionentry##1##2##3##4##5{%
\ifnum##5=\c@part%
\hbox{{%
\usebeamerfont{section in sidebar}\usebeamercolor[fg]{section in sidebar}%
\ifnum\c@section=##1%
\ifnum\c@subsection=0\relax%
{\usebeamertemplate{section in sidebar}}%
\else%
\ifx\beamer@nav@css\beamer@hidetext%
{\usebeamertemplate{section in sidebar}}%
\else%
\fi%
\fi%
\else
\fi}}}%
\beamer@currentsubsection=0\relax\fi}%

%code commented out:
%\def\slideentry##1##2##3##4##5##6{}%
%

\def\beamer@subsectionentry##1##2##3##4##5{%
\ifnum##1=\c@part%
\beamer@tocifnothide{\ifnum\c@section=##2\ifnum\c@subsection=##3\beamer@nav@css\else\beamer@nav@oss\fi\else\beamer@nav@ooss\fi}%
{\hbox{{%
\usebeamerfont{subsection in sidebar}\usebeamercolor[fg]{subsection in sidebar}%
\ifnum\c@section=##2%
\ifnum\c@subsection=##3%
\ifnum\c@subsubsection=0\relax%
{\usebeamertemplate{subsection in sidebar}}%
\else%
\fi%
\else%
\fi%
\else%
\fi}}}%
}%
\fi}%
\def\beamer@subsubsectionentry##1##2##3##4##5##6{%
\ifnum##1=\c@part%
\beamer@tocifnothide{\ifnum\c@section=##2\ifnum\c@subsection=##3\beamer@nav@css\else\beamer@nav@oss\fi\else\beamer@nav@ooss\fi}%
{\hbox{{%
\usebeamerfont{subsubsection in sidebar}\usebeamercolor[fg]{subsubsection in sidebar}%
\ifnum\c@section=##2%
\ifnum\c@subsection=##3%
\ifnum\c@subsubsection=##4%
{\usebeamertemplate{subsubsection in sidebar}}%
\else
\fi%
\else%
\fi%
\else%
\fi}}}%
}%
\fi}%
%\beamer@currentsubsection=0\relax%
}%
}

\makeatother

\begin{document}
\section{Foo}
\begin{frame}{Test1}
content...
\end{frame}
\subsection{foo}
\begin{frame}{Test2}
content...
\end{frame}
\begin{frame}{Test3}
content...
\end{frame}
\begin{frame}{Test4}
content...
\end{frame}
\begin{frame}{Test5}
content...
\end{frame}\section{Goo}
\begin{frame}{Test6}
content...
\end{frame}
\begin{frame}{Test7}
content...
\end{frame}
\section{goo}
\begin{frame}{Test8}
content...
\end{frame}
\begin{frame}{Test9}
content...
\end{frame}
\begin{frame}{Test10}
content...
\end{frame}
\begin{frame}{Test11}
content...
\end{frame}

\end{document}


However with this the mini-frames don't format as they would with the standard mini-frame outer theme. See the picture below (I apologise for the bad formatting in the MWE, it is minimal).

As you can hopefully see from the picture of from the MWE, instead of aligning on a single row beneath each subsection each new mini-frame appears on a seperate line. Does anyone know how one would get the mini-frames to generate properly or which code I could hack to attempt to get the correct behaviour?

Cheers.

• For some reason, consecutives \hboxes will be put into different lines in the sidebar. – Symbol 1 Jul 22 '17 at 22:01

For miniframes, beamer does the following:

• Each frame (the circle/dot) is drawn in an \hbox of zero width. The position of the circle/dot is controlled by explicitly specifying the coordinate. (For example

\hbox to0cm{\kern1cm O}
\hbox to0cm{\kern2cm O}
\hbox to0cm{\kern3cm O}


)

• these frames (circles/dots) are put into another \hbox. By default, materials in an \hbox will be aligned horizontally.

On the other hand, there is a \vbox in the definition of \insertverticalnavigation, which forces all \hboxes be aligned vertically. Therefore the circles/dots do the lie on the same line.

To overcome, you have to compensate the line height, which seems to be exactly 5pt in this case. So, instead of %\def\slideentry##1##2##3##4##5##6{}%, you can put

\def\slideentry#1#2#3#4#5#6{%
%section number, subsection number, slide number, first/last frame, page number, part number
\ifnum#6=\c@part\ifnum#2>0\ifnum#3>0%
\ifbeamer@compress%
\else%
\beamer@xpos=#3\relax%
\beamer@ypos=#2\relax%
\fi%
\kern-3pt% compensate line break
\hbox to 0pt{%
\beamer@tempdim=-\beamer@vboxoffset%
\multiply\beamer@tempdim by\beamer@ypos%
\raise\beamer@tempdim\hbox{%
\beamer@tempdim=\beamer@boxsize%
\multiply\beamer@tempdim by\beamer@xpos%
\kern\beamer@tempdim
\global\beamer@section@min@dim\beamer@tempdim
\usebeamerfont{mini frame}%
\ifnum\c@section=#1%
\ifnum\c@subsection=#2%
\usebeamercolor[fg]{mini frame}%
\ifnum\c@subsectionslide=#3%
\usebeamertemplate{mini frame}%\beamer@minislidehilight%
\else%
\usebeamertemplate{mini frame in current subsection}%\beamer@minisliderowhilight%
\fi%
\else%
\usebeamercolor{mini frame}%
%\color{fg!50!bg}%
\usebeamertemplate{mini frame in other subsection}%\beamer@minislide%
\fi%
\else%
\usebeamercolor{mini frame}%
%\color{fg!50!bg}%
\usebeamertemplate{mini frame in other subsection}%\beamer@minislide%
\fi%
}}}\hskip-10cm plus 1fil%
}%
\kern-2pt% compensate line break
\fi\fi%
\else%
\fakeslideentry{#1}{#2}{#3}{#4}{#5}{#6}%
\fi\ignorespaces
}


This is the original definition of \slideentry except that two \kerns are added.

Playing code

\documentclass[compress]{beamer}
\useoutertheme[right,width=50pt,height=25pt]{sidebar}
\usetheme{Copenhagen}
\makeatletter

\def\slideentry#1#2#3#4#5#6{%
%section number, subsection number, slide number, first/last frame, page number, part number
\ifnum#6=\c@part\ifnum#2>0\ifnum#3>0%
\ifbeamer@compress%
\else%
\beamer@xpos=#3\relax%
\beamer@ypos=#2\relax%
\fi%
\kern-3pt% compensate line break
\hbox to 0pt{%
\beamer@tempdim=-\beamer@vboxoffset%
\multiply\beamer@tempdim by\beamer@ypos%
\raise\beamer@tempdim\hbox{%
\beamer@tempdim=\beamer@boxsize%
\multiply\beamer@tempdim by\beamer@xpos%
\kern\beamer@tempdim
\global\beamer@section@min@dim\beamer@tempdim
\usebeamerfont{mini frame}%
\ifnum\c@section=#1%
\ifnum\c@subsection=#2%
\usebeamercolor[fg]{mini frame}%
\ifnum\c@subsectionslide=#3%
\usebeamertemplate{mini frame}%\beamer@minislidehilight%
\else%
\usebeamertemplate{mini frame in current subsection}%\beamer@minisliderowhilight%
\fi%
\else%
\usebeamercolor{mini frame}%
%\color{fg!50!bg}%
\usebeamertemplate{mini frame in other subsection}%\beamer@minislide%
\fi%
\else%
\usebeamercolor{mini frame}%
%\color{fg!50!bg}%
\usebeamertemplate{mini frame in other subsection}%\beamer@minislide%
\fi%
}}}\hskip-10cm plus 1fil%
}%
\kern-2pt% compensate line break
\fi\fi%
\else%
\fakeslideentry{#1}{#2}{#3}{#4}{#5}{#6}%
\fi\ignorespaces
}

\vbox{%
\def\sectionentry##1##2##3##4##5{%
\ifnum##5=\c@part%
\hbox{{%
\usebeamerfont{section in sidebar}\usebeamercolor[fg]{section in sidebar}%
\ifnum\c@section=##1%
\ifnum\c@subsection=0\relax%
{\usebeamertemplate{section in sidebar}}%
\else%
\ifx\beamer@nav@css\beamer@hidetext%
{\usebeamertemplate{section in sidebar}}%
\else%
\fi%
\fi%
\else
\fi}}}%
\beamer@currentsubsection=0\relax\fi}%

\def\beamer@subsectionentry##1##2##3##4##5{%
\ifnum##1=\c@part%
\beamer@tocifnothide{\ifnum\c@section=##2\ifnum\c@subsection=##3\beamer@nav@css\else\beamer@nav@oss\fi\else\beamer@nav@ooss\fi}%
{\hbox{{%
\usebeamerfont{subsection in sidebar}\usebeamercolor[fg]{subsection in sidebar}%
\ifnum\c@section=##2%
\ifnum\c@subsection=##3%
\ifnum\c@subsubsection=0\relax%
{\usebeamertemplate{subsection in sidebar}}%
\else%
\fi%
\else%
\fi%
\else%
\fi}}}%
}%
\fi}%
\def\beamer@subsubsectionentry##1##2##3##4##5##6{%
\ifnum##1=\c@part%
\beamer@tocifnothide{\ifnum\c@section=##2\ifnum\c@subsection=##3\beamer@nav@css\else\beamer@nav@oss\fi\else\beamer@nav@ooss\fi}%
{\hbox{{%
\usebeamerfont{subsubsection in sidebar}\usebeamercolor[fg]{subsubsection in sidebar}%
\ifnum\c@section=##2%
\ifnum\c@subsection=##3%
\ifnum\c@subsubsection=##4%
{\usebeamertemplate{subsubsection in sidebar}}%
\else
\fi%
\else%
\fi%
\else%
\fi}}}%
}%
\fi}%
%\beamer@currentsubsection=0\relax%
}%
}

\begin{document}

\section{Foo}
\begin{frame}{Test1}
content...
\end{frame}

\subsection{foo}
\begin{frame}{Test2}
content...
\end{frame}
\begin{frame}{Test3}
content...
\end{frame}
\begin{frame}{Test4}
content...
\end{frame}
\begin{frame}{Test5}
content...
\end{frame}

\section{Goo}
\begin{frame}{Test6}
content...
\end{frame}
\begin{frame}{Test7}
content...
\end{frame}

\section{goo}
\begin{frame}{Test8}
content...
\end{frame}
\begin{frame}{Test9}
content...
\end{frame}
\begin{frame}{Test10}
content...
\end{frame}
\begin{frame}{Test11}
content...
\end{frame}

\end{document}


There is a special beamer theme for this purpose, the sidebarwithminiframes outer theme. It can be found at http://mirrors.ctan.org/macros/latex/contrib/beamer-contrib/themes/beamerauxtheme/themes/beamerouterthemesidebarwithminiframes.sty

\documentclass[compress]{beamer}
\useoutertheme[right,width=50pt,height=25pt]{sidebarwithminiframes}
\usetheme{Copenhagen}

\begin{document}
\section{Foo}
\begin{frame}{Test1}
content...
\end{frame}
\subsection{foo}
\begin{frame}{Test2}
content...
\end{frame}
\begin{frame}{Test3}
content...
\end{frame}
\begin{frame}{Test4}
content...
\end{frame}
\begin{frame}{Test5}
content...
\end{frame}\section{Goo}
\begin{frame}{Test6}
content...
\end{frame}
\begin{frame}{Test7}
content...
\end{frame}
\section{goo}
\begin{frame}{Test8}
content...
\end{frame}
\begin{frame}{Test9}
content...
\end{frame}
\begin{frame}{Test10}
content...
\end{frame}
\begin{frame}{Test11}
content...
\end{frame}

\end{document}