How to stop a scene showing up in my TOC

There are multiple secret squirrels! Here are the three main approaches, with their pros and cons and a little setup info.

Custom Table of Contents

Use the technique described in §22.2, Contents in Ebooks of the user manual PDF, in Chapter 22: Creating a Table of Contents. This gives you maximum control over the visual ToC in an eBook (the one you see while flipping through pages), and of course you can omit binder items by simply not having them in the link list.

There are special rules that need to be followed for this to work properly. If you run into issues, check the yellow tip box on the following page of the PDF.

The main downside with this approach is maintenance. It is worth it if you want a custom designed layout, or wish to build a multi-level navigation system, etc. It’s a bit overkill to just remove a few entries though.

Omit from Visual HTML Table of Contents

If you simply want to clean up the visual ToC but not completely remove the recipe from the ebook’s internal navigation guides (what most readers will be using to navigate through the book these days, through software menus rather than clicking on links), then the next approach is to create a Section Type for these types of files (call it “Recipe” for example), and then create a Section Layout for handling them specifically:

  1. Duplicate from the “New Section” Layout, provided in the stock Ebook template, as this is closest to what you want. Call it something like “New Section (Hidden)”.
  2. At the bottom of the Formatting tab, set the dropdown to read “Text and notes use editor formatting”, for “as-is” style behaviour.
  3. Click on the Settings tab and tick the Hide entry in HTML table of contents option.
  4. Save your Format, and assign the “Recipe” → “New Section (Hidden)”.

Of course if you don’t want the recipe to be accessible from either the visual ToC or the reader software navigation, then the first method will be superior, as that route establishes the actual navigation of the eBook, not just how navigation is presented in HTML.

New Pages as Layout, not Structure

With those two methods aside, there is a somewhat more philosophical question worth thinking about: is the recipe actually a part of the chapter it follows—is it in that chapter for all intents and purposes, like any other scene, and that’s why you don’t want it in the ToC? If so, any kind of section break here isn’t what you really truly want—and hiding the fact that it is a section from the ToC systems is just a bandaid approach to the problem.

What you want is a mere layout decision: to go to a new screen on the reader. And in that case, using CSS is the right answer, as that is the technology used for implementing layout decisions in ebooks:

  1. Follow the first two steps in the instructions above, to create a new Layout. In this case I’ll call the new Layout, “New Page (No Break)”.
  2. In the Separators compile format pane, make sure the new Layout only inserts “single return”. We’re taking this route specifically because this recipe isn’t a new section, after all. :slight_smile:
  3. Click on the Settings tab, and give this section layout a CSS class name. I went with “new-page” (do not use spaces).
  4. Select the CSS compile format pane. The left column, titled “Custom Stylesheet”, is a place where you can override or add CSS layout instructions to your book. As you can see we provide a lot of layout out of the box (much of it based on checkboxes and fields you use elsewhere). We need a new directive that handles the “new-page” class; copy and paste the following into the CSS pane:
.new-page { page-break-before: always; }

(The original write-up of this technique can be found in this forum thread, though it’s worth noting that is aimed at those that use Markdown in Scrivener, and make use of the Pandoc ePub generator when they compile. Much of the principles and steps involved will be similar however.)

There are other approaches as well, but unless you have strong objections to adopting any of the above, I wouldn’t say they have any inherent advantages over these.