View Single Post
Old 09-20-2010, 12:21 AM   #1
sherman
Addict
sherman is kind to children and small, furry animalssherman is kind to children and small, furry animalssherman is kind to children and small, furry animalssherman is kind to children and small, furry animalssherman is kind to children and small, furry animalssherman is kind to children and small, furry animalssherman is kind to children and small, furry animalssherman is kind to children and small, furry animalssherman is kind to children and small, furry animalssherman is kind to children and small, furry animalssherman is kind to children and small, furry animals
 
Posts: 262
Karma: 6566
Join Date: Aug 2008
Location: New Plymouth - NZ
Device: Sony PRS-505/SC, B&N Nook, Sony PRS-650/BC, Kobo Glo
Getting calibre to detect "Prologue" and "Epilogue" for TOC

By default, calibre does not detect the Prologue or Epilogue of a book while building a table of contents for the book during conversion.

To get calibre to detect the prologue and/or epilogue of a book, go to Preferences -> Conversion (Common Options) -> Structure Detection. In the Detect chapters at (XPath expression: box, change the text from
Code:
//*[((name()='h1' or name()='h2') and re:test(., 'chapter|book|section|part\s+', 'i')) or @class = 'chapter']
to
Code:
//*[((name()='h1' or name()='h2') and re:test(., 'prologue|epilogue|chapter|book|section|part\s+', 'i')) or @class = 'chapter']
.

Eg: add "prologue|epilogue|" (sans quotes" before the "chapter|book|section|part" part of the expression.

calibre should now detect any instances of prologue or epilogue in a book during conversion, and add entries to them in the calibre built table of contents (if an existing TOC isn't already being used of course).


@Kovid: Is there a reason why calibre does not detect the prologue and/or epilogue of a book during structure detection? If there isn't a reason (or you just didn't think of it), is it possible to change this in future builds of calibre?
sherman is offline   Reply With Quote