Skip to content
Use case

Converting a paper full of equations to EPUB

Updated:

Equations are the weak point: the EpubCC engine keeps the prose and simple inline symbols, but display equations with fractions, sums and subscripts come out as scrambled plain text, because it does not build MathML yet. On the DPO paper (arXiv, CC BY 4.0) our 8-gram recall is 0.814, behind OpenDataLoader (0.860) and PDFium (0.838).

Try 5 pages free

Original and result

Display equations with fractions, sums, exponents and subscripts; Greek letters in running text; theorem-style derivations in the appendix.

Original PDF
Page of the original PDF
Result (EPUB, as a reader shows it)
The same passage in the converted EPUB

Download source PDF Download the sample EPUB

When to keep the PDF

If the equations are the point of the document, keep the PDF for reading them. The EPUB is useful for the prose around them (introduction, discussion, related work), which reflows and joins across pages correctly.

MathML output is not planned for the first version; when it exists this case will be regenerated and the date above will change.

Source and licence

Document
Direct Preference Optimization paper (arXiv 2305.18290)
Licence
CC BY 4.0
Pages
27
Traits
text PDF, one column, formulas, footnotes, academic paper

Rafailov, Sharma, Mitchell, Ermon, Manning and Finn, “Direct Preference Optimization: Your Language Model is Secretly a Reward Model”, arXiv:2305.18290v3, licensed CC BY 4.0 (checked on the arXiv abstract page, 2026-11-04). Pages shown unmodified; the EPUB is our conversion.

Settings used

  • Engine: EpubCC engine at commit 3b74b26, the binary that generated the images and the sample (2026-11-04).
  • Pages: the whole document for the figures; pages 4–5 for the images and the sample EPUB.
  • Benchmark figures: a run of 2026-11-04 with the same binary, every engine on the whole document; this document is not yet part of the published benchmark.
  • Options: none. The engine has no per-document settings yet; the same defaults apply to every file.

Validation and results

EPUBCheck EPUBCheck on our EPUB: 0 errors, 0 warnings.

EPUBCheck 5.4.0 on the downloadable sample: 0 errors, 0 warnings (checked 2026-11-04).

Pages
27
Time
0.15 s
Peak memory
63 MB
Chapters
11, from the paper's headings
Footnotes found
7, 6 linked
Equations converted to MathML
0
Quality warnings
none

Benchmark run of 2026-11-04, not yet part of the published benchmark.

8-gram recall · Like 4-gram recall with 8 words: drops when reading order or line joins break sentences (continuity). Methodology
Engine8-gram recall
EpubCC engine (EPUB output)0.814
EpubCC engine (plain text)0.810
pdf_oxide · extract_text0.780
pdf_oxide · to_plain_text (XY-cut)0.777
pdf_oxide · Markdown0.807
PDFium · text().all()0.838
OpenDataLoader PDF (local mode)0.860
pdftotext (Poppler)0.827

Limitations we observed

  • Display equations are written as plain text in the order the PDF draws them: fraction bars disappear, numerators and denominators land on separate lines, and the equation number drifts («r(x, y) = β log + β log Z(x). (5) π ref (y | x)»).
  • Subscripts are written inline with a space (π ref, π θ) instead of as subscripts; some superscripts are kept (π^SFT).
  • No MathML: a reading app cannot render or read the formulas aloud.
  • OpenDataLoader (0.860), PDFium (0.838) and pdftotext (0.827) have a higher 8-gram recall than our engine (0.814); the reference skips equations, so this measures the prose.
  • The sample's title came out as «4 Direct Preference Optimization» (the first heading of the pages converted), not the paper's title.

Convert a similar PDF

Share LinkedIn X Reddit Email