# Making Elegant Presentation Slides Using LaTex Beamer

This post demonstrates how to make elegant presentation slides using LaTex with Beamer package. If you are an Emacs user and haven’t read my previous posts about how to set up a nice LaTex working environment with Emacs on MacOS and Ubuntu, please have a look at it and I am pretty sure you’re gonna love it.

## What’s Beamer

Beamer is a LaTeX document class for creating slides for presentations. With Beamer, it’s going to be much easier for us to create presentation slides using LaTex. Next, let me show you how to make elegant slides from scratch.

## Create a LaTex Project

Fire a terminal and execute the following commands.

cd ~
mkdir -p example/pdf
cd example
mkdir bib
touch main.tex


In this example project, we create a folder example with two sub-folders pdf and bib in it. pdf contains all the figures you are including in the slides (we use pdf format for all the figures), and bib stores bibliography related files. The main source file main.tex is created in the root directory. Put the logo figures in the pdf sub-folder, and you should have a similar file tree as follows.

example/
├── bib
├── main.tex
└── pdf
├── CUHK_logo.pdf
└── JHU_logo.pdf


Fire a text editor that you are comfortable with (e.g., Emacs). Copy and paste the following codes into the newly created main.tex file.

\documentclass[serif]{beamer}

% you can play with different themes and color themes to find your favorite combination.
\mode<presentation> {
\usetheme{Luebeck}
\usecolortheme{beaver}
}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% include necessary packages here
\usepackage{graphicx} % for including images
\graphicspath{ {./pdf/} } % declare the path where your graphic files are
\DeclareGraphicsExtensions{.pdf} % so you won't have to specify these with every instance of \includegraphics
\usepackage{pgf} % for logo
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% declare new command here
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% ----------------------------------------------------------
%	TITLE PAGE
% ----------------------------------------------------------

% The short title in [] appears at the bottom of every slide
% The full title is only on the title page
Title
}

\institute{
\medskip
}

\date{\today} % Date, can be changed to a custom date

\logo{
\pgfputat{\pgfxy(0,7.8)}{\pgfbox[right,base]
{\includegraphics[width=1.2cm,height=1.2cm,keepaspectratio]{CUHK_logo}
\hspace{\dimexpr\paperwidth-2.4cm-5pt}
\includegraphics[width=.9cm,height=.9cm,keepaspectratio]{JHU_logo}}}
}

\begin{document}

\begin{frame}
\titlepage % Print the title page as the first slide
\end{frame}

\logo{} % logo only appears on the first slide

\begin{frame}
\fontsize{12}{10}
\tableofcontents
\end{frame}

% Throughout your presentation, if you choose to use \section{} and \subsection{} commands, these will automatically be printed on this slide as an overview of your presentation
\AtBeginSection[]{
\begin{frame}
\fontsize{12}{10}
\tableofcontents[
currentsection,
]
\end{frame}
}

\end{document}


Compile the project and you will see a PDF file with the following pages.

The second page is empty because we haven’t defined any sections or subsections. So let’s add more slides.

Include two more useful packages subfig and bm, and add more slides by copying the presentation slides code at the end of previous code block.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% include necessary packages here
\usepackage{graphicx} % for including images
\graphicspath{ {./pdf/} } % declare the path where your graphic files are
\DeclareGraphicsExtensions{.pdf} % so you won't have to specify these with every instance of \includegraphics
\usepackage{pgf} % for logo
\usepackage{subfig}
\usepackage{bm}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% ----------------------------------------------------------
%	PRESENTATION SLIDES
% ----------------------------------------------------------

\section{section A}

\subsection{subsection B}
\begin{frame}\frametitle{title D}
\begin{figure}
\centering
\includegraphics[height=.7\textheight]{example-image}
\caption{This is the caption.}
\end{figure}
\end{frame}

\section{section C}

\subsection{subsection D}
\begin{frame}\frametitle{title E}
\begin{figure}
\centering
\subfloat[Second subfigure\label{fig:b}]{\includegraphics[height=2cm,width=3cm]{example-image-a}}
\caption{A figure}
\label{fig:1}
\end{figure}
\begin{figure}
\centering
\subfloat[Fourth subfigure\label{fig:d}]{\includegraphics[height=2cm,width=3cm]{example-image-c}}
\caption{Another figure}
\label{fig:2}
\end{figure}
\end{frame}

\begin{frame}\frametitle{title F}
\begin{align}
\mathbf{H}(\bm{\theta}(t)) \ddot{\bm{\theta}}(t) + \mathbf{C}(\bm{\theta}(t),\dot{\bm{\theta}}(t)) + \mathbf{G}(\bm{\theta}(t)) = \bm{\tau}
\end{align}
\end{frame}


After compilation, you can obtain some elegant slides as follows.

Enjoy playing with Beamer.