#!/bin/bash

#Remove the .tex extention, it just messes up the bibliography
tex="${1%%\.tex}"
flags="${@:2}"
echo "$flags"

latex "$flags" "$tex"
biber "$tex"
latex "$flags" "$tex"
pdflatex "$flags" "$tex"

echo
echo "Removing biliography database \n\t$tex"
rm $tex.bbl

echo
echo Done
exit 0

