I have been using pandoc (from John Macfarlane) to generate PowerPoint slides. I have documented this here.
For specific projects, where the presentations had to include mathematical formulas, footnotes and citations, I decided to generate "Beamer" slides from Org mode source documents.
"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 settings, customisations and observations. You can download the file ./org2beamer.zip to see my test and configuration files.
I use the "texlive" TeX/LaTeX software. I installed the following Debian packages:
texlive
texlive-latex-extra
wrapfig.sty
, which is required by the Org mode exporter (Emacs v28.2 Org mode v9.5.5)cm-super
texlive-lang-german
texlive-latex-recommended-doc
inkscape
inkscape
automatically to support SVG
I put in init.el
;;; Beamer export (require 'ox-beamer)
to have the Beamer export option show in the Org mode exporter front-end.
The file org2beamer.zip
contains the following files:
README.txt | txt version of this web-page |
test.org | Test Org mode source file |
test.pdf | Resulting Beamer output PDF slides |
test.tex | Resulting intermediate LaTeX file |
mysetup-bmr-169-ysctn.org | Org set-up file when using sections |
mysetup-bmr-169-nsctn.org | Org set-up file when not using sections |
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 |
The files are provided as is. I do not take any responsibility nor provide any warranty.
mysetup-bmr-169-ysctn.org
to your home directory. If you choose a different location, please amend the path in the first line of test.org
You might want to copy myAddUTF8.tex
to ~/texmf/
. If you choose a different location, please amend the line
#+LATEX_HEADER: \input{~/texmf/myAddUTF8}
in file mysetup-bmr-169-ysctn.org
test.org
in EmacsC-c C-e l P
, which runs the command org-beamer-export-to-pdf
test.pdf
using your favourite PDF-viewer. Please note that the ZIP archive also contains a result file test.pdf
and the intermediate file test.tex
for your reference. You might want to rename those two before
While the C-c C-e
standard Org mode exporter is fine for tests and occasional exports, I use a Makefile
for more complex projects. That Makefile would typically contain (covers both Windows and Linux):
ifeq ($(OS),Windows_NT) EMACSCL=$(MYPROGPATH)/emacs-27.2/bin/emacsclientw.exe else EMACSCL=emacsclient endif test.pdf: test.org $(HOME)/mysetup-bmr-169-ysctn.org $(EMACSCL) --eval "(find-file \"test.org\")" \ "(org-beamer-export-to-pdf)"
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, hence the names of the 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.
Please read below for details about slide format customisation, which are also effected by the set-up file.
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 or the setup-file which gets included by the Org mode source file.
So far I did not need to change the table settings from the defaults.
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.
For non-English language texts, you would add
#+LANGUAGE xx
to your Org mode text, where xx is the ISO language code. The Org mode exporter will replace the AUTO literal in the
\usepackage[shorthands=off,AUTO]{babel}
statement from the set-up file by that language.
However: The table of contents will always read "Outline". This literal seems to come from Beamer.
The set-up file includes the statement
#+LATEX_HEADER: \input{~/texmf/myAddUTF8}
The file myAddUTF8.tex
is included in the ZIP-file. It contains LaTeX definitions for additional UTF-8 characters you could use directly in the Org mode main file. I chose to store myAddUTF8.tex
in the texmf
sub-directory of my home directory.
The file test.org
shows how to scale images. I found that scaling relative to the LaTeX textheight
works best for slides, both for 16:9 and 4:3 aspect ratios. However, if you use columns, then scaling relative to textwidth
is often preferable, as textwidth
tracks the column width.
For LaTeX article documents I usually scale relative to textwidth
, as article has a portrait aspect ratio.
Putting text and images on the same slide on top of each other is straight forward. Using columns, they can be put next to each other. You could also stack images on top of each other in the same column.
Often Beamer documentation shows how to employ Beamer's »block« environments. Blocks allow to use coloured text and background and additional title text, which might have its own text and background colours.
When referencing SVG files to be included in the PDF-slides, inkscape
is being run automatically in the background, to help LaTeX/Beamer deal with SVG.
By default text
elements (text objects), which are contained in the SVG files, would be processed by LaTeX/Beamer. E.g. an underscore would switch to subscript. Usually, this is not what you want. To prevent this, the set-up file contains the option inkscapelatex=false
in the line
#+LATEX_HEADER: \svgsetup{inkscapelatex=false, inkscapearea=page}
By default, the "bounding box" of all graphics elements in the SVG file determines what is being projected/scaled into the resulting LaTeX/PDF. The option inkscapearea=page
rather makes shure that the full size of the SVG is considered instead, either using the viewBox
attribute or the width
and height
attributes in the SVG file.
The set-up file mysetup-bmr-169-ysctn.org
contains various customisations, how the generated slides shall look like. The customisations are applied to the default LaTeX/Beamer »theme« (theme is a Beamer term for a defined slide layout). These are my personal preferences:
test.org
main Org file, rather than the set-up file, because I need different logos for different projectsbfseries
(sans serif). I include the helvet
package, to get those fonts rather than »Computer Modern«parskip
as outside blocks. Default is zero parskip
parskip
as outside columns. Default is zero parskip
. Beamer uses the LaTeX »minipage« for columnsThe Org mode built-in exporter to Beamer slides supports the full Org functionality, like macro support and Org babel support.
When using Pandoc instead, you might want to use the ox-pandoc
package from Alex Fenton, to be able to use most of Org's functionality and use Pandoc for additional target formats like PowerPoint.
I trust you notice that mysetup-bmr-169-ysctn.org
also contains Org mode in-buffer customisations for HTML export and text export. I have written about HTML export here
You might also be interested in LaTeX article generation from Org mode or using pandoc together with Org mode.