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 trying to modify some themes in Beamer and nearly have what I want. The last step is to change the headline to display the sections in the presentation.

What I have so far is:

enter image description here

however, I would like the top (headline) bar to be solid black and list the sections similarly to

enter image description here

I've tried loading themes and modifying themes, but nothing seems to work. If anyone has any recommendations, please post an answer. I appreciate your help and time.

Minimum Example:

\documentclass{beamer}
\usetheme{Warsaw}

\title[Short Title]{Long Title}
\author[Short Name]{Long Name}
\institute[Short Inst.]
{Long Inst.}
\date{October 1, 2012}

\begin{document}
\section{Section 1}
\begin{frame}
\frametitle{Section 1}
Hello World!
\end{frame}

\section{Section 2}
\begin{frame}
\frametitle{Section 2}
Hello World!
\end{frame}

\end{document}

Theme:

\ProvidesPackageRCS $Header: /home/vedranm/bitbucket/beamer/base/themes/theme/beamerthemeWarsaw.sty,v d02a7cf4d8ae 2010/06/17 09:11:41 rivanvx $

\mode<presentation>

%% Themes
% Outer themes
\useoutertheme{shadow}
% Color themes
\usecolortheme{orchid}
\usecolortheme{whale}
% Rounded boxes and shadows
\useinnertheme[shadow=true]{rounded}
% Solid \item symbols
\useinnertheme{circles}

%% Custom colors
\setbeamerfont{block title}{size={}}
\setbeamercolor{structure}{fg=red}
\setbeamercolor{item}{fg=red}

% Hide navigation symbols
\setbeamertemplate{navigation symbols}{}

%% Title block
\definecolor{beamer@darkred}{RGB}{190,0,0}
\setbeamercolor*{title}{use=structure,fg=white,bg=beamer@darkred}

%% Bottom infolines
\setbeamertemplate{footline}
{
  \leavevmode%
  \hbox{%
  % Name and institution
  \begin{beamercolorbox}[wd=0.5\paperwidth,ht=2.3ex,dp=1.25ex,right]{title in head/foot}%
    \usebeamerfont{title in head/foot}\insertshortauthor~~\beamer@ifempty{\insertshortinstitute}{}{(\insertshortinstitute)}\hspace{1em}
  \end{beamercolorbox}%\hspace*{-0.5pt}%
  % Short title
  \begin{beamercolorbox}[wd=0.41\paperwidth,ht=2.3ex,dp=1.25ex,left]{author in head/foot}%
    \usebeamerfont{author in head/foot}\hspace{1em}\insertshorttitle
  \end{beamercolorbox}\hspace*{-0.5pt}%
  % Frame counter
  \begin{beamercolorbox}[wd=0.1\paperwidth,ht=2.3ex,dp=1.25ex,right]{author in head/foot}%
    \usebeamerfont{author in head/foot}\insertframenumber{}\hspace{1pt}/\hspace{1pt}\inserttotalframenumber\hspace*{4ex}

  \vskip0pt%
}

\mode
<all>
share|improve this question
add comment

1 Answer

up vote 17 down vote accepted

Beamer appearance cheat sheet is a very useful cheat sheet when it comes to customize the look of beamer documents. To get the layout you are interested in, I would modify the template for the headline as follows:

\setbeamertemplate{headline}{%
\leavevmode%
  \hbox{%
    \begin{beamercolorbox}[wd=\paperwidth,ht=2.5ex,dp=1.125ex]{palette quaternary}%
    \insertsectionnavigationhorizontal{\paperwidth}{}{\hskip0pt plus1filll}
    \end{beamercolorbox}%
  }
}

The command insertsectionnavigationhorizontal does all the magic. The remaining code just puts all the sections within a colored box of width paperwidth.

Note that the insertsectionnavigationhorizontal command takes three parameters: the width of the box, material that is inserted to the left, and material that is inserted to the right. In this case, nothing goes to the left and an expandable space goes to the right, making the section names left justified. If you want centered section titles, just copy the third argument into the second:

\insertsectionnavigationhorizontal{\paperwidth}{\hskip0pt plus1filll}{\hskip0pt plus1filll}

The setting of the template goes before the \begin{document}, and after all themes have been loaded.

Beamer create own headline theme is also a related question in TeXSX.


EDIT

There are errors in your theme file: you forgot to close the last beamercolorbox and the overall hbox. Add these lines before the vskip0pt:

 \end{beamercolorbox}}

(yes that's a double brace, the last one closes the hbox). This is how the header looks like: result

share|improve this answer
    
+1 for the cheat sheet! That will save me lots of beamer guide look-ups. –  hakaze Dec 4 '12 at 8:26
    
Yes! This is exactly what I was looking for. Thank you very much, I truly appreciate. And I agree with hakaze, that cheat sheet looks like it will be infinitely helpful. I've printed it and placed it next to me desktop. Sorry about the missing \end{beamercolorbox}}, I did have it in my theme; however, when I copied it to StackExchange and indented everything, somehow it go deleted. Thank you nonetheless for pointing it out (I'm sure it will help someone if they want to use the theme. –  William Dec 4 '12 at 13:00
    
@WilliamAndrewLane you're welcome! and yes, that cheat sheet is so good that deserves all the attention it can get. –  guillem Dec 4 '12 at 14:25
    
@guillem I haven't read the cheat sheet carefully yet, but it seems a nice resource! –  Gonzalo Medina Dec 4 '12 at 16:43
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.