Answers.Body: <p>Both <a href="http://code.google.com/p/sigil/" rel="nofollow noreferrer">Sigil</a> and <a href="http://calibre-ebook.com/" rel="nofollow noreferrer">Calibre</a> can edit or create a TOC for <code>.epub</code> books.</p>
  <p>In Sigil, once you have opened your ebook, press <kbd>Ctrl</kbd>+<kbd>T
  </kbd>, and you will open a window where you can generate the TOC from the various <code>h1</code>, <code>h2</code>, <code>h3</code> (and so on) tags, you can manually select how deep to go in the header hierarchy.</p>
  <p>Inside Calibre, select the ebook, press <kbd>K</kbd>, and you will get another window that will let you do something similar, but you have some more options compared to Sigil, for example you can generate entries not only from html headings but also from single files inside the <code>.epub</code>, rearranging the list and the hierarchy, and so on. It's simplier to do it than to explain it.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2013-12-22T18:51:25.893Z
Answers.Text: Is the TOC just a bunch of links (e.g. same as creating one by hand for HTML document) or an actual TOC markup?
Answers.UserDisplayName: DVK
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2013-12-22T19:57:35.690Z
Answers.Text: @DVk that should be a separate question
Answers.UserDisplayName: mmmmmm
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2013-12-22T21:48:52.470Z
Answers.Text: It's a special XML file. As Mark suggest, maybe this could be asked in a new question, where I can answer to you in more detail. Also see here http://ebooks.stackexchange.com/questions/192/how-is-an-epub-structured-internally
Answers.UserDisplayName: Sekhemty
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2013-12-22T18:17:25.680Z
Answers.LastActivityDate: 2022-12-27T23:28:51.077Z
Answers.LastEditDate: 2022-12-27T23:28:51.077Z
Answers.UserDisplayName: Sekhemty
Body: <p>Some text editors (e.g. MS Word, or Atlassian Confluence Wiki editor) make it trivial to add a table of contents to a text that was properly formatted (e.g. has headings/chapter titles), by merely doing a single "insert table of contents" operation, as opposed to manually creating all the links - and the TOC can be easily refreshed as the text structure changes.</p>
  
  <p>Is there such a capability for EPUB books?</p>
  
  <ul>
  <li><p>Is there a TOC concept in the format specification itself?</p></li>
  <li><p>If so, does at least one popular EPUB editing software support that concept, including refreshing TOC to reflect text structure changes?</p></li>
  </ul>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2013-12-22T15:30:30.097Z
Comments.Text: If the HTML files in the EPUB are using consistent styles/tags (e.g. H1, H2) for section headers, then generating an TOC can be done with a very simple program, outside of the EPUB generation software.
Comments.UserDisplayName: Anthon
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2013-12-22T17:08:30.247Z
Comments.Text: @Anthon - in the scope of this question, DIY wasn't really considered. If the answer is "no", i'll probably ask DIY as a follow up
Comments.UserDisplayName: DVK
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2013-12-22T18:07:27.233Z
Comments.Text: that is what I thought, that is why I posted as a comment, not as an answer. But it is of course an option with any program that provides consistent structure without explicit generation of a ToC.
Comments.UserDisplayName: Anthon
Tags: <epub><hyperlinking><table-of-contents>
Title: How easy is it to add a table of contents to an epub book?
UserDisplayName: DVK
ThreadText: # How easy is it to add a table of contents to an epub book?
  
  (Asked by: username_0 on 2013-12-22)
  
  Some text editors (e.g. MS Word, or Atlassian Confluence Wiki editor) make it trivial to add a table of contents to a text that was properly formatted (e.g. has headings/chapter titles), by merely doing a single "insert table of contents" operation, as opposed to manually creating all the links - and the TOC can be easily refreshed as the text structure changes.
  
  Is there such a capability for EPUB books?
  
  * Is there a TOC concept in the format specification itself?
  * If so, does at least one popular EPUB editing software support that concept, including refreshing TOC to reflect text structure changes?
  
  **Tags:** epub, hyperlinking, table-of-contents
  
  > **Comments:**
  > **username_1**: If the HTML files in the EPUB are using consistent styles/tags (e.g. H1, H2) for section headers, then generating an TOC can be done with a very simple program, outside of the EPUB generation software.  
  > **username_0**: @username_1 - in the scope of this question, DIY wasn't really considered. If the answer is "no", i'll probably ask DIY as a follow up  
  > **username_1**: that is what I thought, that is why I posted as a comment, not as an answer. But it is of course an option with any program that provides consistent structure without explicit generation of a ToC.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_2 on 2013-12-22. Score: 6
  
  Both [Sigil](http://code.google.com/p/sigil/) and [Calibre](http://calibre-ebook.com/) can edit or create a TOC for `.epub` books.
  
  In Sigil, once you have opened your ebook, press `Ctrl`+`T`, and you will open a window where you can generate the TOC from the various `h1`, `h2`, `h3` (and so on) tags, you can manually select how deep to go in the header hierarchy.
  
  Inside Calibre, select the ebook, press `K`, and you will get another window that will let you do something similar, but you have some more options compared to Sigil, for example you can generate entries not only from html headings but also from single files inside the `.epub`, rearranging the list and the hierarchy, and so on. It's simplier to do it than to explain it.
  
  > **Comments:**
  > **username_0**: Is the TOC just a bunch of links (e.g. same as creating one by hand for HTML document) or an actual TOC markup?  
  > **username_3**: @DVk that should be a separate question  
  > **username_2**: It's a special XML file. As Mark suggest, maybe this could be asked in a new question, where I can answer to you in more detail. Also see here http://ebooks.stackexchange.com/questions/192/how-is-an-epub-structured-internally  
  
  ---
  
  