- 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:
- Mozilla Seamonkey HTML Editor
- WYSIWYG (What-you-see-is-what-you-get) editor: NVU
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.
Sample code:
<nav epub:type="toc">
<ol>
<li><a href=”Sway_body.html#preface_1">AUTHOR'S NOTE</a></li>
<li><a href=”Sway_body.html#part_1">PART ONE</a>
<ol>
<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>
</ol>
</li>
</ol>
</nav>
This sample produces a TOC that looks like this:
AUTHOR'S NOTE
PART ONETHE HOUSES, 1969
ROCK AND ROLL, 1962
THE EMPRESS, 1928–1947