Quality of EPUB generation

Hi folks, been using Windows Scrivener since first beta and it has been instrumental in writing my book ever since I switched from trying to manage 30K words in MS Word (and the size has since tripled). Now I’m approaching the point where I’m looking to bring to market.

I shall be self-publishing to finished product (and subsequent products!) into next year and Scrivener’s e-book generation was an added bonus when the feature was introduced. However, I have a few concerns about the actual quality of the ePub data the software produces.

Bit of a disclaimer: my day job is software development and has been for over 20 years. I have been involved with anything from games development on consoles to high profile business applications across multiple platforms. In short, I know my way around software.

So naturally, when I exported my first proof of my book to ePub from Scrivener, I immediately extracted all the files from the Zip file to see what was generated. While the meta-data is generally OK, the HTML is less than perfect.

Because Scrivener is a word processor and not an HTML editor, I suppose some of the intricacies of polished HTML generation is lost based on the flexibility of the word processing and formatting…

<p style="text-align:center;  margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; page-break-before:always;"><span style=" font-family:'Garamond'; font-size:16pt; font-weight:600;">Chapter Twenty-One</span></p>

However, that is just awful – and every paragraph in the entire book is composed of in-line style sheets such as this. As I am primarily looking to ship my books digitally, if I have to modify the ePub generated in the future for whatever reason, cleaning up the HTML is going to be a real chore.

I realise this is more of a niggle than serious functionality failure, but there is a lot of unnecessary mark-up in the HTML, most of which can be normalised into the single CSS file that Scrivener generates anyway.

Also, is there any way to customise the generated human-readable contents.xhtml file?

This is not a niggle it is a serious flaw and should be stamped on immediately, additional to this file bloat, which will cause conversion errors, every epub I have tried to create fails to validate correctly. Best option I have found is to export the work to LibreOffice and run it through writer2epub, this produces a valid epub and most people will not need to further edit the epub with Sigil.
The even better solution is to miss out Scrivener altogether and just use open source free software.

I’m new to all these epub details, so please forgive me if all this is obvious to you folks with more experience.

How does file bloat cause conversion errors?
What is epub validation?
Why should I care about validation?
What is writer2epub? A LibreOffice plugin? Where do I find it?

If you are suggesting to use LibreOffice, I don’t agree. There is a reason I don’t use LibreOffice for my writing, only for my notes and my research. Scrivener helps me write a better story. YMMV. If there is an open source alternative to Scrivener itself, I’d give it a look. if you do so, please post it here: http://www.literatureandlatte.com/forum/viewforum.php?f=15.

I still count my measly $45 USD as one of the best investments I ever made.

I found it easiest to open the Scrivener ePUB into Sigil and do global find/replace for all the bloated html tags. But I agree that the compile process could have a “don’t carry over XYZ formatting options”, particularly font. Fonts should not be in ePUB files, imho. (I always strip them out when publishers include them.)

My workaround is to export from Scrivener into a RTF, then using OpenOffice-Extension “writer2epub” to generate the ebook. That way I usually get very nicely formatted and correct HTML files. If necessary, I clean them up with Sigil afterwards, but for the quick “exporting this for friends to beta-read” the method is good enough and doesn’t take that much longer than directly exporting to epub from Scrivener.

However, I think that’s a problem that should soon be fixed! It doesn’t make sense to offer converting to epub when the result is that bad.