compiler handler added
This commit is contained in:
parent
2dc5e82233
commit
8d49ac56b7
1 changed files with 17 additions and 0 deletions
17
.scripts/compiler
Executable file
17
.scripts/compiler
Executable file
|
@ -0,0 +1,17 @@
|
|||
#!/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
|
Loading…
Reference in a new issue