Create a presentation in LaTeX (beamer)

Use the document class beamer. Each slide is a frame environment, and the result is a PDF with one page per slide.

The snippets use the document class beamer.

Smallest presentation

\title, \author, \institute and \date store the data in the preamble, and \titlepage inside a frame prints it. The braces after \begin{frame} hold the title of the slide; a second pair of braces adds a subtitle.

Complete document:

\documentclass{beamer}

\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}{Why a new sensor}
\begin{itemize}
\item Cup anemometers wear out.
\item Ultrasonic sensors have no moving parts.
\end{itemize}
\end{frame}

\end{document}
Result
Page 1 of the compiled examplePage 1
Page 2 of the compiled examplePage 2

Open in the editor

Sections and an outline slide

\section stands between the frames and prints nothing on its own. \tableofcontents inside a frame lists the sections; the list is complete after the second run. The code in \AtBeginSection is inserted at the start of every section, here an outline slide on which the option currentsection fades the other sections.

Complete document:

\documentclass{beamer}

\AtBeginSection{
\begin{frame}{Outline}
\tableofcontents[currentsection]
\end{frame}
}

\begin{document}

\section{Motivation}
\begin{frame}{Motivation}
Cup anemometers wear out.
\end{frame}

\section{Method}
\begin{frame}{Method}
The sensor measures the travel time of sound.
\end{frame}

\end{document}
Result
Page 1 of the compiled examplePage 1
Page 2 of the compiled examplePage 2
Page 3 of the compiled examplePage 3
Page 4 of the compiled examplePage 4

Open in the editor

Text and image side by side

Each column inside columns takes its width as argument. The columns are centred vertically against each other; \begin{columns}[T] aligns their top edges instead. beamer loads graphicx itself, so \includegraphics works without \usepackage{graphicx}.

\begin{frame}{Test setup}
\begin{columns}
\begin{column}{0.55\textwidth}
\begin{itemize}
\item Two transducers face each other.
\item The distance is 20 cm.
\end{itemize}
\end{column}
\begin{column}{0.4\textwidth}
\includegraphics[width=\linewidth]{image.png}
\end{column}
\end{columns}
\end{frame}
Result
The compiled example

Highlighted blocks

The argument is the title of the block; empty braces give a block without title. alertblock uses red and exampleblock green. In the default theme only the block titles are coloured; themes such as Madrid put a coloured box around the block, see Change the theme and colours of a beamer presentation in LaTeX.

\begin{frame}{Result}
\begin{block}{Finding}
The error stays below 2 percent.
\end{block}

\begin{alertblock}{Limitation}
Heavy rain disturbs the signal.
\end{alertblock}

\begin{exampleblock}{Example}
At 10 m/s the sensor shows 9.8 m/s.
\end{exampleblock}
\end{frame}
Result
The compiled example

Open in the editor

Slides in the format 16:9

Without the option, a slide measures 128 mm × 96 mm (4:3). aspectratio=169 gives 160 mm × 90 mm, and aspectratio=1610 gives 160 mm × 100 mm. The slide is small, so the standard font size of 11 pt looks large once the PDF fills the screen.

Complete document:

\documentclass[aspectratio=169]{beamer}

\begin{document}

\begin{frame}{Wide slide}
This slide has the format 16:9.
\end{frame}

\end{document}
Result
The compiled example

Open in the editor

Pitfalls

Compiled with pdfLaTeX from TeX Live 2023.

Related pages