View Single Post
Old 12-23-2011, 03:51 PM   #3
Streadmob
Member
Streadmob began at the beginning.
 
Posts: 17
Karma: 10
Join Date: Dec 2011
Device: none
Hi George –

Thanks for getting back!

Looking through your reply, I started on:
“1. Check the links in your toc.html (either to separate files or to anchors)”

I don’t have a toc.html file. I didn’t have one when I was working a couple of days ago, but I still at least managed to get a single line table of contents. As I understood it, all you needed was a single html file exported from your wordprocessor. However, today I checked for h2 and h3 in the html file that I used before. h2 was there (and this became the single line of the table of contents) but h3 wasn’t (except for an introductory mention covering about the top six levels).

I suspected it was because I had been experimenting with heading numbering etc, so I restarted from fresh, and this time the html file DID include h3 mentions, e.g.:

<h3 class="Heading_20_3"><a name="2.1 First bit of second Section"><span/></a>2.1 First bit of second Section</h3>

I then carefully logged all my actions throughout the Calibre process:

Structure Detection window:

Detect chapters at:
I added mentions for h3 in case it made any difference:

//*[((name()='h1' or name()='h2' or name()='h3') and re:test(., '\s*((chapter|book|section|part)\s+)|((prolog|prol ogue|epilogue)(\s+|$))', 'i')) or @class = 'chapter']


Insert page breaks before (XPath expression):
Again, I added mentions for h3 in case it made any difference:

//*[name()='h1' or name()='h2' or name()='h3']

Table of Contents:

Force use of auto-generated table of contents box checked.

Level 1 TOC (XPath expression)
//h:h1

Level 2 TOC (XPath expression)
//h:h2

Level 3 TOC (XPath expression)
//h:h3

Result:
Although the correct Table of Contents is inserted at the start of the text of the book, as displayed by Kindle Reader for Mac and Kindle Previewer, no table of contents appears now (a couple of days before, at least I got the one-line table in both programs, so I’ve gone backwards).

(What gets me is that the production of the TOC as a separate entity should be the DEFAULT. And when you have requested a separate TOC, the program should DETECT the point at which its production failed, REPORT to the user where and why it failed, and suggest changes that would be SUFFICIENT to produce a table, according to the specific conditions :-( .)

Thanks for your later advice, George. The first part of it refers to toc.[...] files, which I didin’t think I needed to input to Calibre, and weren’t needed a couple of days ago for a (one line) TOC. I’ll study the other bits when I’ve got the TOC working.

If you or anyone else can tell from my log what else was needed, I’d be very appreciative, and probably also produce a detailed guide as to how to get the thing to work from NeoOffice.

Cheers!
Streadmob is offline   Reply With Quote