From .tex, .docx, or .pptx to Markdown

(and back again)

Markdown is a lightweight syntax

  • In contrast to LaTeX, you type less funny business
  • In contrast to Microsoft Office, everything is plain text — no buttons or formatting issues on different machines

Markdown math is \(\approxeq \LaTeX\)

Equations in MathJax are similar to LaTeX but more accessible.

Inline: $\sum_{i=0}^n i^2 = \frac{(n^2+n)(2n+1)}{6}$

Inline: \(\sum_{i=0}^n i^2 = \frac{(n^2+n)(2n+1)}{6}\)

Display mode allows equation labels (see @eq-1a):

$$
\sum_{i=0}^n i^2 = \frac{(n^2+n)(2n+1)}{6}
$$ {#eq-1a}

Display mode allows equation labels (see Equation 1):

\[ \sum_{i=0}^n i^2 = \frac{(n^2+n)(2n+1)}{6} \tag{1}\]

Pandoc converts between file types

e.g. from .docx or .tex to markdown

(and back again)

Docx syllabus to markdown

  1. In terminal: pandoc -t markdown -o syllabus.md syllabus.docx
  2. Change “.md” to “.qmd”
  3. Add a YAML header at the top:
---
title: Syllabus
format:
 html: default
 pdf: default # Delete this line if you don't want a PDF version rendered via LaTeX
 ---

(Just copy the header from syllabus.qmd)

LaTeX syllabus to markdown

  1. In terminal: pandoc -t markdown -o syllabus.md syllabus.tex
  2. Change “.md” to “.qmd”
  3. Add a YAML header at the top:
---
title: Syllabus
format:
 html: default
 pdf: default # Delete this line if you don't want a PDF version rendered via LaTeX
 docx: default # Do you really want a docx version, too? 🤨
---

(Just copy the header from syllabus.qmd)

Beamer to markdown

  1. In terminal: pandoc -t markdown -o slides.md slides.tex
  2. Change “.md” to “.qmd”
  3. Add a YAML header at the top:
---
title: My Slides
format:
  revealjs: 
    slide-number: true
---

(Just copy from the file that made these slides, pandoc.qmd)

Tip

Pandoc can also do the reverse, of course. And thus, Quarto can render to beamer, too.

format:
  beamer:
    keep-tex: true