View Single Post
Old 08-03-2011, 03:35 PM   #3
PeterT
Grand Sorcerer
PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.
 
Posts: 13,565
Karma: 79436716
Join Date: Nov 2007
Location: Toronto
Device: Libra H2O, Libra Colour
Quote:
Originally Posted by Tearin de Hairou View Post
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:

Code:
}
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:

Code:
	 <p class="chapter">Body of Evidence</p>
The Structure Detection has this in its 'Detect chapters at (XPath expression):

Code:
//*[((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:

Code:
//h:p[re:test(@class, "chapter", "i")]
What am I doing wrong?

Thanks in advance for your help.
It helps to wrap stuff like that in [ CODE ] [ / CODE ] blocks.
PeterT is offline   Reply With Quote