xetexgen/generate-pdf
2016-04-15 14:15:54 +02:00

22 lines
558 B
Bash
Executable file

#!/bin/bash
TEXFILE=$1
if ! [ -f ${TEXFILE} ]; then
echo "You need to specify the file to render."
exit 1
fi
if ! ( xelatex -interaction=batchmode ${TEXFILE} ); then
echo "An error occurred while processing ${TEXFILE}. Please see the log."
exit 1
fi
# Do a second run in order to render page numbers etc
if ! ( xelatex -interaction=batchmode ${TEXFILE} ); then
echo "An error occurred while processing ${TEXFILE}. Please see the log."
exit 1
fi
echo "Rendering was successful. Cleaning up..."
rm -f ${TEXFILE/.tex/.log} ${TEXFILE/.tex/.aux}