Forcing your TOC

I love Calibre/Sigil for constructing epub files, but what I don’t love is the Calibre generated TOC which picks up H1 and H2 Chapter Heading Styles.  I don’t like it because it forces you to use H1 and H2 heading styles, not just bookmarks, for everything that you want to include in your epub TOC.  Here’s what I do instead:

I manually contruct a TOC for every Word (e-book) file, for Smashwords the TOC is in the front of the book where their Guide suggests (?…more like demands) that it be.  But I move the TOC to the back of the epub and prc files.

For the Kindle Content (prc) format, that TOC in the back is no big deal because I build a Guide within MobiPocket Creator that “guides” the reader to the TOC no matter where it is.  BUT, in Calibre, there is no guide.  There is a Structure and TOC detector feature.  And although there is a little square in the TOC feature that suggests that if it’s checked, then Calibre will force their generated TOC onto your file (and vice versa, without checking it, your manual TOC within your document will be used)…they lie.  They force their TOC no matter what if you even touch those two screens (Structure and TOC).

To force THEM (Calibre) to use your beautifully constructed TOC instead of theirs, do this:  1) On the Structure Detection screen, erase everything…except Chapter Mark (choose None) and Remove Falce Margins (check that box).   2) Table of Contents screen, leave everything blank except the default Number of links (50) and Chapter threshold (6).  This will insure (on most files) that the epub will pick up and use YOUR manually constructed (in Word…but don’t use Word’s TOC build feature) TOC.

I’ve found that sometimes Calibre will mix up the placement though.  You’ll have all your Chapters in order, but sometimes the Excerpts and other items will be before the Chapters not after even though you have them listed in your TOC as following the Chapters.  If this doesn’t bother you, and it shouldn’t, then…there you go!  You’ve forced your own TOC.

Of course you could play by Calibre rules, and just make sure that everything that you want in your TOC has been styled H1 or H2 chapter headings…but if you’d like something to not match the style of H1 or H2 (bold, centered, italics, etc) and still be in your TOC, then you have to individually edit that entry:  For instance…”Dear Reader” letter. You want that included in your TOC, but neither the H1 or H2 style looks good.  Instead you want the “Dear Reader” line flush left with 12 pts trailing space.  You of course can edit this from your Word (paragraph) feature on the format bar (Word again).  However, sometimes an e-book will pick up on the H1/H2 style and disregard your edits and…there you are…your Reader Letter is centered/bold/18pt trailing space…not good and you won’t know it until you’ve finished building your epub/prc file.

So I would just manually construct a TOC, link each entry to a bookmarked item within your doc, and then make Calibre use it using the method above.  As I mentioned before, you won’t have trouble with the prc file because you’ll be constructing a Guide to your TOC (as well as beginning page and cover of course).


About athirstyblog

If you're a published author and are sitting on a basement full of backlisted books, then you've found the right blog. Although I formerly filled these pages with book reviews, they will now be filled with tips on eBook formatting, talk about the current technology of eBooks, and other stuff that interests me and hopefully interests you. I'm currently an eBook formatter, formerly a bookseller, archaeologist, illustrator and lover of all things historical and scientific. And I'm now a permanent citizen of DownEast Maine with my own beach and 175 year old house and everything! Come along for the Journey!
This entry was posted in Formatting, Tips and tagged , , , . Bookmark the permalink.

5 Responses to Forcing your TOC

  1. Sewana says:

    Do you have more great artciels like this one?

  2. WONDERFUL Post.thanks for share..more wait .. …

  3. varun says:

    What I want to do is provide a toc.html to Calibre to guide it in correctly ordering the HTML files (in a zip file) but not actually add toc.html page to the epub. I would be happy with the metadata TOC alone but not actually having a TOC in the displayed document whether at the front or the back of displayed document. Also, I would like to understand how I can choose what TOC level is displayed in metadata TOC and how sub-levels can be turned off even though sub-levels are still used for guiding Calibre in properly ordering the HTML files in a zip archive.

    • athirstyblog says:

      Well, I have changed the way I use calibre and MobiPocket now… in fact, I don’t use MobiPocket at all. I use Calibre for the epub as well as the mobi file conversion. As far as I know, you don’t actually have to have a TOC physically in the epub to get the Go To feature to work on an epub device. I never leave it out though because it’s too much work to add the physical TOC back into mobi where you do have to have a physical TOC . I imagine if, on the Structure page (NCX), you choose h1 or whatever you have used to style your chapter headings, that would be enough.

      You must open the epub in Sigil though and “Guide” the Book Browser view (not the TOC) by right-clicking the cover file, the title page file, and at least the chapter file where you would like the book to start…. Cover, choose from the drop-down menu after you right-clicked the cover file, Add Semantics, and then check the ‘cover’ box. Do the same for Title page file, and the chapter file where you want the ebook to begin (right-click, Add Semantics, check the Text box.)

      But I really don’t know if your epub will pass muster without an actual physical TOC. Calibre’s generated one is awful, so I would construct one within your HTML file but place it at the end of the book where it isn’t noticeable. .

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s