View Single Post
Old 08-03-2011, 01:57 PM   #1
Tearin de Hairou
Junior Member
Tearin de Hairou began at the beginning.
 
Posts: 9
Karma: 10
Join Date: Aug 2011
Device: Kindle
Table of contents doesn't work for me

Thanks for this great forum.

I'm having trouble getting a table of contents when outputting a .mobi from an html file in Calibre. I've set a chapter style like this:

}
p.chapter
{
text-indent: 1em;
font-weight: bold;
font-size: 1.2em;
margin-top: 2em;
margin-bottom: 1em;
page-break-before: always;

and wrapped the chapter headings like this:

<p class="chapter">Body of Evidence</p>

The Structure Detection has this in its 'Detect chapters at (XPath expression):

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

In the Table of Contents icon's dialogue, I've left 'Force use of auto-generated Table of Contents' unchecked, and in its 'Level 1 TOC (XPath expression)' field I've added:

//h[re:test(@class, "chapter", "i")]

What am I doing wrong?

Thanks in advance for your help.
Tearin de Hairou is offline   Reply With Quote