I have an epub 3 that I want to be backwards compatible for older e-readers that expect an epub 2.

My table of contents is rendered in a toc.xhtml, as expected by an epub 3. In addition, I have an .ncx file listing the table of contents as expected by an epub 2. However, since my toc.xhtml is just a regular file like all the other content files, not a separate file like the .ncx one, I worry that older e-readers will try to render it as content.

It seems to me I have two options:

  1. Somehow tell older e-readers to ignore the toc.xhtml file so they don't render it (this is preferred)
  2. Somehow tell newer e-readers to render the toc.xhtml file (which I could then use to replace a table of contents I manually placed in the text for aesthetic reasons and for consistency with the print version of the book)

This article says that including the toc.xhtml file in the spine would render it, but that is not the case for me.

How do I do either one of the two options above?


all reading systems are able to read epub3 files (even they can't support all the epub3 features). This started to be true as early as 2013 or so. So I would recommend keeping it as an epub3 -- and not worry at all about backwards compatibility with epub2.

Having the TOC as a separate html file is now standard and even recommended for epub files -- (navigation is included with the toc nav elements). Toc file is both an html file and a navigation document because it includes elements like:

DIV class="toc"
<nav epub:type="toc">
(ordered list using html list elements)

The reading systems look for a list contained inside the NAV tag and then builds the toc from it. (That's how the reading system populates the dropdown list of chapters). Default behavior on many systems is to begin on the first element of this toc, but if you go back a page or two, you will always see the html file containing the toc.

You may not realize that the .ncx has been deprecated for several years now on epub3s. for most readers you could probably leave it out -- though most keep it for legacy reasons. But AFAIK, all ereaders ignore it.


My toc.xhtml was rendering after all, just not where I expected. Removing it from the spine did the trick.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.