ePub: no more line feeds & strange ToC

User avatar
sjordi
Posts: 12
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: 22353
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: 12
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: 22353
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: 12
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: 22353
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

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

Wed Nov 14, 2018 6:48 am Post

OK,
I have no differences. I tried 20 files.
But since you talk about ePub 3... I just recalled that the working versions were published in ePub 2 format.
Now I try to find this option but I see only ePub, no option for ePub 2 or 3... But I'm sure I had that option.
So the only thing that really changed, is that Scrivener has been updated in between. Did you remove that ePub 2/3 option in the latest version? That might be the problem. ePub 3 shows some problems, ePub 2 is correctly displayed on Kobo ?

---added---
Just found a former copy of my VM which has Scrivener 3.0.3 and it shows ePub 2 /3 in the compile dialog box.
Just recompiled my project for ePub2... which actually has the famous Adobe Digital option you were talking about (I didn't use it).
So the results, I published one in ePub2, and one in ePub3.
Both work fine on both my Kobo devices...
The ePub 3 is better, the TOC is correctly indenting the subsections while the ePub2 aligns the entire TOC to the left.
So my guess is that something changed in the compile method. I'm going to check the differences between the Scrivener 3.1.1 generated ePub and the 3.0.3 generated ePub3 files...
Hope this helps.

---more---
Ok, I compared the cover page between Scrivener 3.0.3 and 3.1.1
In 3.0.3, the paragraph tags (<P>) are like this:
<p style="text-align: center; text-indent: 0em">
In 3.1.1 they use a CSS class:
<p class="ps2">
Those are the only apparent differences.
Both stylesheet.css files from 303 and 311 are identical though.
So to me, it looks like in Scrivener 3.1.1 you have removed the ePub 2/3 option, and you switched to CSS classes implementation for text alignment, etc... in the ePub generation that was not implemented in Scrivener 3.0.3 .
Steve JORDI

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

Wed Nov 14, 2018 1:54 pm Post

Yes, that’s what I was referring to above, when I mentioned that the ePub 2 method is now deprecated and no longer readily available in 3.1. It is still in the software and can be accessed for projects that had custom compile formats that depend on it. So if you really do want ePub 2 then use 3.0.3 to create a custom compile format that requires only ePub 2 (click the gear button in the header area of the compile format designer to set up its scope). Then when you load that project in 3.1 you’ll have access to the older method along with the Adobe layout option (which is hopefully no longer necessary for anything out there with the functional battery).

Along with the change, modifications were made to the ePub 3 method to better support the kind of WYSIWYG approach you could use with ePub 2. You can read more about it in Appendix E.12, under ePub 2 and Legacy Mobi Deprecated. So yes there will be changes to how the CSS works.
.:.
Ioa Petra'ka
“Whole sight, or all the rest is desolation.” —John Fowles

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

Wed Nov 14, 2018 2:04 pm Post

Ok thanks for the clarification,
I will use only 3.1.1+ and ePub 3 as I consider this should be the standard.
But I still don't get it why all paragraph spacings are gone.
All the <P></br></P> are identical. And the Kobo H2O got a firmware update just about 2 weeks ago, my hint is that they're supposed to be compatible.
I will write to them with a code excerpt and ask them why the paragraph spacings seem to be ignored (while they are correctly interpreted in Calibre, Books mac, Books iOS...

Thanks
Steve
Steve JORDI

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

Wed Nov 14, 2018 2:24 pm Post

That is what I would do as well; see if they have any advice to give. Since the .epub file seems to be working everywhere else, and the HTML itself looks good, there must be some other factor involved. I'd be curious to hear what they have to say.

And yes, I think ePub 3 is the right way forward at this point in time.
.:.
Ioa Petra'ka
“Whole sight, or all the rest is desolation.” —John Fowles

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

Wed Nov 14, 2018 2:28 pm Post

I'll post back the answer from Kobo... if any :D
Steve JORDI

kw
kwhitehurst
Posts: 21
Joined: Thu Jun 04, 2009 1:54 am

Thu Nov 15, 2018 9:23 pm Post

AmberV wrote:Yes, that’s what I was referring to above, when I mentioned that the ePub 2 method is now deprecated and no longer readily available in 3.1. It is still in the software and can be accessed for projects that had custom compile formats that depend on it. So if you really do want ePub 2 then use 3.0.3 to create a custom compile format that requires only ePub 2 (click the gear button in the header area of the compile format designer to set up its scope). Then when you load that project in 3.1 you’ll have access to the older method along with the Adobe layout option (which is hopefully no longer necessary for anything out there with the functional battery).

Along with the change, modifications were made to the ePub 3 method to better support the kind of WYSIWYG approach you could use with ePub 2. You can read more about it in Appendix E.12, under ePub 2 and Legacy Mobi Deprecated. So yes there will be changes to how the CSS works.


I had a legacy project created prior to the change in 3.1 that used ePUB 2. When I accessed that file today, the ePUB 2 option did NOT appear. So I'm not exactly sure what you meant when you said: "It is still in the software and can be accessed for projects that had custom compile formats that depend on it." Do you just mean 3.1x will interpret the previous settings, but one can do nothing else? Because, it definitely was not possible to choose ePUB 2 in the compiler or change any settings associated with ePUB 2, like whether tables get converted to graphics or not.

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

Fri Nov 16, 2018 1:15 pm Post

I had a legacy project created prior to the change in 3.1 that used ePUB 2. When I accessed that file today, the ePUB 2 option did NOT appear.


The key concept in my description is custom formats, either in the project or saved globally to “My Formats”. In the latter case, ePub 2 will become available to all projects and the Compile for menu will look just like it did in 3.0.3 even for new blank projects you create.

But if all you did was select a Format, like the stock “Ebook”, and assign layouts, then the project will be transitioned to the new workflow.
.:.
Ioa Petra'ka
“Whole sight, or all the rest is desolation.” —John Fowles