From 782795779b89d04dc47ec0af9f82e314127ffb08 Mon Sep 17 00:00:00 2001 From: Jonathan Hodgson Date: Mon, 10 Dec 2018 15:09:43 +0000 Subject: [PATCH] Makes compiler work correctly for letter and fplreport --- bin/compiler | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/bin/compiler b/bin/compiler index 4cfdf281..37e67cf4 100755 --- a/bin/compiler +++ b/bin/compiler @@ -27,7 +27,23 @@ textype() { \ biber --input-directory "$dir" "$base" && $command --output-directory="$dir" "$base" && $command --output-directory="$dir" "$base" - } +} + +mdtype() {\ + type="${2:-default}" + + case "$type" in + "letter") + pandoc --template template-letter.tex "$file" -o "${base}.pdf" + ;; + "fplreport") + pandoc --template fellowship.latex --pdf-engine=xelatex "$file" -o "${base}.pdf" + ;; + *) + pandoc "$file" -o "${base}.pdf" + ;; + esac +} shebangtest() { case "$shebang" in @@ -42,7 +58,8 @@ case "$file" in *\.rmd) echo "require(rmarkdown); render('$file')" | R -q --vanilla ;; *\.tex|*\.latex) textype "$file" ;; #*\.md) pandoc "$file" --pdf-engine=xelatex -o "$base".pdf ;; - *\.md) pandoc "$file" -o "$base".pdf ;; + #*\.md) pandoc "$file" -o "$base".pdf ;; + *\.md) mdtype "$file" "$2" ;; *config.h) make && sudo make install ;; *\.c) cc "$file" -o "$base" && "$base" ;; *\.py) python "$file" ;;