Update tex compile function