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 |
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.
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 is 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 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 in the intermediate .tex
file.
Hence it will become the "start" language used for the slides.
However: The table of contents will always read "Outline".
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 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
, as article has portrait
aspect ratio.
Beamer allows for fine grained control of how to use the slide real estate of individual slides, e.g. when placing multiple images on a slide. However, I have not yet needed that functionality.
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 line
#+LATEX_HEADER: \svgsetup{inkscapelatex=false}
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:
bfseries
(sans serif)test.org
main org file, rather than the set-up file, because I
need different logos for different projectsThe 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.
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.