A walk through my beamer theme

2020-10-05

A few years ago I started converting to LaTeX: first for proposals, manuscripts and then eventually for presentations. I am not going to lie: the first one took me way longer than usual but since then, now that I have a basic template, it became really worth it. I didn't go for a flashy, fancy theme but made a very simple one based on my institution official template. And since it is simple, it makes for a nice introduction to people willing to learn how to make their own beamer template.
First: your theme will reside in a separate file, called by your main presentation file in a way similar to a package. A weird quirk of beamer is that your filename has to be of the form "beamerthemethemename.sty", i.e. beamerthemeexample.sty for a theme called "example". In my case the file is called beamerthememfn_green.sty, and reside in the same folder as the presentation file, it is thus imported in it as follows:
\usetheme{mfn_green}
The theme file (downloadable here) itself starts like this:
\mode<presentation>
\usepackage{pgfcomp-version-0-65}
\usepackage{color}                %Used to define colors
\usepackage{fontspec}             %Used to import a new font
After importing a few packages, it starts by defining colors and the main font (here the one used in all official documentation by my institution: Trade Gothic LT StdBeware however that the presentation file thus needs to be compiled with xelatex or lualatex, not standard pdflatex/latex!):
\definecolor{black}{RGB}{0, 0, 0}
\definecolor{mfngreen}{RGB}{161, 191, 36}
\usefonttheme{professionalfonts}
\setmainfont{Trade Gothic LT Std}
Then set the appearence of normal slides:
\useinnertheme{rounded} %Base minimalist template
\setbeamercolor{frametitle}{fg = mfngreen} %Titles are green...
\setbeamerfont{frametitle}{size = \large}  %... large ...
\setbeamertemplate{frametitle}[default][center] %... and centered
\setbeamercolor{normal text}{fg = black}   %Rest of text is black
\setbeamertemplate{navigation symbols}{}   %And i don't want any navigation symbols
Then the title slide:
\setbeamertemplate{title page}{
	\begin{center}
	\huge{\textcolor{mfngreen}\inserttitle}  %The title of the talk, called in the file with \title{}

	\vspace{1cm}
	\Large{\insertauthor}                    %The author(s) of the talk, called in the file with \author{}

	\small{\insertinstitute}                 %Their institute, called in the file with \institute{}

	\small{\insertdate}						 %And the date (called with \date{})

	\end{center}
}
The "outline" slide, together with the look of bullet point lists (not that I use a lot of them):
\setbeamercolor{section in toc}{fg= black}
\setbeamertemplate{itemize item}{\color{mfngreen}$\textbullet$} %All lists have a green bullet for each item
\setbeamertemplate{itemize subitem}{\color{mfngreen}$\textbullet$} %...and subitem
\setbeamertemplate{section in toc}{\color{mfngreen}$\textbullet$~\color{black}\inserttocsection} %Needs to be specified separately for the TOC
And then I created a new environment for the "thank you" frame:
\newenvironment{thankframe}{
	\setbeamercolor{frametitle}{fg = black}
	\setbeamercolor{background canvas}{bg=mfngreen} %Here the background is green and the title black
	\begin{frame}
}
{\end{frame}}
The file then terminates with this statement:
\mode
<all>
And it's basically it! In the real file I also upload a couple of logos to add to the first and last slide footers but it could be as well done in the presentation file itself with the usual \includegraphics bit.
Here is an example of what the output looks like (in this case a seminar talk I gave in Potsdam last year when visiting my colleagues at the GFZ):

Download.