Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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.

share|improve this question
    
I'm looking for the same thing, a mix of the infolines and smoothbars. Did you find some solution? –  adn Nov 16 '11 at 6:57
add comment

1 Answer

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 subsection}{}
\usepackage{etoolbox}
\makeatletter
\beamer@compressfalse
\patchcmd{\insertnavigation}{\hskip-1.875ex plus-1fill}{}{}{}
\patchcmd{\sectionentry}{\beamer@section@set@min@width}{}{}{}
\patchcmd{\sectionentry}{\hskip1.875ex plus 1fill}{}{}{}
\patchcmd{\sectionentry}{\hyperlink{Navigation#3}{{\usebeamertemplate{section in head/foot shaded}}}}{}{}{}
\patchcmd{\slideentry}{\beamer@ypos=#2\relax}{}{}{}
\patchcmd{\fakeslideentry}{\beamer@ypos=#2\relax}{}{}{}
\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}}
\subsection{Subsection 2}
\frame{\frametitle{Frame 1}}
\frame{\frametitle{Frame 2}}
\frame{\frametitle{Frame 3}}
\frame{\frametitle{Frame 4}}
\end{document}

Example headline:

example headline: section 2, subsection 1, frame 3


Explanation of the code:

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

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

The beamer option compress=false is used, so that every subsection has a line on its own. This is necessary to be able to remove all the space occupied by the mini frames of other subsections (which is done later):

\beamer@compressfalse

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

  • Remove the space between the sections:

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

    \patchcmd{\sectionentry}{\hyperlink{Navigation#3}{{\usebeamertemplate{section in head/foot shaded}}}}{}{}{}
    
  • Remove the new line generated by each subsection. Like this, all the subsections are written on top of each other, which is no problem as only the current subsection is displayed anyway. This may sound a bit weird, but it is necessary as the other subsections would create spurious space otherwise:

    \patchcmd{\slideentry}{\beamer@ypos=#2\relax}{}{}{}
    \patchcmd{\fakeslideentry}{\beamer@ypos=#2\relax}{}{}{}
    
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.