Quote:
Originally Posted by banjobama
... I was hoping it would be similar to Word, which will generate a table of contents for you. I made all the story names in a header format, then Word detects those and automatically makes a ToC to link back to the page. It looks like there's a way to have Calibre detect headings in that same kind of way but I don't know how to make it do that.
|
If you have your source ebook in MSWord then you can use this approach for a simple single-level TOC:-
- Apply Word built-in style "Heading 2" to each story heading
- Save-As Webpage-filtered. This will convert your ebook to HTML format and each story heading will be enclosed in <h2>...</h2> tags.
- Import the HTML book into Calibre, which will zip up your HTML and any associated images into a .zip file.
- Convert book from ZIP to EPUB.
In [Convert] - [Structure Detection] set "Detect chapters at" to //h:h2
In [Convert] - [Table of Contents] set "Level 1 TOC" to //h:h2
- This will create an EPUB with a TOC with one entry per story. The TOC will not be seen in the book as part of the text but will be available on your Sony Reader when you choose the TOC menu item. The TOC is also accessible if you open the EPUB in Calibre's ebook viewer and press the TOC button.
Once you get the hang of a single-level TOC you can experiment with a 2-level TOC.
Proceed as before with the following additions:-
In 1/2 above, style each chapter heading within each story as built-in style "Heading 3"
When you Save-As Webpage-filtered each chapter heading will be wrapped in <h3>...</h3> tags.
In 4. above:
[Convert] - [Structure Detection] change "Detect chapters at" to
//*[name()='h2' or name()='h3']
[Convert] - [Table of Contents] add "Level 2 TOC" to
//h:h3
The resulting EPUB will have a nested 2-level TOC
+Story 1
Chapter 1
Chapter 2
...
+Story 2
Chapter 1
Chapter 2
...