Answers.Body: <p>My toc.xhtml <em>was</em> rendering after all, just not where I expected. Removing it from the spine did the trick.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-08-26T04:52:46.803Z
Answers.LastActivityDate: 2021-08-26T04:52:46.803Z
Answers.UserDisplayName: Dennis Hackethal
Answers.Body: <p>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.</p>
  <p>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:</p>
  <pre><code>DIV class=&quot;toc&quot;
  &lt;nav epub:type=&quot;toc&quot;&gt;
  (ordered list using html list elements)
  &lt;/ol&gt;
  &lt;/nav&gt;
  ...
  &lt;/body&gt;
  </code></pre>
  <p>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.</p>
  <p>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.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-08-23T17:39:53.330Z
Answers.LastActivityDate: 2021-08-23T17:39:53.330Z
Answers.UserDisplayName: idiotprogrammer
Body: <p>I have an epub 3 that I want to be backwards compatible for older e-readers that expect an epub 2.</p>
  <p>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.</p>
  <p>It seems to me I have two options:</p>
  <ol>
  <li>Somehow tell older e-readers to <em>ignore</em> the toc.xhtml file so they don't render it (this is preferred)</li>
  <li>Somehow tell newer e-readers to <em>render</em> 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)</li>
  </ol>
  <p><a href="https://electricbookworks.github.io/ebw-training/making-ebooks/text/6-contents.html" rel="nofollow noreferrer">This article</a> says that including the toc.xhtml file in the spine would render it, but that is not the case for me.</p>
  <p>How do I do either one of the two options above?</p>
  
Tags: <epub><ebook-readers>
Title: How to hide toc.xhtml in epub 2
UserDisplayName: Dennis Hackethal
ThreadText: # How to hide toc.xhtml in epub 2
  
  (Asked by: username_0 on 2021-08-18)
  
  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](https://electricbookworks.github.io/ebw-training/making-ebooks/text/6-contents.html) 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?
  
  **Tags:** epub, ebook-readers
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_0 on 2021-08-26. Score: 0 | Accepted answer
  
  My toc.xhtml *was* rendering after all, just not where I expected. Removing it from the spine did the trick.
  
  
  ---
  
  ### Answer by username_1 on 2021-08-23. Score: 0
  
  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)
  </ol>
  </nav>
  ...
  </body>
  
  ```
  
  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.
  
  
  ---
  
  