Answers.Body: <p>The epub 3 toc.xhtml was created specifically to do away with the need to have separate logical and visual ToCs. Unfortunately, it's not quite there. As long as you're only interested in adding some styles to the text, though, you should be fine. Where you start to run into problems is if you want to have lots of other stuff going on in your ToC, like a number of images. Here's a quote from the <a href="http://www.idpf.org/epub/301/spec/epub-contentdocs.html#sec-xhtml-nav-def" rel="nofollow">relevant section</a> of the epub 3 spec:</p>
  
  <blockquote>
    <p>The optional heading must be followed by a single ol ordered list; no
    other elements are permitted as direct children of the nav element.
    This ordered list represents the primary level of content navigation.</p>
    
    <p>Each list item ( li ) of the ordered list represents a primary
    heading, structure or other point of interest within the EPUB
    Publication and must contain either a child a element or a child span
    element. The a element describes the target within the Content
    Document that the link points to. The span element serves as a heading
    for breaking down lists into distinct groups (for example, a large
    list of illustrations can be segmented into several lists, one for
    each chapter).</p>
  </blockquote>
  
  <p>So as long as all you're doing is enclosing parts of the list items in <code>&lt;span&gt;</code>s you'll be fine and won't need to create a separate visual ToC. If for some reason you do need to create a separate visual ToC, I would advise only including the visual one in the <code>&lt;spine&gt;</code>. The reading system will use as the logical ToC whichever file has <code>properties="nav"</code> declared in the <code>&lt;manifest&gt;</code>.</p>
  
  <p>As far as using <code>list=style-type: none;</code> goes: technically, you shouldn't need it, but it doesn't hurt at all to include it, and some reading systems will include numbers if you don't use it. So yes, by all means include that statement. It will cause no problems with KindleGen.</p>
  
  <p>Finally, the frustrating note: be sure that you also include an epub 2.0-style toc.ncx file. It's perfectly <a href="http://www.idpf.org/epub/301/spec/epub-publications.html#ncx-superseded" rel="nofollow">valid to do so</a> in epub 3.0, and it's the only way that epub 2.0 reading systems will be able to make use of your table of contents. Yes, this means that if you have a visual ToC separate from the logical toc.xhtml, you're now up to three tables of contents in your file.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-04-16T04:07:26.213Z
Answers.Text: Thanks so much for a very detailed answer Tom! Clears up a lot of things, including the .ncx part. So, I could just simply include css for the <li> tags in the list (the css for the <li> would work in kindle, right?). And a span element surrounding the <sup> tags (around text in the subheading) for it to work since no other tags except the ordered list tags are allowed. Also, I am fine with reading systems using numbers for the logical TOCs, but would they also include it for the TOC that appears to the user just after the cover page ? Thats the page I want to remove numbers from.
Answers.UserDisplayName: QPTR
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-04-16T18:41:20.190Z
Answers.Text: Applying CSS to the `<li>` elements in the `<nav>` should work just fine, yes, and will remove the numbers from the ToC after the cover page. The only devices you might run into problems with are the older eInk Kindles (the keyboard ones and the DX), which are very limited in styling. I've never tried `<sup>` in a ToC, so can't guarantee anything there.
Answers.UserDisplayName: Tom
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-04-18T06:39:21.973Z
Answers.Text: thanks Tom! I hope the problems that you say that may be encountered with the older eInk Kindles aren't the crashing sort.
Answers.UserDisplayName: QPTR
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-04-18T07:35:39.220Z
Answers.Text: No, not the crashing sort at all; more just the looking bad and potentially showing numbers in the ToC regardless of what you do sort.
Answers.UserDisplayName: Tom
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-04-15T16:56:51.070Z
Answers.LastActivityDate: 2014-04-15T16:56:51.070Z
Answers.UserDisplayName: Tom
Body: <p>I am trying to create an epub file (in epub 3), and will be using KindleGen to convert it into kindle's mobi format. At the moment I was working on the table of contents files, and there were a few things that I needed to ask, that I would be glad if someone were to answer. </p>
  
  <p>Firstly, I wanted to include superscripts and have different font styles and sizes for each subheading in the table of contents, is this possible in the logical TOC without all the botchings in different eReading devices, or should I create an html TOC for this purpose ? </p>
  
  <p>Secondly, after having created these two TOCs (if two are needed), should these both be included in the  tag ? How will the reader know which one is logical and which one is html (and hence shown to the reader at the beginning after the cover page) ?</p>
  
  <p>Thirdly, I am using 'list-style-type: none' in the epub css to remove numbers from the ordered list for epub's table of contents in the logical TOC. Is that acceptable for epub and kindle ? I looked up at some sample epub code, and they seem to have included it without any ill-effects. Tried to look up if Amazon allowed this property for kindle but didn't find any reference to it. So, is it an okay property to use ?</p>
  
Tags: <kindle><amazon><css>
Title: Formatting Table of Contents in epub using HTML TOC or Logical TOC and how to include TOCs in <spine>
UserDisplayName: QPTR
ThreadText: # Formatting Table of Contents in epub using HTML TOC or Logical TOC and how to include TOCs in <spine>
  
  (Asked by: username_0 on 2014-04-15)
  
  I am trying to create an epub file (in epub 3), and will be using KindleGen to convert it into kindle's mobi format. At the moment I was working on the table of contents files, and there were a few things that I needed to ask, that I would be glad if someone were to answer.
  
  Firstly, I wanted to include superscripts and have different font styles and sizes for each subheading in the table of contents, is this possible in the logical TOC without all the botchings in different eReading devices, or should I create an html TOC for this purpose ?
  
  Secondly, after having created these two TOCs (if two are needed), should these both be included in the tag ? How will the reader know which one is logical and which one is html (and hence shown to the reader at the beginning after the cover page) ?
  
  Thirdly, I am using 'list-style-type: none' in the epub css to remove numbers from the ordered list for epub's table of contents in the logical TOC. Is that acceptable for epub and kindle ? I looked up at some sample epub code, and they seem to have included it without any ill-effects. Tried to look up if Amazon allowed this property for kindle but didn't find any reference to it. So, is it an okay property to use ?
  
  **Tags:** kindle, amazon, css
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2014-04-15. Score: 3 | Accepted answer
  
  The epub 3 toc.xhtml was created specifically to do away with the need to have separate logical and visual ToCs. Unfortunately, it's not quite there. As long as you're only interested in adding some styles to the text, though, you should be fine. Where you start to run into problems is if you want to have lots of other stuff going on in your ToC, like a number of images. Here's a quote from the [relevant section](http://www.idpf.org/epub/301/spec/epub-contentdocs.html#sec-xhtml-nav-def) of the epub 3 spec:
  
  > The optional heading must be followed by a single ol ordered list; no
  > other elements are permitted as direct children of the nav element.
  > This ordered list represents the primary level of content navigation.
  >
  > Each list item ( li ) of the ordered list represents a primary
  > heading, structure or other point of interest within the EPUB
  > Publication and must contain either a child a element or a child span
  > element. The a element describes the target within the Content
  > Document that the link points to. The span element serves as a heading
  > for breaking down lists into distinct groups (for example, a large
  > list of illustrations can be segmented into several lists, one for
  > each chapter).
  
  So as long as all you're doing is enclosing parts of the list items in s you'll be fine and won't need to create a separate visual ToC. If for some reason you do need to create a separate visual ToC, I would advise only including the visual one in the . The reading system will use as the logical ToC whichever file has `properties="nav"` declared in the .
  
  As far as using `list=style-type: none;` goes: technically, you shouldn't need it, but it doesn't hurt at all to include it, and some reading systems will include numbers if you don't use it. So yes, by all means include that statement. It will cause no problems with KindleGen.
  
  Finally, the frustrating note: be sure that you also include an epub 2.0-style toc.ncx file. It's perfectly [valid to do so](http://www.idpf.org/epub/301/spec/epub-publications.html#ncx-superseded) in epub 3.0, and it's the only way that epub 2.0 reading systems will be able to make use of your table of contents. Yes, this means that if you have a visual ToC separate from the logical toc.xhtml, you're now up to three tables of contents in your file.
  
  > **Comments:**
  > **username_0**: Thanks so much for a very detailed answer username_1! Clears up a lot of things, including the .ncx part. So, I could just simply include css for the <li> tags in the list (the css for the <li> would work in kindle, right?). And a span element surrounding the <sup> tags (around text in the subheading) for it to work since no other tags except the ordered list tags are allowed. Also, I am fine with reading systems using numbers for the logical TOCs, but would they also include it for the TOC that appears to the user just after the cover page ? Thats the page I want to remove numbers from.  
  > **username_1**: Applying CSS to the `<li>` elements in the `<nav>` should work just fine, yes, and will remove the numbers from the ToC after the cover page. The only devices you might run into problems with are the older eInk Kindles (the keyboard ones and the DX), which are very limited in styling. I've never tried `<sup>` in a ToC, so can't guarantee anything there.  
  > **username_0**: thanks username_1! I hope the problems that you say that may be encountered with the older eInk Kindles aren't the crashing sort.  
  > **username_1**: No, not the crashing sort at all; more just the looking bad and potentially showing numbers in the ToC regardless of what you do sort.  
  
  ---
  
  