Run a localized parse through the llm output (at least maybe in notes or content generated) and then identify patterns of math formatting errors so that you can make a quick llm call to replace that particular part with another attempt with correct formatting given narrower context (tune to be sufficient so llm2 can understand what llm1 was trying to say)