diff options
author | InigoGutierrez <inigogf.95@gmail.com> | 2020-05-08 14:22:01 +0200 |
---|---|---|
committer | InigoGutierrez <inigogf.95@gmail.com> | 2020-05-08 14:22:01 +0200 |
commit | 41d2c549d364883a250b7370b2915667f4ec8da5 (patch) | |
tree | 2a3386a25c5880085843a64cd8398d4594403502 | |
parent | 474d9a5d588403d889aa230244e8034224da4a30 (diff) | |
download | scripts-41d2c549d364883a250b7370b2915667f4ec8da5.tar.gz scripts-41d2c549d364883a250b7370b2915667f4ec8da5.zip |
Updated toPDF.sh to compile .tex files.
-rwxr-xr-x | pdfs/toPDF.sh | 14 |
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" & |