Parse Latex error more robustly.