Is it possible to change the font color of the sections in the head/foot independent from the fg/bg color of the head/foot?
edit: Here's a MWE:
\documentclass{beamer}
\useoutertheme{miniframes}
\setbeamercolor{palette tertiary}{fg=white,bg=black}
\begin{document}
\section{sec 1}
\begin{frame}
sec 1
\end{frame}
\section{sec 2}
\begin{frame}
sec 2
\end{frame}
\end{document}
If I wanted to change the color of the active section names in the header to red, the inactive section name to blue, but keep the colors black and white for the tertiary palette – how would I do that?
Best Answer
This should work:
Explaination
Look at the first line: It says that
section in head/foot
inherits colors frompalette tertiary
and redefinefg=red
. Thereforepalette tertiary
remains unchanged and active section-titles are set to be red.Similarly we want something like
\setbeamercolor{section in head/foot shaded}{parent=palette tertiary,fg=blue}
for inactive section-titles. Yes, we can set these colors. But no, Beamer will never use it. See the following code frombeamerbasenavigation.sty
:You could see that there is an
\ifnum\c@section=#1
checking whether it should shade the section-title or not. However, the color theme is already applied at\usebeamercolor[fg]{section in head/foot}
. Therefore\setbeamercolor{section in head/foot shaded}{parent=palette tertiary,fg=blue}
is legal but useless.But we still got one more chance: after
\ifnum
there is an\usebeamertemplate{section in head/foot shaded}
. It is defined inbeamerouterthemedefault.sty
:Notice that
bg
andfg
here are the colors fromsection in head/foot
. This explains why inactive section-titles seems to be transparent. Assigning brutally a new color at this point solves your problem.