Automatic Numbering in ToC

I’m really confused by something…

I have a book project comprising four novellas that will also be published as one full-length novel.

There are 20 chapters in total. Novella one will contain chapters 1-5. Novella 2 will contain 6-10 and so on. The novel will be all 20 chapters.

Since I don’t want to fix any errors my editor finds in two places, the sensible way to do this seems to be with collections: have a collection per novella and one for the novel. Novella 1 can then pull in chapters 1-4 and the same chapters can be pulled into the novel by its collection. A change can then be made in just one place and be reflected everywhere that chapter’s used.

(With me so far?)

Now when Novella 2 is compiled, I don’t want the chapters to be called 6-10: I want them to be called 1-5. So the chapters need to be numbered sequentially based on what’s in that collection. None of this is a problem - Scrivener’s auto-numbering (Chapter <$t>) works fine…for the text in the book itself. But how do I get Scrivener to used auto-numbered chapters for the Table of Contents in an ebook? Whatever I do, it seems to pull in the actual title of the text document that makes up that folder. I’ve tried every combination of settings in the formatting tab of the compile settings, but prefixes and suffixes don’t seem to get added to ToC entries. Before banging me head against the wall any more, I wanted to check that this is actually possible. This guy seems to have done it: … ok-part-1/

But he’s on Mac. Please: can anyone help?

Does your problem persist if you compile to PDF or .doc? I don’t think the ToC will give you links in those formats, but if it’s the same (shows document names instead of/in addition to CHAPTER ONE and the like), that might be helpful.

What should work is to un-check the “Title” column in the Formatting pane, but to leave the code that produces the CHAPTER ONE text. You’ll know it’s in place by clicking on the folder row in the compile Formatting pane. If the preview below it shows “CHAPTER ONE”, but no title, then you should be on the right track.

Try compiling that to various output formats, including ebook and pdf. If you aren’t getting the results you want (ToC without titles, but with “CHAPTER ONE” and so-forth) in ANY of the formats, then it must be your settings. If you get it in one format, but not the other, then you may be experiencing a bug.

Thanks for your reply Robert!

OK, I’ve tried all that. With the ‘title’ column unchecked but the prefix ‘Chapter <$n>’ still present, the auto-numbered title appears correctly at the start of each chapter. But the ToC still pulls in the document name.

When I compile with the same settings to .pdf and .doc I don’t get a ToC at all - does that suggest I’m doing something else wrong?

I’ve screenshotted my current settings: could you very kindly take a look at them and let me know if you see anything wrong?

As far as I can see I have:

The title of each document in Scrivener is e.g. ‘Title of Chapter One’ - this is what I don’t want to appear, anywhere.
The title checkboxes are unchecked for all levels
The prefix for the levels I’m using is set to ‘Chapter <$n>’
Yet when I compile this into an ebook, in the ToC I get ‘Title of Chapter One’ and not ‘Chapter 1’

EDIT: Update: I thought this might be something to do with me using collections, so I compiled the manuscript. Same problem. I also tried using a folder for each chapter - same problem: I just get the folder name AND the text document name appearing in the ToC. So still stuck :frowning:

Further Update: I’ve just tried with the ‘Novel (Standard Manuscript’ template that comes with Scrivener, and compiling that into an ebook again puts the folder name of the chapter into the ToC without any auto-numbering (in the ToC it just says ‘Chapter’ for each chapter). This is with a template file and the ‘ebook’ presets that come with Scrivener, so I don’t see what I can be doing to screw it up: could this be a bug in

If so, it’s pretty easy to replicate:

  • Fire up Scrivener
  • Start a new project, picking Fiction -> Novel as the template
  • Compile, picking ‘epub’ as the format and changing nothing else.
  • Look at the ToC

It occurred to me that maybe this was because there’s only one chapter folder in the template - but when I add a second chapter folder, I just get them both listed as ‘Chapter’ in the ToC.

Any thoughts?

Hey there Tanya,

I believe the issue you are experiencing is just one of the realities of the Windows eBook compile functionality at the moment. Whilst the Mac version (which the individual was using in the blog post you reference) has a few more options around ToCs, the WinScriv only builds a ToC from the precise text within the document headings of the binder.

As with all the differences between the Mac and Windows functionality, this will be on the teams list to implement, but in the meantime the easiest workaround is to name the files in your binder accordingly for your ebook compile.

Graaaah :frowning: OK, thanks Pigfender.

OK, I managed to find a way round it so I thought I’d post it in case others are stuck.

You can’t do automatic chapter numbering in the ToC on Windows. But if you need alternate chapter numbers as I do (see above for why) the way I made it work is to have an extra folder layer between the chapter folder and the actual text document inside it.

In my case, I now have 20 text docs, titled MC (Master Chapter) 01 - 20
Each one lives in a folder titled how I want the chapters for the BOOK to appear: 1 - 20
Each one of those lives in a folder titled how I want the chapters for each novella to appear: 1 - 5, 1 -5, 1 - 5 and 1 - 5

So the sixth chapter of the book looks like this:

Chapter 1
Chapter 6

Then by pulling the top level chapter folder and the text doc, but NOT the book chapter folder (the middle one) I can create a collection for each novella.

By pulling the book chapter folder and the text doc (all 20 of them) I can in theory make a collection for the whole book - but currently that scrambles the order. It’s a separate issue so I’ll report it separately. But even if I can’t get this to work, I can compile the manuscript and just deselect the novella level chapter folders to get the same effect.

The reason to use two sets of folders and not the folder and the document name is that the document name doesn’t seem to get pulled into the ToC if folders are present - at least, I couldn’t get it to work.

Thanks Robert and Pigfender for your help.

UPDATE: OK, I’ve found a bug and a workaround. If you select a load of chapters and folders and add them to an empty, existing collection, they’ll get scrambled. As long as you create the collection only when you right-click and do ‘Add to Collection’, it all works fine.