I’m trying to figure out how to insert a blank page before Parts. Parts already start on a new page, but i want an extra blank page before each one.
I’ve tried adding a blank Text before each part folder and that kind of works, except it causes a <$BLANK_PAGE> entry to show up in the table of contents. I’ve also tried to go into the section layout area of my custom format and use a custom separator with a page break (Insert menu > Break > Page Break). Those get stripped out when saving the separator. I’ve also tried adding page breaks to the section prefix. Those are also stripped out.
How can I insert an automatic page break before each part?
You don’t mention what format you’re compiling to, but from the comment about the table of contents I’m assuming an ebook that’s generating an automatic table of contents. There are two ways around the blank pages showing up in the contents: you can set the section layout they use to be hidden from the HTML table of contents, or you can create a custom table of contents rather than having Scrivener generate it.
For the first option, in the compile format designer, select the layout you’re using for the blank pages, or create a new one, then click the Settings tab and tick the option to hide the entry in the HTML table of contents.
For the second option, in the binder select the items you want to appear in your table of contents, choose Edit > Copy Special > Copy Documents as Structured Link List, then create a new “Contents” document in the Front Matter or in the Draft and paste your link list. In compile, click the “E-book table of contents” icon in the right-hand pane (the right-most icon when you have an ebook file format selected) and deselect the option to automatically generate an HTML table of contents. You’ll also probably want to give your contents document its own section type and assign it a fitting layout. Chapter 22 in the user manual provides more specifics and some gotchas for creating a custom table of contents.
Creating a custom contents isn’t difficult, but if you’re happy with the automatically generated TOC with the exception of the blank pages appearing there, the first option is the simpler choice.
For print formats, rather than manually inserting a blank page, in the compile format designer’s Section Layouts, you can choose the “New Pages” tab to set a given layout to always start a new section on either a recto or verso page, which will cause the compiler to insert a blank page when necessary to accomplish this. So for instance if you set your “Part” layout to always begin on a recto page when it starts a new section, then if your final scene of Part One ends on page 53, you’ll get a blank page 54 so that Part Two begins on the recto page 55. That might do what you’re after?
Thanks for taking the time to respond and listing out a couple of options.
Yes, sorry I should’ve been more clear. I am generating an eBook, and I am using the automatic table of contents.
I should’ve also been clearer by what I meant by “Table of Contents”. In eBooks, there are two of them: there’s one that’s embedded in the content of the book, and there’s one in the eBook reader app itself. The first one shows up in the OPS folder as “contents.xhtml”, and the second is “toc.ncx”.
I can make a blank page in the output of the eBook by creating a Text with the contents of “<$BLANK_PAGE>”. I give it a custom section type (“Blank”) that I have defined in my project format to be omitted from the generated table of contents (“contents.xhtml”). That part is working.
However, the blank page is not omitted from the “toc.ncx” file, which leads to this disparity:
[attachment=0]contents.png[/attachment]
In short, neither of the approaches you suggested will work (that I’ve found) to remove this errant “<$BLANK_PAGE>” entry from the toc.ncx file.
At a higher level, I’m really hoping to avoid creating the “<$BLANK_PAGE>” text at all. Ideally, I’d like to find a way to edit the Part layout and have that automatically insert a blank page, because conceptually that’s what I’m trying to do. The <$BLANK_PAGE> Text approach would have me put that document in an unrelated place (the content before each successive part) and therefore disassociates it from the new Part itself.
I’ve seen other references on the forum that indicate the “toc.ncx” file is deprecated in ePub 3, which implies that readers shouldn’t be using it.
Whether that’s actually the case or not, the fact remains that iBooks on macOS Big Sur, macOS Catalina, iOS 14, and iOS 13 are all using it to display the table of contents in the app’s UI, in addition to the “contents.xhtml” version in the book itself.
OK, I’ve come up with a way to do this that I think fits what you’re after. Basically, you use the layout’s section suffix to enter a blank line styled with with a class that you define in the custom CSS to use the “page-break-before” property.
You’ll want this to be in the final section before your Part documents so that the blank page is placed correctly. There are two options I can see for that: either use the part layout itself and tick the option to place the suffix after subdocuments, or create a separate “Section End” layout identical to the one you’re currently using for the final document before a part but that will use this suffix.
For the second method, you’d need to also create a new section type to assign to each of the documents preceding a new part, then assign that type to the new layout. For the first method, you’ll need the binder structured such that all the parts are containers that include all the documents between as subdocuments. That way when the suffix is added after the final subdocument, it comes directly before the next part. This one is less fiddly if your binder is structured that way, but the gotcha is that it won’t affect your first Part, so if that matters, you’d need to add the suffix to another layout also, e.g. to your Front Matter folder (and then include the folder itself in compile, just to get that suffix, though none of its text need be included).
To set up the rest of it:
In the compile format designer, select the Styles pane and create a new paragraph style via the “+” button. All you need to set for this is a name, e.g. “Blank Page”, and a unique CSS class name, e.g. “blank-page”.
In Section Layouts, select the layout you want to add the suffix to and then click the “Suffix” tab.
In the section suffix editor, add an empty line and then a non-breaking space (Opt-space) or a word-joiner (from the Insert > Break menu).
Edit > Select All, then click the style menu or icon (leftmost in the format bar there in Section Layouts) and choose the Blank Page style you created in step 1 to apply it to your suffix text.
If you’re using the container method, applying the suffix to the Parts folders and front matter container, tick the option to “Place suffix after subdocuments”.
Select CSS on the left and, if needed, choose “Append Custom CSS Stylesheet” from the popup menu in the centre of the CSS pane.
In the custom style sheet, add the following, using the class name you created for the style in step 1: /* insert a blank page at the end of the section */
.blank-page { page-break-before: always; }
Save your your format and reassign your section layouts as needed so that the section suffix will fall before each Part.
Then compile and see how it works for you. I found this worked fine in Apple Books, but Adobe Digital Editions seems to ignore the page-break CSS properties, so your final results will depend on your device. You could experiment with other page-break or similar CSS settings in the same manner; I didn’t have any luck with the page-break-after, which is why this is a little convoluted. You could simply add the page-break-before to the Part layout’s class in the CSS custom stylesheet, but doing so means that when you jump to a new Part via the table of contents, you’re taken to a blank page rather than the Part text, which seems undesirable.
I’ve attached a sample project that demonstrates using the suffix in the Parts and front matter.