Typevia
Presentations

Understanding the Beamer Theme System

Beamer is the most powerful tool for creating presentations in LaTeX. While a standard Beamer document looks functional, its true power lies in its flexible theme system. Instead of manually positioning every element, you use themes to control the visual identity of your presentation.

Beamer themes are divided into four main categories, often referred to as the "Theme Matrix":

  1. Presentation Themes (Global): These control the overall look (layout, colors, and fonts combined). They are usually named after cities (e.g., Madrid, Warsaw, Berlin).
  2. Color Themes: These specifically control the color palette of the elements (e.g., beaver, crane, shark).
  3. Font Themes: These handle the typography, such as using serif fonts or bold headings (e.g., structurebold, serif).
  4. Inner and Outer Themes: These control specific structural elements. Inner themes handle things inside slides (bullets, blocks, circles), while outer themes handle the "frame" (headers, footers, sidebars).

To apply a global theme, you use the \usetheme{} command in your preamble:

\documentclass{beamer}

% Applying a global theme
\usetheme{Madrid}

\begin{titlepage}
    \title{Introduction to Beamer Themes}
    \author{LaTeX Instructor}
    \date{\today}
\end{titlepage}

\begin{document}
\frame{\titlepage}
\end{document}

Mixing and Matching Themes

One of the best ways to create a unique look without writing complex code is to mix different theme types. You can take the layout of one theme and apply the colors of another.

For example, if you like the clean layout of Boadilla but prefer the professional blue/grey tones of the whale color theme, you can combine them:

\documentclass{beamer}

\usetheme{Boadilla}      % Professional, clean layout
\usecolortheme{whale}    % Deep blue color palette
\usefonttheme{professionalfonts} % Improved font handling
\useinnertheme{circles}  % Changes bullet points to circles

\begin{document}
\begin{frame}{Mixing Themes}
    \begin{itemize}
        \item This slide uses the Boadilla layout.
        \item But it uses the Whale color scheme.
        \item And the bullets are now circles!
    \end{itemize}
\end{frame}
\end{document}

Note: When mixing themes, the order matters. Generally, load the global \usetheme first, then override specific parts with color, font, or inner/outer themes.


Customizing Colors and Elements

Sometimes, pre-defined themes don't match your specific needs (like a university's brand colors). Beamer allows you to redefine the color of almost any element using the \setbeamercolor command.

The syntax is: \setbeamercolor{element name}{fg=foreground_color, bg=background_color}.

Example: Changing Block Colors

Beamer "Blocks" are used to highlight specific content. Here is how you can customize them:

\documentclass{beamer}
\usetheme{Madrid}

% Customizing colors
% 'structure' affects titles and main UI elements
\setbeamercolor{structure}{fg=darkred} 

% Customizing the 'block' element
\setbeamercolor{block title}{bg=darkred, fg=white}
\setbeamercolor{block body}{bg=red!10, fg=black}

\begin{document}
\begin{frame}{Custom Color Example}
    \begin{block}{Important Note}
        This block now uses a custom dark red scheme instead of the default blue.
    \end{block}
    
    \begin{alertblock}{Alert}
        Alert blocks stay red by default unless specifically changed.
    \end{alertblock}
\end{frame}
\end{document}

Best Practice: Use the color!percentage syntax (e.g., blue!20) to create lighter versions of colors for backgrounds. This ensures text remains readable.


Fine-Tuning Templates

Beamer is built on "templates." Almost everything you see—the headline, the footline, the navigation symbols—is a template that can be modified or disabled.

Removing Navigation Symbols

Many presenters find the small navigation icons at the bottom right distracting. You can remove them with:

\setbeamertemplate{navigation symbols}{}

Modifying the Footline

If you want to add a slide number or a custom logo to every slide, you modify the footline template.

\documentclass{beamer}
\usetheme{ProgressBar} % Hypothetical clean theme

% Customizing the footline to show slide numbers
\setbeamertemplate{footline}[frame number]

% Or a more manual approach for a custom footer:
\setbeamertemplate{footline}{
  \leavevmode%
  \hbox{%
  \begin{beamercolorbox}[wd=.5\paperwidth,ht=2.25ex,dp=1ex,center]{author in head/foot}%
    \insertshortauthor
  \end{beamercolorbox}%
  \begin{beamercolorbox}[wd=.5\paperwidth,ht=2.25ex,dp=1ex,right]{title in head/foot}%
    \insertframenumber{} / \inserttotalframenumber\hspace*{2ex} 
  \end{beamercolorbox}}%
  \par\vskip0pt%
}

\begin{document}
\frame{Main Content}
\end{document}

Adding Professional Touches: Logos and Backgrounds

To make your presentation look truly professional, you may want to add a company or university logo and adjust the aspect ratio for modern screens.

1. Change the Aspect Ratio

By default, Beamer uses a 4:3 ratio. Most modern projectors and monitors use 16:9. You can change this in the document class:

\documentclass[aspectratio=169]{beamer}

The \logo{} command places an image on every slide. The exact position depends on the theme you've chosen.

\logo{\includegraphics[width=1cm]{university_logo.png}}

3. Background Images

If you want a subtle watermark or a full background image:

\setbeamertemplate{background}{
    \includegraphics[width=\paperwidth,height=\paperheight,keepaspectratio]{background.jpg}
}

Common Pitfalls and Best Practices

When customizing Beamer, it is easy to over-design and distract your audience. Follow these guidelines to keep your presentation effective:

  • Avoid High-Contrast Backgrounds: While a dark background with white text looks cool, it can be difficult to read in bright rooms. If you use a dark theme, ensure the font weight is sufficient.
  • Don't Overload the Footer: Information like the date, author, title, and slide number are useful, but if they take up 20% of the slide height, you're losing valuable space.
  • The "Sans-Serif" Rule: In general, sans-serif fonts (like the Beamer default) are easier to read on projected screens than serif fonts (like Times New Roman).
  • Consistent Blocks: If you change the color of a standard block, make sure to also update exampleblock and alertblock so the visual language remains consistent throughout the deck.

Summary Checklist for Customization:

  1. Choose a Global Theme for layout (\usetheme).
  2. Adjust the Color Palette to match your brand (\usecolortheme or \setbeamercolor).
  3. Set the Aspect Ratio to 16:9 for modern displays.
  4. Remove Navigation Symbols if they aren't being used.
  5. Add a Logo for institutional branding.

By mastering these commands, you can move away from the "default LaTeX look" and create presentations that are both academically rigorous and visually engaging.