Can Everton Jones find out how his father stole Emperor Bokassa’s diamonds and, more importantly, where he hid them; before the world and his brother get there first?
Click on the picture link in the sidebar to read an extract of my first novel, which was published by Paradise Press in August 2012.

Thursday, 13 March 2014

How to link the html table of Contents in a Kindle e-book

A valid epub ebook which passes epubcheck will already contain a logical table of contents. This is a file called ‘toc.ncx’. (I will link to a future post on how Sigil generates this here.) You will find this in the OEBPS folder. (See here to understand the structure of the OEBPS.) It will already be correctly linked in the <manifest> and <spine> sections of the content.opf file. You don’t need to do anything to these entries. Kindle will, however, ignore the ncx table of contents, even though the Kindle needs the file. You should have created a chapter near the front of the e-book containing hyperlinks to the various other chapters and perhaps sections within chapters. This is the html table of contents. There are important details about the way the hyperlinks are coded for them to work properly in Kindle ebooks, and I have devoted an entire post to how to do this. (Click here to read this post.) Once the links in the html table of contents have been restructured for Kindle, you need to link the html table of contents to the ‘table of contents’ button on the Kindle. If you do not do this the button will be greyed-out and the reader will not be able to use the button to jump to the table of contents.

To link the html table of contents, first unpack the epub and open the content.opf file using an html editor such as Komodo Edit. Scan down the entries in the <manifest> section of content.opf and find the entry for the html table of contents. Mine was called ‘Index.xhtml’. The entry for Index.xhtml in the <manifest> looked like this:

<item href="Text/Index.xhtml" id="Index.xhtml" media-type="application/xhtml+xml" />

(I have a separate post on the structure and syntax of the <manifest> ready to go and will link it here.)

To link this file to the ‘table of contents’ button you need to edit the <guide> section of the <manifest> so it looks like this:

   <reference type="toc" title="Table of Contents"
href="Text/Index.xhtml" />

Note that Text/Index.xhtml should be EXACTLY the same as the href in red in the entry in the <manifest> shown above.

type="toc" MUST be entered as shown. There should be nothing else in the <guide>.

The title, "Table of Contents" can most likely be anything you like. Especially considering that the button on my Kindle uses lower case for the table of contents button, whilst my <guide> entry is capitalised, following the example in the Amazon Kindle Publishing Guidelines. But I see no reason to change it. If you want to use something different: experiment! and see if it still works. My guess is that on a Kindle, nothing will change.

When I looked at my blank Example epub file, the <guide> was completely blank and was entered as a single closed tag:

<guide />

This could catch you out because the syntax is different. It definitley caught me out recently! YOUR guide entry should begin with an opening <guide> tag and end with a closing </guide> tag NOT with <guide />.

Index to ‘how to …’ posts:

How to ‘unpack’ an epub file to edit the contents and see what’s inside.
How to understand what is inside an epub
How to link the html table of Contents in a Kindle e-book
How to restructure the html table of contents for a Kindle
How to delete the html cover for a Kindle ebook
How to link the cover IMAGE in a Kindle e-book
How to clean up your MS Word file before your get started
How to markup an MS Word file to identify the formats before importing it into an epub
How to create a new blank e-pub using Sigil
How to import your marked-up MS Word file into your ebook using Sigil
How to create and link a CSS stylesheet in an e-book using Sigil
How to replace the markup with CSS styles in your ebook using Sigil
How to style an e-book so it works with the limited CSS styling available to Kindle e-readers
How to understand the syntax of CSS
How to style Small Caps in an e-book
How to split your ebook up into chapters using Sigil
How to sequence your e-book
How to phrase the copyright declarations etc. in an e-book
How to generate the logical table of contents using Sigil
How to understand toc.ncx in an e-book
How to generate the html table of contents in an e-pub
How to style the html table of contents using CSS
How to create an html cover for your epub using Sigil
How to present references and notes in a book
How to use Mark Up to link notes in your e-book
How to present a bibliography in a book
How to use markup to link entries in a bibliography with the notes section
How to index an e-book
How to use the tools in MS Word to create an index
How to alphabetise an index or bibliography
How to adapt the print index in your MS Word file for an e-book using markup
How to adapt cross-references in your print index for e-book and how to use markup to make the links
How to understand content.opf
How to understand and edit the Metadata of an ebook using Sigil
How to understand the manifest in content.opf
How to understand the spine and guide in content.opf
How to test your e-pub using flightCrew in Sigil
How to test your e-pub using epubcheck
How to convert an e-pub to Kindle using kindlegen

TinyURL for this post:


  1. This comment has been removed by a blog administrator.

  2. Hey There. I found your blog using msn. This is a very well written article. I’ll be sure to bookmark it and come back to read more of your useful info. Thanks for the post. I’ll definitely return. book reader

  3. This is my first time i visit here and I found so many interesting stuff in your blog especially it's discussion, thank you. psd to responsive wordpress


Twitter Bird Gadget