Footnotes Merged Into Body Text or Lost: Causes and Fixes
Agent Appends Footnotes as Inline Text Instead of Linking Them to Their Reference
6 patterns for this goal
Layout preservation fails when an agent reads every character correctly but flattens the document’s two-dimensional structure into the wrong one-dimensional text stream. Table boundaries, spanning headers, footnotes, running headers, and mixed-direction scripts all carry positional or hierarchical meaning that a naive top-to-bottom, left-to-right reading pass destroys — a two-column newsletter interleaves into a nonsensical sentence, a footnote reference gets appended as trailing body text, and a table with borders and no whitespace runs into one unparseable string. Layout preservation failures are especially dangerous because the extracted characters are individually correct, so the error only shows up when something tries to parse structure out of the flattened text — a line-item total, a footnote citation, a column value — and finds it’s in the wrong place or missing entirely.
Every layout-preservation pattern’s mitigation follows the same two-stage shape: classify page regions or structural elements first (table grid, column boundary, footnote band, header/footer band, script segment), then extract or recombine content within that established structure as a separate step — never let a single extraction pass do both region-classification and content-reading at once. Table-boundaries and merged-cells both push toward detect-structure-then-extract-content pipelines; column-ordering, footnotes, and headers-footers all push toward segment-pages-into-regions-then-read-each-region; bidirectional-text pushes toward script-detection-then-BiDi-recombination. The unifying diagnostic is a coherence or consistency check run after extraction — semantic coherence checks catch scrambled column text, orphaned-marker detection catches lost footnote links, repetition validation catches header/footer leakage, and aggregation-mismatch checks catch flattened table hierarchy — because layout errors don’t corrupt individual characters, only their structural relationships.
Text extraction failures are character-level: the model misreads a 0 as an O. Layout preservation failures happen even when every character is read correctly — the structural relationship between correctly-read pieces of text (which column a sentence belongs to, which row a footnote references, which parent row a table cell nests under) is lost or scrambled. See Accurate Text Extraction.
Because table-boundaries detection has no visual grid line to anchor on and must infer structure from whitespace projection profiles or alignment patterns instead, and table-boundaries failure is rated Very Common precisely because so many real-world tables use whitespace-only alignment rather than drawn borders.
Table-boundaries is about detecting that a table exists and where its grid lines are at all; merged-cells is a step further — once the grid is detected, spanning headers and nested rows (a cell that visually covers multiple rows) still need to be reconstructed as a hierarchy rather than flattened into a flat list of siblings.
No, but it catches a specific and common subset. The column-ordering pattern’s mitigation runs a lightweight language-model coherence check on extracted paragraphs to catch text that jumps between unrelated topics mid-sentence — the signature of interleaved columns — but the coherence check is a detection method, not a fix; the underlying gutter/column-boundary detection still needs to be correct for the extraction to be right in the first place.
Primarily, but the failure also appears in mixed-script documents like an Arabic invoice with embedded English product codes or numeric IDs — the bidirectional-text pattern’s mitigation specifically calls out that numeric/ID fields need a field-type-driven direction override, since they should read left-to-right even when embedded in right-to-left surrounding text.
| Pattern | Mechanism |
|---|---|
| Bidirectional Text | RTL/LTR script mixing reversed or jumbled without proper BiDi-algorithm handling |
| Column Ordering | Multi-column pages read across columns instead of down each column, interleaving unrelated text |
| Footnotes | Footnote/margin content appended as inline body text, losing its reference link |
| Headers Footers | Repeating headers/footers and page numbers bleed into body content mid-paragraph |
| Merged Cells | Spanning headers and nested rows flattened into a sibling list, losing parent-child hierarchy |
| Table Boundaries | Borderless/inconsistent tables extracted as continuous text with misaligned columns |
Total: 6 patterns
Agent Appends Footnotes as Inline Text Instead of Linking Them to Their Reference
Agent Interleaves Repeating Headers/Footers Into Body Content
Agent Flattens Spanning Headers and Merged Cells Into a Grid, Destroying Parent-Child Structure
Agent Interleaves Text From Different Columns Into Nonsensical Output
Agent Extracts Right-to-Left and Mixed-Direction Text Reversed or Jumbled
Agent Extracts Table Data as Continuous Text Instead of Rows and Columns