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
Pancakes

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:

Hi!
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?
Thanks!

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

I use MacOS. I am compiling for epub. Writing fiction.

I have chapter breaks, created by folders with chapter names and numbers. That seems to work, it has a built-in page break, putting a chapter start on a new page.

I have scene breaks, created by carriage returns—no page break there, or needed.

But I also have a dinkus I use for more significant breaks in the story. I want that to happen on a new page. Adding a page break the end of the previous section, or adding a page break at the beginning of the next section (which begins with the dinkus) does not seem to work.

I created a section layout for sub-heading that appears to include a page break without any text connected to it, but that also does not seem to work.

So I (reluctantly) tried turning the document beginning with the dinkus into a folder. That does invoke a page break where I want it, but if there is text in that document title in the Binder, that ends up in the TOC. Not what I have in mind.

I want the page break, but I want to retain the label for that doc in the Binder, yet I do not want that appearing in the TOC, neither the TOC revealed in the menu drop-down in the menubar of Apple books, nor the TOC list that is directly ahead of Chapter One, nor anywhere in a Kindle import. Somehow, I think this is not wanting my cake and eating it, too, but that this should be possible.

Can anyone help me fix this?

In what way does it fail to work?

What is your dinkus? An image? And are you plunking it into a Binder document, or using a custom separator?

The general principle at work here is that both the automatically generated ToC and the menu generated by the reader software are driven by the Binder structure of the document. Any section break (ebooks don’t have pages as such) will trigger a new ToC entry. The Compile command has an option to override this in the automatically generated ToC – look at the Settings tab in the Section Layout editor – but the reader software may be more stubborn. At some point you may need to tweak the ePub file in something like Calibre.

1 Like

Thank you for responding. Now I have learned (from you) that the terminology I should be using is likely ‘section break’? And not ‘page break’.

I’m not sure if I have the terminology exactly right, what what I’m looking for is for the document with the dinkus to start on a new page, the same way that folders used as chapter headings do that. So my best guess is that folders have a section break built into them automatically?

That does make a certain amount of sense.

The way this fails to work for me, is I want to retain the text of the label of the document in the Binder, yet not have that appear in the TOC, the way that the chapter heading does when I create those as folders in the Binder.

Yes, the dinkus I am using is an image, using what I think is common Scrivener formatting:

<$img:dinkus;w=44>

And no, I had not thought of making the dinkus a separate document by itself, I always had it the first line in a document that had other text. Maybe that is the solution I’m looking for? If the dinkus is in a folder all by itself, it doesn’t need to have text in the label that would end up in the TOC.

To find out, I am going to experiment with that right now. Since all of us writers love a happy ending, I’ll report back.

I am only mildly acquainted with Calibre, as back in 2015 Scrivener did not have all of the great features that it has today. Once it quickly acquired those features, I pretty much abandoned Calibre. So I’m not sure what it is capable of.

I have always dreaded that I might actually have to spend a lot of time learning CSS to solve all these niggling problems (I’d much rather be writing!), and whether Calibre can help with CSS or not, learning CSS might have to be my last resort.

I’ve merged this query into the existing thread on how to enforce page breaks without creating section breaks, which indeed must be listed in the ebook’s “spine”, for them to be something you can navigate to at all.[1]

Full details on the alternatives and methods can be found in this how-to post above.

That is correct though: a section break, which is all Scrivener deals with in the Separators pane, while many ebook readers will treat as a page break, are not the same thing, and are not the only way to get page breaks. A section break is a strong declaration of content, but we can make much softer cosmetic declarations, for example for a full-page figure, with page breaks and formatting.

By the way, if you haven’t figured it out already, I’d use the Prefix tab, in the Section Layouts pane, for the symbol you want to insert at the top.


  1. There actually are options to do just that, as noted in §24.2.9, Settings in the user manual. But such uses are quite niche since even page flips will skip over such sections. They can only be navigated to with links, and thus may be more often found for use by extended notation, or in Choose-Your-Own-Adventure books for kids. ↩︎

1 Like

I had not yet figured that out. But I think I know what you’re getting at.

My mind is currently spinning in many different directions regarding the technical requirements, so it might take me a little while to figure all this out.

But I greatly appreciate your response. One of the best features of Scrivener, which has an incredible amount of great features (and can run rings around every other writing platform) is the community, the helpful members in that community, and you folks who are directly a part of Scrivener.

1 Like

OK, it looks like simply putting the dinkus in a document by itself (folder) with no text in the label gets me what I’m looking for. Why I never considered putting it in a separate document, I do not know.