node package manager
We need your input. Help make JavaScript better: Take the 2017 JavaScript Ecosystem survey ยป



This is an updated version of the script originally released by Claes Holmerson. It allows to generate pdf through xelatex and customize fonts and other aspects of the document very easily (just edit the variables in the


You should have already installed both pandoc and xelatex. Then,

npm install -g md2pdf



The following variables can be customized by editing md2pdf:

  • paper (default: a4paper)
  • hmargin (default: 3cm)
  • vmargin (default: 3.5cm)
  • fontsize (default: 10pt)
  • mainfont (default: "Palatino Linotype")
  • sansfont (default: Corbel)
  • monofont (default: Consolas)
  • language (default: english)
  • nohyphenation (default: false)
  • columns (default: onecolumn)
  • geometry (default: portrait)