Matt Gemmell

TOLL is available now!

An action-thriller novel — book 2 in the KESTREL series.

★★★★★ — Amazon

Beautiful ebook novels with Ulysses

tech, ipad-only & books 5 min read

This article is part of a series on going iPad-only.


Within the next week, the second novel in my KESTREL thrillers series, entitled TOLL, will be released. I wrote it entirely in Ulysses, and I’d like to share my method for creating beautiful epub ebooks of novels using Ulysses itself.

I’ve created a Ulysses epub export style for this purpose, and it’s on the Ulysses Style Exchange entitled Gemmell Novel. Read on for info on how to set up your book project and formatting.

Ulysses ebook epub export popover

It’s important to note that this is strictly for novels (or books that are similar in conventional formatting, structure, and layout). It particularly won’t work well for books that require multiple levels of headings within the text, because I repurpose headings to create various other effects instead, as detailed below.

Since Ulysses uses Markdown as its writing format, there’s no built-in concept of various things we need to produce a typographically acceptable and aesthetically pleasing ebook novel, such as:

  • A title page, dedication, copyright notice, or epigraph;
  • Centred text, commonly for use in front matter;
  • Formatted front and back matter generally;
  • Scene breaks.

We can get around all of that by (mis-)using certain Markdown and HTML formatting to create those elements, though, and that’s what my epub export style does. Here’s how to use it.

Structuring your novel

With my export style, you’ll get a clean, readable, beautiful ebook — with justified text, indented paragraphs (except the first of a section), automatic section breaks for chapters and parts, and a generally pleasant experience for the reader.

There are just two rules to follow with your book’s main content:

  1. Use heading level 1 (h1, or a single “#” in Markdown) for chapter titles. Also use it for part titles, if your novel has parts.

  2. Use a horizontal rule (hr, or “----” in Markdown) for scene breaks. Put one at the end of every scene, except those which end a chapter.

The part and chapter headings will be shown in a larger font and in boldface, with some spacing above them. Each will begin a new page (section), which is what you want.

Apple Books ebook chapter heading page

Scene breaks will be shown as a fully blank line, with no ornamentation; this is the preferred style for a novel, and it looks excellent.

Apple Books ebook scene break

Two personal recommendations, which are entirely optional: keep each scene in its own sheet in Ulysses, and also keep each title (chapter or part heading) in its own sheet. This means you can easily reorder scenes, and move scenes between chapters.

Front matter (and back matter)

Books have front matter, which is stuff that comes before the actual story: it usually includes at least a copyright notice, title page, and perhaps a dedication. There might also be information about the author, the book’s series, an epigraph (a quote, poem, lyric or such which serves to set the mood for the story, or ties into it in some way), and even the book’s back-cover blurb.

Since ebooks have no back cover, I recommend putting the blurb (enticing summary or teaser description) in the front matter — sometimes readers buy your book but don’t start reading for a while, and it serves as a useful reminder.

The thing about front matter that’s tricky from a Markdown point of view is that it typically uses different formatting from the main story; for example, the copyright, dedication, and title pages all tend to be centred rather than left-aligned or fully justified. Similarly, while each front matter page has a conceptual title (like “Copyright” or such), those titles usually aren’t actually shown. We can deal with all of this.

For each front matter page, start the relevant sheet in Ulysses with an h2 heading (##), but put the title in an inline comment (++like this++). This gives you a title for the page in Ulysses, and a way for my epub style to format the page, but the title won’t actually be shown in the ebook. There are several examples below. Front matter pages use non-indented paragraphs with vertical spacing between, which is very likely what you want.

For your title page, use an h5 heading for the book’s title, and use an h6 heading for the author’s name (and also for the series name, if you have one). These will be shown in suitable sizes, without boldface, and centred.

Ulysses front matter title page

Here’s how it’ll look:

Apple Books ebook front matter title page and epigraph

For left-aligned front matter content, such as author biography, series information, or certain types of epigraphs, use an h3 heading for each paragraph.

Ulysses front matter author information

Here’s how it’ll look:

Apple Books ebook front matter series and author information

For centred front matter content, such as a copyright notice, dedication, and certain epigraphs such as perhaps poetry or such, use an h4 heading for each paragraph.

Ulysses front matter copyright page

Here’s how it’ll look:

Apple Books ebook front matter copyright and dedication

Yes, the raw Markdown in Ulysses for the front matter is slightly odd, but you’ll get a beautiful ebook out of it, and without resorting to raw code blocks and custom HTML or CSS.

Regarding back matter, its format is up to you — feel free to use the above conventions just as for your front matter. I tend to just let each section of back matter be formatted as a normal chapter, which works well for an afterword, acknowledgements section, and such like.

Closing thoughts

That’s about it. You can install my epub export style and try it out to see the results. The typeface shown in all screenshots is my beloved Palatino, which I also set my paperback novels in.

A brief aside: since I work on an iPad Pro, and have an Apple Pencil, one of the beneficial side-effects of being able to produce attractive epub files straight from Ulysses is that I can offer my readers autographed and personalised ebooks, with custom-inscribed covers. They’ve been very popular.

I hope this article has been useful to you. Again, you can find my Gemmell Novel epub export style on the Ulysses Style Exchange. Feel free to duplicate and modify it for your needs, if you have the Mac version of Ulysses. Similarly, you might be interested in my Gemmell Two theme, which provides a clean and readable environment for writing in Ulysses.

I’m @mattgemmell on Twitter, and that’s the best place to get in touch with me, though you can also email me. If you’re interested in my work, you might also want to sign up for my occasional readers’ newsletter, which has bonus scenes from my books, articles on writing, previews of future projects, and more.

The book you’ve been seeing in the various screenshots within this piece is my own upcoming novel, TOLL, which is out on Wednesday 5th December 2018. If you’re interested in fast-paced technothrillers with a European focus and a hint of conspiracy and fringe science (or just want to say thanks for this article), here’s where you can find it:

I hope you’ll take a look, and best of luck with your own writing projects.

Thanks for reading.