Best Practices for Ebook Front Matter: Table of Contents, Part 2

Expert publishing blog opinions are solely those of the blogger and not necessarily endorsed by DBW.

Best Practices for Ebook Front Matter: Table of Contents, Part 2The front matter of a book communicates a lot of helpful and important information to readers. But publishers and authors often find themselves wondering how to handle that information in their ebook files. In the current installments of my column here on Digital Book World, I am delving into some best practices, ideas and options for these opening and ending parts of your ebook. In my last installment, we started our discussion about the table of contents, which we will continue today.

Note: As is my standard practice, the markup examples below are all suitable for EPUB 3 files. If you are still creating an EPUB 2 file for some reason, your mileage may vary.

Today’s article is going to cover some little-known and under-utilized features of the EPUB 3 Nav Doc. However, despite the fact that so many people ignore these features, I firmly believe they are still very important to the quality of your ebook files and the future of your content.

Page Numbers

For many years, publishers and readers have complained that there are no page numbers in ebooks. However, the lack of page numbers is not due to technical limitations or to appropriate markup not being present in the EPUB specification; the Page List feature has been part of the EPUB standard since EPUB 2. The lack of page numbers in ebooks is only due to 1) retailers and other reading system creators dragging their feet in supporting page lists (the notable exception being Apple iBooks), and 2) publishers largely ignoring the feature because it is “too hard to create” or does not get automatically exported from standard workflow tools like InDesign.

Regardless of the reasons, the fact is that the EPUB standard has support for page numbers, and it only requires two things: marking each page location within the text of the book, and compiling a list of these markers in the Nav Doc.

Adding page break markers in the text of your book is not hard; it is just time-consuming. All you have to do is add the following span tag wherever the page break occurs in the print book:

<span epub:type=”pagebreak” id=”page125″ title=”125″/>

These page break tags should be placed where the given page’s content begins. When the page begins with a heading or a new paragraph, it is normal practice to place the page break tag inside the tag but before the text:

<h1><span epub:type=”pagebreak” id=”page125″ title=”125″/>Chapter 1</h1>

If the page break occurs in the middle of a word in the print book, I recommend you go ahead and combine the split word together and place the page break after it. Some reading systems do not handle span tags inside words very well, and may introduce a space or allow the word to break without a hyphen in that location.

For blank pages, it is probably best not to include the page break, as that may mess with display in reading systems that do support this feature.

There are some InDesign plugins that will assist in the addition of page numbers within your EPUB file (LiveIndex is one that some ebook developers like), but be careful about how and where they place your page break tag. I have seen some EPUBs where the page break was moved to the top of the containing paragraph, regardless of where the break actually occurred in the text.

It is best to mark actual page content with the actual print page number that applies to it, even if that means that the page numbers will be out of order. This offers better results to readers who are using page numbers to navigate.

The Page List

Once you have the page numbers marked in the text of your book, all you have to do is compile a list of these page numbers and include that in your Nav Doc. This page list section is wrapped in a <nav> element that includes the epub:type attribute with a value of “page-list”.

Here is a sample of a page list section, as seen in The Book of Texas, my sample EPUB 3 file:

<nav epub:type=”page-list” hidden=””>

<h1>List of Pages</h1>

<ol>

<li><a href=”07-start.xhtml#pagexvi”>xvi</a></li>

<li><a href=”07-start.xhtml#pagexvii”>xvii</a></li>

<li><a href=”08-part1.xhtml#page1″>1</a></li>

<li><a href=”09-part1_chap1.xhtml#page3″>3</a></li>

<li><a href=”09-part1_chap1.xhtml#page4″>4</a></li>

</ol>

</nav>

Note that this is very similar to the markup we use for the table of contents. However, because we don’t really want readers to see this section (trying to swipe through 300 pages in a list would be very frustrating), you can hide it using the hidden="" attribute (no value is needed). You might also want to use some CSS to ensure that the section is hidden even on older devices (like the Nook). The easiest way to do that is to add a class name to the <nav> tag (like class="hidden") and add .hidden {display:none;} to your CSS.

Note that your page list should match the order of the pages in your HTML files as listed in the spine (in the OPF), even if some page content moved around to accommodate the new format. Also, because there is no nesting of page numbers in a print book, the page numbers in the page list cannot be nested.

Other Navigation Lists

Many books include illustrations, charts, photos, tables and other special content within them, and making those sections easily accessible to a reader is an important function of the navigation in an ebook. This is easily done with secondary navigation sections inside the EPUB 3 Nav Doc.

Just like the standard Table of Contents, these additional sections are wrapped in <nav> tags and are given appropriate epub:type attributes (as defined in the EPUB 3 Structural Semantics Vocabulary). Those include:

  • loa: List of Audio clips
  • loi: List of Illustrations
  • lot: List of Tables
  • lov: List of Video clips

For example:

<nav id=”illustrations” epub:type=”loi”>

<h1>List of Illustrations</h1>

<ol>

<li><a href=”02-alamoimage.xhtml”>The Alamo, San Antonio</a></li>

<li><a href=”10-part1_chap2.xhtml#image_house”>A Typical Fort Worth Residence</a></li>

<li><a href=”10-part1_chap2.xhtml#image_alamo02″>A view of the Alamo Plaza, San Antonio</a></li>

<li><a href=”10-part1_chap2.xhtml#image_alamo03″>A modern view of the Alamo Plaza, San Antonio</a></li>

</ol>

</nav>

These sections can include nested content, just like the Table of Contents section, and are usually something you’ll want to visibly show to the reader, not hide.

Landmarks

The last section we need to discuss in the Nav Doc is the Landmarks. This section is a replacement for the Guide section that was included in the OPF file in EPUB 2. It should include links to the cover page, the Table of Contents, and the opening section of text (“start location”) of the book. For example:

<nav epub:type=”landmarks” hidden=””>

<ol>

<li><a epub:type=”cover” href=”cover.xhtml”>Cover</a></li>

<li><a epub:type=”toc” href=”toc.xhtml#TOC”>Table of Contents</a></li>

<li><a epub:type=”bodymatter” href=”chapter1.xhtml”>Start of Content</a></li>

</ol>

</nav>

Note that the landmarks section not only includes links, but it also marks each link with the appropriate epub:type attribute, allowing the reading system to understand what the link specifically points to.

In my next installment, we will talk about footnotes and endnotes. If you have a suggestion for a topic you’d like me to cover—anything related to ebooks or metadata—please post a comment below.


To get all the ebook and digital publishing news you need every day in your inbox at 8:00 AM, sign up for the DBW Daily today!

2 thoughts on “Best Practices for Ebook Front Matter: Table of Contents, Part 2

  1. ricardo t. sabaybay

    Hi Josh,

    Can we alkso use the page list or navigation list to create a table/listing of Exercises/quizzes? This is most useful for textbooks/review books etc.

    Can you share an example on how to do this?

    Appreciate your feedback.

    Sincerely

    Reply

COMMENT

Your email address will not be published. Required fields are marked *


*