View Single Post
Old 03-24-2016, 08:30 PM   #1
morgon
Junior Member
morgon began at the beginning.
 
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]+$")]
And this works - all chapters are detected but the problem I am having is that each chapter is added to the TOC twice.

Why is that?

Can anybody suggest a solution so that each chapter only appears in the TOC once?

Many thanks!
morgon is offline   Reply With Quote