Nate Tracy-Amoroso

Home > Convert between markdown and pdf on macOS

I write my homework in markdown and my professors usually want pdfs. Here’s what I do

Install dependencies

# Install homebrew (see below)
brew install pandoc
brew cask install basictex

homebrew

This is the main macOS package manager. If you do any programming on macOS you’ll need it eventually. Follow the instruction on their homepage to install.

pandoc

“If you need to convert files from one markup format into another, pandoc is your swiss-army knife…”

basictex

basictex provides pdflatex, a lib needed by pandoc to convert markdown -> pdf

Do it

pandoc -f markdown-implicit_figures -t pdf file.md > file.pdf

-f means from

You can also just use markdown but your images will be moved around like in latex which I generally don’t want.

-t means to

> redirect output to file.pdf