Beamer customization I: colors and \setbeamercolor


Recently, I started using beamer for creating slides with LaTeX. My intention was to mimic, to a sensible extend, the available design of my slides in power point. This circles around three main issues:

  1. A custom color for headlines, titles, etc.
  2. A footline that displays the title, author, institute, date and slide number in two lines
  3. Logos at the right top and left bottom of each slide

None of the available beamer themes truly met my requirements, so I started to customize the default theme. It took some time and a lot of manual reading, so I am providing my solutions for these requirements. Due to the amount of code required, I will release the complete template in multiple posts.

The first issue, A custom color for headlines, titles, etc., was pretty easy to solve by customizing the color theme of certain beamer elements in my preamble.

\definecolor{UniBlue}{RGB}{83,121,170}
\setbeamercolor{title}{fg=UniBlue}
\setbeamercolor{frametitle}{fg=UniBlue}
\setbeamercolor{structure}{fg=UniBlue}

\definecolor is a standard command from the color package. \setbeamercolor can be used to change the default color of certain beamer elements. In the example, the elements title and frametitle should be self-explanatory. structure refers to elements such as bullet points. Unfortunately, the beamer documentation leaves no hint as to what beamer elements actually exist. A quite comprehensive list can be found here or here (thanks to Christian). fg sets the foreground color. The other option is bg for background. The command also comes in a starred version, \setbeamercolor*, which is useful if there are cummulative calls of the command for the same beamer element. The starred version first resets all configurations to their default values, while the non-starred version only changes the specified configurations. So, to change the color for the same element multiple times without side effects, use \setbeamercolor*.


Update 30.07.2013: Link to beamer themes was dead. Replaced with a new one.

Update 10.11.2014: Added link to beamer appearance cheat sheet.

About these ads

10 comments

  1. Pingback: Beamer customization II: footline with multiple lines | Jörg Lenhard's Blog

  2. Anonymous

    Thanks, this is very nice!

  3. Pingback: The ub-beamer Template « Jörg Lenhard's Blog

  4. Anonymous

    This posting answered a question I had, about changing color of the frame title. I used the same \setbeamercolor{frametitle}…
    The difference between what you do and I tried is that I did not add the “fg=” in front of the color name.
    So here is my question, as I struggle to figure out the very mild customization of the default theme: where is such detailed info to be found? You mentioned a lot of reading. Any suggested venue (in English or French, sorry) beyond the user manual?

    Thanks, –Micha Hofri

    • Hi Micha,
      at the time I was building this, the only definite source I had was the manual. When the manual did not make sense to me, I googled my issue and fixed things through reading blog posts, mailing lists, and trial and error. But I don’t have a definite and nice to read source for beamer.
      One blog I concerning LaTeX I follow is this one: http://texblog.org/ There are also some posts on beamer there, maybe it is of help to you.
      Regards, Jörg

  5. I am getting this error.
    l.263 \setbeamercolor{palette primary}{bluedark}

    can anyone help/

  6. Nikolay

    Thanks, very useful information!

  7. Christian

    This really helped me, thank you!

    Maybe you should consider adding the following beamer element cheat sheet to the post, it’s by far the best list I could find: http://www.cpt.univ-mrs.fr/~masson/latex/Beamer-appearance-cheat-sheet.pdf

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 38 other followers