Pandoc md to pdf with better headings

I keep my notes mostly in one Git’d folder of markdown files, which is vastly quicker and easier than my old WYSIWYG word-processed noting system.  I write and navigate my md’d notes in gVim.  For wide convertablility across markdown engines, I only use markdown headings down to the 4th level.  This was working fine until I put some lyrics directly under a 4th level heading and converted the md file to pdf.

The 4th level heading snag

Pandoc converts its headings to LaTeX document divisions as described here.

The 4th level heading is \paragraph, which just appears bold, and with no

newline for the following text…

The fix: elevate the headings, and tweak the Chapter formatting

I discuss this more in my DokuWiki, but it’s summarised here.

Convert one md file, or many

To implement my fix for one file, I wrote a Windows Batch file, and to convert a directory of markdown files recursively, I unpacked my PowerShell one-liner into a more intelligible script, and added in this fix.

You can find them both here.

Share Button