Skip to content

Instantly share code, notes, and snippets.

@davisford
Last active June 20, 2023 06:20
Show Gist options
  • Save davisford/01b4eea0f1ddfb858d89 to your computer and use it in GitHub Desktop.
Save davisford/01b4eea0f1ddfb858d89 to your computer and use it in GitHub Desktop.
Convert Markdown to PDF
$ brew install markdown htmldoc
$ markdown <file.md> | htmldoc --cont --headfootsize 8.0 --linkcolor blue --linkstyle plain --format pdf14 - > <file.pdf>
if (( $# != 2 ))
then
echo "Usage: md2pdf <input.md> <output.pdf>"
exit 1
fi
markdown $1 | htmldoc --cont --headfootsize 8.0 --linkcolor blue --linkstyle plain --format pdf14 - > $2
@decodering
Copy link

Doesn't seem to work well on my end for codeblocks. Pandoc solved this for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment