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'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.

share|improve this question
    
Welcome to TeX.sx! –  mafp Mar 14 '13 at 14:49

1 Answer 1

up vote 2 down vote accepted

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

share|improve this answer
    
Awesome! Thank you very much Gonzalo. –  user27383 Mar 14 '13 at 16:43
    
@user27383 You're welcome! I'm glad I could help. –  Gonzalo Medina Mar 14 '13 at 16:45
    
If it wouldn't be considered bothersome of me to ask, how could I best adjust that second beamercolorboxto include a frame number/total frame number like seen in that PDF listed above (which would probably be its own beamercolorbox and adjusted to the right)? Please forgive my lack of awareness, I'm trying to make some Beamer themes for my department and having to teach myself from scratch. –  user27383 Mar 14 '13 at 17:11
    
@user27383 It's not bothersome at all; there's no need for a new beamercolorbox; looking at the position of the numbers, they use the same box as the section/subsection heads; it's enough to use a \hfill and insert the numbers and then leave some little \hspace, as I did in my updated answer. Now it's my time to bother you: please, if you consider that my answer solved your problem, don't forget to up-vote it and accept it (they are two different actions); in case of doubt about accepting answers, please see How do you accept an answer?. –  Gonzalo Medina Mar 14 '13 at 17:57

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.