Multi-column Markdown Presentations (2024)

I was super happy to kinda figure this out.

  1. Install [pandoc](https://pandoc.org/installing.html)
  2. Install [revealjs](https://revealjs.com/installation/)
  3. Install [PowerPoint](https://www.microsoft.com/en-us/microsoft-365/)

Okay! You’re now almost there!

This is the markdown format

---

# Hello World!

---

# This slide has two columns

::: columns

:::: column
left
::::

:::: column
right
::::

:::

---

# This has two columns too

::: columns

:::: {.column width=70%}

The percentage of width doesn't work in ppt but works in revealjs

::::

:::: {.column width=30%}

Right 30

![Image](img/Untitled.png)

::::

:::

---

# Other notes

- Revealjs allows more than two columns
- PPT is limited to two columns
- PPT will ignore the column width
- Images will need newline before and after to get recognized
- Columns can only have one text element and can't occur before and after

Making a PowerPoint PPTX deck

This will make a PowerPoint:

% pandoc demo.md -o demo.pptx
% open demo.pptx

For info on how to change the template, some day I’ll look closer at this link. That has this cryptic info that I think is probably important:

Pandoc-compatible pptx templates must adhere to the following rules:
- There must be at least 4 slides in the slide masters, named ppt/slideLayouts/slideLayout[1-4].xml. Each of these templates has a number of expected elements to be found under p:sp / p:nvSpPr / p:nvPr
- ppt/slideLayouts/slideLayout1.xml is a title slide, and must:
  - have a p:ph element with type="ctrTitle"
  - have a p:ph element with type="subTitle"
  - have a p:ph element with type="dt"
- ppt/slideLayouts/slideLayout2.xml is a title + content slide, and must:
  - have a p:ph element with type="title"
  - have a p:ph element *without* a type attribute
- ppt/slideLayouts/slideLayout3.xml is a section header slide, and must:
  - have a p:ph element with either type="title" or type="ctrTitle"
- ppt/slideLayouts/slideLayout4.xml is a title + two-content slide, and must:
  - have a p:ph element with type="title"
  - have at least two p:ph elements *without* a type attribute

But I lucked out and found this doc that explains how to absorb the theme of another doc.

% pandoc demo.md -o demo.pptx --reference-doc another.pptx

Which points out this syntax that I was looking for to adjust the size of pictures:

![Alt text](bench.jpg){width=25%}

Making a dynamic revealjs deck

This will make a Revealjs presentation that’s v cool:

% pandoc -t revealjs -s demo.md -o demo.html
% open demo.html

Note that the defaults for revealjs CSS have giant H1s, so stuff this in the demo.html style section so that you don’t get confused too quickly.

.reveal h1 {font-size: 10px !important }

Also I couldn’t figure out how to get code to display properly, but this set of 5 tildes turns on tt style:

~~~~~~~
​```basic
10 rem hi hi
20 print 'nothing'
```
~~~~~~~

I figured out that <br /> works to force newlines. That’s a plus!

And if you want to embed the images so that your .html is self-contained, add the:

% pandoc ... --embed-resources=true ...

I can confirm that this unfortunately doesn’t work for PPT export.

Making a PDF via the LaTeX route …

Note that if you have pdflatex installed, you can make PDFs with:

% pandoc demo.md -o demo.pdf

but keep it in mind you’ll teleport to the past with LaTeX and TeX in the driver’s seat. Note that I had to install basictex to get pdflatex on Mac with:

% brew install basictex

And be sure to restart your terminal after you do that.

Let’s say you did all that and you’re a little WTH! Luckily there’s this giant repo that explains how to make your pandoc file create a usable PDF. But IMHO you’re better off just making the PDF from your PPT …