Why do I have two tables of contents?

I think I am missing some fundamental concept about ebook tables of content, specifically ePub and mobi.

I have a nonfiction book with front matter, eight chapters, many numbered subsections, and so on. I can make a table of contents for PDF (using Copy Documents as ToC) and it works beautifully.

For mobi and ePub both I made the equivalent table of contents (using Copy Documents as Structured Link List), and this gives me two tables of content. One is the one I made, showing up as normal pages in all my various readers, but not clickable. The second is accessible by clicking an icon in the ebook reader (or the Go To on Kindle); this one has clickable links, but contains only chapters, not subsections. Worse, it includes all my front matter (dedication, etc.), and that shouldn’t be there.

My ToCs are in Front Matter > Paperback > Contents for PDF and Front Matter > Ebook > Contents for ePub and mobi. When I compile, Generate HTML table of contents is not checked.

I have tried someone’s suggestion to use Copy Documents as ToC for the ebook versions, and stripping off the $P tags. That didn’t work; I don’t remember why, but for some reason I couldn’t use find/replace to get rid of the tags, so I had to do that one at a time, and that was a lot of work.

Using Sigil, I see that the active but normally invisible ToC is in nav tags with href links, while the ToC that I made is just in paragraph tags with no links. There are no anchor tags for the subsections, so it would be a huge effort to add them.

Why do I even have this second table of contents? What am I missing? Help!

Most ebook reader software generates a contents “menu” based on the structure of your project. This menu is not under Scrivener’s direct control. Usually, new sections in this menu are defined by page breaks, so that would be something to check if you aren’t seeing what you expect to see.

In the ToC that you created, are the links clickable in the Scrivener Editor? That is, do the links work before you Compile the document?

Katherine