[Tex/LaTex] How to show only current section/subsection in beamer

beamerheader-footernavigationsectioning

I was wondering, if it is possible to show only the current section and subsection in the navigation bar ?
In the default configuration, the navigationbar uses too much space of the slide. With

\documentclass[compress]{beamer}

the items are squashed together.

Here is a minimal example:

% packages
\documentclass[serif,mathserif]{beamer}
\usepackage[utf8x]{inputenc}
\usepackage{amsmath, amsfonts, epsfig, xspace}
\usepackage{beamerthemesplit}

% template
\usetheme{default}
\useoutertheme{default}
\setbeamertemplate{navigation symbols}{} 


\begin{document}

 \section{section a}
    \begin{frame} \frametitle{frame 1} \end{frame}
 \section{section b}
    \begin{frame} \frametitle{frame 2} \end{frame}
 \section{section c}
    \begin{frame} \frametitle{frame 3} \end{frame}
 \section{section d}
    \begin{frame} \frametitle{frame 4} \end{frame}


\end{document}

Best Answer

You can either use the infolines outer theme, or set the headline beamer template using \insertsectionhead and \insertsubsectionhead; a little example:

\documentclass{beamer}

\usecolortheme{whale}
\useoutertheme{split}
\usefonttheme[onlysmall]{structurebold}

\setbeamertemplate{headline}
{%
  \leavevmode%
  \begin{beamercolorbox}[wd=.5\paperwidth,ht=2.5ex,dp=1.125ex]{section in head/foot}%
    \hbox to .5\paperwidth{\hfil\insertsectionhead\hfil}
  \end{beamercolorbox}%
  \begin{beamercolorbox}[wd=.5\paperwidth,ht=2.5ex,dp=1.125ex]{subsection in head/foot}%
    \hbox to .5\paperwidth{\hfil\insertsubsectionhead\hfil}
  \end{beamercolorbox}%
}

\setbeamertemplate{navigation symbols}{} 

\begin{document}

 \section{Test section a}
    \begin{frame} \frametitle{frame 1} \end{frame}
 \subsection{Test subsection a1}
    \begin{frame} \frametitle{frame 2} \end{frame}
 \subsection{Test subsection a2}
    \begin{frame} \frametitle{frame 3} \end{frame}
 \section{Test section b}
    \begin{frame} \frametitle{frame 4} \end{frame}
 \subsection{Test subsection b1}
    \begin{frame} \frametitle{frame 5} \end{frame}
 \subsection{Test subsection b2}
    \begin{frame} \frametitle{frame 6} \end{frame}

\end{document}