Skip to content

Instantly share code, notes, and snippets.

@JonathanMH
Created April 12, 2013 04:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JonathanMH/5369411 to your computer and use it in GitHub Desktop.
Save JonathanMH/5369411 to your computer and use it in GitHub Desktop.
Build your pdf report from markdown
#!/bin/bash
# dependencies:
#
# http://johnmacfarlane.net/pandoc/installing.html
# variables:
mainfont="Helvetica"
sansfont="Helvetica"
monofont="Courier"
fontsize="12pt"
version=`git rev-parse HEAD` # getting current commit hash as version number :D
# build the three reports:
cd ../modules/
for input in $(find *.md -type f -maxdepth 1 \( ! -iname ".*" \))
do
basename=`basename $input .md`
echo 'building:' $basename
pandoc -N --template=../tools/mytemplate.tex --variable mainfont=$mainfont --variable sansfont=$sansfont --variable monofont=$monofont --variable fontsize=$fontsize --variable version=$version $input --latex-engine=xelatex --toc -o ../export/$basename.pdf
done
@JonathanMH
Copy link
Author

This is assuming that you have a folder modules for your reports and export for the pdfs. For more info on this visit the pandoc documentation: http://johnmacfarlane.net/pandoc/installing.html

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