Quote:
Originally Posted by Dillinquent
1. Use the heading (<h1>, <h2>,...etc.) tags for your chapter headings. In Sigil you just highlight the text you want as your chapter heading and select the required heading from the dropdown box.
2. Go to Tools/TOC editor and you will see your headings as TOC entries. Deselect any entries you don't want showing in the TOC.
* The TOC compiler is hierarchical, so an <h2> won't show if there's not an <h1> before it, for example.
The TOC listing can be different to the heading if you use a title attribute in the <h> tag.
Quote from Sigil FAQ:-
|
You have basically hit the nail on how to do the ToC. But it is not hierarchical. When I make the ToC in my books, I usually use <h3></h3> for the chapter headings. IF you do not have a <h1></h1> or <h2></h2> before it, <h3> will still work. I mainly use <h1> for the physical ToC if you want one to show up with it also linking to the chapters of the book as well as it showing up in the invisible ToC ( the one the book actually reads and is saved inside the ePub for when you move the book over or transfer to a different type of file). As for <h2>, I usually use them fore Acknowledgments, dedications, etc. Those sorts of pages in the book. But again, they do not have to be used for you to use a heading higher than that.
Also, if you have books that have words as the chapter name instead of just "Chapter 1," you can go in and add a blank space at the top of the chapters as well like so in Code Edit Mode:
Code:
<div style="display:none">
<h3> Chapter 1</h3>
</div>
<div style="display:none">
<h3>Chapter 2 </h3>
</div>
And so forth...
I use that very often when I want to make the chapter text to show up in the ToC, but not on the page. This way, I can make the chapter text whatever I want it to be as it is not being linked at all, just regular words with extra formatting to them.
Also, on the code above, I don't know how mobi will handle it, so I will not guarantee that it will still be hidden when you convert the ePub to another format. It might show up in mobi, it might stay the way it was formatted to be, I don't know.
Hope all of this helps a little bit. CHEERS
P.S. Reason why I use <h3> is cause the other 2 before it are to big for my liking. I like my words to be a little bigger than the words in the chapter themselves, unless I'm adding a graphic under the chapter title, Then I make them however big they need to be to match the size of the graphic.