View Single Post
Old 12-19-2011, 09:20 AM   #1
Streadmob
Member
Streadmob began at the beginning.
 
Posts: 17
Karma: 10
Join Date: Dec 2011
Device: none
metadata TOC from html

I was so delighted to discover Calibre! I’d just recovered from wasting half an evening with eCub :-( .

I’ve managed to get NeoOffice to compile my 2-level “content” TOC.

It’s in this format:

1.1 Thing at the Start
1.2 Whatever Comes Next
1.2.1 First bit of second Section
1.2.2 And Afterwards Here
1.3 This is the Third
1.4 And So On

(except NeoOffice puts a hefty indent in front of the 1.2.1, 1.2.2 (i.e. level 3 in my scheme) headings.)

I soon found out .odt files did not have the TOC recognised by Calibre so I got NeoOffice to output as .html (actually xhtml, or possibly just html since the file appeared with the extension .html).

The TOC is recognised and a metadata TOC is set up, but only the title. In other words:

1.1 Thing at the Start

When asking Calibre to convert from html to mobi, I do enter //h:h1 , //h:h2 , & //h:h3 in the TOC screen. I found this was necessary to get any metadata TOC to appear. (Actually I don’t use level 1 headings at the moment, only 2 & 3.) I’m using 50 & 6 as the top two parameters on that screen, and I don’t think I exceeded 6.

On the Structure Detection screen I’ve inserted or name()='h3' into the middle field to see if it helps but it makes no difference.

I can’t understand why it hasn’t been made easier to get Calibre to spot the “h2”s, “h3”s etc in the apt place in the html TOC and simply include them in the metadata TOC. What could be more elementary? All the conditions searching for content in the “Detect Chapters at (XPath expression)” on the Structure Detection screen could then be dropped.

If anyone has any idea how to get this to work I’d appreciate the advice.

Also, if anyone knows how to get NeoOffice to remove the stupid “1.” from the number at the start of each heading when using automatic numbering, making it numerate as:

1 Thing at the Start
2 Whatever Comes Next
2.1 First bit of second Section
2.2 And Afterwards Here
3 This is the Third
4 And So On

...I’d also appreciate it! This seems the sensible basic thing people would normally want but it seems necessary to code the numbers by hand to get it.
Streadmob is offline   Reply With Quote