Table of Contents shows xhtml

Any idea what I’ve done to create a ToC that looks like this?

1. [Prologue](body3.xhtml)
1. [Chapter One - Butterfly Counter](body4.xhtml)
1. [Chapter Two - Jacob](body5.xhtml)
...

This is Scrivener 3 on Mac OSX, generating epub. I did the usual Copy Special > Copy as Structured Linked list. When I open the book in Calibre or Book Reader, I have a table of contents on the left that actually works fine–active links–but I can open to the Contents page and see this.

I’m a longtime user of Scrivener, but I’ve never seen this before.

My guess would be that somewhere in your titles in a character that Markdown doesn’t like, and it is prohibiting the conversion of your text to HTML, or what your ebook reader would know how to display natively.

I would suggest compiling A/B tests with half the list removed, and then half of the half that doesn’t work, until you narrow it down to the title causing issues. At that point you could probably just delete the title entirely in the Binder and re-type it.

Can you explain how you get the table of contents on the left. That is what I would like to do but haven’t figured out how to do it. Not sure how you use Copy Special → Copy as Stuctured Linked List. Is that done before the compile, during ?? Obviously I’m not an expert user of Scrivener though I’ve used it for quite some time.

In the Binder on the left, you should have a Front Matter folder, with Paperback and Ebook sub-folders. Each of these should have a document named “contents” (if not, you can make one).

Copy Special → Copy Documents as ToC is for making a table of contents for paperbacks; it will have page numbers. Copy Special → Copy Documents as Linked List is for e-books; it will have active links but no page numbers.

To make the index, make sure everything in the binder that you want in the index is highlighted. If you want everything then you have to expand everything; if you can’t see it, it isn’t chosen. Then go to Copy Special and use ToC for print books, Linked List for eBooks. Once you’ve copied it, go to the correct “contents” document and paste it. You can do either or both, but be sure to use ToC for print books and LL for eBooks.

Finally, when you compile, be sure “Add front matter” is checked, and it says EBook or Paperback next to the checkbox.

Good luck.

I have a tip for eBooks (only). There’s free software called Sigil. It’s complicated, but one of the icons is for creating a table of contents, and that’s all you need. Open your compiled eBook in Sigil, locate that icon, and you’re home free–much easier than Scrivener.

It might help to know what you mean by “the table of contents on the left”. Do you mean something always visible no matter what page you’re on? I don’t think there is a good way of doing that in an ebook, nor would it be terribly useful since most ebook readers have a button you can press that brings up the ToC whenever you want—no need to cramp the viewing area with it always.

As for what goes into that button, you kind of get that for free, without having to go through the trouble of making your own. The only reason you’d want to do that is if you do not like how the automatically generated one orders things, or what it all lists.

If you aren’t getting a useful table of contents in your ebook reader, there is probably some other issue, like not using proper section break generating Layouts for elements that should have one, like parts and chapters.