Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- # Autor: Alex Wall
- # Licence: GPLv3
- # pandoc (markdown2pdf) needs an path to a template
- # this script searches for a template in a custom folder (TEMPLATE_DIR)
- # you can pass any other option (e.g. xetex), it will be passed to markdown2pdf
- # the default custom pandoc template (latex.template) in ~/.pandoc/templates
- TEMPLATE="latex.template"
- TEMPLATE_DIR=$HOME/.pandoc/templates/
- while getopts 't:' OPTION ; do
- case $OPTION in
- t) TEMPLATE=$TEMPLATE_DIR$OPTARG.template
- shift $((OPTIND-1));;
- \?) # do nothing
- ;;
- :) echo "Option \"-$OPTARG\" needs an argument"
- echo $HELP ; exit 1;;
- esac
- done
- # run markdown2pdf with options
- markdown2pdf --template=$TEMPLATE $@
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement