Posted on by & filed under epub, tools.

This is part two of a series on using author-friendly word-processing tools with native EPUB export. Part 1 was about Apple Pages.

Part two: Scrivener

I first became aware of Scrivener’s support for EPUB export in November of 2010, when they released a special edition for NaNoWriMo (and the less said about my novel-writing experiment, the better). EPUB export is now available in the latest major release.

Though Scrivener is primarily a Mac application, there are beta versions for Windows and Linux. I have no idea if they support EPUB export — please comment if you know either way!

The sample document

Scrivener’s interface can be intimidating if you have only worked with relatively straightforward word processors. It’s less of a document editor than a book authoring platform (or the way I would look at it, it’s Visual Studio, not emacs).

Screenshot of Scrivener main screen with numerous panels

For this test I used the “Manuscript” style, which provides many of the utilities that an author of a novel-length book might want, rather than starting with an entirely blank document (analogous to using the EPUB sample document in Pages). For one thing, the Manuscript layout already provides obvious support for structured blocks like chapters and parts. In fact Scrivener segments documents even further into “scenes” which can be relocated easily through the document. Programmers love structured content!

As in the previous post, I set up the sample document to include all of the obvious stylistic elements that I wanted to test. I didn’t attempt to exactly re-create the Pages sample as that would be soul-crushing.

Finding the EPUB export feature can be challenging; it’s actually listed as “Compile.”

Export options

No complaints here. There are dozens of options for EPUB configuration from the menus.

EPUB-specific output options:

Scrivener panel

Select which content segments are included in the book, and in what order:

Scrivener panel

My favorite pane. Look at all that metadata!

Scrivener panel


Scrivener’s output is variable in quality. Some things are nice. It’s valid, for one thing, and I was able to produce this valid output without any special handling — I didn’t change any of the menu items beyond adding the metadata, which indeed trickles down nicely into the OPF file:

       <dc:title>Creating an EPUB sample document</dc:title>
        <dc:identifier id="PrimaryID">urn:uuid:A54DCD13-A6E0-4ACA-8B31-4E0EBA0624EF</dc:identifier>
        <dc:creator opf:role="aut">Liza Daly</dc:creator>
        <dc:description>An EPUB test of Scrivener's output</dc:description>
        <dc:publisher>Threepress Consulting Inc.</dc:publisher>

Whitespace is exported as significant. While this makes the web developer in me cringe (I’d rather see CSS margins used here), it’s acceptable, especially since whitespace is semantically relevant in fiction, as when used for scene breaks:

<p class="p1"><br /></p>
<p class="p1"><br /></p>
<p class="p2">Hello world!</p>
<p class="p2">I have lists and tables!</p>

Unlike Pages, lists are generated as the correct list elements:

<ol class="ol1">
  <li class="li3">Numbered lists are numerous.</li>
  <li class="li3">We often have more than one item.</li>
<ul class="ul1">
  <li class="li3">Make love</li>
  <li class="li3">Not bullets</li>

Tables are fine, though I’d like for these tools to have a “table header” style that could ultimately map to th elements. This is a little more readable than the Pages output.

<table cellspacing="0" cellpadding="0" class="t1">
      <td valign="top" class="td1">
        <p class="p2">Not sure how to make headers</p>
      <td valign="top" class="td1">
        <p class="p2">Without just using colors</p>
      <td valign="top" class="td1">
        <p class="p2">Not semantic</p>

Headers are curiously not optimal:

<h2 style="margin: 0.0px 0.0px 0.0px 0.0px; font: 138% Optima"><b>First, a header.</b></h2>
<h3 style="margin: 0.0px 0.0px 0.0px 0.0px; font: 92% Optima"><b>A subheader.</b></h3>

Why the inline margins and font? Why the b? And like Pages, no apparent way to generate strong and em:

<p class="p2">Back to body text. But with <b>strong</b> and <i>emphasis</i>?</p>

Drag-and-drop images and internal and external hyperlinking all worked well:

<p class="p2"><span class="s1"><img src="images/droppedImage.png" width="272" alt="Image" /></span><span class="s2">Hello dog.</span></p>
<p class="p4">Inline URL: <a href=""></a></p>
<p class="p4">A hyperlink to <a href="body1.xhtml">Chapter One.</a> A hyperlink to <a href="">a website</a>.</p>

I pulled the image out of the Pages EPUB output – Pages renamed it to droppedImage.png, and Scrivener retained the filename, which is a nice touch.

Room for improvement

  • Scrivener seems to generate one CSS file for each XHTML file too many CSS files by default. Uncool! This could potentially generate huge unwieldy EPUB books. There’s no reason to have more than one CSS file in an automatically-converted document, and the styles should be normalized across XHTML files.
  • Like Pages, there was no obvious way to add alt text values to images.
  • Also like Pages, I’d like to be able to customize the elements and class names in the outputted XHTML using simple menus.

A pleasant surprise to me was that Scrivener has a lot of options for power-users under the hood, including integration with version control tools like Subversion, use of a text-based markup format for better serialization to other formats, or low-level customization of the CSS or even XSLT: Scrivener advanced topics. This means it’s potentially a better choice for an ambitious digital-only publisher; you can start with the basic WYSIWYG layer, and gradually customize the output by diving into the lower level. This will be especially true once Scrivener is fully cross-platform.

Recommended with reservations (but mainly because of the CSS file issue).

Download the sample EPUB file and Scrivener file (unzip first). (Released under a Creative Commons Attribution license)


11 Responses to “Can an author create an EPUB using normal tools? Part 2: Scrivener”

  1. Baldur Bjarnason

    Scrivener’s output varies a bit with the input.

    I have several epubs exported from Scrivener which have each about 30-60 xhtml files and Scrivener outputs, at most, four CSS files. Usually one for each chapter style.

    If you make sure that the input text has no extraneous whitespace and spend some time configuring the Compile dialogue properly, then the only real issues I can find are the inline styles in the headers and the inability to edit the img alt tags.

    Using Scrivener with Sigil 4RC makes for a very productive epub production workflow.

    The whitespace issue is, IMO, generally the writer’s responsibility. It’s impossible for Scrivener to know which whitespace is supposed to be significant and which isn’t. Also, if you have a substantial work (35 000 – 85 000 words) it really pays off to read through the manual and properly familiarise yourself with all of the Compile dialogue options.

    All in all, for text only ebooks a decently structured Scrivener project will result in an epub file that’s easily 99% there. If you are writing in Scrivener in the first place, then it’s a no-brainer.

  2. Patrick

    I’d be interested to see this series extended to include 2 more programs: Nisus Writer Pro 2.0, which now includes EPUB exporting, and Sigil, which is geared towards specifically creating EPUBs (in fact, that’s its native format).

    As I create versions of some of my works for viewing on my readers, I’m very interested in tools that ease or automate the process without having to handcode my documents.

    Also, is there some kind of matrix that shows the features supported by various readers on the market (hardware and software alike), as well as their limitations (such as Adobe’s poor character repertoire without using embeddded fonts)? Thanks in advance, and for all of the great work you and others are doing to improve EPUB and further its adoption and utility.

  3. Geordee Naliyath

    I had searched for EPUB generators and found iStudio Publisher. Generates reasonably good EPUB files, but misses key features like ordered/unordered lists. Releases have slowed down too. Another interesting tool I evaluated is Flux, a WYSIWYG HTML editor. It’s EPUB support is in nascent stages, but the developers were responsive.

  4. Baldur Bjarnason

    I tried out epub export in the Nisus Writer Pro demo and the first thing I noticed was that it had some of the same whitespace issues as Scrivener. I didn’t do a thorough test but my impression was that the quality of the epub was on par with Pages, but a little less flexible. I really didn’t test it properly, though.

    Sigil is brilliant, especially the RC for version 4 (it really is an improvement on earlier versions), but not for authoring. It’s a lousy writing environment. It’s great for editing and tweaking epub files exported from Pages/Scrivener et al.

    Flux, OTOH, is one of those apps that I just don’t understand. It’s only useful if you understand HTML (you need to know what divs, iframes, etc. are) and not that much easier than hand-coding. (I may be biased, since I’ve been hand-coding HTML for 18 years). It also seems limited to only one xhtml file when you’re making an epub.

    All in all, though, it looks like epub export is on the radar of quite a few software cos, which is good news. I hope some of them are reading this series and making notes. Both Pages and Scrivener have a lot of potential in this area.

  5. bowerbird

    for the purposes of having fair comparison,
    i would like to see you start with a document
    containing what you’d call a good test-suite,
    which you would then turn into an ideal .epub.

    after that, you’d judge contenders based on
    how close their output came to your ideal…


  6. Frank Lowney

    If you have a Mac running 10.6 or later, you’ll want to explore this Automator service for rapidly creating ePub documents:
    There’s an automatic installer to download from MACOSXAUTOMATION.COM so it’s quite easy to set up. I suspect that the binary at the heart of this MacOS X Service might have been a precursor to the Pages ePub export.
    It’s a delight to use and works almost everywhere so is ideal for rapidly converting an on-line article into an ePub — the kind of stuff that teachers like to do. Just highlight the text, copy it and invoke the service with a right-click or Cmd click of the mouse or the Services menu of the application.

  7. Moriah Jovan

    Atlantis word processor has been able to export to EPUB for several years now. I used it for a time before I found Sigil, so I’m not now aware of its container or compliance issues. Many things have changed since.

  8. Aaron Shepard

    What about eCub and Jutoh (both from same company)? eCub was actually recommended by Apple’s first publicly available iBookstore documentation.

  9. YKastell

    As far as I can see the ePUB export is not cirrently available neither in the Windows nor in the Linux unfortunately