Text that wraps around an image: where the engine breaks
Updated:
When a paragraph flows around a floating image, the EpubCC engine keeps the image but breaks the paragraph: the narrow lines beside the picture become separate one-line paragraphs, and the caption can land inside a sentence. On an English Wikipedia article pdf_oxide reaches an 8-gram recall of 0.800 against our 0.761.
Original and result
Images floated left or right with captions, and body text wrapping around them in a narrower column for a few lines, then returning to full width.


Download source PDF Download the sample EPUB
Why it happens
The engine finds columns by looking for a vertical gap that runs the full height of a region with at least two lines on each side. A floating image with text beside it looks exactly like that: a narrow column of text next to a column that holds the picture and its caption.
Recognising wrap-around (a narrow run of lines that continues at full width below the image) is on the list; until then we show the result as it is.
Source and licence
- Document
- Wikipedia (English): Alice's Adventures in Wonderland
- Licence
- CC BY-SA 4.0 (text); images under their own licences
- Pages
- 24
- Traits
- text PDF, one column, images, English
Wikipedia contributors, “Alice's Adventures in Wonderland”, English Wikipedia, PDF from the Wikimedia REST API; text licensed CC BY-SA 4.0, images under their own licences (the Tenniel illustrations are in the public domain). The EPUB is our conversion, under the same licence.
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: the published run of 2026-11-03 (engine commit c953279).
- 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
- 24
- Time
- 0.55 s
- Peak memory
- 48 MB
- Images kept
- 20
- Chapters
- 14, from the article's headings
- Quality warnings
- none
| Engine | 8-gram recall |
|---|---|
| EpubCC engine (EPUB output) | 0.761 |
| EpubCC engine (plain text) | 0.760 |
| pdf_oxide · extract_text | 0.800 |
| pdf_oxide · to_plain_text (XY-cut) | 0.800 |
| pdf_oxide · Markdown | 0.672 |
| PDFium · text().all() | 0.774 |
| OpenDataLoader PDF (local mode) | 0.781 |
| pdftotext (Poppler) | 0.769 |
Limitations we observed
- Lines beside a floating image become one-line paragraphs: the gap between the image and the text is read as a column break.
- The image is placed where its region starts, which can be in the middle of a sentence.
- Captions can be interleaved with body text line by line (in this article: «Page from the manuscript of» between two halves of a sentence).
- pdf_oxide extract_text (0.800), OpenDataLoader (0.781) and PDFium (0.774) have a higher 8-gram recall than our engine (0.761) on this document.