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 using beamer2thesis, i.e., the beamerthemeTorinoTh style to compile my presentation slides. It is nice but I realized that I need to do some modifications. The upper header stripes seems quite unnecessary unless I put navigation bar there, to show the sections we are in. I modified the outertheme style file,

 \leavevmode%
 \hbox{%
 \begin{beamercolorbox}[wd=\paperwidth,ht=\headerheight,dp=0pt,center]{page header}%
 \usebeamerfont{navigation} \insertsectionnavigationhorizontal{\paperwidth}{\hskip0pt   plus1filll}{}%
 \end{beamercolorbox}%
 }%

The navigation text locates in the bottom of the colorbox. I expect it is at the center of the box instead of a location so low. Any modification I need to do? By the way, I want the color to be white, not this interaction color, because it looks quite not clear.

enter image description here

share|improve this question
    
I upvoted. Now you must be able to upload it. Pl. try. Also it is advisable to provide a complete MWE along with your question. –  Harish Kumar Mar 27 '12 at 7:07
add comment

1 Answer

up vote 6 down vote accepted

You can use a \vbox and \vfil inside the beamercolorbox to center its contents:

\begin{beamercolorbox}[wd=\paperwidth,ht=\headerheight,dp=0pt]{page header}%
  \vbox to\headerheight{\vfil\insertsectionnavigationhorizontal{\paperwidth}{\hskip0pt plus1filll}{}\vfil}%
\end{beamercolorbox}

To get the sections colored in white, the beamer templates section in head/foot and section in head/foot shaded have to be changed:

\setbeamertemplate{section in head/foot}{\color{fg}\insertsectionhead}
\setbeamertemplate{section in head/foot shaded}{\color{fg!50!bg}\insertsectionhead}
\setbeamercolor{section in head/foot}{fg=white}

Full example code:

\documentclass{beamer}
\usetheme{TorinoTh}

\makeatletter
\setbeamertemplate{headline}
{
  \leavevmode%
  \hbox{%
  \begin{beamercolorbox}[wd=\paperwidth,ht=\headerheight,dp=0pt]{page header}%
    \vbox to\headerheight{\vfil\insertsectionnavigationhorizontal{\paperwidth}{\hskip0pt plus1filll}{}\vfil}%
  \end{beamercolorbox}%
  }%
  \vskip0pt%
  \hbox{%
  \begin{beamercolorbox}[wd=\paperwidth,ht=\beamer@torinoth@line]{second header}%
  \end{beamercolorbox}%
  }
}
\makeatother

\setbeamertemplate{section in head/foot}{\color{fg}\insertsectionhead}
\setbeamertemplate{section in head/foot shaded}{\color{fg!50!bg}\insertsectionhead}
\setbeamercolor{section in head/foot}{fg=white}

\begin{document}
\section{Introduction}
\frame{}
\section{Conclusion}
\frame{}
\end{document}

Result:

example headline, centered and with white text color

EDIT: If you want to show only the current section in the headline, you can use the following beamercolorbox instead of the above one:

\begin{beamercolorbox}[wd=\paperwidth,ht=\headerheight,dp=0pt,right]{page header}%
  \vbox to\headerheight{\vfil{\usebeamerfont{section in head/foot}\usebeamercolor[fg]{section in head/foot}\secname\hspace*{.3cm}}\vfil}%
\end{beamercolorbox}
share|improve this answer
    
Great, this works. Thanks, diabonas. One more thing, is that possible to show only the current section, i.e., the other sections are invisible instead of shaded. Using \insertsection does not work. –  seasoul Mar 27 '12 at 12:33
    
@seasoul I've updated my answer to support this. Simply use the alternative beamercolorbox I provided, the rest of the code remains the same. –  diabonas Mar 27 '12 at 13:40
    
Thank you, diabonas. I managed to get it work. What I have to mention is that there is a compile error "undefined control sequence". After searching, I found the solution is add a line in the preamble "\def \secname{}". Until now the problem is solved. –  seasoul Mar 28 '12 at 6:45
    
@seasoul Sounds as if you were using an older version of beamer (before v3.11, released in September 2011). Anyway, your solution \def\secname{} is fine, this is exactly what the newer versions of beamer do, too. –  diabonas Mar 28 '12 at 10:29
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.