The fast track to your own Beamer(poster) Theme

In order to get one's presentations and posters into shape one has the choice among a series of predefined themes and color themes. If these are not sufficient or do not agree with the corporate design, one can simple take an existing (color)theme and make changes to it in order to get a new theme that agrees with one's desires.

beamerthemeXYZ.sty

Themes for beamer are easily recognized by the prefix "beamertheme" followed by the actual theme name "XYZ" and the file extensions "sty". On a Texlive installation on Ubuntu Linux the predefined theme files can be found in the folder /usr/share/texmf/tex/latex/beamer/base/themes/theme/

If we take a look at the theme Madrid, there is not much to be done. I simply broke the explicit usage of the colortheme, which controlls the remaining options of this theme.

\mode<presentation>

\newif\ifbeamer@secheader
\beamer@secheaderfalse

\DeclareOptionBeamer{secheader}{\beamer@secheadertrue}
\ProcessOptionsBeamer

% \usecolortheme{whale}
\useinnertheme[shadow]{rounded}
\useoutertheme{infolines}

\ifbeamer@secheader\else\setbeamertemplate{headline}[default]\fi

\mode<all>

beamercolorthemeABC.sty

More fun can be found in the colortheme files which are located in the same directory as the theme files. For my purposes I have started from the default colortheme whale of the Madrid theme.

General theme for beamer

As I was rather fond of the original (color)theme except for its colors, I simply have added a color definition (line 3) and changed the colors of some specific theme elements like the palette quanternary. One quickly notices that for each element two color arguments are available: fg for the text color (foreground) and bg for the background color. When it comes to defining/changing colors in beamer themes the command setbeamercolor [1,2] is your friend.

\mode<presentation>

\definecolor{eisvogel}{RGB}{0,137,147}

\setbeamercolor*{palette primary}{use=structure,fg=white,bg=eisvogel}
\setbeamercolor*{palette secondary}{use=structure,fg=black,bg=eisvogel!60!white}
\setbeamercolor*{palette tertiary}{use=structure,fg=white,bg=black!90!white}
\setbeamercolor*{palette quaternary}{fg=white,bg=eisvogel}

\setbeamercolor*{sidebar}{use=structure,bg=structure.fg}
  
\setbeamercolor*{palette sidebar primary}{use=structure,fg=structure.fg!10}
\setbeamercolor*{palette sidebar secondary}{fg=white}
\setbeamercolor*{palette sidebar tertiary}{use=structure,fg=structure.fg!50}
\setbeamercolor*{palette sidebar quaternary}{fg=white}

\setbeamercolor{titlelike}{parent=palette secondary}

\setbeamercolor*{separation line}{}
\setbeamercolor*{fine separation line}{}

\setbeamercolor*{item}{fg=eisvogel!90!black}
\setbeamercolor*{section}{fg=black,bg=eisvogel!80!black}
\setbeamercolor*{subsection number projected}{fg=black,bg=eisvogel!70!white}

\setbeamercolor{headline}{fg=white,bg=eisvogel}
\setbeamercolor{logo in headline}{fg=black,bg=white}
\setbeamercolor{title in headline}{fg=black}
\setbeamercolor{author in headline}{fg=black}
\setbeamercolor{institute in headline}{fg=black}
\setbeamercolor{logo in headline}{fg=black,bg=white}
\setbeamercolor{separation line}{bg=eisvogel}

\setbeamercolor{footline}{fg=white,bg=eisvogel!80!black}

\setbeamercolor*{normal text}{fg=black,bg=white}

\setbeamercolor*{block body}{bg=eisvogel!15!white,fg=black}
\setbeamercolor*{block title}{fg=black,bg=eisvogel!60!white}

\setbeamertemplate{itemize items}[triangle]
\setbeamertemplate{navigation symbols}{}

\mode<all>

Special theme for beamerposter

As I wanted to use identical color in my posters as in my presentations I had to make some other changes to the color theme to address the different requirements in making a poster like one wanting a different footer with a QR code or a poster header.

For such tasks the command setbeamertemplate [3] is very helpful to override the footer (aka. footline) and header (aka. headline). To change the footer nd header of my posters I have added the following line to the above colortheme file.

\setbeamertemplate{headline}{  
  \leavevmode
  \begin{columns}[T]
	\column{.74\paperwidth}
	  \begin{beamercolorbox}[wd=\columnwidth,sep=1em]{headline}
	  	\vskip2cm
        \begin{center}
          \usebeamercolor{title in headline}{\color{fg}\textbf{\veryHuge{\inserttitle}}\\[1ex]}
          \usebeamercolor{author in headline}{\color{fg}\Huge{\insertauthor}\\[1ex]}
          \usebeamercolor{institute in headline}{\color{fg}\large{\insertinstitute}\\[1ex]}
		  
        \end{center}
	  \end{beamercolorbox}
	\column{.25\paperwidth}
	   \begin{beamercolorbox}[wd=\columnwidth]{logo in headline}
		\centering
		\vskip1.5cm
		\includegraphics[width=.6\linewidth]{logo-gray.png}
		\vskip1.5cm
	   \end{beamercolorbox}
  \end{columns}
  \begin{beamercolorbox}[wd=\paperwidth]{lower separation line head}
    \rule{0pt}{2pt}
  \end{beamercolorbox}
}

\setbeamertemplate{footline}{
  \begin{beamercolorbox}[wd=\paperwidth]{upper separation line foot}
    \rule{0pt}{6pt}
  \end{beamercolorbox}
 
  \begin{beamercolorbox}[ht=6em,leftskip=1cm]{footline}
  \begin{minipage}[b]{9em}
	\includegraphics[height=3.5em]{group_logo_transp.png}
	\vspace{1em}
  \end{minipage}
  \begin{minipage}[b]{.3\columnwidth}
	A. Pritschet\\
	andreas.hasenkopf@physik.uni-regensburg.de\\
	Fakultät für Physik\\
	Universität Regensburg\\
	\vspace{1em}
  \end{minipage}
  \hfill
  \begin{minipage}[b]{.4\columnwidth}
	\raggedleft
	\textbf{http://em.ur.de/}\\
	\vspace{1em}
  \end{minipage}
  \begin{minipage}[b]{6em}
  	\includegraphics[height=5em]{qrcode.png}
  	\vspace{1em}
  \end{minipage}
  \end{beamercolorbox}

  \begin{beamercolorbox}[wd=\paperwidth]{lower separation line foot}
    \rule{0pt}{2pt}
  \end{beamercolorbox}
}

Example

To give you an idea of how things should look like take a look at these three *.sty files I used for my posters and presentations:

Conclusion

The macros of the beamer(poster) classes are kind of an abstraction of simple TeX offering a bunch of structures that can be reshaped and recolored (and more) by means of themes and colorthemes. I admit that my example is rather trivial compared to the possibilities, but in academia trivial examples rule :P

In case you haven't noticed yet .sty files do not have to neccessarily be located in the above mentioned directory. They simple have be in a path known to Tex. If you do not want to install the themes globally, the files can simply be put in the same folder as the .tex file.

References

  1. http://en.wikibooks.org/wiki/LaTeX/Presentations
  2. http://ftp.gwdg.de/pub/ctan/macros/latex/contrib/beamer/doc/beameruserguide.pdf#subsection.3.15
  3. http://ftp.gwdg.de/pub/ctan/macros/latex/contrib/beamer/doc/beameruserguide.pdf#subsection.8.2