Wednesday, December 5, 2012

EBOOK BASICS: the Table of Contents

There are two major types of ebook formats out there: EPUB books and MOBI books.

EPUB books are sold by Apple, Kobo, Barnes & Noble, Sony, and others.

MOBI books are sold by Amazon. Though they are often referred to as “Kindle” books, there are now actually two formats that are used for Kindle books: MOBI, and Amazon’s new (and proprietary) KF8 format. I will leave KF8 for another time and deal with Amazon’s MOBI format (and MOBI-specific reading devices) here. If anything that I say here is in contradiction to how the KF8 format works, remember that I’m speaking about MOBI, and, until KF8 becomes more common, there are now and will continue to be for a long time far more MOBI books for Kindle devices than KF8. Because of that, I use “MOBI” and “Kindle” interchangeably here.

Though each of these ebook types is also sold by various small, independent retailers, the companies that I mentioned are the ones that make up the bulk of ebook sales worldwide.

There are two Table of Contents types that are present in ebooks:

1.) the first type is the separate, not-part-of-the-text Table of Contents (also known as an “NCX Table of Contents”), and it is the most ubiquitous. All properly-formatted ebooks have one (even semi-properly-formatted ones do), whether they are MOBI books (where it is normally invisible and often hard to get to) or EPUB books (where it is also normally invisible but is very easy to get to).

In EPUB books this Table of Contents type becomes visible when the reader clicks on the “Table of Contents” button. It is displayed as a single scrolling list of chapters on which you can click and be taken to the corresponding section of the book. (I’ll speak about how Kindle devices handle this type in a moment.)

2.) the second type is the visible-and-clickable-within-the-text Table of Contents (also known as an “HTML Table of Contents”), and it is the one that is most useful for MOBI books though (unfortunately) can be the most difficult to create and place within a book. (There’s an easy way around this that I’ll speak about in another post.)

Unlike the NCX type (which on a Kindle device or app is often difficult or even impossible to get to), an HTML Table of Contents is almost always visible within the running text and is displayed just like any other page of the book, except that it is composed entirely of clickable links that correspond to the various sections of the book. It is most often found right near the beginning of the book or at the very end, and can usually be gotten to merely (though sometimes tediously) by turning enough pages until you arrive. It can be as short as a single page or, in books with many chapters, several pages long.

A Kindle device will sense its presence in the book and will make it more easily available by listing it in in the book’s “Go to…” list. The “Go to…” list is a handy little window which, with a couple of clicks, pops up and gives the reader a list of places to “Go to” within the book. A complete “Go to…” list consists of six items: table of contents, beginning, page, cover, end, and location. Without an HTML Table of Contents, the “table of contents” item in the “Go to…” list will be grayed out and un-clickable. Without a clickable Table of Contents, getting to a particular spot within an ebook can get very tedious very quickly.

A Kindle book’s NCX Table of Contents is how the device keeps track of four of the other “Go to” items: the beginning, the cover, the end, and any specific location within the text that you might want to go to. People have a tough time specifying a “location” with a Kindle book because “location” to a Kindle does not correspond to any particular page or chapter. It has something to do with approximately how many kilobytes of data you are from the beginning of the book, so it’s not generally very useful to people. (Aren’t you glad that you asked?) It’s useful to the machine, though (and, thus, in this case here to you), because it’s this “knowing the distance from the front of the book” that enables the Kindle to place your bookmarks into the text.

The NCX also keeps track of the beginning of each chapter (even though the device often won’t show you the list). This makes it possible on certain Kindle devices (the Kindle Keyboard is one) to, with just a click, jump to the start of the next chapter. This is certainly easier than going page-by-page but is still no cakewalk if you want to get to Chapter 43. That’s why an HTML Table of Contents is so important in a Kindle book.

The two places where I’m sure that a Kindle book’s NCX Table of contents will be visible are the Kindle for Mac/PC app and the downloadable Kindle Previewer, which is used to test a Kindle book before it’s published. Using either of those apps, if you click on the button for the HTML Table of Contents for a book that doesn’t have one, you will get an error message stating that the Table of Contents is “missing” (as though the HTML Table of Contents is the only one). On the other hand, if you click on the button for the NCX one, it will be quite visible and clickable. I’m not sure if any of the actual Kindle devices will show the NCX Table of Contents. If not, you’re left with only the “Go to” items again. (By the way: if you click on the NCX button and are told that even that one is missing, the formatting for that book is really messed up and will be very difficult for a reader to navigate.)

The last “Go to” item, the page, is visible in those Kindle books that have been specially coded to have actual page counts that correspond to what the page number would be if it were a printed book. Some people have thought for a long time that this might be useful, so Amazon made this coding ability available not too long ago for those programmers who want to take advantage of it. Personally, I don’t.

A book’s “Go to…” list is especially useful when the Table of Contents is at the end of the book. Why would you want the Table of Contents there? Because that way it takes no space away from the book’s sample pages, which, for books that are for sale on Amazon, consist of the first ten per cent of the book. You want the sample to be as useful and enticing as possible to a potential customer, something that’s difficult when a good portion of the sample is several pages of nothing but “Chapter 1,” “Chapter 2,”… “Chapter 43,” etc. If, on the other hand, your chapter titles are interesting and descriptive (“Chapter 1: How I Got Thin in 30 Days”) then, yeah, keep the Table if Contents in the front, where it will be seen as part of the sample.

Interestingly, though Kindle books should have both Table of Contents types, many times they do not. Amazon supposedly requires it (that requirement is, in fact, stated in its Publishing Guidelines) but they do not seem to enforce that requirement in actual practice. That means that many Kindle books (especially self-published ones) have only an NCX Table of Contents, which, for the reasons stated above, can be a real drag. EPUB books, on the other hand, need only the NCX type. An HTML type is superfluous since, with a click or two, an EPUB book’s NCX Table of Contents pops up for you to see and click on, and doesn’t even take pages away from the book’s sample.

I hope that this helps. How a Table of Contents for your book is actually created I will discuss in another post. Leave a comment with any questions, concerns, or suggestions for future topics.


  1. Hi. I wrote an ebook in Mac pages, converted to epub, uploaded to Kindle previewer, and everything was displayed properly, but no toc. the toc IS displaying in NCX, and when I click the the chapter headings, it links to them. Can a toc be developed from the ncx files? How can this be done? Is Pages to be blamed [got a warning notice that some formatting, tables] were not supported at epub conversion.

    1. I used to get that warning, too. I think that it was a warning about items that one MAY have placed within the file (items that will not convert to EPUB), not about items that one actually HAD placed there. Pages gave that warning no matter how simple the file was that one was converting, so I turned the warning off because I already know what will convert and what won’t.

      Let me say that my remarks here concern Pages version 4.1. If you use the later version, the one that works with Lion and later, I think that all will still be relevant. (If that turns out to be not true, please let me know.)

      You can’t use the semi-automatically-generated Table of Contents that Pages creates for a word-processing document. Don’t even make one of those for your book. The way to have a Text-Linked Table of Contents appear in one’s EPUB from Pages is to create it by hand. It’s not difficult to make one, and it’s only tedious if one has a huge number of chapter headings that one wants to include there. If there are only a few, it takes only a few minutes.

      First, decide which places within the book are the ones that you want to designate as destinations that a reader might want to go to: chapter names, headings, interesting places in the text, whatever. Place a bookmark at each of those destinations. For example: for a chapter name, you would select the words that make up the chapter name (the words “Chapter 3”) and turn them into a bookmark.

      When you have your bookmarks set, go to somewhere near the beginning of the book and create a new chapter and call it “Table of Contents” or just “Contents” or whatever. In that chapter you type a list of the various destinations, one to each line. Then you make each of the items in the list a hyperlink to its respective bookmark.

      Bingo! You now have a Text-Linked Table of Contents. If you place that chapter near or at the front of the book, a person will see it and be able to jump to wherever he wants to go. Further refinements to this technique can easily be done if you are just a little familiar with HTML (or are not scared to try it), but they are a bit too much to go into here.

      I cover all of the details of this and numerous other easy ways to make Pages behave the way that you want in my forthcoming book, “Easiest Ebooks Ever: How to Format Your Kindle or EPUB Book Using Pages.” I will post a note on my blog when it’s ready. If you want to be notified personally, send me your e-mail address.