From 41d2c549d364883a250b7370b2915667f4ec8da5 Mon Sep 17 00:00:00 2001 From: InigoGutierrez Date: Fri, 8 May 2020 14:22:01 +0200 Subject: Updated toPDF.sh to compile .tex files. --- pdfs/toPDF.sh | 14 ++++++++++++-- 1 file 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" & -- cgit v1.2.1