Advertisement
Guest User

Untitled

a guest
Oct 14th, 2011
214
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. #!/bin/bash
  2. # Autor: Alex Wall
  3. # Licence: GPLv3
  4.  
  5. # pandoc (markdown2pdf) needs an path to a template
  6. # this script searches for a template in a custom folder (TEMPLATE_DIR)
  7. # you can pass any other option (e.g. xetex), it will be passed to markdown2pdf
  8.  
  9. # the default custom pandoc template (latex.template) in ~/.pandoc/templates
  10. TEMPLATE="latex.template"
  11. TEMPLATE_DIR=$HOME/.pandoc/templates/
  12.  
  13. while getopts 't:' OPTION ; do
  14. case $OPTION in
  15. t) TEMPLATE=$TEMPLATE_DIR$OPTARG.template
  16. shift $((OPTIND-1));;
  17. \?) # do nothing
  18. ;;
  19. :) echo "Option \"-$OPTARG\" needs an argument"
  20. echo $HELP ; exit 1;;
  21. esac
  22. done
  23.  
  24. # run markdown2pdf with options
  25.  
  26. markdown2pdf --template=$TEMPLATE $@
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement