Menu

Generate PowerPoint Slides from Org Mode Using Pandoc

Introduction

Summary

Telling pandoc How the Resulting pptx File Shall Look

Pandoc has two main mechanisms to influence the look of the result document:

The difference seems to be that templates can also have content that will be copied to the output document, whereas reference documents only provide "styles" that will influence the look of the output document.

Where Pandoc looks for Template, Reference and Defaults Files 1/2

By default, pandoc looks for the files /home/user/.local/share/pandoc/reference.docx or /home/user/.local/share/pandoc/reference.pptx as reference documents.

However, if you provide a --reference-doc=file command line argument, pandoc will look for file in the "resource-path" and use file as the reference document instead. The resource-path is the working directory by default. You can give an absolute path as file. There is also the possibility to specify the resource-path.

Where Pandoc looks for Template, Reference and Defaults Files 2/2

Pandoc's default search tree for templates, reference documents and defaults documents seem to be as follows (not exhaustive):

/home/user/.local/share/pandoc/
 ├ reference.docx
 ├ reference.potx
 ├ templates/
 │ └ default.html
 └ defaults/
   └ FILE[.yaml]

Legacy .pandoc Directory in User's Home Directory

Alternatively /home/user/.pandoc/ can be used instead of /home/user/.local/share/pandoc/.

Note that the user has to create either of these directories himself.

Options to Run the Conversion

Observations

Structure of the Presentation

Localised Master Slide Names Need To Be Renamed 1/2

Localised Master Slide Names Need To Be Renamed 2/2

Showing Source Code or Similar Content

Tables

Images - Shape Types

Images - Scaling

Images - Captions and Links to Images

Images - Limitations

Slide Footer

The PowerPoint output contains the footer information as given in the PowerPoint reference file:

Covered Functionality

Scope

Two factors determine, what PowerPoint functionality can be used from org mode via pandoc conversion:

  1. What PowerPoint functionality is accessible from pandoc
  2. What pandoc functionality is accessible from org mode

Regards the PowerPoint output format, the pandoc documentation elaborates about

Markdown and Org Mode

Because of this, my first attempt to scope the supported functionality was to convert the provided markdown example to org mode using pandoc.

What about Generating DOCX Files?

Same Approach for docx as for pptx

Generating Microsoft Word docx files using pandoc follows the same mechanics as outlined above for pptx.

However I noticed the following issue (pandoc version 3.1.8):

The same org file referencing an SVG graphics would be processed by pandoc OK and properly show the graphics in the resulting pptx. However for docx, pandoc would show a warning:

Could not convert image process file.svg:
check that rsvg-convert is in the path.

Issue with Scalable Vector Graphics (SVG) Files

When opening with MS Word 2016, the resulting docx file did show the graphics. But when opened with LibreOffice Writer version 7.4.7.2, the graphics did not show, rather an empty frame with some place holder graphics.

rsvg-convert is a command line utility to convert SVG to PNG. In Debian Bookworm, it is contained in package librsvg2-bin.

On the other hand, this LibreOffice version does support inserted SVG graphics.

Appendix with Further Test Slides

Slide Title - Simple Text Paragraph with hard line break

Body text: Lorem ipsum dolor sit amet,
consectetur adipisici elit, sed eiusmod tempor incidunt ut labore et dolore magna aliqua.

Level 3 Heading within a slide

Body text after heading: strong text, emphasized text, strike through text underline text. code with wiggle, code with equals sign. Superscript and subscript text.

Slide Title - Source Code Blocks

Code block with colons:

line 1
line 2

Code block using #+BEGIN_EXAMPLE#+END_EXAMPLE

line 1
line 2

Slide Title - Bullets and Lists

  1. Ordered List - Level 1
  2. Ordered List - Level 1

Section Divider Slide

Slide Title - Tables

Column 1 Column 2 Column 3
Some very very very very long description 123 Comment
Shrt dscr 956  
Sum 1079  

Slide Title - JPEG Images

Text before picture

blind_400x300_96dpi.jpg

Slide Title - JPEG Images

Text before picture

blind_400x300_300dpi.jpg

Slide Title - SVG Graphics

Text before picture

blind_400x300.svg

Slide Title - SVG Graphics

blind_400x300.svg

Slide Title - SVG Graphics with UTF-8 BOM (who uses a BOM anyway?)

blind_400x300_UTF-8-BOM.svg


Last change: 2025-09-26
© 2002-2025 Dr. Thomas Redelberger redetho(a‍t)gmx.de

Close menu