Today I wanted to print a markdown file and found out there was no straightforward way to do it from my code editor. Even though they have beautiful markdown previews, they won’t let you print them.
That’s when I found pandoc. Pandoc is a document converter that can turn markdown into PDF. It does this by converting markdown to LaTeX first, then using LaTeX to generate the PDF.
I don’t miss struggling with LaTeX from my computer science student days, but it always produced beautiful documents (when I didn’t mess anything up).
Here is the setup on macOS:
brew install pandoc
brew install basictex
After installing basictex, restart your terminal to get the LaTeX binaries in your path.
Then:
pandoc file.md ...
Today I wanted to print a markdown file and found out there was no straightforward way to do it from my code editor. Even though they have beautiful markdown previews, they won’t let you print them.
That’s when I found pandoc. Pandoc is a document converter that can turn markdown into PDF. It does this by converting markdown to LaTeX first, then using LaTeX to generate the PDF.
I don’t miss struggling with LaTeX from my computer science student days, but it always produced beautiful documents (when I didn’t mess anything up).
Here is the setup on macOS:
brew install pandoc
brew install basictex
After installing basictex, restart your terminal to get the LaTeX binaries in your path.
Then:
pandoc file.md -o file.pdf
That’s it. PDFs from all your Markdown files.