aboutsummaryrefslogtreecommitdiff
path: root/pdfs
diff options
context:
space:
mode:
authorInigoGutierrez <inigogf.95@gmail.com>2020-05-08 14:22:01 +0200
committerInigoGutierrez <inigogf.95@gmail.com>2020-05-08 14:22:01 +0200
commit41d2c549d364883a250b7370b2915667f4ec8da5 (patch)
tree2a3386a25c5880085843a64cd8398d4594403502 /pdfs
parent474d9a5d588403d889aa230244e8034224da4a30 (diff)
downloadscripts-41d2c549d364883a250b7370b2915667f4ec8da5.tar.gz
scripts-41d2c549d364883a250b7370b2915667f4ec8da5.zip
Updated toPDF.sh to compile .tex files.
Diffstat (limited to 'pdfs')
-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" &