Menu

Using Org Mode to Generate Beamer Slides

Introduction

I have been using pandoc (from John Macfarlane) to generate PowerPoint slides. I have documented this here.

For a specific project, where the presentation had to include mathematical formulas, footnotes and citations, I decided to generate "Beamer" slides from an org-mode source document.

Summary

"Beamer" slides are PDF files, which are generated using the LaTeX system.

org-mode has an out-of-the-box beamer export module. Hence Emacs and LaTeX is all you need to generate beamer slides

I have documented below my observations. You can download the file org2beamer.zip to see my test and configuration files.

Manifest

The file org2beamer.zip contains the following files:

test.org Test org-mode source file
test.pdf Resulting beamer output PDF slides
test.tex Intermediate LaTeX file
mysetup-bmr-169-ysctn.org Org set-up file
myAddUTF8.tex LaTeX symbol definitions
redetho-logo1.svg Test logo
blind_*.svg Test vector graphics file
blind_*.jpg Test image files
lit.bib Test BibTeX file for citations
mysetup-bmr-169-nsctn.org Org set-up file when not using sections

The files are provided as is. I do not take any responsibility nor provide any warranty.

Using Org-Mode's SETUPFILE Mechanism for Configuration

The file test.org contains the slide content and essential meta data. It references the file mysetup-bmr-169-ysctn.org using org-mode's #+SETUPFILE: mechanism. mysetup-bmr-169-ysctn.org configures the org-mode beamer exporter and contains LaTeX and Beamer settings. The key settings are:

Obviously, different key settings require different set-up files. I include in the ZIP archive the file mysetup-bmr-169-nsctn.org which is meant for shorter presentations that do not need section divider slides.

How To Run the Conversion From an Org-File To a Beamer-PDF?

Observations

Note that some of the issues discussed below are LaTeX/Beamer issues. However, I discuss them here because I collected solutions for them from various documentation pieces or from the internet.

I also document how these issues can be addressed directly from the org-mode source code.

Tables

So far I did not need to change the table settings from the defaults.

Links

When you want to generate a link in a beamer presentation to a PDF document from org-mode, you need to provide a description, like so

[[./file.pdf][Description]]

If you omit the description, like

[[./file.pdf]]

the first page of the PDF document gets embedded in the output beamer PDF file.

Language Support

For non-English language texts, you would usually write

#+LANGUAGE xx

where xx is the ISO language code. The org-mode exporter will add that language to the

\usepackage[shorthands=off,english]{babel}

statement from the set-up file. The desired language gets added after the english babel option. Hence it will become the "start" language used for the slides.

However: The table of contents will always read "Outline".

Images - Scaling

The file test.org shows how to scale images. I found that scaling relative to the paperheight works best for slides, both for 16:9 and 4:3 aspect ratios. However, for LaTeX article documents I usually scale relative to paperwidth

Images - Multiple on a page

Beamer allows for fine grained control of how to use the slide real estate of individual slides. However, for my first use case I did not need to use that feature

Scalable Vector Graphics (SVG) Text Issues

When using text elements (text objects) in SVG files, be aware that LaTeX/Beamer processes these texts. E.g. an underscore will switch to subscript. This can be seen in the resulting Beamer PDF for the referenced graphics file blind_400x300.svg, where the SVG file contains the file name as a text element.

The LaTeX processing listing also shows, that LaTeX is trying to use appropriate fonts.

To avoid such issues, you might want to convert SVG text objects to SVG path objects. A tool like Inkscape can achieve this.

Covered Functionality

The org-mode built-in exporter for Beamer slides supports the full org functionality, like macro support and org babel support.

When using Pandoc instead, you might want to try the ox-pandoc package, to be able to use most of org's functionality and use Pandoc for additional target formats like PowerPoint.


Last change: 2024-03-28
© 2002-2024 Dr. Thomas Redelberger redethogmx.de

Close menu