Ebook TOC Depth

I would like to control two things when compiling an ebook from Scrivener Mac:

  • For each chapter, show the folder name preceded by the number. So for an example chapter folder called “Daisy Cakes”, the TOC would have the line “23: Daisy Cakes”.
  • Depth: list only the top-most folders in the TOC, not the scenes in each chapter.

My book has a simple structure: chapter folders with scene texts inside. I only want the chapters to show in the TOC. Both the Windows and Mac versions include all the scenes in the TOC. I don’t want to have to edit them out in other programs later.

The Windows version could be told to use the folder number and name, but the Mac version only shows the number no matter how I configure it. I have the section layout selected and set up for the TOC, using <$n:chapter>: <$rst_scene>, but this has no effect for some reason.

Does anybody have experience with this?

Is the attached sample project, when compiled to “Wartybliggens”, more or less what you want?

Slàinte mhòr.

TestNovelEpub.zip (495 KB)

Thanks for writing back!

The output in your screenshot is what I want, however there are two differences in the actual interior:

  • In my book, each chapter heading is on its own page (so the scene text begins on the next page). I don’t want the chapter headings to be on the same page as the start of the scene. This is no doubt why Scrivener is adding the scene to the TOC, though I find it strange that I can’t just choose how deep the TOC should go instead of Scrivener doing auto-detection of page breaks. It has access to the entire structure after all.
  • My book isn’t nested under “part” folders - it’s just chapter folders. This might not be relevant, though.

Your version doesn’t make any attempt to format the chapter titles with the number first, so where is that coming from? I don’t understand what is going on here.

You can create a custom ToC to get round the section breaks generating ToC entries.

The parts don’t matter. Removed in this example project.

Titles are included and excluded through section-layout settings.

Slàinte mhòr.

2.zip (517 KB)

Thank you!

I spent forever trying to figure out why mine still didn’t work after your second example (I only got numbers), combing through settings until I was half-crazy, but finally I discovered that in the compile settings under “Document Title Links”, the item “Links use title prefixes only” was checked, while it shouldn’t have been.

Now that I’ve come this far, it seems to me that the settings affecting the table of contents are spread out all over the place, making editing it quite obtuse. I feel that Scrivener should create a more direct and user-friendly way to manage the ToC output, especially since it’s such a central part of most books.

But I’m grateful for your assistance! Thanks again.

There are so many settings – can be hard for the user and hard for anyone to really help when working sight unseen and at a distance.

A custom ToC is possible (section “22.1 How to Create a ToC” of the manual), but an auto-generated ToC is obviously much easier. I believe the “new page creates a new ToC entry” is the way ebooks and ebook compilers work by default. AFAIK, it is not specific to Scrivener. Come what may, section / page breaks don’t always show up very cleanly in standard ebooks as much depends on how the user chooses to display the text. They will see a space, but they might not get the full new-page experience if, for example, they read using continuous scrolling.

Good luck with the book.

Slàinte mhòr.