Correctly trap latex build error.