Skip to content

Instantly share code, notes, and snippets.

@stefanschmidt
Last active October 12, 2022 07:30
Show Gist options
  • Select an option

  • Save stefanschmidt/90809342daa5281f2e1a to your computer and use it in GitHub Desktop.

Select an option

Save stefanschmidt/90809342daa5281f2e1a to your computer and use it in GitHub Desktop.
Convert Markdown to PDF with custom page size and margins
# depends on Calibre (available via Homebrew Cask)
ebook-convert \
doc.md doc.pdf \
--extra-css=style.css \
--margin-left 72 \
--margin-right 72 \
--margin-bottom 72 \
--margin-top 72 \
--custom-size 8.5x11 \
--disable-font-rescaling \
--pdf-page-numbers \
--page-breaks-before //h:h1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment