3

Bonjour,

I desesperately try to change the colour of \insert(short)part in CambridgeUS theme.

Here is what I want:

\setbeamertemplate{headline}{%
  \leavevmode%
  \hbox{%
    \begin{beamercolorbox}[%
      wd=.5\paperwidth,ht=2.25ex,dp=1ex,center]{%
        author in head/foot}%
      \usebeamerfont{%
        section in head/foot}%
      \insertpart%
    \end{beamercolorbox}%
    \begin{beamercolorbox}[%
      wd=.5\paperwidth,ht=2.25ex,dp=1ex,center]{%
        part in head/foot}%
      \usebeamerfont{%
        date in head/foot}%
      \insertsubsection%
    \end{beamercolorbox}}%
  \vskip0pt%
}

But whatever the \setbeamercolor I use, the fg colour for \insertpart (or \insertsection...) remains red!

For instance, I can change the bg colour:

\setbeamercolor*{palette tertiary}{fg=green,bg=black}

the background becomes black the the foreground (for \insertpart) remains red and is not turned into green!

Does anybody have an answer and a reference where this is documented?

2
  • Welcome to TeX.sx! A tip: If you indent lines by 4 spaces, they'll be marked as a code sample. You can also highlight the code and click the "code" button (with "{}" on it).
    – cgnieder
    Commented Sep 10, 2012 at 21:05
  • Check out the Beamer Manual. Part 3 is dedicated to "changing the way things look."
    – Daryl
    Commented Sep 10, 2012 at 21:20

1 Answer 1

1

Bonjour. Your code works for me:

\documentclass{beamer}
\usetheme{CambridgeUS}

\setbeamercolor{palette tertiary}{fg=green,bg=black}

\setbeamertemplate{headline}{%
  \leavevmode%
  \hbox{%
    \begin{beamercolorbox}[%
      wd=.5\paperwidth,ht=2.25ex,dp=1ex,center]{%
        author in head/foot}%
      \usebeamerfont{%
        section in head/foot}%
      \insertpart%
    \end{beamercolorbox}%
    \begin{beamercolorbox}[%
      wd=.5\paperwidth,ht=2.25ex,dp=1ex,center]{%
        part in head/foot}%
      \usebeamerfont{%
        date in head/foot}%
      \insertsubsection%
    \end{beamercolorbox}}%
  \vskip0pt%
}
\begin{document}

\part{Test Part}
\section{Test Section}
\begin{frame}
Test
\end{frame}

\end{document}

enter image description here

However, you must be careful; changing palette tertiary will affect other elements of the theme besides the headline (as can be seen in my example). If you want to change only the colors used in the headline, then you need to proceed in another way (setting the appropriate colors for the corresponding beamer boxes, for example).

1
  • The culprit has been found: in \hypersetup command, to feed the metadata, colorlinks=true override the changes made on colours for hyperlinks and \insertpart is a hyperlink... (similarly, you cannot change colours of items in toc) Commented Sep 11, 2012 at 10:38

You must log in to answer this question.

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