[Tex/LaTex] Two-level Tree Navigation in Beamer

beamernavigationthemes

I'm curious what would be an effective work-around for the Beamer tree outer theme package that would allow for two-level navigation instead of the default three-level navigation.

For example, I'm rather partial to this format: http://www.math.umbc.edu/~rouben/beamer/beamer_pstricks.pdf

In this presentation, the subsubsection is a horizontal tree to the subsection. How would I go about doing this? Any input would be appreciated.

Best Answer

You can redefine the headline template as defined in beamerouterthemetree.sty, to give you the desired layout; something along these lines:

\documentclass{beamer}
\useoutertheme{tree}

\makeatletter
\setbeamertemplate{headline}
{%
    \begin{beamercolorbox}[wd=\paperwidth,colsep=1.5pt]{upper separation line head}
    \end{beamercolorbox}
    \begin{beamercolorbox}[wd=\paperwidth,ht=2.5ex,dp=1.125ex,%
      leftskip=.3cm,rightskip=.3cm plus1fil]{title in head/foot}
      \usebeamerfont{title in head/foot}\insertshorttitle
    \end{beamercolorbox}
    \begin{beamercolorbox}[wd=\paperwidth,ht=2.5ex,dp=1.125ex,%
      leftskip=.3cm,rightskip=.3cm plus1fil]{section in head/foot}
      \usebeamerfont{section in head/foot}%
      \ifbeamer@tree@showhooks
        \setbox\beamer@tempbox=\hbox{\insertsectionhead}%
        \ifdim\wd\beamer@tempbox>1pt%
          \hskip2pt\raise1.9pt\hbox{\vrule width0.4pt height1.875ex\vrule width 5pt height0.4pt}%
          \hskip1pt%
        \fi%
      \else%  
        \hskip6pt%
      \fi%
      \insertsectionhead
      \usebeamerfont{subsection in head/foot}%
      \ifbeamer@tree@showhooks
        \setbox\beamer@tempbox=\hbox{\insertsubsectionhead}%
        \ifdim\wd\beamer@tempbox>1pt%
          \ \raise1.9pt\hbox{\vrule width 5pt height0.4pt}%
          \hskip1pt%
        \fi%
      \else%  
        \hskip12pt%
      \fi%
      \insertsubsectionhead\hfill\insertframenumber/\inserttotalframenumber\hspace{0.5em}
    \end{beamercolorbox}
    \begin{beamercolorbox}[wd=\paperwidth,colsep=1.5pt]{lower separation line head}
    \end{beamercolorbox}
}
\makeatother
\title{Tree Outer Theme}
\begin{document}

\section{Test Section}
\begin{frame} test \end{frame}
\subsection{Test Subsection One}
\begin{frame} test \end{frame}
\subsection{Test Subsection Two}
\begin{frame} test \end{frame}

\end{document}

Some images of the resulting headlines, showing the desired layout:

enter image description here

and

enter image description here