Skip to content

Instantly share code, notes, and snippets.

@arvearve
Last active August 29, 2015 13:57
Show Gist options
  • Save arvearve/9622831 to your computer and use it in GitHub Desktop.
Save arvearve/9622831 to your computer and use it in GitHub Desktop.
Pandoc markdown -> pdf macro
# Put in ~/.bashrc or similar
# requires pandoc and xelatex
#
# usage:
# $ mdpdf myfile.md
# outputs myfile.pdf in same directory
#
# Additional flags are passed:
# $ mdpdf myfile.md --toc
# outputs myfile.pdf with table of contents.
function _mdpdf(){
pandoc -o ${1%.*}.pdf $1 --latex-engine=xelatex --gladtex -V geometry:margin=1in "${@:2}"
}
alias mdpdf=_mdpdf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment