11

I am wondering whether we can use the subsection part of the beamer infolines outer theme headline (the right half) to show the miniframe bullets of the current section. Assuming the section has three frames, the headline would look like this

First frame of the section:

       Section Title @oo
       Frame title 

Next frame of the section:

       Section Title o@o
       Frame title 

and so on.

I guess this can be done by hacking around \dohead, but I couldn't figure out how to tweak things. Any help will be greatly appreciated.

1
  • I'm looking for the same thing, a mix of the infolines and smoothbars. Did you find some solution?
    – adn
    Commented Nov 16, 2011 at 6:57

1 Answer 1

11

This is quite a hackish solution: It starts with the miniframes outer theme and patches the internal beamer commands in order to remove the other sections from the headline:

\documentclass{beamer}

% "Beamer infolines outer theme with miniframe bullets only for the current section"
% (http://tex.stackexchange.com/a/45152/3323)
\useoutertheme[subsection=false]{miniframes}
\setbeamertemplate{mini frame in other section}{}
\usepackage{etoolbox}
\makeatletter
\let\beamer@section@set@min@width=\relax
\patchcmd{\insertnavigation}{\hskip-1.875ex plus-1fill}{}{}{}
\patchcmd{\sectionentry}{\hskip1.875ex plus 1fill}{}{}{}
\patchcmd{\sectionentry}{\hyperlink{Navigation#3}{{\usebeamertemplate{section in head/foot shaded}}}}{}{}{}
\patchcmd{\slideentry}{\usebeamertemplate{mini frame in other subsection}}{\usebeamertemplate{mini frame in other subsection of current section}}{}{}
\patchcmd{\slideentry}{\usebeamertemplate{mini frame in other subsection}}{\usebeamertemplate{mini frame in other section}}{}{}
\patchcmd{\slideentry}{\usebeamertemplate{mini frame in other subsection of current section}}{\usebeamertemplate{mini frame in other subsection}}{}{}
\makeatother

\begin{document}
\section{Section 1}
\subsection{Subsection 1}
\frame{\frametitle{Frame 1}}
\frame{\frametitle{Frame 2}}
\frame{\frametitle{Frame 3}}
\subsection{Subsection 2}
\frame{\frametitle{Frame 1}}
\frame{\frametitle{Frame 2}}
\frame{\frametitle{Frame 3}}
\frame{\frametitle{Frame 4}}
\section{Section 2}
\subsection{Subsection 1}
\frame{\frametitle{Frame 1}}
\frame{\frametitle{Frame 2}}
\frame{\frametitle{Frame 3}}
\frame{\frametitle{Frame 4}}
\subsection{Subsection 2}
\frame{\frametitle{Frame 1}}
\frame{\frametitle{Frame 2}}
\frame{\frametitle{Frame 3}}
\frame{\frametitle{Frame 4}}
\frame{\frametitle{Frame 5}}
\end{document}

Example headline:

example headline: section 2, subsection 1, frame 3

(If you want to have all mini frames in one line instead of using a single line per subsection, you can use \documentclass[compress]{beamer} as usual.)


Explanation of the code:

We use the outer theme miniframes and remove all the mini frames that do not belong to the current section:

\useoutertheme[subsection=false]{miniframes}
\setbeamertemplate{mini frame in other section}{}

Now, etoolbox is used to remove some code from the beamer macros responsible for generating the navigation bar:

  • Remove the space between the sections:

    \let\beamer@section@set@min@width=\relax
    \patchcmd{\insertnavigation}{\hskip-1.875ex plus-1fill}{}{}{}
    \patchcmd{\sectionentry}{\hskip1.875ex plus 1fill}{}{}{}
    
  • Do not display sections other than the current section at all:

    \patchcmd{\sectionentry}{\hyperlink{Navigation#3}{{\usebeamertemplate{section in head/foot shaded}}}}{}{}{}
    
  • Fix an inconsistency in the current beamer version: currently, the template mini frame in other subsection is used for both mini frames in the current section and other sections, where the latter case should use mini frame in other section:

    \patchcmd{\slideentry}{\usebeamertemplate{mini frame in other subsection}}{\usebeamertemplate{mini frame in other subsection of current section}}{}{}
    \patchcmd{\slideentry}{\usebeamertemplate{mini frame in other subsection}}{\usebeamertemplate{mini frame in other section}}{}{}
    \patchcmd{\slideentry}{\usebeamertemplate{mini frame in other subsection of current section}}{\usebeamertemplate{mini frame in other subsection}}{}{}
    
6
  • I really appreciate the explanation of the code! A further look-and-feel question: is it possible to center your navigation bar?
    – Matti
    Commented Aug 24, 2014 at 15:48
  • @diabonas Your solution works well, thank you! Is there a way to show all the circles at once instead of showing only the circles for current section? Commented Jun 17, 2016 at 11:07
  • @Mappi To do that, you can add \patchcmd{\insertnavigation}{\hskip.3cm}{\hfill}{}{}\patchcmd{\insertnavigation}{\hskip.3cm}{\hfill}{}{} (sic!) right before \makeatother.
    – diabonas
    Commented Jun 18, 2016 at 11:59
  • @GeMir You mean the mini frames for the other subsection of the current section? I have updated the answer to do that.
    – diabonas
    Commented Jun 18, 2016 at 12:00
  • @diabonas Thank you for your answer! I mean this: tex.stackexchange.com/questions/315234/… Commented Jun 18, 2016 at 12:52

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .