Last active
July 13, 2016 16:00
-
-
Save kurenaif/ff3558b7210ac6c722420f76a6954ff4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#/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