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 08-01-2009, 07:10 AM   #1
pepak
Fanatic
pepak has a spectacular aura aboutpepak has a spectacular aura aboutpepak has a spectacular aura aboutpepak has a spectacular aura aboutpepak has a spectacular aura aboutpepak has a spectacular aura aboutpepak has a spectacular aura aboutpepak has a spectacular aura aboutpepak has a spectacular aura aboutpepak has a spectacular aura aboutpepak has a spectacular aura about
 
Posts: 594
Karma: 4150
Join Date: Mar 2008
Device: Sony Reader PRS-505
Too many chapters with 0.6

For some reason I can't figure out the proper sequence of command-line parameters that would achieve my goals:

1) Only H2 and H3 tags are considered for chapters.
2) These tags must have class starting with either "part" or "chapter".
3) Nothing else is a chapter.
4) Page-breaks occur before any H2, but nowhere else.

I thought these parameters would do the trick:
Code:
--no-chapters-in-toc
--chapter="//*[re:test(name(), '^h[23]', 'i') and re:test(@id, '^(chapter|part)', 'i')]"
--chapter-mark=pagebreak
--page-breaks-before=//h2
--level1-toc=//h2
--level2-toc=//h3
It almost works, but goal #3 gives me trouble: If a book contains intra-document links (which I use for footnotes), they ALSO get added to the TOC. I thought that --no-chapters-in-toc would take care of that, but apparently that is not the case. What other option should I use then?
pepak is offline   Reply With Quote
Old 08-01-2009, 11:01 AM   #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: 25,395
Karma: 4961459
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Change --level1-toc to //h:h2 and --level2-toc to //h:h3
Put --chapter-mark none
--page-break-before //h:h2

In 0.6 you have to prefix html tags with the h: namespace
kovidgoyal is offline   Reply With Quote
 
Enthusiast
Old 08-01-2009, 11:31 AM   #3
pepak
Fanatic
pepak has a spectacular aura aboutpepak has a spectacular aura aboutpepak has a spectacular aura aboutpepak has a spectacular aura aboutpepak has a spectacular aura aboutpepak has a spectacular aura aboutpepak has a spectacular aura aboutpepak has a spectacular aura aboutpepak has a spectacular aura aboutpepak has a spectacular aura aboutpepak has a spectacular aura about
 
Posts: 594
Karma: 4150
Join Date: Mar 2008
Device: Sony Reader PRS-505
Thanks.

I assume the h: prefix applies to my --chapter, too. Correct?
pepak is offline   Reply With Quote
Old 08-01-2009, 11:48 AM   #4
pepak
Fanatic
pepak has a spectacular aura aboutpepak has a spectacular aura aboutpepak has a spectacular aura aboutpepak has a spectacular aura aboutpepak has a spectacular aura aboutpepak has a spectacular aura aboutpepak has a spectacular aura aboutpepak has a spectacular aura aboutpepak has a spectacular aura aboutpepak has a spectacular aura aboutpepak has a spectacular aura about
 
Posts: 594
Karma: 4150
Join Date: Mar 2008
Device: Sony Reader PRS-505
Unfortunately, it didn't help. I still keep getting links to footnotes in my TOC. And, I have just noticed, even H2 without chapter/part are included :-(
pepak is offline   Reply With Quote
Old 08-01-2009, 11:58 AM   #5
pepak
Fanatic
pepak has a spectacular aura aboutpepak has a spectacular aura aboutpepak has a spectacular aura aboutpepak has a spectacular aura aboutpepak has a spectacular aura aboutpepak has a spectacular aura aboutpepak has a spectacular aura aboutpepak has a spectacular aura aboutpepak has a spectacular aura aboutpepak has a spectacular aura aboutpepak has a spectacular aura about
 
Posts: 594
Karma: 4150
Join Date: Mar 2008
Device: Sony Reader PRS-505
Apparently I needed to add:
Code:
--max-toc-links=0
--toc-threshold=0
pepak is offline   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
Joining chapters afv011 Sigil 2 06-25-2010 07:11 PM
how to make chapters? rysiu Calibre 9 05-31-2010 10:28 AM
ePub Chapters vs. Stanza Chapters kjk Sigil 4 09-14-2009 10:50 AM
Chapters from images bremler LRF 0 09-02-2009 06:35 PM
Detecting chapters Tibor Calibre 4 01-17-2009 01:25 PM


All times are GMT -4. The time now is 07:53 AM.


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