Pandoc, markdown, powerpoint: support for equations?
Asked Answered
D

1

8

Pandoc can now generate powerpoint presentations from markdown. This seems to work quite well.

However, when I try to include an equation – even something as simple as $a=2$ – the whole contents of the slide disappears. Is this a bug or a feature? Can you include equations in PowerPoint presentations? I was hoping that I would be finally able to write my lectures (which need to be in powerpoint because of reasons) using TeX math syntax in a plain text file.

EDIT:

The command to convert the markdown document saved in the file test.rmd was

render("test.rmd")

Minimal example #1:

---
output: powerpoint_presentation
---

## Math test

This is a test (no maths)

Output:

enter image description here

Test example #2:

---
output: powerpoint_presentation
---

## Math test

This is a test $a=2$

Output:

enter image description here

Versions:

> rmarkdown::pandoc_version()
[1] ‘2.7.1’
> packageVersion("rmarkdown")
[1] ‘1.10’

MS PowerPoint 2007. Note that if Word output is chosen, the formula appears as expected.

Daisie answered 27/3, 2019 at 9:50 Comment(4)
Works for me. Could you add a minimal example, including pandoc version, input and command used to convert into pptx?Irenairene
I have added the information.Daisie
I get the expected output with that pandoc version and with both, rmarkdown v1.9 and v1.12. I'm using a very recent office version, so it might be a PowerPoint issue.Irenairene
Hm. OK, this seems to be the problem, I tested it on another version of Powerpoint and it works as expected. Unfortunately, 2007 is still quite widely spread and you can never know on which computer your presentation will be run; therefore, the presentation must work on 2007. Please post your comment as an answer and I will accept it.Daisie
I
5

The problem seems to be with PowerPoint. From what you found, and from what I can tell from searching the web, is seems safe to say that PowerPoint 2007 does not have full support for Microsoft's OMML math format (although Word 2007 does have support).

Unfortunately, inserting inline PNGs through pandoc is not possible with PowerPoint, so inserting formulas rendered as PNG won't work either. The only option would be to insert equation images as figures, but that would limit you to one equation per slide (or two when used with columns).

Irenairene answered 27/3, 2019 at 19:56 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.