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.

Currently only subsection highlighted on the outline on the side of the slide. Is it possible to change the template so when in a subsection the respective section stays highlighted.

\documentclass{beamer}
\mode<presentation>{\usetheme{Hannover}}
\begin{document}
\section{1}
\subsection{a}
\begin{frame}
stuff
\end{frame}
\subsection{b}
\begin{frame}
more stuff
\end{frame}
\end{document}
share|improve this question
add comment

1 Answer

up vote 4 down vote accepted
+50

This behaviour is not limited to the theme Hannover, it concerns all themes using sidebars. To change it, you have to patch the macro \insertverticalnavigation, which is responsible for generating the sidebar navigation:

\documentclass{beamer}
\mode<presentation>{\usetheme{Hannover}}

\usepackage{etoolbox}
\makeatletter
\patchcmd{\insertverticalnavigation}%
{\ifx\beamer@nav@css\beamer@hidetext{\usebeamertemplate{section in sidebar}}\else{\usebeamertemplate{section in sidebar shaded}}\fi}%
{{\usebeamertemplate{section in sidebar}}}{}{}
\makeatother

\begin{document}
\section{1}
\subsection{a}\frame{}
\subsection{b}\frame{}
\section{2}
\subsection{a}\frame{}
\subsection{b}\frame{}
\end{document}

The code in ll. 4-9 changes the default behaviour of beamer to always highlight the current section (with the beamer theme section in sidebar in contrast to section in sidebar shaded) - normally, the section is only highlighted if no subsections are shown in the sidebar, i.e. if you have \usetheme[hideallsubsections]{Hannover}.

The resulting sidebar with highlighted section (cropped):

sidebar with section "1" and subsection "b" highlighted

share|improve this answer
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.