fix bad latex -> pdf conversion with messed up figure and eq numbering