EPUB books as input
An .epub file is an input like a PDF or a Word document (kakemono convert book.epub -o book.md). The content documents of the book (XHTML), in the order of its spine, are read
directly, without layout analysis, into the same intermediate form as a Word document, so the same
rules give each paragraph its kind:
<h1>–<h6>are headings (raised together so that the highest is of level 1, since many books keep<h1>for the title or start their chapters at<h2>); the title and authors come from the title page (class="title",class="author") or else from the book’s metadata (dc:title,dc:creator);<pre>is code;<figcaption>and a table’s<caption>are captions; ordered and bullet lists keep their markers (start,type,value) and nesting;- MathML formulas keep their structure (MathML, LaTeX and Office Math in the outputs, in running text too);
- tables become rebuilt tables (
colspan,rowspanand header rows kept); pictures (<img>, an<svg>showing one, or a drawing in SVG) become figures at the size the book gives them; - a note called by a link marked
epub:type="noteref"(orrole="doc-noteref") follows the paragraph that calls it, without its link back (Word, LaTeX and Typst set it as a footnote of its call); links between the documents of the book keep working, and citations and references to figures and tables become links, as for a PDF; - bold, italics, monospace, scripts and small capitals come from the elements (
<em>,<b>,<code>,<sup>, …) and from simple rules of the book’s style sheets (.italic { font-style: italic }); elements withdisplay: none, page break markers and the navigation document are left out; - line breaks (
<br>: the lines of a poem, of an address) stay line breaks in every output, as the manual line breaks of a Word document do:<br>in HTML, EPUB and Markdown,<w:br/>in Word,\newlinein LaTeX (a space inside a table, whose cells hold one line),#linebreak()in Typst.
A book has no pages: all four HTML modes give the friendly article, and -o book.pdf lays the
book out in pages through a Word document, as for Word input. Books protected by DRM (encrypted
content documents) cannot be read.