# Introduction

Beamer is a LaTeX package for writing presentations. This documents presents a simple introduction to preparing beamer presentations using org-mode in Emacs.

This documents assumes that the reader is already acquainted with org-mode itself and with exporting org-mode documents to LaTeX. There are tutorials and references available for both org-mode itself and for LaTeX exporting. The document also assumes that the reader understands the notation for Emacs keybindings.

# First steps

### The export template

Starting with an empty file called presentation.org 1[A previously created example presentation]] is available.], say, the first step is to insert the default org export template (C-c C-e t with the default keybindings). This will generate something that looks like this (some specific entries will vary):

<p>
,#+TITLE:     Writing Beamer presentations in org-mode
</p>
<p>
,#+AUTHOR:    Eric S Fraga
</p>
<p>
,#+EMAIL:     e.fraga@ucl.ac.uk
</p>
<p>
,#+DATE:      2010-03-30 Tue
</p>
<p>
,#+DESCRIPTION:
</p>
<p>
,#+KEYWORDS:
</p>
<p>
,#+LANGUAGE:  en
</p>
<p>
,#+OPTIONS:   H:3 num:t toc:t \n:nil @:t ::t |:t ^:t -:t f:t *:t <:t
</p>
<p>
,#+OPTIONS:   TeX:t LaTeX:t skip:nil d:nil todo:t pri:nil tags:not-in-toc
</p>
<p>
,#+INFOJS_OPT: view:nil toc:nil ltoc:t mouse:underline buttons:0 path:http://orgmode.org/org-info.js
</p>
<p>
,#+EXPORT_SELECT_TAGS: export
</p>
<p>
,#+EXPORT_EXCLUDE_TAGS: noexport
</p>
<p>
</p>
<p>
</p>

### Beamer specific settings

In this default template, you will want to modify, at the very least, the title, as I have done, as this will be used as the title of your presentation. It will often be useful to modify some of the LaTeX export options, most commonly the toc option for generating a table of contents. For this document, and the , I have left all options as they are by default according to the template. As well as the general options provided by the template, there are Beamer specific options. The following options are what I use:

<p>
,#+startup: beamer
</p>
<p>
,#+LaTeX_CLASS: beamer
</p>
<p>
,#+LaTeX_CLASS_OPTIONS: [bigger]
</p>

The first line enables the Beamer specific commands for org-mode (more on this below); the next two tell the LaTeX exporter to use the Beamer class and to use the larger font settings2.

### Outline levels for frames (slides)

The following line specifies how org headlines translate to the Beamer document structure.

<p>
,#+BEAMER_FRAME_LEVEL: 2
</p>

### Column view for slide and block customisation

A Beamer presentation consists of a series of slides, called /frames/ in Beamer. If the option shown above has a value of 1, each top level headline will be translated into a frame. Beamer, however, also makes use of LaTeX sectioning to group frames. If this appeals, setting the option to a value of 2 tells org to export second level headlines as frames with top level headlines translating to sections. The final line that is useful to specify to set up the presentation is

<p>
,#+COLUMNS: %40ITEM %10BEAMER_env(Env) %9BEAMER_envargs(Env Args) %4BEAMER_col(Col) %10BEAMER_extra(Extra)
</p>

The purposes of this line is to specify the format for the special interface that org-mode provides to control the layout of individual slides. More on this below.

Once all of the above has been set up, you are ready to write your presentation.

# The slides

Each slide, or frame in Beamer terminology, consists of a title and the content. The title will be derived from the outline headline text and the content will simply be the content that follows that headline. A few example slides are presented below. These will only cover the basic needs; for more complex examples and possible customisations, I refer you to the detailed manual.

### A simple slide

The simplest slide will consist of a title and some text. For instance,

<p>
,* Introduction
</p>
<p>
,** Overview
</p>
<p>
- org-mode template
</p>
<p>
- beamer structure
</p>
<p>
- beamer settings
</p>

defines a new section, Introduction, which has a slide with title /Overview/ and a three item list. The result of this with the settings defined above, mostly default settings, will generate a slide that looks like this:

./a-simple-slide.png

### A more complex slide using blocks

Beamer has the concept of block, a set of text that is logically together but apart from the rest of the text there may be in a slide. How blocks are presented will depend on the Beamer theme used (customisation in general and choosing the theme specifically are described below).

There are many types of blocks. The following

<p>
,** A more complex slide
</p>
<p>
This slide illustrates the use of Beamer blocks.  The following text,
</p>
<p>
with its own headline, is displayed in a block:
</p>
<p>
,*** Org mode increases productivity                               :B_theorem:
</p>
<p>
:PROPERTIES:
</p>
<p>
:BEAMER_env: theorem
</p>
<p>
:END:
</p>
<p>
- org mode means not having to remember LaTeX commands.
</p>
<p>
- it is based on ascii text which is inherently portable.
</p>
<p>
- Emacs!
</p>

<p>
\hfill $$\qed$$
</p>

creates a slide that has a title (the headline text), a couple of sentences in paragraph format and then a theorem block (in which I prove that org increases productivity). The theorem proof is a list of points followed a bit of LaTeX code at the end to draw a fancy /end of proof/ symbol right adjusted.

You will see that there is an org properties drawer that tells org that the text under this headline is a block and it also specifies the type of block. You do not have to enter this text directly yourself; org-mode has a special beamer sub-mode which provides an easy to use method for specifying block types (and columns as well, as we shall see in the next section).

To specify the type of block, you can type C-c C-b. This brings up a keyboard driven menu in which you type a single letter to select the option you wish to apply to this headline. For the above example, I typed C-c C-b t. The options selected in this manner are also shown as tags on the headline. However, note that the tag is for display only and has no direct effect on the presentation. You cannot change the behaviour by changing the tag; it is the property that controls the behaviour.

##### Slides with columns

The previous section introduced the special access keys (C-c C-b) for defining blocks. This same interface allows you to define columns. A headline, as the text that follows it, can be in a block, in a column, or both simutaneously. The | option will define a column. The following

<p>
,** Two columns
</p>

<p>
</p>
<p>
:PROPERTIES:
</p>
<p>
</p>
<p>
:BEAMER_col: 0.4
</p>
<p>
:END:
</p>
<p>
- this slide consists of two columns
</p>
<p>
- the first (left) column has no heading and consists of text
</p>
<p>
- the second (right) column has an image and is enclosed in an
</p>
<p>
@example@ block
</p>

<p>
,*** A screenshot                                            :BMCOL:B_example:
</p>
<p>
:PROPERTIES:
</p>
<p>
:BEAMER_col: 0.6
</p>
<p>
:BEAMER_env: example
</p>
<p>
:END:
</p>
<p>
,    #+ATTR_LATEX: width=\textwidth
</p>
<p>
<a href="./a-simple-slide.png" title="./a-simple-slide.png">./a-simple-slide.png</a>
</p>

defines a two column slide. As the text in the slide says, the left column is a list and the right one is an image. The left column's headline text is ignored, specified by C-c C-b i which tells org to *ignore* the headline text completely. The column on the right however is placed with an example block (whose appearance will depend on the Beamer theme).

The columns also have widths. By default, these widths are the proportion of the page width to use so I have specified 40% for the left column and 60% for the right one.

The image in the right column is inserted by simply specifying a link to the image file with not descriptive text. I have added an attribute to the image to tell LaTeX to scale the image to the full width of the column.

# Customisation

Org has a very large number of customisable aspects. Although daunting at first, most options have defaults that are suitable for most people using org initially. The same applies to the Beamer export support. However, there are some options which many will soon wish to change.

### Beamer theme

Beamer has a large number of themes and I simply refer the reader to the manual or the Web to find what themes are available and what they look like. When you have chosen a theme, you can tell org to use it but inserting some direct LaTeX code into the preamble of the document, the material that comes before the first headline. For instance, adding this line

<p>
</p>

to the preamble after the beamer font size option described above will produce a presentation that looks very different from the default (with no other changes required!):

The default toc:t option generated by the export template command (C-c C-e t) indicates that a table of contents will be generated. This will create a slide immediately after the title slide which will have the list of sections in the beamer document. Please note that if you want this type of functionality, you will have to specify the =BEAMER-FRAME-LEVEL= to be 2 instead of 1 as indicated above.

Furthermore, if you have decided to use sections, it is possible to have Beamer automatically place a table of contents slide before the start of each section with the new section highlighted. This is achieved by inserting the following LaTeX code, again in the preamble:

<p>