voidrice/.scripts/compiler

18 lines
356 B
Text
Raw Normal View History

2018-04-11 00:48:45 +00:00
#!/bin/bash
# This is a compilation handler, so to speak, which I have vim run.
#
# It compiles a document to pdf
file=$(basename "$1")
ext="${file##*.}"
base="${file%.*}"
echo $ext
case "$ext" in
rmd) echo "require(rmarkdown); render('$file')" | R --vanilla ;;
tex) xelatex "$file" ;;
md) pandoc "$file" --pdf-engine=xelatex -o "$base".pdf ;;
esac