03-03-2011, 04:59 AM | #1 |
hopeless n00b
Posts: 5,111
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
|
Chapter detection and pagebreak issues
I'm currently redoing a couple of my virtual machines so I figured I might as well upgrade from calibre 0.5.14 to 0.7.47 while I'm at it. I'm using calibre solely for conversion from zipped html to epub via commandline.
CLI (pretty much the same as I used for 0.5.14 html2epub): Code:
ebook-convert file.zip file.epub --level1-toc "//*[@class='chaptertitle']|//*[@class='toctitle']|//*[@class='fictitle']" --chapter "//*[@class='chapter']" --chapter-mark "pagebreak" Code:
<h1>title</h1> <h2>author</h2> |
03-03-2011, 05:55 AM | #2 |
Wizard
Posts: 3,130
Karma: 91256
Join Date: Feb 2008
Location: Germany
Device: Cybook Gen3
|
Calibre has no method of detecting whether a tag matched by the XPath opens a chapter or not, so it assumes that all tags matching open a chapter. You'll have to change the --chapter-mark option to avoid those pagebreaks, however, that will remove the pagebreaks in front of chapters, as well.
|
Advert | |
|
03-03-2011, 07:19 AM | #3 |
Wizard
Posts: 1,337
Karma: 123455
Join Date: Apr 2009
Location: Malaysia
Device: PRS-650, iPhone
|
In this case I think you're running afoul of Calibre's default conversion settings - if you're calling ebook-convert from the command line then you need to change all the defaults that could affect you with the appropriate argument.
Calibre defaults to inserting page breaks before all h1 and h2 tags, this is the xpath: //*[name()='h1' or name()='h2'] I think if you just pass an empty argument that should fix it - I think it's --page-breaks-before='', but double-check the docs. |
03-03-2011, 10:43 AM | #4 |
creator of calibre
Posts: 43,779
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
--page-breaks-before /
will do it |
03-03-2011, 12:39 PM | #5 |
hopeless n00b
Posts: 5,111
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
|
Thanks so much! Will do that when I get home.
P.S. I'm really digging the new generated covers. Last edited by ilovejedd; 03-03-2011 at 12:41 PM. |
Advert | |
|
Thread Tools | Search this Thread |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Chapter Detection Tutorial | ldolse | Conversion | 34 | 01-11-2012 06:32 PM |
Help with Chapter detection | ubergeeksov | Calibre | 0 | 09-02-2010 04:56 AM |
chapter detection in any book | yuki86 | Calibre | 9 | 05-06-2009 06:54 AM |
Cant find help for chapter detection | fallwood | Calibre | 6 | 12-10-2008 01:20 PM |
BD: Auto pagebreak preceding chapter? | Xsavior | Sony Reader | 5 | 07-15-2007 04:21 PM |