Skip to content

Export an EPUB

Choose File → Export → EPUB… (Ctrl+E). Leafbind saves your open scene first, so the last words you typed are in it, then shows what it is about to make before it writes anything.

The export dialog starts with a checklist of the book, read from your settings the same way the export reads them:

  • Title, author and language. A ⚠ means one is missing. The book then names no author, or says its language is undetermined, so e-readers can’t hyphenate it or read it aloud in the right language. Set them under Project details & settings.
  • Cover and description. When the book has a cover, it is shown beside the checklist. See Cover and details.
  • Pages before or after the story, by name, such as “Title Page” and “Copyright” before the story, “Afterword” after it, and parts, when the book has them. Parts that print nothing are counted and marked not printed.
  • Chapters: how many, whether each is a document or a folder, and the first and last headings as they will be printed, such as “Kapitel 1” to “Kapitel 39”. Then the scenes inside them, if any.
  • Formatting: how headings and paragraphs are set, how a chapter opens, whether the formatting is locked, and the length of the book in pages and words.
  • Pending edits: suggestions nobody has accepted go into the book as proposed. Accept or reject them first if they shouldn’t be in it.
  • Placeholders: a placeholder Leafbind can’t fill in, such as a misspelt {{ subtile }}, with its page and line. That page would go into the book as you wrote it. Click the row to open it.

If something looks wrong, such as 40 chapters where you expected 39, change it beside the checklist: the dialog’s second column is Exporting a book, the same settings as in Project details & settings, from Chapters are to how a chapter opens. The checklist is read again after each change. A fix that isn’t a setting, such as a scene in the wrong folder, means Cancel, fixing it in the tree, and pressing Ctrl+E again.

Under the checklist is where the file goes:

  • Folder: your project’s folder, unless you chose another for this project before. … chooses a different one. Leafbind remembers it for this project on this computer, once a book has been written there. Choosing the project’s folder again goes back to the default.
  • File: the name your template gives (see The file name). Click it to change it. Press Enter to keep the change, or Esc to drop it. Leafbind tidies a typed name the same way it tidies an offered one.

If a file of that name is already there, the dialog says so, and Export asks before replacing it. Choose Replace to write the new book over it, or Cancel to keep it and change the name or folder first.

Export writes the book. Leafbind then says how many pages and words went in. Show in folder takes you to the file, and Open opens it in your e-reader app, as a double-click on the file would. If no app on your computer reads EPUBs, Windows asks which one to use.

Every EPUB is checked before it is written. One that would not open in an e-reader is never saved.

The same as when you copy a chapter for Royal Road:

  • Only published scenes. A scene set to Left out of copies and exports in its properties (the crossed eye) stays out, and so does a planning note.
  • Nothing from a folder you’ve switched off. In the tree, the eye on a folder’s row leaves it and everything in it out of every export and every Royal Road copy: the eye shows crossed out, and the folder’s name is struck through. Click it again to put the folder back.
  • Your notes, story events and highlights stay out. The words you highlighted stay in.
  • A status window arrives framed, with its icon and its numbers in. A calculated number with nothing in the story to go on is left empty, and the export says which.

By default:

  • Each folder is a chapter. Its scenes run on, with your scene break between them. It starts on a new page, is listed in the contents, and its title is printed at the top. A folder of folders is a part, with its chapters inside it.
  • A document at the top of the manuscript is a page of its own, such as a title page or a copyright page. It is listed in the contents by its title, but the title is not printed on it.
  • If you write one file per chapter (your written unit is chapter), each document is a chapter.

If your book is laid out differently, change it in the export dialog’s second column, or under Project details & settings → Publishing → Exporting a book: they are the same settings. Set it on the series, and every book in it follows.

  • Chapters are: folders or documents.

  • Folder levels: what each level of folders is, outermost first:

    • part
    • chapter
    • front-matter or back-matter: each document inside is a page of its own, with no heading and no number.

    For example, part, chapter means the top folders are parts and the folders inside them are chapters.

  • One folder that is different, such as a folder of book recommendations at the end: give its folder document the line export-as: back-matter. A single document can say export-as: too: chapter, scene, front-matter or back-matter.

Leave Chapter heading empty and each chapter’s title is printed. Or write how a heading should read, with {{ … }} where Leafbind fills something in:

You write A heading reads
Kapitel {{ number }} Kapitel 7
Chapter {{ number | roman }} Chapter VII
Chapter {{ number }}: {{ title }} Chapter 7: The Storm
Chapter {{ number | words | capitalize }} Chapter Seven
Kapitel {{ number | roman }}\n{{ title }} Kapitel VII, with The Storm on the line below

What you can use:

  • number: the chapter’s number, counted through the whole book. Title pages and back matter don’t count.
  • number_in_part: its number within its part.
  • title: the chapter’s title. Leave it out, and a title you use only for yourself stays out of the book.
  • part.number and part.title: the part it is in.
  • book.title, book.subtitle, book.authors and the book’s other facts, under book., since title is the chapter’s own.
  • | roman writes a number in Roman numerals; | roman | lower in small ones.
  • | words writes it out in your book’s language: seven or sieben. Add | capitalize for Seven. It works in English and German, so set the book’s language first, or write words("de").
  • \n starts a new line. In a heading of two lines, the first is set small, in spaced capitals, over the second, so put the title last: Kapitel {{ number | roman }}\n{{ title }} sets KAPITEL VII small over The Storm.

To print the title only when there is one: {% if title %}{{ number }}. {{ title }}{% else %}Chapter {{ number }}{% endif %}.

Part heading works the same way, with number counting parts. Each part gets a page of its own, with its heading set lower down, the way a printed part page looks. Part {{ number | words | capitalize }}\n{{ title }} shows PART ONE small over the part’s title in large type.

Some folders are only for you while you write, such as the acts of your outline. To keep them out of the book while their chapters go in, click No heading beside Part heading. A part with an empty heading and no text of its own gets no page and no contents entry, and its chapters number straight through. To hide only the first part, write {% if number > 1 %}{{ title }}{% endif %}.

No heading works on Chapter heading too. Use Clear to go back to printing titles.

Under each field, Leafbind shows what a sample heading would look like. If a heading can’t be built, it says why, and the book prints titles instead until you fix it.

Leave Project details & settings → Publishing → File name empty and the file is named after the book’s title. Or write how it should be named, with {{ … }} where Leafbind fills something in:

You write The file is offered as
{{ series }}{{ reading_order }} {{ title }} {{ date("yyyy-MM-dd") }} SE3-Der-Gesang-der-Sirenen-2026-10-06.epub
{{ title }} v{{ version }} Der-Gesang-der-Sirenen-v24.03.epub
{{ series }}-{{ reading_order | pad(2) }} {{ date("yyyy-MM-dd HHmm") }} SE-03-2026-10-06-0915.epub

What you can use:

  • title: the book’s title.
  • series and series_name: the series’ short code (SE) and its name.
  • reading_order: the book’s place in its series. Add | pad(2) for 03.
  • version: what you typed in Version, under the title.
  • folder: the name of the project’s folder.
  • date("…"): the date and time of the export, with yyyy (year), MM (month), dd (day), HH (hour), mm (minutes) and ss (seconds). date() alone is yyyy-MM-dd.
  • Everything a title page can use too, such as subtitle, authors and publication_date.

Spaces become hyphens, apostrophes are left out, and anything a file name can’t hold is replaced, the way Leafbind names folders. You can still change the name in the export dialog. Set the template on the series, and every book in it is named the same way. Under the field, Leafbind shows what the name would be if you exported now.

Unless you say otherwise, Leafbind sets a book the way a printed novel is set. Chapter headings are centred. Paragraphs have a first-line indent and no gap between them, and the first paragraph after a heading or a scene break starts flush. Title and copyright pages are never indented.

To change that, open Exporting a book:

  • Chapter headings: centred or left-aligned.
  • Paragraphs: indented, or spaced (a gap between paragraphs and no indent, the way web serials look).
  • Drop cap: each chapter opens with a large first letter, about three lines deep.
  • Capitals: the first words of each chapter are set in capitals. Words in capitals says how many, 3 if you don’t say. A word runs to the next space, so „Wait, counts as one.

Drop cap and capitals work together: the capitals follow the large letter, the way many printed novels open a chapter. Both are off unless you switch them on, and both apply to the first paragraph of each chapter only. A chapter that starts with a quotation, such as an epigraph, opens on the paragraph after it.

Like the other settings here, all of them can be set once on the series.

An EPUB has no fixed pages: each e-reader flows the text to its own screen and font size. So the page count Leafbind gives is an estimate. It allows 175 words to a page, about a Kindle page, and starts every chapter on a new page, as e-readers do. A chapter of 250 words is two pages, and a title page is one.

Locking a published book keeps its text and its order of chapters as readers have them, but it never stops you setting the book up for export. Headings, folder levels, scene breaks, the file name and the version all stay editable on a locked book.

To keep the formatting too, so that exporting the book again gives the same result, switch Formatting to Locked at the top of Exporting a book. The structure, headings, scene breaks and cover are then frozen for this book. Leafbind copies the settings it inherits from the series into the book first, so a later change to the series doesn’t reach it. The file name and version stay editable. Switch it back to Editable to change the formatting again; the copied settings stay with the book.

If Leafbind can’t save a change in Project details & settings, it says so at the top of the dialog and shows the setting as it really is.

The book’s title, subtitle, version, authors, language and publication date come from Project details & settings, and so do the title and copyright pages that name them. Its description, which stores show, comes from the blurb (manuscript/blurb.md).

For a cover, add a line to project.md naming the image, relative to the project folder: cover: art/cover.jpg. JPEG, PNG, GIF and WebP all work.

Press Ctrl+4, or choose Book beside Edit, Split and Preview, to read the chapter you are in as the EPUB will set it, with its heading, its first letter and its scene breaks. What you see is drawn by the export itself, so a change to Exporting a book shows the next time you look. A scene that is left out of the book shows on its own, marked not in the book. See Keyboard shortcuts.

The EPUB passes the W3C’s epubcheck, the validator stores use. To check one yourself, open it in an e-reader such as Apple Books, calibre or Kindle Previewer.