Rheo

EPUB

EPUB is, in our view, the most promising document format for the future of digital reading. It combines the portability of PDF – a document encapsulated in a single file that renders reliably – with the flexibility of HTML – dynamic layout that adapts to different screens, and the ability to support interactivity and extensions.1

Typst does not yet support EPUB. The Rheo EPUB format bridges the gap, allowing you to compile fully functional EPUB documents from a Rheo project directory. As EPUB export is on Typst’s roadmap, we will track this feature closely in the upstream and look to integrate with it when it lands in the future.

What Rheo provides

Unlike the PDF and HTML formats, EPUB always produces a single merged output from your project. Rheo handles the full EPUB packaging pipeline: it converts your Typst source files to XHTML, generates a table of contents from your document headings, and bundles everything into a standards-compliant EPUB archive.

The spine determines which files are included and in what order. An EPUB must have a spine in order to be valid; if you don’t specify one, Rheo infers a default that includes all Typst files ordered lexicographically. You can customize it to control the set and order of sections:

[epub.spine]
title = "My book"
vertebrae = ["intro.typ", "chapters/*.typ"]

The title field sets the EPUB’s metadata title. Rheo also generates a unique identifier for the document and populates other metadata fields such as language and publication date.

Relative links between source files are resolved to internal links that navigate between sections in the EPUB.

  1. 1For more on why we believe EPUB deserves wider adoption, see Portable EPUBs.