Create a Table of Contents with a Navigation Document
|TOC Type||Required?||Where Found||Why it Matters|
|Logical TOC||Required for all Kindle books by Amazon||Accessible from the Kindle Go To menu|
Lets the reader easily find parts, sections, and chapters of your book from the Kindle Go To menu
Lets the reader see how far along they are in the book
|HTML TOC||Strongly Recommended by Amazon||Appears as a page in the beginning of the book|
Users expect to see an HTML TOC at the beginning of a book
Some older devices don’t support a logical TOC, so an HTML TOC lets readers on all devices find parts of your book easily
1. Build a Logical TOC Using a Navigation DocumentWe recommend using a navigation document to make a logical TOC, which provides the best customer experience on newer devices. This type of TOC can also serve as an HTML TOC, which older devices depend on for navigation. If you're more experienced with coding, you can also create a logical TOC with NCX, but these steps will show you how to use the navigation document method.
- In your HTML editor, create an HTML or XHTML file. Name it toc.html or toc.xhtml.*
- Assign an epub:type attribute with the value "toc" in a <nav> element to identify it as a Table of Contents (sample code below).
- Create an ordered list of hyperlinks leading to each chapter and section. Ordered lists can be nested to create a hierarchy of levels.
Free HTML editing tools can be found here:
Important: Do not nest anchor tags in fixed-layout books. Fixed-layout books with nested anchor tags cannot be supported and will be suppressed.
Warning: Unnecessary or confusing hyperlinks, misplaced Tables of Contents (TOCs), or the addition of disruptive content that takes readers away from the main content of your book can result in a poor customer experience. If the formatting of a book results in a poor experience or genuine reader confusion, or is designed to unnaturally inflate sales or pages read, we will take action to remove titles and protect readers.
<li><a href=”Sway_body.html#preface_1">AUTHOR'S NOTE</a></li>
<li><a href=”Sway_body.html#part_1">PART ONE</a>
<li><a href="Sway_body.html#chapter_1">THE HOUSES, 1969</a></li>
<li><a href="Sway_body.html#chapter_2">ROCK AND ROLL, 1962</a></li>
<li><a href="Sway_body.html#chapter_3">THE EMPRESS, 1928–1947</a></li>
This sample produces a TOC that looks like this:
THE HOUSES, 1969
ROCK AND ROLL, 1962
THE EMPRESS, 1928–1947
2. Use Your TOC as an HTML TOC (Recommended)For customers on older devices, this saves many clicks when they want to jump to a part of your book.
- Activate a guide item in the Kindle Go To menu to make a link to the HTML TOC accessible from anywhere in the book. To do this, reference your TOC in the navigation document with a landmarks nav element (sample code below).
- In the epub:type attribute, set "landmarks" as the value.
- In the epub:type attribute, add a link with "toc" as the value.
<nav epub:type="landmarks"><ol><li><a epub:type="toc" href="table-of-contents.xhtml">Table of Contents</a></li></ol>
Tip(Optional): To add the Table of Contents guide item without adding extra text to your TOC, include this attribute: hidden="hidden" in your landmarks nav element.
Sample code with "hidden" attribute:
<nav epub:type="landmarks" class="hidden-tag" hidden="hidden"><ol class="none" epub:type="list">
<li><a epub:type="toc" href="table-of-contents.xhtml">Table of Contents</a></li></ol>
3. Finish Your TOC
- Save your navigation document
- Open your OPF file for editing
- Declare your navigation document in the <manifest> section of the OPF file with "nav" as the value of the properties attribute. This identifies it for the device as the source of the logical TOC.
Sample OPF file manifest code
<item id="table-of-contents" properties="nav" href="xhtml/table-of-contents.xhtml" media-type="application/xhtml+xml"/>
- To use the navigation document as an HTML TOC, enter it in the <spine> section of the OPF where you would like it to appear in the flow of your content. Including it in the flow of your content will provide easy navigation for customers on devices without chapter-to-chapter navigation in the Kindle Go To menu.
Tip: To avoid interrupting the customer’s reading progress, we recommend placing it at the front of the book.
Sample OPF file HTML TOC code
4. Quality CheckYour TOC is now finished, offering a rich navigation experience for customers. Please perform a quality check by checking the items below:
- All TOC entries in the Table of Contents are clickable and lead to the correct locations
- Every chapter and section has a TOC entry
- All chapter and section names in the TOC match the names in the book
- No typographical errors
- No duplicates in the TOC
- No TOC entries that lead to the same location
Common FixesQ: Why is the button for Table of Contents grayed out in the Go To menu?
A: Make sure the link to the navigation document (e.g., toc.xhtml) in the landmarks nav element also contains epub:type="toc" to identify it for the device as the Table of Contents.
Q: I am following the IDPF 2 specification, but my Table of Contents is grayed out in the Go To menu. Why?
A: If you include a TOC guide item in the <guide> section of the OPF, the landmarks nav element in the navigation document must have the epub:type="toc" element. Be sure the navigation document has a landmarks nav element that includes epub:type="toc" in addition to the reference in the <guide> section of the OPF (per the IDPF 2 spec).
Q: Why doesn’t my Table of Contents appear inside my book?
A: The Table of Contents will only appear in the flow of your book if the navigation document is listed in the <spine> section of the OPF document.
Q: Why doesn’t my Table of Contents appear in the Go To menu?
A: A list of chapters will only appear in the Go To menu on devices that support a logical TOC. Make sure the navigation document is identified with properties="nav" in the <manifest> section of the OPF so that the device knows you intend to use it as the logical TOC.
Q: What if I already have an NCX TOC?
A: Navigational Control File from XML (NCX) is still supported as a source for logical TOC on Kindle, but the device will prefer the navigation document if it exists.
Q: What if I already have an NCX TOC, but the logical TOC on Kindle is not working (or not working as expected)?
A: We strongly recommend adding a logical TOC using a navigation document. However, you're welcome to read the instructions on how to create an NCX TOC.
Tip: Professional formatting and conversion services are available to prepare your book for print and Kindle.