Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Reply
 
Thread Tools Search this Thread
Old 07-20-2009, 04:13 PM   #1
ronin712
Junior Member
ronin712 began at the beginning.
 
Posts: 8
Karma: 10
Join Date: Jul 2009
Device: stanza
Problem generating TOC

Hi,

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.
ronin712 is offline   Reply With Quote
Old 07-20-2009, 04:26 PM   #2
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,826
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
try enabling the option to force use of auto generated TOC
kovidgoyal is online now   Reply With Quote
Advert
Old 07-20-2009, 04:40 PM   #3
ronin712
Junior Member
ronin712 began at the beginning.
 
Posts: 8
Karma: 10
Join Date: Jul 2009
Device: stanza
Quote:
Originally Posted by kovidgoyal View Post
try enabling the option to force use of auto generated TOC
Turned that on, still no TOC.
ronin712 is offline   Reply With Quote
Old 07-20-2009, 08:22 PM   #4
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,826
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Look at the conversion log to see why there is no TOC
kovidgoyal is online now   Reply With Quote
Old 07-20-2009, 10:07 PM   #5
ronin712
Junior Member
ronin712 began at the beginning.
 
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.
ronin712 is offline   Reply With Quote
Advert
Old 07-21-2009, 12:23 AM   #6
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,826
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
XPath supports regexp based matching on content read the Xpath tutorial in the User Manual
kovidgoyal is online now   Reply With Quote
Old 07-21-2009, 02:30 AM   #7
ronin712
Junior Member
ronin712 began at the beginning.
 
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')]
ronin712 is offline   Reply With Quote
Old 07-21-2009, 11:19 AM   #8
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,826
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
http://calibre.kovidgoyal.net/user_m...by-tag-content
kovidgoyal is online now   Reply With Quote
Old 07-21-2009, 03:25 PM   #9
ronin712
Junior Member
ronin712 began at the beginning.
 
Posts: 8
Karma: 10
Join Date: Jul 2009
Device: stanza
Quote:
Originally Posted by kovidgoyal View Post
Thanks for all your help by the way, I really appreciate it.

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. :-)
ronin712 is offline   Reply With Quote
Old 07-21-2009, 05:19 PM   #10
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,826
Karma: 22666666
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
kovidgoyal is online now   Reply With Quote
Old 09-06-2015, 11:50 PM   #11
DVK
Junior Member
DVK began at the beginning.
 
Posts: 1
Karma: 10
Join Date: Sep 2015
Device: kindle
Problem with edit toc

Hi Kovid and Fellows,

I'm trying to edit the table of contents of a document converted from docx to azw3, but nothing happens when the edition is complete: the respective html file remains the same and no change takes effect. However, the changes made still remain in the toc editor when the document (azw3) is reopened.
What happens?

Tank you

DVK
DVK is offline   Reply With Quote
Old 09-06-2015, 11:53 PM   #12
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,826
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
The table of contents you are editing is in the ncx file not the html file. HTML table of contents need to be edited manually.
kovidgoyal is online now   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

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


All times are GMT -4. The time now is 09:03 AM.


MobileRead.com is a privately owned, operated and funded community.