Markdown to PDF in 1 Line

With the rise of markdown as the default formatting for so many note-taking apps, and really good apps like Bear, Ulysses, and Notion, working within a markdown-only setup has never been easier. For the most part, I use those apps like inboxes, moving anything that needs keeping or gets larger than a single page into my folder system, which has served me well for, well, decades, now. Once there, I now use Typora for writing — for a long time it was FoldingText, but Typora has finally surpassed it in terms of ease of use and functionality. (I still keep FoldingPaper around, because.) For coding, I use Atom, which handles interacting with GitHub readily, which is where most of those projects live.

The remaining gap in functionality has been going from markdown to the printed page. MD to HTML and then into Word or Pages is okay, but I would prefer to stay in markdown up until the final moment of output, and now it looks like there is a simple path: pandoc + wkhtmltopdf:

pandoc --pdf-engine=wkhtmltopdf -o filename.pdf -c some.css filename.md

Make sure your version of Pandoc is up-to-date. I had an older version which did not take kindly to the --pdf-engine option, but once I updated, everything “just worked.” (FTR, I use MacPorts, which made installing, and upgrading, pandoc as well as installing wkhtmltopdf super easy. I then made sure wkhtmltopdf was in my PATH.)