aboutsummaryrefslogtreecommitdiff
path: root/pdfs/toPDF.sh
diff options
context:
space:
mode:
Diffstat (limited to 'pdfs/toPDF.sh')
-rwxr-xr-xpdfs/toPDF.sh14
1 files changed, 12 insertions, 2 deletions
diff --git a/pdfs/toPDF.sh b/pdfs/toPDF.sh
index ac390a7..4761f37 100755
--- a/pdfs/toPDF.sh
+++ b/pdfs/toPDF.sh
@@ -20,8 +20,18 @@ targetDir="/tmp/toPDF"
sourceFile="$1"
targetFile="${targetDir}/${sourceFile##*/}"
targetFile="${targetFile%.*}.pdf"
+extension="${sourceFile##*.}"
+texengine="xelatex"
[ -d "$targetDir" ] || mkdir -p "$targetDir"
-pandoc "$sourceFile" -o "$targetFile" > ~/logs/toPDF.log
-[ -n "$open" ] && "$READER" "$targetFile" &
+case "$extension" in
+ "tex")
+ "$texengine" -output-directory "$targetDir" "$sourceFile"
+ ;;
+ *)
+ pandoc "$sourceFile" -o "$targetFile" > ~/logs/toPDF.log
+ ;;
+esac
+
+[ -n "$open" ] && "$READER" "$targetFile" &