notes_compile.sh (593B)
1 if [ $# -eq 0 ] 2 then 3 echo "USAGE: ./notes_compile.sh <tex file>" 4 exit 1 5 fi 6 7 if [ ! -e "$1" ] 8 then 9 echo "File doesn't exist: $1" 10 exit 1 11 fi 12 13 body=`cat "$1"` 14 printf '\\documentclass[12pt]{article}\n' > notes_compile.tex 15 printf '\\usepackage[a4paper]{geometry}\n' >> notes_compile.tex 16 printf '\\geometry{top=1.0in, bottom=1.0in, left=0.5in, right=0.5in}\n' >> notes_compile.tex 17 cat defs.tex >> notes_compile.tex 18 printf '\\begin{document}\n%s\n\\end{document}\n' "$body" >> notes_compile.tex 19 pdflatex notes_compile.tex 20 mv notes_compile.pdf `basename $1 .tex`.pdf 21 rm notes_compile.{aux,log,tex}