|
|
#1 |
|
Junior Member
![]() Posts: 8
Karma: 10
Join Date: Jul 2009
Device: stanza
|
Problem generating TOC
I've having trouble getting calibre to generate the table of contents converting from an rtf file to a epub. It's correctly detecting the chapters because if I open the epub file, i have a separate index_split_X.html/xhtml file for each one. But the table of contents button in calibre reader is disabled and the toc.ncx has an empty navMap. I've tried setting the chapter threshold to more chapters than the book has in the conversion settings, but that didn't help. Searched the user manual, the FAQ, Google, and this forum, but I've come up empty. What could I be missing? I've tried 0.5.14 and 0.6.0b15. Thanks. |
|
|
|
|
|
#2 |
|
Creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 22,473
Karma: 2944574
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
try enabling the option to force use of auto generated TOC
__________________
Get calibre Notice to all: I can not provide assistance with DRM removal, for legal reasons, so please do not contact me about it. |
|
|
|
|
Enthusiast
|
|
|
|
#3 |
|
Junior Member
![]() Posts: 8
Karma: 10
Join Date: Jul 2009
Device: stanza
|
|
|
|
|
|
|
#4 |
|
Creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 22,473
Karma: 2944574
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Look at the conversion log to see why there is no TOC
__________________
Get calibre Notice to all: I can not provide assistance with DRM removal, for legal reasons, so please do not contact me about it. |
|
|
|
|
|
#5 |
|
Junior Member
![]() Posts: 8
Karma: 10
Join Date: Jul 2009
Device: stanza
|
Ok, my fault. I was misunderstanding how it detects chapters. I'm still learning how the tool works. :-)
Is it possible to specify a regex instead of a xpath? For example, I'd like detect chapters with a regex like /^Chapter [0-9]*$/. This would save me from having to go into every file i want to convert and manually setting styles. |
|
|
|
|
|
#6 |
|
Creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 22,473
Karma: 2944574
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
XPath supports regexp based matching on content read the Xpath tutorial in the User Manual
__________________
Get calibre Notice to all: I can not provide assistance with DRM removal, for legal reasons, so please do not contact me about it. |
|
|
|
|
|
#7 |
|
Junior Member
![]() Posts: 8
Karma: 10
Join Date: Jul 2009
Device: stanza
|
Thanks a lot for your help.
I understand xpaths, but I don't know how you apply them to a rtf file. Is that documented somewhere? All the chapters in my rtf file start with a line that says "Chapter 1", etc. Just experimenting, I tried the following xpath, but it throws a conversion error if I use a star instead of a specific tag. But if I give it a specific tag, it doesn't work (since I have no idea what tag matches an arbitrary line of text). //*[re:test(., 'chapter [0-9]*', 'i')] |
|
|
|
|
|
#8 |
|
Creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 22,473
Karma: 2944574
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
__________________
Get calibre Notice to all: I can not provide assistance with DRM removal, for legal reasons, so please do not contact me about it. |
|
|
|
|
|
#9 | |
|
Junior Member
![]() Posts: 8
Karma: 10
Join Date: Jul 2009
Device: stanza
|
Quote:
I probably should have mentioned that I read the XPath tutorial the first time you pointed me to it. I had originally overlooked it because I thought it was something that only applied to html/xml, and I had a rtf file. I still haven't come across any docs on how to apply an XPath to rtf (e.g. what's the structure and tag/attribute names as they relate to XPath?). In the XPath tutorial, under "Selecting by tag content", the example is only looking at h2 tags. How do you look at lines that have no style applied? If I try to use a '*' instead of h2, I get a conversion error. Thanks again for your help. :-) |
|
|
|
|
|
|
#10 |
|
Creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 22,473
Karma: 2944574
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
calibre converts every input format internally to HTML. The HTML is then converted to the output format. All content will be in some tag or the other, you just have to figure out what tagit is. You can do that easily enough by converting to epub, unzipping the epub and looking at the HTML
__________________
Get calibre Notice to all: I can not provide assistance with DRM removal, for legal reasons, so please do not contact me about it. |
|
|
|
![]() |
| Thread Tools | Search this Thread |
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Problem with TOC | bobcdy | Sigil | 3 | 07-23-2010 04:09 PM |
| Generating TOC entries for prelims / end matter in InDesign | forlor | ePub | 7 | 07-07-2010 08:26 AM |
| Trouble generating a TOC | foghat | Calibre | 2 | 05-07-2010 06:00 PM |
| Problem with TOC | Soxendom | OpenInkpot | 4 | 10-28-2009 01:47 PM |
| Problem with TOC | Soxendom | Calibre | 2 | 10-28-2009 12:12 PM |