summaryrefslogtreecommitdiffstats
path: root/.scripts
diff options
context:
space:
mode:
authorLuke Smith <luke@lukesmith.xyz>2018-04-10 17:48:45 -0700
committerLuke Smith <luke@lukesmith.xyz>2018-04-10 17:48:45 -0700
commit8d49ac56b7e70b94a140e43051df9df8aa4a3a75 (patch)
tree93ce822e7b800c1cd7c8249b8be84610b08a3715 /.scripts
parent2dc5e822334a2d0fb6860f9b55f91b2e328a2ad6 (diff)
downloadeibhear-8d49ac56b7e70b94a140e43051df9df8aa4a3a75.tar.gz
eibhear-8d49ac56b7e70b94a140e43051df9df8aa4a3a75.tar.zst
eibhear-8d49ac56b7e70b94a140e43051df9df8aa4a3a75.zip
compiler handler added
Diffstat (limited to '.scripts')
-rwxr-xr-x.scripts/compiler17
1 files changed, 17 insertions, 0 deletions
diff --git a/.scripts/compiler b/.scripts/compiler
new file mode 100755
index 0000000..7a24a35
--- /dev/null
+++ b/.scripts/compiler
@@ -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