Skip to content

Instantly share code, notes, and snippets.

@kurenaif
Last active July 13, 2016 16:00
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 kurenaif/ff3558b7210ac6c722420f76a6954ff4 to your computer and use it in GitHub Desktop.
Save kurenaif/ff3558b7210ac6c722420f76a6954ff4 to your computer and use it in GitHub Desktop.
#/bin/bash
usage_exit(){
echo "Usage:"
echo " md2pdf [-p] [filename.md]"
echo "Arguments:"
echo " p:use pandoc(for presentation)"
echo " h:help"
exit 1
}
while getopts hp OPT
do
case $OPT in
p) FLAG_P=1
;;
h) usage_exit
;;
\?) usage_exit
;;
esac
done
shift $((OPTIND - 1))
if [ $# -ne 1 ]; then
usage_exit
fi
if [ "$FLAG_P" ]; then
pandoc $1 -o ${1%.*}.pdf --latex-engine=lualatex -t beamer -V theme:Madrid -V colortheme:seahorse -V fontsize:12pt -H h-luatexja.tex
else
pandoc $1 -o ${1%.*}.pdf -V documentclass=ltjarticle -V geometry:a4paper --latex-engine=lualatex
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment