03-24-2016, 08:30 PM | #1 |
Junior Member
Posts: 3
Karma: 10
Join Date: Sep 2015
Device: none
|
Help with chapter detection
Hi,
I try to convert a rtf to epub and would like calibre to detect the chapters by regex. The chapters are easily identified by starting with the chapter number, then a dot, followed by the chapter name in captitals (apart from A-Z the only character appearing in chapter names is an apostrophe. So I use this: Code:
//*[re:test(., "^\d+\. [ 'A-Z]+$")] Why is that? Can anybody suggest a solution so that each chapter only appears in the TOC once? Many thanks! |
03-24-2016, 10:30 PM | #2 |
Well trained by Cats
Posts: 29,800
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
do you already have an inline TOC?
|
Advert | |
|
03-25-2016, 11:14 PM | #3 | |
Junior Member
Posts: 3
Karma: 10
Join Date: Sep 2015
Device: none
|
I managed to work around it by having a look at the debug-logs.
It seems that calibre converts input-files into an intermediate xhtml-format to which the xpath-selectors refer. In my case I found that all the chapter-headings from the input-rtf where rendered as h1-tags, so I changed the selector to: Quote:
Unfortunately I still don't understand why the chapters appear twice with the above selector.... Oh well... |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Help with Chapter detection | ubergeeksov | Calibre | 0 | 09-02-2010 04:56 AM |
xpath for chapter detection | romnempire | Calibre | 7 | 07-26-2010 05:34 PM |
chapter detection in any book | yuki86 | Calibre | 9 | 05-06-2009 06:54 AM |
Chapter detection for LRF | HenryP | Calibre | 12 | 04-03-2009 08:22 AM |
Cant find help for chapter detection | fallwood | Calibre | 6 | 12-10-2008 01:20 PM |