Site icon R-bloggers

Creating a Presentation with LaTeX Beamer – Getting Started

[This article was first published on Software for Exploratory Data Analysis and Statistical Modelling, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

The LaTeX beamer package can be used to create appealing presentations for many applications. A working knowledge of LaTeX is required but once the initial learning curve and transition is made from a visual word processor to a markup based approach the benefits are worth the initial investment of time.

Title Pages

In a previous post we considered creating a title page for a presentation which follows the same general approach to creating titles in other LaTeX document types.

< !--[Fast Tube]-->
Fast Tube by Casper
< !--[/Fast Tube]-->

An example of the commands needed to create the title of a presentation are shown below, where the square brackets are used to indicate the short information that is used in places like the running headers of a document:

title[ggplot2 Tutorial]{An Introduction to the ggplot2 package}
subtitle[GM-RAM]{http://www.wekaleamstudios.co.uk}
author[GM-RAM]{GM-RAM Technical Staff}

Then we need to create a frame in the document to display the title page via the frame environment:

begin{frame}
titlepage
end{frame}

Document Structure

Most LaTeX documents make use of the sectioning commands to create a logical structure to the contents of a document. Headings can be defined at various levels starting from chapter moving down to sections then subsections.

< !--[Fast Tube]-->
Fast Tube by Casper
< !--[/Fast Tube]-->

These sections commands can be used in beamer and behave slightly differently to other document classes and the display of the section headings depends on the theme and the use of tables of contents which can be interspaced around the presentation, for example appearing at the start of each section to remind the audience of progress through the presentation.

The sections are defined in the same way as with other LaTeX documents:

section{Introduction}
 
section{Basic Graphs}

Table of Contents

It is a simple task to add a slide with the table of contents to a presentation using the following commands:

begin{frame}
frametitle{Outline}
tableofcontents[currentsection]
end{frame}

We can specify a title for the slide with the table of contents using the frametitle command.

< !--[Fast Tube]-->
Fast Tube by Casper
< !--[/Fast Tube]-->

We can generate a recurring table of contents at the start of each section with the AtBeginSection command like this:

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

Other useful resources are provided on the Supplementary Material page.

To leave a comment for the author, please follow the link and comment on their blog: Software for Exploratory Data Analysis and Statistical Modelling.

R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.