Change the theme and colours of a beamer presentation in LaTeX (usetheme)
\usetheme{Name} in the preamble selects a complete design, and \usecolortheme{name} replaces its colours. Single elements are changed with \setbeamercolor, \setbeamerfont and \setbeamertemplate.
The snippets use the document class beamer.
Choose a theme
Most themes that come with beamer are named after cities, for example Madrid, Berlin, Warsaw, Copenhagen, Singapore, Boadilla and Frankfurt. Write the name exactly as shown, with the capital letter. Without \usetheme, the theme default applies: white background, blue titles and no bars at the edges.
Complete document:
\documentclass{beamer}
\usetheme{Madrid}
\title{Measuring Wind Speed with Ultrasound}
\author{Anna Schmidt}
\institute{Example University}
\date{12 May 2025}
\begin{document}
\begin{frame}
\titlepage
\end{frame}
\begin{frame}{Motivation}
\begin{block}{Problem}
Cup anemometers wear out.
\end{block}
\end{frame}
\end{document}Change the colours of the theme
A colour theme replaces the colours and keeps the layout of the theme. beaver uses dark red and grey, crane yellow, dove black and white, and albatross a dark blue background.
This goes into the preamble.
\usetheme{Madrid}
\usecolortheme{beaver}Use your own colour
structure is the colour from which titles, list bullets and bars are derived. \usecolortheme[named=brand]{structure} sets it to a colour defined with \definecolor. \setbeamercolor{element}{fg=..., bg=...} changes one element, here the title line of the slides; fg is the text colour and bg the background.
This goes into the preamble.
\usetheme{Madrid}
\definecolor{brand}{HTML}{005A9C}
\usecolortheme[named=brand]{structure}
\setbeamercolor{frametitle}{bg=brand, fg=white}Change fonts
beamer sets the slides in a sans-serif font. \usefonttheme{serif} switches them to the serif font. \setbeamerfont sets the size, the series (\bfseries) or the shape (\itshape) of one element.
This goes into the preamble.
\usefonttheme{serif}
\setbeamerfont{frametitle}{size=\Large, series=\bfseries}
\setbeamerfont{title}{size=\huge, shape=\itshape}Navigation symbols, slide numbers and logo
The first line removes the row of small navigation symbols in the lower right corner. The second replaces the footline with the slide number in the form 3/12; themes such as Madrid already show the number in their own footline, which this line would replace. \logo puts an image on every slide; where it appears depends on the theme.
This goes into the preamble.
\setbeamertemplate{navigation symbols}{}
\setbeamertemplate{footline}[frame number]
\logo{\includegraphics[height=8mm]{logo.png}}Pitfalls
- Keep the order
\usetheme, then\usecolortheme, then your own\setbeamercolor,\setbeamerfontand\setbeamertemplatelines. A theme that is loaded later sets its values again: a footline set before\usetheme{Madrid}is replaced by the footline of the theme. beamerloadsxcoloritself, so\definecolorand mixes such asbrand!20work without\usepackage{xcolor}. To get the colour names of anxcoloroption, pass it through the class:\documentclass[xcolor=dvipsnames]{beamer}.- The theme
metropolisis a separate package. With pdfLaTeX it writes a warning to the log that its Fira fonts need XeLaTeX or LuaLaTeX, and the slides use the standard sans-serif font.
Compiled with pdfLaTeX from TeX Live 2023.
Related pages
- How-to Create a presentation in LaTeX
- How-to Show slide content step by step in LaTeX
- How-to Colored text in LaTeX
- Package
xcolor - Error Undefined color `darkgreen'