View Single Post
Old 07-07-2012, 12:54 PM   #13
st_albert
Guru
st_albert gives new meaning to the word 'superlative.'st_albert gives new meaning to the word 'superlative.'st_albert gives new meaning to the word 'superlative.'st_albert gives new meaning to the word 'superlative.'st_albert gives new meaning to the word 'superlative.'st_albert gives new meaning to the word 'superlative.'st_albert gives new meaning to the word 'superlative.'st_albert gives new meaning to the word 'superlative.'st_albert gives new meaning to the word 'superlative.'st_albert gives new meaning to the word 'superlative.'st_albert gives new meaning to the word 'superlative.'
 
Posts: 696
Karma: 150000
Join Date: Feb 2010
Device: none
Quote:
Originally Posted by Tulpana View Post
I have read as much of this thread as I can understand (and I have edited .Epubs with Sigil for approximately nine months). I have never been able to generate a TOC.

I do not know HTML. My .Epub file was generated by Calibre from a Microsoft Word .xhtml document. I have no problems with any other feature of Sigil, except this.

If anyone can tell me what I'm doing wrong, I'd be very grateful. (FWIW, I have tried clicking on the "Generate TOC from Headings," but I don't know what "Headings" means in the context of Sigil. I assume "Headings" means the various sections of the .epub file created when a Chapter Break is made.)
A few points:

1) I don't mean to sound snippy, really I don't, but if you're going to be editing epubs in Sigil, you really should make the effort to learn at least a little (x)html. There are tutorials here, as well as reference pages on the various elements of HTML and CSS and their syntax.

2) re: generating a TOC in Sigil. In Sigil, the "Generate TOC from Headings" button will generate the file "toc.ncx", which is the epub table of contents, based on heading tags in the xhtml files which constitute the body of the book. (i.e. <h1>, <h2>, etc.). NB: Sigil responds ONLY to HEADING tags, so if your chapter headers are coded some other way (a styled <p> tag for example) they won't show up in the TOC. After completion, the right-hand column, "Table of Contents" should be filled out. That's all there is to it.

3) There is also another kind of "Table of Contents" which is often referred to as an "in-line" table of contents, which consists of an xhtml file just like all the other xhtml files containing text of the book (hence "in-line"). This file contains hyperlinks to targets within the text of the book, such that when you click on "Chapter 3" in the inline TOC you jump to wherever that link points (hopefully to the start of chapter 3). In an epub, the inline TOC is not needed (its function duplicates that of toc.ncx). But some people, for various reasons, prefer to have one anyway. And if you're intending to use the epub as source code for conversion to mobi (kindle), it is essential to have it, IMHO.

4) In your initial conversion via Calibre, you can have Calibre create both the inline TOC and the toc.ncx (it should do the latter regardless). You can "teach" Calibre how to recognize chapter headers via changing options in the conversion process. (solution is left to the student.)

HTH

Albert
st_albert is offline   Reply With Quote