Know what each target can hold
Formatting does not disappear by accident; it disappears because the target format has nowhere to put it. Decide on the target before you convert, based on what you must keep.
| Element | TXT | Markdown | PDF (print) |
|---|---|---|---|
| Chapter boundaries | Blank lines | Headings and rules | New page per chapter |
| Heading levels | Lost (own line only) | Kept | Kept |
| Bold / italics | Lost | Kept | Kept |
| Lists | Dashes and numbers | Kept, nested | Kept |
| Tables | Pipe-separated rows | Pipe-separated rows | Kept |
| Images | Alt text only | Alt text or ZIP with files | Embedded |
| Fonts and colours | Lost | Lost | System fonts, colours from CSS kept |
| Links inside the book | Lost | Lost | Not clickable |
| Right-to-left text | Characters kept | Characters kept | Laid out right to left |
Why chapters go missing or run together
- The spine is incomplete. Conversion follows the reading order. A chapter that exists in the archive but is not in the spine is not exported. The validator lists files missing from the manifest and navigation entries that do not point into the reading order.
- One file holds several chapters. Some books put a whole part in a single XHTML file with several headings. A converter that splits by file will not split them. Markdown and PDF keep the headings; TXT keeps them on their own lines.
- Chapter headings are images. If a chapter title is a picture, it has no text to export unless the author gave it alt text.
Why formatting looks different afterwards
- Styling is done with classes, not tags. If a book makes italics with a CSS class on a span instead of an
emtag, a text-based converter cannot know it was italic. Visual formatting that is only in CSS rarely survives conversion to Markdown or TXT. - Drop caps and decorative breaks. These are CSS or images; they either become stray letters or vanish.
- Footnotes. The note text stays where the book put it; the jump link is removed.
A five-minute check before you trust a conversion
- Count: the number of chapters in the output should match the book’s table of contents.
- Search the output for a phrase from the first and from the last chapter.
- Open one chapter with a table or list and compare it with the book in the reader.
- If the book has images that matter, check that they are present: in the PDF preview, or in the Markdown ZIP’s
imagesfolder. - For right-to-left books, check the first line of a paragraph starts on the right.
Choosing the right route
For reading on paper or sharing a fixed copy, use EPUB to PDF. For notes and publishing, use Markdown. For searching and analysis, use plain text. When a book looks wrong in all of them, the problem is probably in the EPUB, and the repair tool is the next stop.
A worked example: chapters in one file
Many EPUBs made from word-processor documents contain the whole text in one XHTML file with headings marking chapters. The book looks chaptered in a reading app because the app builds navigation from the headings. Convert it to plain text and you get a single long file with the headings as lines of text; convert it to Markdown and the chapter headings become # lines you can split on; convert it to PDF and the chapters flow one after another without new pages, because the page break rule works per document, not per heading.
If you need a page break before each chapter in the PDF, there are two ways. Convert the book to Markdown, split it by chapter and convert the pieces separately, or split the chapters into files in an EPUB editor first. Neither is automatic, because deciding what counts as a chapter is the author’s decision.
Emphasis that is only visual
Good EPUBs mark emphasis with em and strong tags. Others use a CSS class such as .italic or .s1 on a span. Visually they look the same in a reading app, but a converter that looks at structure sees a plain span. After converting to Markdown, search for text that you know was italic. If it is plain, the book used class-based styling and the italics can only be restored by hand or by an editor that understands the book’s CSS.
Keeping things that tables and images carry
- Tables of data: if rows and columns matter, convert to PDF, or copy the table from the reader into a spreadsheet; the pipe-separated rows of the TXT and Markdown outputs paste well too.
- Diagrams: keep images by choosing the ZIP option in the Markdown converter or by converting to PDF.
- Poetry: line breaks are kept as line breaks in all three outputs. Indentation is not.