EPUB compile feature requests

Hi! First of all, I absolutely love the ability to compile ePub from Scrivener! Until now, I have been creating my ePub and Mobi files from hand, or leaving it to a traditional publisher to hire an ebook specialist.

I just have a few minor requests, which would save me 20 minutes every time I want to compile from Scrivener. Currently I am compiling the ePub from Scrivener and then opening the ePub to manually adjust the XHTML and CSS code.

The two most critical feature requests that I can’t recommend strongly enough:

1. Grant the ability to set the opening page for the reader in the compile settings.
Something like: Page that opens for the reader: [dropdown box: Choose document]
This is set in content.obf. Example: <reference type="text" title="Chapter1" href="body1.xhtml"/>
Body1.xhtml is, in my case, Chapter 1 of my ebook.

A reader opens this ebook and it automatically goes straight to Chapter 1 instead of the book cover or table of contents.

2. Combine all CSS files into one CSS file. Currently this makes for a bloated and convoluted ePub that is nightmarish to edit. If you change only one thing, please change this!

Other minor feature requests:

For ePub 2 compatibility reasons:

  • Convert to

  • Convert to

  • Convert all characters to safe HTML entities
    (except “©” which should be converted to “©”)

  • Removal of the following code, which sometimes occurs in Scrivener ePubs:

<span class="Apple-converted-space">&nbsp;</span> <span class="Apple-converted-space"> </span>

  • Setting table widths to a maximum of 100%, instead of the 250% that Scrivener seems to like.

  • First lines with no indents should have the following CSS, as an example:

p.p1 {text-indent: 0em!important;} @media amzn-mobi { p.p1 { text-indent: 0.01in!important; }
The reason this is important is because Amazon enforces an indent on first lines, and if you try to stop Amazon doing this by setting 0em with !important then it inexplicably give you a double indent. The workaround is to indent your first lines to a very small amount (0.01) so that Amazon won’t try to enforce an indentation and it will display for the reader as 0 indent.

Currently, I can add this to the custom CSS box. But it might benefit all Scrivener users.

Metadata fields:

  • ISBN
  • Replace Date with “Original Publication Date” and use the date of the compiled epub for “Modification Date”, or offer this as a field.

I understand this may not be possible from within Scrivener, but the ability to search and replace HTML would be fantastic.
For example, replace:

With: <span class="kf8only-inline"></span>—

Thank you for your time! And despite my many suggestions, I think the ePub compile feature is excellent.

Nathan (a very happy customer)

Hi Nathan,

I’m afraid most of what you suggest isn’t possible in the current implementation. The problem is that Scrivener currently relies on Apple’s HTML export methods, and most of what you mention here is stuff handle by Apple’s exporter. For instance, for this reason it’s not possible to combine the CSS into a single file, and this is why you get the “Apple converted space” text, as well as less control over indents etc. This, in fact, is also the reason we only support ePub 2 - because Apple’s exporters only support HTML4.

However, for the next major (paid) upgrade I spent about a month improving ePub support. I wrote a whole bunch of code that could convert rich text to MultiMarkdown (that code is slightly crazy complicated :slight_smile: ) so that I could pipe it through MMD and generate some really clean HTML5 - allowing for ePub 3 support. And with this, I have been able to make it so that you can edit the CSS right in Scrivener (for those who want to), ensuring a clean, single CSS file, and total control.

I believe all of your other suggestions here will also be covered in the next paid update (there’ll be news on that soonish), but I will double-check.

Thanks and all the best,

Hi Keith,

Thank you for taking the time to respond and also for the exciting update on the next paid version of Scrivener. It sounds very promising and I look forward to purchasing it.

Is there anywhere I can follow the latest developments and discussions of v3?