Beamer Tutorial: LaTeX Presentations with Section Slides, Overlays, and Themes

Date Published

Beamer Presentations: LaTeX Slides Tutorial for Beginners

Quick answer: How do you make slides in LaTeX? Use the beamer class: write \documentclass{beamer}, choose a theme with \usetheme{Madrid}, and put each slide in \begin{frame}{Title} ... \end{frame}. Compile with pdfLaTeX, XeLaTeX or LuaLaTeX and present the PDF full-screen in any viewer. This is a complete deck:

1\documentclass[aspectratio=169]{beamer} % 16:9 slides
2\usetheme{Madrid}
3\title{My Talk}
4\author{Your Name}
5\date{\today}
6\begin{document}
7\begin{frame}
8 \titlepage
9\end{frame}
10\begin{frame}{First Slide}
11 \begin{itemize}
12 \item Beamer slides are ordinary LaTeX
13 \item One frame is one slide
14 \end{itemize}
15\end{frame}
16\end{document}

Try this in Octree — free LaTeX editor with AI, compiles in your browser

Beamer is the LaTeX class for presentations: you write \documentclass{beamer}, put each slide in a frame environment, and compile to a PDF that opens full-screen in any viewer. A complete minimal talk is a title frame plus a few \begin{frame}{Title} ... \end{frame} blocks, and everything you already know from LaTeX documents, including math, figures, tables, and bibliographies, works unchanged inside a frame.

This tutorial builds up a real talk: the document skeleton, section slides with an automatic table of contents, overlays that reveal content step by step, themes and colour themes (including the dark and 16:9 variants), columns and blocks, speaker notes, handout mode, and the errors that catch beginners such as \verb in a non-fragile frame. Every snippet compiles as shown.

Beamer Slides in LaTeX

The commands you use on almost every slide deck, in one compilable file: a theme and colour theme, frames with titles, two columns with a block and an image, and overlays with \pause and \only<2->. Beamer loads graphicx and xcolor itself, so no extra packages are needed; the example images ship with TeX Live (mwe package).

1\documentclass[aspectratio=169]{beamer}
2\usetheme{Madrid} % layout theme: Madrid, Berlin, Warsaw, metropolis ...
3\usecolortheme{beaver} % colour theme
4\setbeamertemplate{navigation symbols}{} % hide the navigation icons
5\title{Beamer Slides Cheat Sheet}
6\author{Your Name}
7\begin{document}
8
9\begin{frame}{Frames} % one frame = one slide
10 \framesubtitle{Frame title and subtitle}
11 Text, lists and maths work as usual: $E = mc^2$.
12\end{frame}
13
14\begin{frame}{Columns}
15 \begin{columns}[T]
16 \begin{column}{0.48\textwidth}
17 \begin{block}{Left column}
18 A block has a title bar and a shaded body.
19 \end{block}
20 \end{column}
21 \begin{column}{0.48\textwidth}
22 \includegraphics[width=\linewidth]{example-image-a}
23 \end{column}
24 \end{columns}
25\end{frame}
26
27\begin{frame}{Overlays}
28 First point.
29 \pause % the rest appears on the next click
30 Second point.
31 \only<3->{Shown from step 3 on.}
32 \begin{itemize}
33 \item<3-> Appears on step 3
34 \item<4-> Appears on step 4
35 \end{itemize}
36\end{frame}
37\end{document}

Want a finished deck instead? The free Beamer presentation template (Madrid theme) compiles unchanged in Octree, Overleaf or any TeX install. For footnotes on slides, see how to add a footnote in Beamer.

A Minimal Beamer Document

1\documentclass[aspectratio=169]{beamer}
2\usetheme{Madrid}
3\title{A Short Talk}
4\subtitle{Written in Beamer}
5\author{Your Name}
6\institute{Your University}
7\date{\today}
8
9\begin{document}
10
11\begin{frame}
12 \titlepage
13\end{frame}
14
15\begin{frame}{Outline}
16 \tableofcontents
17\end{frame}
18
19\section{Introduction}
20
21\begin{frame}{Why Beamer?}
22 \begin{itemize}
23 \item Consistent typography and math, straight from LaTeX
24 \item Overlays reveal content step by step
25 \item One source compiles to slides, handouts, and notes
26 \end{itemize}
27\end{frame}
28
29\end{document}

Each frame is one slide. The title can be given as the frame's optional-looking argument, \begin{frame}{Why Beamer?}, or with \frametitle{Why Beamer?} on the next line; a \framesubtitle is available too. aspectratio=169 gives widescreen 16:9 slides, which match every modern projector and laptop; leave it out for the classic 4:3, or use 1610 or 43.

Compile with pdfLaTeX, XeLaTeX, or LuaLaTeX, as for any document. Run it twice so the table of contents and navigation bars fill in.

Sections and Automatic Section Slides

Beamer's \section and \subsection do not produce slides on their own; they populate the table of contents and the navigation elements in themes that show them. To insert a slide at the start of every section that highlights where you are, use \AtBeginSection:

1\documentclass{beamer}
2\usetheme{Madrid}
3\AtBeginSection[]{
4 \begin{frame}{Outline}
5 \tableofcontents[currentsection]
6 \end{frame}
7}
8\begin{document}
9\section{Background}
10\begin{frame}{Background}
11 Content of the first section.
12\end{frame}
13\section{Method}
14\begin{frame}{Method}
15 Content of the second section.
16\end{frame}
17\end{document}

\tableofcontents[currentsection] shows the full outline with the current section highlighted and the others dimmed; [currentsection,hideothersubsections] keeps the list short in a long talk. \AtBeginSubsection[] does the same at subsection level. For a plain divider instead of an outline, replace the body with \begin{frame} \centering \Huge \insertsection \end{frame}, or use \sectionpage with themes that define one (metropolis does). The empty [] optional argument suppresses an older short-form syntax; keep it.

Overlays: Revealing Content Step by Step

Overlays are Beamer's incremental builds. A frame with overlays is compiled into several PDF pages, one per step, so they work in any PDF viewer without plugins.

1\documentclass{beamer}
2\begin{document}
3\begin{frame}{Overlays}
4 First point.
5 \pause
6 Second point, after a click.
7 \begin{itemize}
8 \item<1-> Visible from the first step
9 \item<3-> Appears on step three
10 \item<3-4> Only on steps three and four
11 \item<5> Only on step five
12 \end{itemize}
13 \only<2>{This text exists only on step two and takes no space otherwise.}
14 \onslide<4->{This text is reserved space, shown from step four.}
15 \alert<5>{Highlighted on step five.}
16\end{frame}
17
18\begin{frame}{Incremental lists}
19 \begin{itemize}[<+->]
20 \item One
21 \item Two
22 \item Three
23 \end{itemize}
24 \begin{enumerate}[<+-| alert@+>]
25 \item Highlighted as it appears
26 \item Then this one
27 \end{enumerate}
28\end{frame}
29\end{document}

The pieces:

  • \pause splits the frame at that point; everything after it appears one step later.
  • <n-> on an \item means "from step n onwards", <n-m> a range, <n> a single step. Steps are numbered from 1.
  • \only<n>{...} includes the content only on those steps and the layout reflows; \onslide<n>{...} (and \visible) keep the space, so nothing jumps. \invisible and \uncover are the complements.
  • \alert<n>{...} colours text (red in most themes) on the given steps; \textbf<n>{...}, \textit<n>{...}, and \color<n>{...} take overlay specifications too.
  • [<+->] on a list makes each item appear on successive steps; [<+-| alert@+>] also highlights the newest item.

Use overlays sparingly: a build on every slide slows a talk down. They earn their place on a proof, an algorithm walkthrough, or a comparison that you want to control.

Themes and Colour Themes

A theme sets layout (headers, footers, sidebars), a colour theme sets the palette, and a font theme sets the typeface; they combine freely.

1\documentclass{beamer}
2\usetheme{Madrid}
3\usecolortheme{beaver}
4\usefonttheme{professionalfonts}
5\setbeamertemplate{navigation symbols}{}
6\begin{document}
7\begin{frame}{Theme test}
8 Madrid layout with the beaver (dark red) colour theme and no navigation icons.
9\end{frame}
10\end{document}

Theme

Look

default

plain, no decoration

Madrid

solid title bar and footer with author, title, page number; the workhorse

Boadilla

lighter version of Madrid

Berlin, Frankfurt

header with section navigation dots

Copenhagen, Warsaw

heavy header with section and subsection

Berkeley, Hannover

sidebar table of contents

metropolis

modern, flat, minimal (separate package beamertheme-metropolis)

Colour themes: beaver (red), seahorse (light blue), whale and orchid (blue with gradient blocks), crane (orange), dolphin, rose, seagull (greyscale for printing), spruce (green), wolverine (yellow). Every colour can also be overridden with \setbeamercolor{structure}{fg=...}.

For a dark theme, the fastest route is metropolis plus its dark colour variant, or any theme with a dark background set through \setbeamercolor{background canvas}{bg=black} and light foreground colours. A ready-made dark deck is at https://tools.useoctree.com/templates/beamer-dark, and a clean standard Madrid deck is at https://tools.useoctree.com/templates/beamer-presentation; both open directly in Octree.

The line \setbeamertemplate{navigation symbols}{} removes the row of tiny navigation icons at the bottom right, which almost nobody uses and every audience notices.

Columns, Blocks, Figures, and Tables

1\documentclass{beamer}
2\usetheme{Madrid}
3\usepackage{booktabs}
4\begin{document}
5\begin{frame}{Two columns with blocks}
6 \begin{columns}[T]
7 \begin{column}{0.5\textwidth}
8 \begin{block}{Definition}
9 A block has a title and a shaded body.
10 \end{block}
11 \begin{alertblock}{Caution}
12 Alert blocks are red in most themes.
13 \end{alertblock}
14 \begin{exampleblock}{Example}
15 Example blocks are green.
16 \end{exampleblock}
17 \end{column}
18 \begin{column}{0.5\textwidth}
19 \begin{table}
20 \centering
21 \begin{tabular}{lr}
22 \toprule Item & Value \\ \midrule
23 A & 1 \\ B & 2 \\ \bottomrule
24 \end{tabular}
25 \caption{A small table}
26 \end{table}
27 \begin{theorem}
28 Theorems, lemmas, and proofs are predefined.
29 \end{theorem}
30 \end{column}
31 \end{columns}
32\end{frame}
33\end{document}

columns[T] aligns the columns at the top; the default [c] centres them vertically. Column widths are fractions of \textwidth, and the two should sum to at most 1. block, alertblock, and exampleblock are the three standard boxes, and theorem, lemma, definition, proof, and example are predefined with the right numbering. Figures use \includegraphics[width=\textwidth]{file} inside a figure environment as usual; floats never move in Beamer because every frame is its own page, so placement options are ignored.

Speaker Notes and Handouts

1\documentclass{beamer}
2\usepackage{pgfpages}
3\setbeameroption{show notes on second screen=right}
4\begin{document}
5\begin{frame}{Results}
6 Main slide content.
7 \note{Remember to mention the sample size.}
8 \note[item]{Second reminder as a bullet.}
9\end{frame}
10\end{document}

\note{...} attaches speaker notes to a frame. With \setbeameroption{show notes on second screen=right} (which needs pgfpages), the PDF pages become twice as wide, with the slide on the left and notes on the right; a presenter tool such as pdfpc, or a dual-monitor setup in a PDF viewer, shows each half on the right screen. \setbeameroption{show notes} prints notes on separate pages after each slide, and \setbeameroption{hide notes} (the default) drops them.

For printing, compile with the class option handout: \documentclass[handout]{beamer} collapses every overlay to its final state, so one frame produces one page. To put several slides on a sheet, add \usepackage{pgfpages} and \pgfpagesuselayout{4 on 1}[a4paper,landscape,border shrink=5mm]. The common pattern is a single source with the handout option toggled, so slides and handouts never diverge.

Common Beamer Errors

"Illegal parameter number in definition of \beamer@doifinframe" or "FATAL: verbatim". Any frame containing \verb, verbatim, lstlisting, or minted must be declared fragile: \begin{frame}[fragile]{Code}. Beamer stores frame contents for overlay processing, and verbatim material cannot survive that unless the frame is written to a file first, which [fragile] does.

Text overflows the slide. Frames do not grow. Shorten, split into two frames, or add [shrink=10] to scale the content as a last resort; [allowframebreaks] splits a long list over several frames automatically, which is acceptable for a bibliography and poor for anything else.

Figures or \maketitle look wrong. Use \titlepage inside a frame, never \maketitle outside one; and omit float placement specifiers.

Overlays do not appear. Check that overlay specifications use angle brackets, \item<2->, not square brackets, and that \pause sits outside a math environment.

Bibliography fills the slide. Put \bibliography or \printbibliography in a frame with [allowframebreaks], and shrink it with \tiny or \footnotesize.

Beamer Slides FAQ

How do I make a section slide in Beamer?

Add \AtBeginSection[]{\begin{frame}{Outline}\tableofcontents[currentsection]\end{frame}} to the preamble. Every \section then inserts an outline frame with the current section highlighted; replace the body with \sectionpage or a centred \insertsection for a plain divider.

How do I make Beamer slides 16:9?

Use the class option \documentclass[aspectratio=169]{beamer}. Other ratios are 1610, 149, 54, and the default 43.

How do I reveal bullet points one at a time?

Write \begin{itemize}[<+->], or give each item its own overlay specification, such as \item<2->. \pause also works between any two pieces of content.

Why do I get an error when I put code in a frame?

Frames containing \verb, verbatim, lstlisting, or minted must be marked \begin{frame}[fragile]. Without it, Beamer cannot process the verbatim text and stops with a confusing error.

How do I print Beamer slides as a handout?

Add the handout class option to collapse overlays, then \usepackage{pgfpages} with \pgfpagesuselayout{4 on 1}[a4paper,landscape] to place four slides per page.

What is Beamer in LaTeX?

Beamer is the standard LaTeX document class for presentations. You write slides as frame environments in a .tex file, and LaTeX compiles them to a PDF with one page per slide (or per overlay step).

How do I change the Beamer theme?

Put \usetheme{Name} in the preamble, for example Madrid, Berlin, Warsaw or metropolis, and optionally \usecolortheme{beaver} for the colours and \usefonttheme{professionalfonts} for the fonts. Themes, colour themes and font themes combine freely.

How do I add a footnote to a Beamer slide?

Use \footnote{...} inside the frame; Beamer prints it at the bottom of that slide. For footnotes inside columns or blocks, see Beamer footnotes.

Can I make LaTeX slides without installing LaTeX?

Yes. Open the Beamer presentation template in an online LaTeX editor such as Octree, which compiles Beamer in the browser with a live PDF preview.

Build your next talk in Octree, the AI LaTeX editor that compiles Beamer in the browser with instant preview: https://www.useoctree.com

Try this in Octree — free LaTeX editor with AI, compiles in your browser

Octree vs Overleaf
News

Discover how Octree compares to Overleaf — from AI-assisted LaTeX writing and TikZ/BibTeX automation to open-source flexibility and offline editing for researchers.