5

I have an issue with the highlighting of my navigation bar within a beamer presentation. On my computer monitor the highlighting looks quite good, but i like to have the current element of the section/subsection a little bit more distinct because at the beamer there isn't a big difference noticeable.

So my question is, how can i style the current element within the navigation bar? I'm using LaTeX with the Warsaw theme.

My presentation looks like this:

\documentclass[12pt]{beamer}
\usepackage[english]{babel}  
\usepackage[utf8]{inputenc} 
\beamertemplatenavigationsymbolsempty
\setbeamercovered{transparent}
\setbeamertemplate{footline}[]

\usetheme{Warsaw}
\usecolortheme{seahorse}

\title[]{PRJ2 - HB Logistics}

\begin{document}
\begin{frame}
\titlepage
\end{frame}

\begin{frame}
\tableofcontents
\end{frame}

\section{Introduction}
\subsection{Project conditions}
\begin{frame}
\frametitle{Project conditions}
\end{frame}

\end{document}
1
  • Welcome to the TeX.SX! Could you please add a minimal (working) example of your efforts? It would help solvers a lot to be able to actually start working on your issue.
    – Malipivo
    Commented Apr 8, 2014 at 12:38

1 Answer 1

9

One option is to change the "opacity" for the shaded sections/subsection, and reduce the default 50% factor used to, say, a 20%:

\documentclass{beamer}
\usetheme{Warsaw}

\setbeamertemplate{section in head/foot shaded}[default][20]
\setbeamertemplate{subsection in head/foot shaded}[default][20]

\begin{document}

\section{Test section one}
\begin{frame} test\end{frame}
\subsection{Test subsection}
\begin{frame} test\end{frame}
\subsection{Test subsection}
\begin{frame} test\end{frame}
\section{Test section two}
\begin{frame} test\end{frame}
\subsection{Test subsection}
\begin{frame} test\end{frame}
\subsection{Test subsection}
\begin{frame} test\end{frame}

\end{document}

enter image description here

In the Warsaw theme, sections in the navigation bar are by default, typeset in white over a black background, so in my opinion that is the maximum possible contrast. If you want to change this, you can set the section in head/foot color according to your liking:

\documentclass{beamer}
\usetheme{Warsaw}

\setbeamertemplate{section in head/foot shaded}[default][20]
\setbeamertemplate{subsection in head/foot shaded}[default][20]
\setbeamercolor{section in head/foot}{bg=black!60,fg=orange}

\begin{document}

\section{Test section one}
\begin{frame} test\end{frame}
\subsection{Test subsection}
\begin{frame} test\end{frame}
\subsection{Test subsection}
\begin{frame} test\end{frame}
\section{Test section two}
\begin{frame} test\end{frame}
\subsection{Test subsection}
\begin{frame} test\end{frame}
\subsection{Test subsection}
\begin{frame} test\end{frame}

\end{document}

enter image description here

You can also change the font size, but, since the font size used for shaded and current elements are not independent, this will require some additional work:

\documentclass{beamer}
\usetheme{Warsaw}

\setbeamertemplate{section in head/foot shaded}[default][20]
\setbeamertemplate{subsection in head/foot shaded}[default][20]
\setbeamerfont{section in head/foot}{size=\small}
\setbeamerfont{subsection in head/foot}{size=\footnotesize}

\makeatletter
\def\insertsectionnavigation#1{%
  \hbox to #1{%
    \vbox{{\usebeamerfont{section in head/foot}\usebeamercolor[fg]{section in head/foot}%
     \vskip0.5625ex%
     \def\slideentry##1##2##3##4##5##6{}%
     \def\sectionentry##1##2##3##4##5{%
       \ifnum##5=\c@part%
       \def\insertsectionhead{##2}%
       \def\insertsectionheadnumber{##1}%
       \def\insertpartheadnumber{##5}%
       \setbox\beamer@tempbox=\hbox{%
         \hyperlink{Navigation##3}{\hbox to #1{%
             \hskip0.3cm%
             \ifnum\c@section=##1%
               {\usebeamertemplate{section in head/foot}}%
             \else%
               {\tiny\usebeamertemplate{section in head/foot shaded}}%
             \fi\hskip0.3cm}}}%
       \ht\beamer@tempbox=1.6875ex\dp\beamer@tempbox=0.75ex%
       \box\beamer@tempbox\fi}%
     \dohead\vskip0.5625ex}}\hfil}}
\def\insertsubsectionnavigation#1{%
  \hbox to #1{%
    \vbox{{%
      \usebeamerfont{subsection in head/foot}\usebeamercolor[fg]{subsection in head/foot}%
      \vskip0.5625ex%
      \beamer@currentsubsection=0%
      \def\sectionentry##1##2##3##4##5{}%
      \def\slideentry##1##2##3##4##5##6{\ifnum##6=\c@part\ifnum##1=\c@section%
        \ifnum##2>\beamer@currentsubsection%
        \beamer@currentsubsection=##2%
        \def\insertsubsectionhead{##5}%
        \def\insertsectionheadnumber{##1}%
        \def\insertsubsectionheadnumber{##2}%
        \def\insertpartheadnumber{##6}%
        \setbox\beamer@tempbox=\hbox{\beamer@link(##4){%
            \hbox to #1{\hskip0.3cm%
              \ifnum\c@subsection=##2%
                {\usebeamertemplate{subsection in head/foot}}%
              \else%
                {\tiny\usebeamertemplate{subsection in head/foot shaded}}%
              \fi\hfil\hskip0.3cm}}}%
        \ht\beamer@tempbox=1.6875ex\dp\beamer@tempbox=0.75ex%
        \box\beamer@tempbox\fi\fi\fi}%
      \dohead\vskip0.5625ex}\hfil}}}     
\setbeamertemplate{headline}%{split theme}
{%
  \leavevmode%
  \@tempdimb=5.4375ex%
  \ifnum\beamer@subsectionmax<\beamer@sectionmax%
    \multiply\@tempdimb by\beamer@sectionmax%
  \else%
    \multiply\@tempdimb by\beamer@subsectionmax%
  \fi%
  \ifdim\@tempdimb>0pt%
    \advance\@tempdimb by 1.825ex%
    \begin{beamercolorbox}[wd=.5\paperwidth,ht=\@tempdimb]{section in head/foot}%
      \vbox to\@tempdimb{\vfil\insertsectionnavigation{.5\paperwidth}\vfil}%
    \end{beamercolorbox}%
    \begin{beamercolorbox}[wd=.5\paperwidth,ht=\@tempdimb]{subsection in head/foot}%
      \vbox to\@tempdimb{\vfil\insertsubsectionnavigation{.5\paperwidth}\vfil}%
    \end{beamercolorbox}%
  \fi%
}

\makeatother
\begin{document}

\section{Test section one}
\begin{frame} test\end{frame}
\subsection{Test subsection}
\begin{frame} test\end{frame}
\subsection{Test subsection}
\begin{frame} test\end{frame}
\section{Test section two}
\begin{frame} test\end{frame}
\subsection{Test subsection}
\begin{frame} test\end{frame}
\subsection{Test subsection}
\begin{frame} test\end{frame}

\end{document}

enter image description here

2
  • Tanks for your answer! But what i'm kind of looking for, is to style the highlighted element for example in another color or make the font size bigger. The purpose is to make them more distinct. Commented Apr 8, 2014 at 12:52
  • 1
    @JanTrienes I did an addition to my answer that might be of interest for you. Commented Apr 8, 2014 at 13:31

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .