dotfiles

personal configuration files and scripts
git clone https://tongong.net/git/dotfiles.git
Log | Files | Refs | README

compiler (770B)


      1 #!/bin/sh
      2 
      3 # This script will compile or run another finishing operation on a document. I
      4 # have this script run via vim.
      5 #
      6 # Compiles .tex. groff (.mom, .ms), .rmd, .md, .org.  Opens .sent files as sent
      7 # presentations. Runs scripts based on extention or shebang.
      8 #
      9 # Note that .tex files which you wish to compile with XeLaTeX should have the
     10 # string "xelatex" somewhere in a comment/command in the first 5 lines.
     11 
     12 file=$(readlink -f "$1")
     13 dir=${file%/*}
     14 base="${file%.*}"
     15 ext="${file##*.}"
     16 
     17 cd "$dir" || exit 1
     18 
     19 case "$ext" in
     20 	# Try to keep these cases in alphabetical order.
     21 	h) sudo make install ;;
     22 	md) pandoc -s -o "$base".pdf "$file" ;;
     23     remark) "$dir"/remark/compile.sh "$file" ;;
     24     tex) pdflatex --shell-escape "$file" ;;
     25     bib) biber "$base" ;;
     26 esac