Generating PDF using pandoc & pdflatex on MacOs

PHOTO EMBED

Tue Mar 10 2026 12:54:00 GMT+0000 (Coordinated Universal Time)

Saved by @teressider

Using Pandoc to generate PDFs from Markdown
on a Mac running macOS 10.13.4
To install the needed components you can use Homebrew

Two Components are needed:
Pandoc
PDFLaTex
Install instructions:
Use Homebrew to install pandoc:

brew install pandoc
 Save
Then use Homebrew to install the PDFLaTex program.

brew install --cask basictex
 Save
You should now have all the needed components but it won't work until the pdflatex executable is available in your PATH environment variable. To configure this my technique is to sym link the executable to a directory already in my PATH.

ln -s -v /Library/TeX/texbin/pdflatex /usr/local/bin/pdflatex
 Save
Now if I enter which pdflatex on the command line the system responds:

/usr/local/bin/pdflatex

And now I'm able to generate a PDF from my Markdown file with this command:

pandoc file.md -s -o file.pdf
content_copyCOPY

https://gist.github.com/ilessing/7ff705de0f594510e463146762cef779