Epub ToC

For an epub table of contents, the default is that the names of each chapter will be taken from their names in the binder.

I’m not getting this behavior. I note that in the Compile pane, there is no level above “section” and section headings are defined as Chapter One, Chapter Two (is there an option that uses chapter names??)

Anyway, how can I fine-tune the ToC? It would be nice to have a page break after each chapter as well (I know there are no page breaks in epubs because there are no pages, but there are).

I also suspect that this is a Compile v2 vs. v3 issue, seems that it was a lot easier to dig into ToC detais in Scrivener 2.x.

It depends on what you mean by defaults, but for how the Ebook compile format is set up, the ToC entry is taken directly from how you choose to present the chapter heading itself, via the Section Layout assigned to them. It sounds like you have the “Chapter Heading” or “Chapter” layout assigned, whereas you’d rather have “Chapter Title” or “Chapter with Title”.

Now as for customisation options for how that happens, you’ll find the settings in the same place as in v2, under the Document Title Links compile format pane. You could for example turn off that entire pane and have the ToC print just the binder name, and thus look potentially nothing like how the chapter is announced in the book itself. That’s all pretty much the same as before—the main difference between v3 and v2 is that in v2 you had to go into the Formatting pane and manually adjust the title prefix and suffix settings to change how chapter names were presented in the ToC and elsewhere. In v3 you can often just select a different preview tile.

Anyway, how can I fine-tune the ToC? It would be nice to have a page break after each chapter as well (I know there are no page breaks in epubs because there are no pages, but there are).

I also suspect that this is a Compile v2 vs. v3 issue, seems that it was a lot easier to dig into ToC detais in Scrivener 2.x.

Specifically to fine-tuning (beyond adjusting the titles), it has more to do with the differences between ePub 3 and ePub 2, or rather how in ePub3 the visible table of contents is used to also define the software navigation as well, and thus it has much stricter rules for the layout, whereas in ePub2 the table of contents was completely informal and essentially just a list of hyperlinks.

That said, for something like that, I think you can actually use CSS to change the appearance of this list without messing up the syntax of the list. This post describes using CSS to create visual breaks, if you examine the HTML structure of your contents.xhtml file, it should be possible to do what you’re describing.

Something like this could work:

/* Put each top level section of the ToC into its own page. */
#toc > ol > li {
	page-break-before: always;
}
/* Ensure the first chapter does not break from the Contents heading. */
#toc > ol > li:first-child {
	page-break-before: avoid;
}

Thank you.
Chapter Title is not an option, nor is Chapter with Title.
Is there no way to add screenshots to posts anymore?

The default epub compile settings “text will appear as it is in the editor” cause Scrivener to hang. The error is reproducible.

What platform and what version of Scrivener, please?

Mac: 3.2.2
Windows: 3.0.1.0 64 bit

Same behavior for each. I moved the project over to the Mac in case Windows doesn’t have the full feature set. I am also less familiar with the Windows version.

At this point I would like to have an ePub ToC with chapter titles based on the names of chapters in the binder. A single level is enough. The manual does not contain step by step instructions, unless I’m missing something.

Are you creating your own ToC, or using the automatically generated one? And are you looking at the ToC document, or the navigation menu created by the reader software?

Chapter 22 in the (Mac) Scrivener manual deals with Tables of Contents. If you generate one manually, you can put whatever you want in it.

If the Compile Format you’re using doesn’t supply the Section Layout you need, it’s easy enough to create one. See Section 24.2 in the manual.

  1. There is no automatically generated one. That’s the problem.
  2. " The compiler will automatically generate a table of contents into the text of the book itself," 23.4.6; except that it doesn’t. Nor does it suggest a way to troubleshoot the failure.
  3. Sec.22.1: " 0. — For ebooks3 and web pages: Edit ▸ Copy Special ▸ Copy Documents as Structured Link List" This does create a list, which can be pasted into a blank page.
  4. Compiling now to default ePub, Scrivener hangs.
  5. But for the hang, this might be a good work around. Why doesn’t the automatic ToC feature work?

Please open a support ticket, here:

Without more information, it’s hard to say whether you have incorrect settings, or have encountered a bug.

The copy/paste workaround didn’t. Unfortunately, it’s not possible to post screenshots here anymore.

Or maybe it is…

I opened a support ticket with references from posts in this thread.

Progress! There’s a buried hidden “table of contents” in the compile pane. The “generate html table of contents has to be checked.”

Unfortunately, this does not yield chapter names with the names given to the chapters in the binder. But I’m getting closer.

This question isn’t showing up in the Mac OS support forum. Someone might have an answer. I’ve been working on it for hours and opened a support ticket.

I moved it to the general Scrivener support area since nothing in here is specific to the Mac version.

What code will cause the automatic generation of an ebook ToC using the chapter headings in the binder?

What code will cause Scrivener to generate the names given the chapters in the Binder and not Chapter One, Two, Three, etc. when compiling an epub?

Earlier I suggested the following:

It depends on what you mean by defaults, but for how the Ebook compile format is set up, the ToC entry is taken directly from how you choose to present the chapter heading itself, via the Section Layout assigned to them. It sounds like you have the “Chapter Heading” or “Chapter” layout assigned, whereas you’d rather have “Chapter Title” or “Chapter with Title”.

To this you responded you don’t have any of these options, but I can see them right in your list of section layouts here. Why not just assign your section type to use the layout that works better for you?

If you’re asking for the sake of curiosity though, see how the “Chapter with Title” layout uses the Title checkbox while “Chapter” does not? That’s the big difference.