Blank page after each chapter when comiling to .epub

Compile inserts a blank page after each chapter folder when compiling to .epub. I have tried all possible Page Break combinations of Compile/Contents and Compile/Formatting that produce the desired page break, but the blank page persists. This does not occur when compiling to .mobi or when I use Calibre to convert a Scrivener-compiled .mobi to .epub.

My project uses a level 1 folder (I think. Levels as shown in Formatting are confusing in Scrivener) for each chapter with no text other than the title and a level 2 files for scenes.

Page breaks are actually set up in Separators, not Formatting, and they do not take levels into account so you don’t have to worry about figuring that out. They work by looking for “seams”. For instance if a folder follows a file (in a literal, non-levelled way) then a page break is inserted, for instance.

I got this one figured out. When Separators is set for Page Break “before folder documents that follow text documents” and Contents specifies Pg Break Before on all the Folder documents, Scrivener inserts two page breaks when building a .epub. But with the same setup and building a .mobi, Scrivener (which I believe uses Kindlegen) inserts only one page break. The solution is to uncheck all the PgBreak checkboxes in Contents. My confusion came about because of the different behaviors between the two file format conversions given the same project setup.

I can’t seem to reproduce that. If I have separators set up so that section breaks happen, and then apply checkmarks to sections that will be impacted by separators, I only get one chapter file per section. The only way to get something like what you describe is if I apply the checkmark to the first text document following the folder.

It might be how we’re viewing .epub files. If I remember it correctly, Adobe Digital Editions eats the extra blank page, but the iPad displays it. Those are the only two ways (other than Sigil) that I have of viewing .epubs.

Well, I don’t think ADE shows any section breaks. It renders a continuous display of content across columns. But I can’t think of anything that would render a section break other than one XHTML file ending and another beginning. So if I set “Page Break Before” on all of the folders, and then set the Seperators panel to generate page breaks for those same folders, and get two XHTML files (beyond contents), then disable those checkboxes on the folders, compile again, and get two XHTML files—there shouldn’t be any difference between the two. Are you getting four XHTML files in the first case? Of course my numbers are illustrative. You probably had something more along the lines of 30 folders, and so you should have 30 XHTML files in Sigil, not 60.

Whatever the case, it sounds like you’ve got things working on your end, so if you don’t have time to help figure this out that’s okay. The thing that it is odd about your posted solution is that a checkbox on a folder would not ever create a page break after the folder output, which is what you describe. That’s now how the code works. If something is scheduled to emit a break in Separators, it emits it before any Title/Meta-Data/Notes/Text output. So there is no way for a folder to generate both a break before its title, and a break after its title. The only thing that can insert a break after folder’s content output is the first thing in the outline following the folder in question.

My project is organized this way:

For each chapter, I have a level 1 folder with no text. I use it to manage the chapter numbers and titles. At level 2 for each chapter are one or more text documents (1 per scene). Within Contents, each text document is marked As-Is. Neither text documents nor folders are marked Pg Break Before at this time.

The Formatting panel is confusing. It has three entries all labeled Level 1+. The top one has a folder icon, the second one has a stack of two text documents, and the third has a single text document icon. Even though I have two levels, the Formatting panel allows me to work with only one. Doesn’t make sense. In the first two entries for Formatting I have Title checked and in the bottom one I have Text checked. (There used to be an entry for Level 2, but it went away on its own.)

Separators are set at Empty Line for the first three entries and Page Break for the fourth one.

Right now, the problem I’m having is that I cannot get the compilations formatted properly. I wish to maintain the document left justified. I want the first line of each paragraph except the first one in a chapter or scene indented and not have to set it every time. I want to compile e-books justified right and left with that same indentation pattern. To have the indents I want, I need to compile the text documents As-Is, which then compiles to a ragged right margin, which is correct for manuscripts but not for e-books. And I want to do all of it without having to make huge changes between compiling for ebooks and compiling for manuscripts. I hope all that makes sense.

The Formatting pane does not show you the whole outline depth because it is designed to be “cascading”. You can set up a rule at one level, and then another rule at a deeper level to negate it from that point on. For example, text files at the very top of teh draft are useful for the dedication page, forward and so on. You’d want those to print their title (but not number themselves along with the chapters). So you’d check off Title for File Level 1, then create a new file Level 2+ and turn the title off for that so your scenes and such do not print their titles.

So, you see if the Formatting pane filled out everything to the outline depth, it would defeat the purpose in many cases. Most things only need one rule no matter how deep the item is. Hence, “Level 1+” not “Level 1”. If you do not have any level 1 files that need to be treated specially, then you can just make your changes there since it also impacts level 2, and 5 or 8.

I’m not sure if I follow why you’ve got As-Is in use here. It sounds like you want to override the formatting of what you have in the editor, but if you have As-Is turned on for everything, then you won’t be able to do anything at all with formatting. That checkbox is only useful for cases where the original document should always override the override. A good example of that is a title page. You wouldn’t ever want it to look like body text, so you put As-Is on so the format override doesn’t touch it.

Turning As-Is on for everything doesn’t make sense. You might as well just turn off the formatting override at that point.

At any rate, there is an error in the e-book generator right now that makes non-hyphenated justification fail. You need to edit the XHTML files in Sigil, and remove the CSS line that sets p and ul’s white-space to “pre-wrap”. Just delete that line and it should look right.

Without it, even though the first paragraph of every scene is set with Format/Text/Spacing… to have a zero first line indent, the compiled epub file indents it. With As-Is, I get the indenting I want, but I can’t compile justified text.

Keep in mind that I am trying to maintain one project file that I can switch from manuscript format to e-book format with the settings I want for each format and without having to make a lot of changes everytime I go from one format to the other. Scrivener is not set up to do that.

I don’t know, something doesn’t quite sound right because I would say Scrivener is exactly designed for that. That’s one of its principle features, that you can use the compiler to modify the formatting of what you wrote, so that you do not have to go through the trouble of changing the original. One compile preset can output a manuscript, and another an e-book with different indent settings line-spacing and so forth. However if you check “As-Is” off for every text document, it won’t work that way because every document will be disregarding the one thing that lets you do that: the formatting pane in the compiler.

It sounds to me as though you have a first-line indent set up in the Formatting pane (probably under Text Level 1+). The fact that it changes it without As-Is turned on is what I was saying above in practice. You just need to make your adjustments to the thing that is doing the changing, rather than the source material (unless you want to change the source material every time you need to compile for a different output).

The key is to make your own presets. Once you get your e-book set up the way you want, click the Save Preset button in the compile window and give it a name. That will save your settings into the “Format As” drop-down menu, so in the future you can just select that and everything comes back the way you had it arranged.

I’m not making myself clear. Here’s the first part of the problem:

I want first-line indent to be 0 for only the first paragraph in every scene and .5 for the other paragraphs in the scenes, irrespective of which format I am compiling to. How do I make presets that do that without using As-Is? I just haven’t figured it out yet.

(I already know how to make a preset.)

Ah, now I follow what you mean. Yes that is true there is not yet a way of doing that with the compiler. We’ll be adding some options for doing that specifically, in the “Options” button of the Formatting pane. It’ll basically be a separate option entirely so that it can be divorced from any other stylistic choices.

You might consider changing the Formatting/Modify dialog to allow the two (latin text) paragraphs to be independently selected and modified. That would be more intuitive than another option setting somewhere.

Thanks for the heads up, Amber. I can proceed accordingly.

That’s not a bad idea, but the problem is in many cases you would not want first-paragraph treatment to be universal per type/level. Consider the scenario where you are not using text documents for sections or scenes, but as components that are entirely invisible to the reader, not even a space in between them on output. The first file in such a sequence might need first-paragraph flush left treatment, but the following files will not. There are also issues with what constitutes a break worthy of going flush-left. There are necessary options required of this feature, and so there will be one trigger to enable them, “Remove first paragraph indents”, then three exclusive choices to select from:

  • On new pages only
  • At the start of each new document
  • After empty lines and centred text