![](https://corporate-assets.lucid.co/co/7c6fd082-22f3-4acf-ac27-a373bf635b6d.png?v=1712437569187)
How to Make a Presentation in LaTeX
Trudy Firestone
Reading time: about 13 min
Topics:
What? LaTeX for Presentations?
LaTeX is a typesetting and document creation tool that is often used for creating academic articles due to its ability to display mathematical equations. Beyond that, it has many other capabilities due to a large amount of packages, such as Forest, which I used for laying out sentence trees in a college Linguistics class. One such package, Beamer, allows you to create presentations. While Beamer lacks the simple click and drag functionality of a GUI tool in creating presentations, it makes up for it by automating a large portion of the stylistic work---as long as you like the default styles or are willing to write your own---and offering all the mathematical equations, graphs, and other tools available in LaTeX. A sample Beamer document:\documentclass{beamer}
\title{Sample Title}
\subtitle{Sample Subtitle}
%\usetheme{lucid}
\begin{document}
\frame {
\titlepage
}
\frame {
\frametitle{Sample Page 1}
\[\frac{-b \pm \sqrt{b^2 - c}}{2a}\]
}
\frame{
\frametitle{Sample Page 2}
\framesubtitle{An Example of Lists}
\begin{itemize}
\item 1
\item 2
\item 3
\end{itemize}
}
\frame{
\frametitle{Paragraph Content}
This is a paragraph.
}
\end{document}
![Sample LaTeX file with default beamer theme](https://corporate-assets.lucid.co/co/090f1fc6-8cd4-4a8f-b8a8-ecd36c54e80c.png?height=1009&width=1339)
\usetheme{lucid}
, I was able to create a presentation I was pleased with. Only a few weeks ago, I was able to reuse the theme and create a new presentation with all the custom styling that I wanted in much less time than a GUI tool would have required to replicate my original theme.
![Sample LaTeX file with our new lucid theme](https://corporate-assets.lucid.co/co/7f83d829-3f95-4730-9d4e-5f8e8e72c7fd.png?height=1007&width=1337)
Building Your Own Beamer Theme
While it’s easy to find documentation on creating a presentation using Beamer, it’s more difficult to locate documentation on building a Beamer theme. Therefore, I’m going to walk through creating a simple Beamer theme with its own title page, header and footer, and styled lists. The first step in creating a Beamer theme is creating the following four files where “lucid” is the name of our new theme:- beamerinnerthemelucid.sty
- beamerouterthemelucid.sty
- beamercolorthemelucid.sty
- beamerthemelucid.sty
\usecolortheme{albatross}
And the output pdf would consist of this:
![Default LaTeX Beamer theme with albatross color theme](https://corporate-assets.lucid.co/co/af965b2b-edf0-4d2c-89eb-0421228f2a59.png?height=1006&width=1337)
- Inner: Defines the appearance of any items that make up the slides central content, e.g., lists or the title on the title page
- Outer: Defines the appearance of the chrome of the slide, e.g., the title and footer of each slide
- Color: Defines the colors used in various parts of the theme, e.g.,the color for frame titles or the background color
\mode<presentation>
\useinnertheme{lucid}
\useoutertheme{lucid}
\usecolortheme{lucid}
\mode<all>
The change to presentation mode at the beginning of the file is added so that the .sty file will match the mode of the presentation .tex file. Beamer automatically converts all files with its document class to presentation mode. The rest of the file simply sets all the portions of the theme to the new lucid theme and then returns the file to the normal mode. Each of the .sty files used to create the theme needs to be put in presentation mode in the same way.
Right now, the theme doesn’t actually change anything. Everything is still using the default theme because we haven’t defined any new styles. Let’s start with the title page. Because the title is part of the inner content of the title page, the definition for its style goes into beamerinnerthemelucid.sty.
I want a title page that’s centered vertically and horizontally like the one in the default theme, but with a bigger font, a different color, and no date. So, let’s add the following to beamerinnerthemelucid.sty between the mode changes:
\defbeamertemplate*{title page}{lucid}
{
\vfill
{\centering
\usebeamerfont{title}\usebeamercolor[fg]{title}\inserttitle
\par
}
\vskip1cm%
{\centering
\usebeamerfont{subtitle}\usebeamercolor[fg]{subtitle}\insertsubtitle
\par
}
\vfill
}
![Sample LaTeX presentation title page with simplified title](https://corporate-assets.lucid.co/co/7540f096-ec02-435d-8ccd-c19b7fbdbaad.png?height=871&width=1164)
\defbeamertemplate
command creates a new template where the first argument is the mode, *
in this case, the second argument is what the template is for, and the third argument is the name of the new template. To access the template elsewhere, the given name is used, in this case “lucid.” The final part of \defbeamertemplate
is where the actual template is defined using arbitrary LaTeX code. In this case, we use common commands for centering and accessed the title and subtitle via \inserttitle
and \insertsubtitle
. To get the correct colors, we use \usebeamercolor
which fetches the correct colors from the color theme based on the element name given, i.e., the name of the color. Similarly, \usebeamerfont
fetches the correct font from the font theme, so that you can specify the font separately.
However, the color and the font remain unchanged, so we need to edit the color theme file next. I want white text on a dark background, so we need to change the background color first.
\definecolor{gray}{RGB}{90, 90, 90}
\setbeamercolor*{background canvas}{bg=gray}
\setbeamercolor*{title}{fg=white}
\setbeamerfont{title}{size=\Huge}
\setbeamerfont{subtitle}{size=\large}
![Sample LaTeX presentation title page with new background color](https://corporate-assets.lucid.co/co/590a9c07-104a-4bbf-ac2f-5fae386dd48a.png?height=873&width=1164)
\setbeamertemplate{navigation symbols}{}
![Updated LaTeX presentation title page without navigation symbols](https://corporate-assets.lucid.co/co/0ee4260f-4bed-4dd3-86be-fb9b9e2269d8.png?height=867&width=1158)
\defbeamertemplate
, \setbeamertemplate
can be used to define a new template. The element that uses the template is immediately set to use the new template rather than being set separately. In this case, the navigation symbols element is set to empty.
Now that the title page looks just the way I want it to, we can move on to the content slides. While they already have the correct background color and are correctly lacking the navigation symbols in the footer, the title and subtitle are the wrong color and lack style.
![LaTeX presentation content slides without any additional style changes](https://corporate-assets.lucid.co/co/f8432d08-1045-4a5a-8bb0-c0a64c72a8b4.png?height=506&width=1352)
\RequirePackage{tikz}
\newlength{\marginedPaperWidth}{\paperwidth - 0.2cm}
% Frame title
\defbeamertemplate*{frametitle}{lucid}[1][]{
\vskip0.5cm%
\begin{beamercolorbox}[wd=\paperwidth,ht=1.2cm]{frametitle}
\begin{tikzpicture}
\useasboundingbox(0,0) rectangle(\the\paperwidth,1.2);
{\usebeamercolor[fg]{frametitle-left}}
\fill[color=frametitle-left.fg] (0.2,0) rectangle(\the\marginedPaperWidth,1.2);
\ifx\insertframesubtitle\@empty%
{\node[anchor=west] at (0.3,0.61){\usebeamerfont{frametitle}\insertframetitle};}
\else%
{\node[anchor= west] at (0.2,0.81){\usebeamerfont{frametitle}\insertframetitle};%
\node[anchor= west] at (0.4,0.25){\usebeamerfont{framesubtitle}-\insertframesubtitle};}%
\fi
\end{tikzpicture}
\end{beamercolorbox}
}
In addition to the now familiar Beamer commands, we use an if statement to differentiate between the cases of when there is and isn’t a subtitle, and we make use of a new package, tikz, which allows the user to create drawings in LaTeX. By using it in the template for the frametitle, we’ve added a rectangle to each frame title in the presentation. We set the color of the rectangle with the Beamer color frametitle-left which the command \usebeamercolor[fg]{frametitle-left}
adds to the environment.
![LaTeX presentation content frames with updated frametitle layout](https://corporate-assets.lucid.co/co/01cca32e-4497-4f3e-be63-774e2b6c0fd1.png?height=505&width=1349)
\definecolor{lucid-blue}{RGB}{41, 170, 225}
\setbeamercolor{frametitle-left}{fg=lucid-blue}
\setbeamercolor{frametitle}{fg=white}
\setbeamerfont{frametitle}{size=\Large}
\setbeamerfont{framesubtitle}{size=\small}
![LaTeX presentation content frames with updated frametitle colors](https://corporate-assets.lucid.co/co/5dc4b49a-dddf-4da1-9266-ff2162f8003c.png?height=506&width=1350)
\setbeamertemplate{itemize items}[square]
Just as \setbeamertemplate can be used to define a new template that is immediately applied, it can also be used to set a template defined by \defbeamertemplate earlier. square
is defined by default in the beamer package, and it makes the bullets in an unordered list square.
![LaTeX presentation slide with square bullets for the list](https://corporate-assets.lucid.co/co/6b776c29-cfb5-4e92-b0e9-57de94ecb6de.png?height=868&width=1158)
\definecolor{light-grey}{RGB}{240, 240, 240}
\setbeamercolor*{itemize item}{fg=light-grey}
\setbeamercolor*{itemize subitem}{fg=light-grey}
\setbeamercolor*{normal text}{fg=white}
![LaTeX presentation slides with updated content colors](https://corporate-assets.lucid.co/co/7f52067e-d472-4b58-9d74-41786b9baf2d.png?height=1010&width=1345)
\def\logo{%
\includegraphics[width=3cm]{lucidsoftware-logo.png}%
}
\setbeamertemplate{footline}{%
\begin{minipage}[t]{0.5\paperwidth}
\begin{beamercolorbox}[wd=3cm, ht = 1cm]{page number in head/foot}
\ifnum\thepage>1\relax%
\vskip0.2cm%
\hskip0.3cm%
\insertpagenumber\,/\,\insertpresentationendpage\kern1em\vskip2pt%
\hfill
\fi
\end{beamercolorbox}
\end{minipage}
\begin{minipage}[t]{0.76\paperwidth}
\hfill
\begin{beamercolorbox}[wd=3cm, ht = 1cm]{page number in head/foot}
\logo
\end{beamercolorbox}
\end{minipage}
}
![LaTeX presentation slides with footer with page numbers and logo](https://corporate-assets.lucid.co/co/ded884e2-1f04-49f9-bfac-1f1e9b9e7a37.png?height=1008&width=1346)
\setbeamercolor*{page number in head/foot}{fg=light-grey}
Conclusion
Creating your own LaTeX theme allows for complete customizability, something you have to work very hard to achieve in more conventional presentational tools. It also makes it trivial to reuse the theme, avoiding wasted effort.Additional References:
About Lucid
Lucid Software is a pioneer and leader in visual collaboration dedicated to helping teams build the future. With its products—Lucidchart, Lucidspark, and Lucidscale—teams are supported from ideation to execution and are empowered to align around a shared vision, clarify complexity, and collaborate visually, no matter where they are. Lucid is proud to serve top businesses around the world, including customers such as Google, GE, and NBC Universal, and 99% of the Fortune 500. Lucid partners with industry leaders, including Google, Atlassian, and Microsoft. Since its founding, Lucid has received numerous awards for its products, business, and workplace culture. For more information, visit lucid.co.