How to stop a scene showing up in my TOC

My question is how do I get a file not to show up in my Table of Contents.
I’m trying to compile to an ebook, epub, using Scrivener vs 3.1.1 on a Mac High Sierra
Each chapter is a folder and is titled Chapter One, Chapter Two etc.
Each chapter has a number of scenes in it, separated by a custom break (3 asterix).
In some of my chapters (not all) I have a scene at the end, (it’s a recipe) that I want to show up differently to the rest of the text.
I also want it to show up on a new page.
If I choose the selection type as N/A then I can compile the document “as is”, which is how I want it to show up (I’ve formatted the recipe within the Scrivener document to show up exactly how I want it.)
The only problem with this, is that the document then shows up as a kind of subheading (or heading, depending on how I compile it) :smiley: in my table of contents.
For example, I might have the following in my TOC:
Chapter One
Chapter Two
Chapter Three
Simple Fare (this is the recipe)
Chapter Four
Chapter Five
Chapter Six

I just want the chapters listed in the TOC.
If I turn the recipe document into a scene in the Selection Type then I can’t format it “as is” because it formats all my scenes the same way.
My question is, is there a secret squirrel way to manually change the Selection Type of a document to something that won’t mess with the rest of my formatting? And that won’t show up in my TOC? Or is there a way to turn off a particular document so it doesn’t show 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.

Wow, Thanks AmberV for such a detailed response. I will go and have a play with each of the 3 things you suggested and get back to you with which one worked the best for me.

Thanks again. :smiley: :smiley: :smiley:

I’ve used the “New Pages as Layout, not Structure” method, but is there a way for the pad top setting of the section to still work, even if the separators are set to single line return?

I haven’t experimented with it to confirm if this works, but I would try using the margin and padding CSS formatting attributes. So something like the following for example, which would add four lines of margin at the top of the screen:

.new-page {
     page-break-before: always;
     margin-top: 4em;

Sometimes margin doesn’t work, but padding-top will, so that’s the second thing I would try.

A post was split to a new topic: Hiding a section from output and table of contents