'7. Table of Contents Patterns - The Standard Ebooks Manual', 'highlight' => 'contribute', 'manual' => true]) ?>

Table of Contents Patterns

The table of contents (the ToC) is not viewable as a page in the ebook's reading order. Instead, the reader's ereading system displays the ToC as part of its reading interface.

These rules outline how to structure the ToC. Typically, the output of se print-toc constructs ToCs according to these rules, without further changes being necessary.

The ToC <nav> element

  1. The first child of the Toc's <body> tag is a <nav> element with the semantic inflection toc.
  2. The first child of the <nav> element is a <h2 epub:type="title">Table of Contents</h2> element.
  3. The second child of the <nav> element is an <ol> element representing the items in the Table of Contents.

The top-level <ol> element

The <nav> element's top-level <ol> element contains a list of items in the Table of Contents.

  1. The first child is a link to the titlepage.
    <li> <a href="text/titlepage.xhtml">Titlepage</a> </li>
  2. The second child is a link to the imprint.
    <li> <a href="text/imprint.xhtml">Imprint</a> </li>
  3. The second-to-last child is a link to the colophon.
    <li> <a href="text/colophon.xhtml">Colophon</a> </li>
  4. The second-to-last child is a link to the Uncopyright.
    <li> <a href="text/uncopyright.xhtml">Uncopyright</a> </li>
  5. In books with half title pages, the half title page is listed in the ToC and the next sibling is an <ol> element containing the book's contents.
    <li> <a href="text/halftitle.xhtml">The Moon Pool</a> <ol> <li> <a href="text/chapter-1.xhtml"><span epub:type="z3998:roman">I</span>: The Thing on the Moon Path</a> </li> <li> <a href="text/chapter-2.xhtml"><span epub:type="z3998:roman">II</span>: “Dead! All Dead!”</a> </li>

<li> descendents

  1. Each <li> contains an <a> tag pointing to a file or hash, and optionally also contains an <ol> element representing a nested series of ToC items.
  2. If an <li> element contains a nested <ol> element, that <li>'s first child is an <a> element that points to the beginning of that section.
    <li> <a href="text/halftitle.xhtml">Sybil</a> <ol> <li> <a href="text/book-1.xhtml">Book <span epub:type="z3998:roman">I</span></a> <ol> <li> <a href="text/chapter-1-1.xhtml" epub:type="z3998:roman">I</a> </li>
  3. Roman numerals in the ToC have the semantic inflection of z3998:roman. A <span> element is included if the entire contents of the <a> element are not a Roman numeral.
    <li> <a href="text/chapter-1.xhtml">I</a> </li>
    <li> <a href="text/chapter-1.xhtml"><span epub:type="z3998:roman">I</span></a> </li>
    <li> <a href="text/chapter-1.xhtml" epub:type="z3998:roman">I</a> </li>
    <li> <a href="text/book-1.xhtml">Book <span epub:type="z3998:roman">I</span></a> <ol> ... </ol> </li>

<a> descendents

  1. Chapters without titles are represented by their Roman ordinal, without the word Chapter:
    <a epub:type="title z3998:roman">XI</a>
  2. Chapters with titles are represented by their Roman ordinal, followed by a colon and a space, followed by the chapter title:
    <a href="text/chapter-3.xhtml"><span epub:type="z3998:roman">III</span>: The Moon Rock</a>
  3. Chapters with unique identifiers (i.e. not Chapter, but something unique to the style of the book, like Book or Stave), include that unique identifier in the <a> element:
    <a href="text/chapter-1.xhtml">Stave <span epub:type="z3998:roman">I</span>: Marley’s Ghost</a>
  4. High-level sections (like parts or divisions) without titles are represented by their identifier (like Book or Part), followed by their Roman ordinal:
    <a href="text/book-1.xhtml">Book <span epub:type="z3998:roman">I</span></a>
  5. High-level sections (like parts or divisions) with titles include the title:
    <a href="text/book-10.xhtml">Book <span epub:type="z3998:roman">X</span>: The Boys</a>
  6. Sections that are not chapters do not include their subtitles in the ToC:
    <a href="text/epilogue.xhtml">Epilogue: A Morning Call</a>
    <a href="text/epilogue.xhtml">Epilogue</a>
  7. High-level sections (like parts or divisions) with titles include the title:
    <a href="text/book-10.xhtml">Book <span epub:type="z3998:roman">X</span>: The Boys</a>
  8. Entries for half title pages do not include the subtitle:
    <li> <a href="text/halftitle.xhtml">His Last Bow</a> <ol> ... </ol> </li>

The landmarks <nav> element

After the first <nav> element, there is a second <nav> element with the semantic inflection of landmarks.

  1. The first child is an <h2 epub:type="title">Landmarks</h2> element.
  2. The second child is an <ol> element listing the major structural divisions of the book.

<li> descendents

Each <li> element contains a link to one of the major structural divisions of the book. In general, a structural division is any section of the book that is not part of the body text.

  1. Each <li> element has the computed semantic inflection of top-level <section> element in the file. The computed semantic inflection includes inherited semantic inflection from the <body> tag.
    <li> <a href="text/preface.xhtml" epub:type="frontmatter preface">Preface</a> </li>
  2. The body text is represented by a link to the first file of the body text. In a prose novel, this is usually Chapter 1 or Part 1. In a collection this is usually the first item, like the first short story in a short story collection. The text is the title of the work as represented in the metadata <dc:title> element.
    <li> <a href="text/book-1.xhtml" epub:type="bodymatter z3998:fiction">Sybil</a> </li>
    <li> <a href="text/chapter-1.xhtml" epub:type="bodymatter z3998:fiction">The Moon Pool</a> </li>
    <li> <a href="text/the-adventure-of-wisteria-lodge.xhtml" epub:type="bodymatter z3998:fiction">His Last Bow</a> </li>