epub - blank pages 1.5.3

When I compile an epub with the new version of WinScriv, if I tell it to put a “page break before” it inserts two page breaks, ie a blank page and a new page, rather than just a new page. It looks like the program is defining a pagebreak in the CSS as well as separating them into separate xhtml items.

This looks to be caused by a known bug with Page Break Before that inserts two of them. The second one is getting turned into CSS, while the first is being used to cut the page to a new XHTML file, which in turn also generates a new “page” on an e-reader, causing double-breaks on those devices that can display this CSS code (Amazon’s iOS software seems to be the main culprit).

If you’re willing to get your hands dirty, compiling to ePub and edit out the CSS with Sigil after compiling. If you need a .mobi file as well you can just open the ePub in Kindle Previewer; it will automatically create a .mobi file when doing so.

FWIW the double pages appear on Adobe Digital Editions and the Nook, so if you add in Apple, it affects all the heavy hitters in the epub market.

Thanks for that, Ioa.

I’ve just done this workaround for the first time and it took some headscratching (as a n00b to Sigil) so I thought I’d post a quick guide for others who may be struggling.

  • Download Sigll (google ‘sigil epub’) and install it
  • File -> Open -> find your .epub file
  • View -> Code View
  • From the file tree on the left, open the ‘Styles’ folder and double-click the ‘stylesheet.css’ file.
  • In the code window, scroll down and look for style that includes in it ‘Page break before: always’
  • Delete that line
  • Save the .epub
  • Open the .epub in Kindle Previewer to create a .mobi

You might want to verify by clicking on the individual ‘body.xhtml’ files that that style is only used in places where you’re getting the double page break problem, but that was the case with mine.

What I don’t get is why this problem affects some files and not others. I had this with my title page and contents page, but none of the chapters, despite them all being set to ‘compile as is’ and being text docs. I wonder if it’s to do with their level?

Hope that helps.

Thanks for providing a “noob’s guide”. :slight_smile:

The nature of the bug is that it only triggers when you use the “Page Break Before” checkbox for a section. The other page breaks are likely all being automatically created for you in the Separators compile option pane. Any folder following a text document (so a typical new chapter scenario) generates one. These are not bugged.

One aside though: you probably don’t need as-is turned on for everything. As-Is merely excludes a document from the compile Formatting pane’s rules. So for instance if a file is set to export its title and text in the Formatting pane, and the text is set to reformat to Helvetica, then As-Is will just opt out of all of that. No title will be generated, no text formatting changed, just the contents as you see them in the editor. Hence, if you have As-Is turned on for everything, you might as well just disable Formatting override checkbox and anything else you are trying to avoid, in that one spot.

Not that you need to change anything now—what works works, that’s just for future reference.