Skip to content

fix(markdown): link PDF footnotes and citations - #51

Open
faysou wants to merge 1 commit into
myhloli:mainfrom
faysou:fix/pdf-markdown-footnotes-citations
Open

faysou wants to merge 1 commit into
myhloli:mainfrom
faysou:fix/pdf-markdown-footnotes-citations

Conversation

@faysou

@faysou faysou commented Nov 22, 2026

Copy link
Copy Markdown

PDF Markdown export currently renders page notes as styled HTML and can leave their markers as standalone formulas. Numbered citations also lose their connection to the bibliography, including groups such as [1, 2, 3, 4] that OCR represents as inline math.

Emit Markdown footnotes when a marker matches a note on the same page. Recover fused consecutive markers when the split is unique, and retain the text of notes that continue onto the next page. Link each citation number to its unique bibliography entry. Unmatched and ambiguous markers keep their existing rendering.

Validation

  • Converted all 96 pages of Compositional Separation of Control Flow and Data Flow (arXiv:2309.06397v5) with MinerU in OCR mode. A GFM parser recognized 24 footnotes and links to 91 bibliography entries, including all four citations in the first-page group.
  • Passed Ruff and the Markdown render tests, including regressions for repeated note labels, cross-page notes, and duplicate bibliography numbers.

- Match superscript markers to page footnotes and emit Markdown notes.
- Link bracketed citation numbers to unique bibliography entries.
- Cover merged markers, split notes, and ambiguous references.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant