Skip to content

Instantly share code, notes, and snippets.

@claudiofreitas
Created July 4, 2013 20:48
Show Gist options
  • Save claudiofreitas/5930142 to your computer and use it in GitHub Desktop.
Save claudiofreitas/5930142 to your computer and use it in GitHub Desktop.
Shell script to "compile" LaTeX documents and generate PDF.
#! /bin/bash
TEXFILE=$1
if [ ! -f $1.tex ]; then
echo "$1.tex doesn't exist";
exit 0;
fi
#Created 'aux' directory if it doesn't exist
[ ! -f ./aux ] && mkdir aux
latex -interaction=errorstopmode --output-directory=aux $TEXFILE.tex
latex -interaction=errorstopmode --output-directory=aux $TEXFILE.tex
cd aux
dvipdfm ./$TEXFILE.dvi
cd ..
mv aux/$TEXFILE.pdf ./$TEXFILE.pdf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment