Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Reply
 
Thread Tools Search this Thread
Old 08-07-2009, 01:20 AM   #1
Achilles
Enthusiast
Achilles began at the beginning.
 
Posts: 27
Karma: 32
Join Date: Aug 2009
Device: Kindle 2
Unhappy TOC created with EPUB but not LRF?

OK, this is driving me bananas. I've spent the past two days off and on trying to clean up some RTF books into html and then convert them to LRF for viewing on my PRS-505. I've saved the RTF out to html using the microsoft word "filtered html" option and then run it through HTML tidy to clean things up. I've then created an XPath expression to detect my chapters, it looks like this:

Code:
//*[((@class = 'c1') and re:test(., 'chapter|book|section|part\s+', 'i')) or @class = 'chapter']
Now, the screwy thing is that when I convert to EPub the chapter detection works great and a TOC is created. When I convert to LRF, however, no TOC is created even though the log file says that it's detecting chapters. I've got "Force use of auto-generated Table of Contents" checked, but it's not working. Does anyone have any suggestions? Let me know what other information you'd need to diagnose the problem. Thanks in advance people!
Achilles is offline   Reply With Quote
Old 08-07-2009, 02:08 AM   #2
Achilles
Enthusiast
Achilles began at the beginning.
 
Posts: 27
Karma: 32
Join Date: Aug 2009
Device: Kindle 2
Unhappy

OK, shedding some more light on the subject... my chapter headings are inside <span></span> tags... when I manually remove them and put them in <p></p> tags, the TOC is created correctly... I really don't want to go in and manually reformat 7 books worth of chapter headings though...
Achilles is offline   Reply With Quote
Advert
Old 08-07-2009, 01:10 PM   #3
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: 44,551
Karma: 24495948
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
This is with what version of calibre?
kovidgoyal is offline   Reply With Quote
Old 08-07-2009, 01:47 PM   #4
Achilles
Enthusiast
Achilles began at the beginning.
 
Posts: 27
Karma: 32
Join Date: Aug 2009
Device: Kindle 2
Hi kovidgoyal, thanks for responding! (You the man by the way...) This is with the latest version 0.6.5. I've attached a trimmed-down version of what I'm trying to get to work, perhaps it'll help.
Attached Files
File Type: zip trimmedtest.zip (4.2 KB, 293 views)
Achilles is offline   Reply With Quote
Old 08-07-2009, 04:09 PM   #5
ilovejedd
hopeless n00b
ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.
 
ilovejedd's Avatar
 
Posts: 5,110
Karma: 19597086
Join Date: Jan 2009
Location: in the middle of nowhere
Device: PW4, PW3, Libra H2O, iPad 10.5, iPad 11, iPad 12.9
Quote:
Originally Posted by Achilles View Post
OK, this is driving me bananas. I've spent the past two days off and on trying to clean up some RTF books into html and then convert them to LRF for viewing on my PRS-505. I've saved the RTF out to html using the microsoft word "filtered html" option and then run it through HTML tidy to clean things up.
Just a comment. If you're using Tidy, it seems to work much better if you save as HTML (in its whole tag-soup mess glory) and not as filtered HTML. I was doing something similar last night on OCR'ed text (using the built-in function in Notepad++) and I noticed Tidy was able to clean the "messy" HTML much better as opposed to the filtered HTML.
ilovejedd is offline   Reply With Quote
Advert
Old 08-07-2009, 04:26 PM   #6
Achilles
Enthusiast
Achilles began at the beginning.
 
Posts: 27
Karma: 32
Join Date: Aug 2009
Device: Kindle 2
Quote:
Originally Posted by ilovejedd View Post
Just a comment. If you're using Tidy, it seems to work much better if you save as HTML (in its whole tag-soup mess glory) and not as filtered HTML. I was doing something similar last night on OCR'ed text (using the built-in function in Notepad++) and I noticed Tidy was able to clean the "messy" HTML much better as opposed to the filtered HTML.
Thanks, I'll give that a try and see if the HTML winds up being cleaner... I don't think it'll solve this problem though...
Achilles is offline   Reply With Quote
Old 08-07-2009, 08:05 PM   #7
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: 44,551
Karma: 24495948
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
That's because the HTML to LRF conversion doesn't support anchors on inline elements like <span>
kovidgoyal is offline   Reply With Quote
Old 08-07-2009, 08:24 PM   #8
Achilles
Enthusiast
Achilles began at the beginning.
 
Posts: 27
Karma: 32
Join Date: Aug 2009
Device: Kindle 2
So I need to get rid of all my <span> elements? That'll be fun... here I was hoping to keep the formatting of this book as close as possible to the original...
Achilles is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
TOC not showing in eBook created by InDesign gabrieleale Sony Reader 0 07-30-2010 05:02 PM
505 TOC from PDF to EPUB/LRF wayamauro Sony Reader 18 09-27-2009 05:21 AM
TOC not created converting from FB2 regul8or Calibre 1 08-03-2009 01:26 PM
Making a TOC for LRFs? Issues with Calibre + LRF TOC editor not working Magitek LRF 0 05-06-2009 02:25 PM
TOC in LRF sAGV Sony Reader 14 12-18-2007 11:50 AM


All times are GMT -4. The time now is 12:38 PM.


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