ePub: no more line feeds & strange ToC

User avatar
sjordi
Posts: 9
Joined: Fri Jan 13, 2012 1:04 pm
Platform: Mac + Windows
Location: Geneva, Switzerland & Portland, OR, USA
Contact:

Fri Nov 09, 2018 3:46 pm Post

Hi,
Something is driving me crazy. I published several times a version of a book to ePub format.
Then in the Compile > Options (the little gear wheel) I checked "Remove trailing whitespaces from document".
I published.
Since that moment, even if I uncheck this option, all returns in my book between paragraphs are ignored on my Kobo reader.

Instead of
Introduction

Blah blah

Blah Blah2

I now have
Introduction
Blah blah
Blahblah2

If I publish to Kindle Mobi with the same options, everything is fine. Titles have a blank lines between them and the start of the next paragraph.
Funny thing is that if I open the book in Books on my Mac, iPad or iPhone. It's perfect.

Also the Table of Contents ends by
Guide
1. Contents

Those two lines appear nowhere. They do not show up in the Mac,iPad,iPhone Books app either.


I tried with another book that publishes fine to my ePub (Kobo). I checked that option, republished, and it's gone forever, no more linefeeds. Like it ignores all blank lines. There is no cache or stupid things that could cause this.
Any idea why???
Thanks for any light.
Steve JORDI

User avatar
AmberV
Posts: 22314
Joined: Sun Jun 18, 2006 4:30 am
Platform: Mac + Linux
Location: Santiago de Compostela, Galiza
Contact:

Fri Nov 09, 2018 6:53 pm Post

How old is the Kobo? I wonder if it’s using ePub 2 with the old ADE stylesheet. In the compile overview screen, click on the general options tab on the right hand side, and test an .epub file with Include standard Adobe Digital Editions page template included.

It’s worth noting that this stylesheet makes the .epub file technically invalid. It probably won’t work with other publishers.

As for the Contents, I don’t really know what to say there except that page breaks generate ToC structure. If they aren’t coming from your compile settings, check the main editor for stray page breaks.
.:.
Ioa Petra'ka
“Whole sight, or all the rest is desolation.” —John Fowles

User avatar
sjordi
Posts: 9
Joined: Fri Jan 13, 2012 1:04 pm
Platform: Mac + Windows
Location: Geneva, Switzerland & Portland, OR, USA
Contact:

Sat Nov 10, 2018 8:47 pm Post

Hi,
I don't find that Adobe Digital option in my Compile dialog box. I checked everywhere to no avail.
Not even in the preferences...
I have a Kobo Aura 1 (2015) and a Kobo Aura H20 2nd edition (late 2017).
But the problem is that everything was fine before I checked that "Remove trailing whitespace from documents".
Very strange.
By the way, I have Scrivener 3.1.1 (9852)
Steve
Steve JORDI

User avatar
AmberV
Posts: 22314
Joined: Sun Jun 18, 2006 4:30 am
Platform: Mac + Linux
Location: Santiago de Compostela, Galiza
Contact:

Sun Nov 11, 2018 1:51 pm Post

Ah okay, you probably won’t find the ADE stylesheet option I referred to then, as it’s part of the older (and now deprecated) ePub 2 workflow. Both of those Kobos are fairly recently though—do you happen to know if they support ePub 3 in general? I should hope so, but sometimes hardware uses older, more stable tech for a thing that won't be changing often.

So if you install Adobe Digital Editions on your Mac and open the .epub file with it, do you get the same result? This would be helpful because my old Kobo broke years ago and I never replaced it. So if your book looks good everywhere except Kobo I’m going to have a hard time figuring how what is wrong. No doubt the HTML/CSS of the book itself is fine if everything else displays it normally. It’s probably an odd quirk in the rendering engine on the Kobo—and my hope is that ADE also has it.

But we might as well check that as well. In the compile’s general options area, toward the bottom, you should find a checkbox to export the source files along with the ePub file. Enable that, and go through the HTML files looking for places that display incorrectly. Does anything look odd? Is the syntax broken? Do you get validation errors?
.:.
Ioa Petra'ka
“Whole sight, or all the rest is desolation.” —John Fowles

User avatar
sjordi
Posts: 9
Joined: Fri Jan 13, 2012 1:04 pm
Platform: Mac + Windows
Location: Geneva, Switzerland & Portland, OR, USA
Contact:

Sun Nov 11, 2018 5:04 pm Post

Hi,
I'm not installing ADE but I can tell you that the ePub is fine in Calibrer, in Books on Mac, iPad and iOS...
But it was fine on my Kindle too, I don't know why it "switched" all of a sudden...
Steve
Steve JORDI

User avatar
AmberV
Posts: 22314
Joined: Sun Jun 18, 2006 4:30 am
Platform: Mac + Linux
Location: Santiago de Compostela, Galiza
Contact:

Mon Nov 12, 2018 10:22 pm Post

Since you have the basic trigger identified, I would compile two different copies of the book out:

  • Set Save source files in a folder with exported ePub file in the general options tab of the compile overview.
  • Compile one copy with Remove trailing whitespace from documents enabled, and another with it disabled to a different file name.

You’ll end up with two folders containing .epub files along with all of the loose files that Scrivener creates for them. This will make it a simple matter to compare the HTML and CSS directly, looking for any differences or problems in the output.

I performed a very simple test, but my results were precisely as expected. There were no differences in the .epub save for in the body.xhtml file where the empty trailing newlines had been physically removed.

Image

Both .epub files pass ePub 3.0.1 validation.
.:.
Ioa Petra'ka
“Whole sight, or all the rest is desolation.” —John Fowles