Abstract
Complex formulas and formula-rich text remain a bottleneck for document OCR: a small symbol or layout error can change mathematical meaning, while different source encodings can render identically. Aggregate OCR metrics do not localize these errors or guide their repair. We propose OCR-EDR (OCR Error Diagnosis and Repair), a rendering-aware framework that compares the source image, the editable OCR prediction, and its rendering. It preserves valid predictions, including rendering-equivalent ones, and applies executable edits to genuine errors before reassessing the updated rendering. We construct OCRErrBench from real text and formula predictions and train DocEDR to execute this loop. DocEDR achieves 94.78% diagnostic accuracy and restores visual consistency on 86.23% of erroneous OCRErrBench inputs. It raises formula Case-F1 by 30.99 percentage points over DOCR-Inspector-7B on DOCRcaseBench and improves full-set formula CDM by up to 7.11 points on UniMER-Test. On 4,760 external OmniDocBench text blocks, mean normalized edit distance decreases for all four parsers and fewer than 0.5% of blocks worsen for each parser.