Compiling Torture

New poster here. I can’t find a clear tutorial on compiling for Kindle and it’s really the WORST in terms of intuitive interface design. My basic problem:
–How do I prevent the front matter items from showing up in the table of contents?

I’m using 2.5 on a Mac and have set up the document so that each chapter is a folder and each folder is named as I want the chapter title to appear. So the auto generate prefix suffix stuff is turned off. The front matter items are checked in the Compile/Contents list, I put a pg break before each. In the Formatting area the Folder Title and Text Text boxes are ticked. Section Layouts left blank.

It’s taken me hours of frustration to get this far. The only flaws to correct are the front matter appearing in the TOC. Does the TOC always appear at the start of the document? Thanks for any help.

Firstly, it’s not unusual to have front matter included in the ToC with professionally created e-books on the Amazon store, so if you’re worried about fitting in, you’ll be just fine with them included.

Normality aside, it’s pretty easy to use your own ToC with Scrivener—far easier than trying to manipulate the automatic generator (which is necessarily a bit simple and makes a lot of assumptions to avoid being a configuration monster). To create a custom ToC, just make a file called “Contents” in the Draft, put it where it should appear in the flow of the book, and then build your own ToC within it, using Scrivener Links where tap zones should be. The easiest way to do that is to select all of your chapter folders in the Binder and use the Edit/Copy Special/Copy Documents as Scrivener Links command. Since this is just a text file in the Binder, you have full control over what appears and how it is laid out.

When compiling, make sure the Layout compile option pane is set up to check for a file called “Contents” (it is by default).

The automatically generated one will, and you should place your custom contents file somewhere in the beginning too, in accordance with Amazon’s publication guidelines:

“Place the HTML TOC towards the beginning of the book and not at the end of the book. This ensures that a customer paging through the book from the beginning encounters the TOC naturally. Incorrect placement of the TOC affects the accuracy of the ‘Last Page Read’ feature. Correct placement ensures that the TOC appears in sample downloads of the book.”

Thanks. I’ll consider that process…but it would involve learning about the HTML linking tapping process. What the program really needs is a very simple “Don’t include this in the TOC” button. I have a few interstitial paragraphs through the manuscript and want them separated from the other chapters, but not included in the TOC. I haven’t found a way to do that yet. In desperation I thought I’d just not name those text docs, but the result was a TOC with “untitled document” for each interstitial section. Frustrating.

I’m sorry, I wasn’t clear enough, the “interface” for doing this in Scrivener does not involve any knowledge of HTML or coding. All you do is make a text file in the Draft folder (or front matter folder as the case may be) with links to all of the sections you want included in the ToC. The menu command I mentioned will create a list of linked chapter names for you. So it may very well be that all you would need to do is paste that list into a file called “Contents”.

Ah, well in that case your compile settings must be set up so that these are being created as individual sections rather than being merged together as a single section. That’s something you may want to fix anyway has having a single paragraph in its own section will confuse internal navigation within the e-book (especially for those readers that have a “Next Chapter” button or gesture).

Basically the way the automatic ToC generator works is it looks for any item that starts a new section, and uses that item’s name for the ToC entry. If an item does not start a new section, then it becomes invisible to the ToC and will be merged into a single file—the last one that declared itself as a new section. So if everything is set up right, these paragraphs, and really all of the text files files within a chapter folder, would be tacked onto the initial section break and not be visible to the e-book “spine”.

A section break happens either when there is a page break code (either from the checkbox or within the text editor as a page break code) or a section break as defined in the Separators compile option pane. If you have section breaks between text files, and you use text files liberally within chapter, that will make a mess of the automatic ToC.

So it may be a good idea to do things in reverse here. Get this sorted out first, using the automatic-ToC to verify your results, and then move on to making a custom ToC if that is still necessary. This way you can make sure that the internal navigation in the book will be logical to the reader rather than glazing it over with a custom ToC that leaves out some of the section navigation.