dotfiles

Unnamed repository; edit this file 'description' to name the repository.
git clone git://git.margiolis.net/dotfiles.git
Log | Files | Refs | README | LICENSE

doccomp (503B)


      1 #!/bin/sh
      2 
      3 usage()
      4 {
      5 	echo "usage: ${0##*/} file" 1>&2 && exit 1
      6 }
      7 
      8 file_exists()
      9 {
     10 	test ! -f "${file}" && echo "${0##*/}: ${file}: file not found" 1>&2 && exit 1
     11 }
     12 
     13 test ${#} -eq 0 && usage
     14 
     15 file="$(readlink -f "${1}")"
     16 dir="${file%/*}"
     17 base="${file%.*}"
     18 ext="${file##*.}"
     19 
     20 file_exists
     21 cd "${dir}" || exit 1
     22 
     23 case "${ext}" in
     24 	md) pandoc ${file} --pdf-engine=xelatex -V mainfont=Arial -o "${base}.pdf" ;;
     25 	# TODO: handle biber
     26 	tex) pdflatex ${file} && rm -f *.aux *.log *.out *.bcf *.run.xml ;;
     27 esac