Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Conversion

Notices

Reply
 
Thread Tools Search this Thread
Old 03-03-2011, 04:59 AM   #1
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,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"
My issue with the latest version is it inserts a pagebreak before all h1 and h2 tags regardless of whether they're chapters or not. I have one page which contains:
Code:
<h1>title</h1>
<h2>author</h2>
and ebook-convert inserts a pagebreak between title and author. Is there an option to change this behavior? Thanks!
ilovejedd is offline   Reply With Quote
Old 03-03-2011, 05:55 AM   #2
Manichean
Wizard
Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.
 
Manichean's Avatar
 
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.
Manichean is offline   Reply With Quote
Advert
Old 03-03-2011, 07:19 AM   #3
ldolse
Wizard
ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.
 
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.
ldolse is offline   Reply With Quote
Old 03-03-2011, 10:43 AM   #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,856
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
--page-breaks-before /

will do it
kovidgoyal is offline   Reply With Quote
Old 03-03-2011, 12:39 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,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
Quote:
Originally Posted by kovidgoyal View Post
--page-breaks-before /

will do it
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.
ilovejedd is offline   Reply With Quote
Advert
Reply


Forum Jump

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


All times are GMT -4. The time now is 09:36 PM.


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