Thread: PDF TOC help
View Single Post
Old 03-14-2011, 04:23 PM   #3
Manichean
Wizard
Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.
 
Manichean's Avatar
 
Posts: 3,130
Karma: 91256
Join Date: Feb 2008
Location: Germany
Device: Cybook Gen3
You'll need to use the TOC option in the conversion options. The options expect an XPath expression to describe what chapter headings look like. You'll probably want to use somethig like the following:
Code:
Layer 1:
//h:p[re:test(., 'chapter', 'i')]
Layer 2:
//h:p[re:test(., 'chapter', 'i')]
Layer 3:
//h:p[re:test(., '[a-z]\.\s', 'i')]
(Note that these expressions may or may not work, they're mostly intended to get you started. There's a XPath tutorial available in case you need it. Also note that this might only work if there's no TOC already present- if there is, you'll need to force the use of the autogenerated TOC, see the TOC options page in the conversion options for that.)
Manichean is offline   Reply With Quote