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

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

Notices

Reply
 
Thread Tools Search this Thread
Old 03-03-2011, 05: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: 2,312
Karma: 5761596
Join Date: Jan 2009
Location: in the middle of nowhere
Device: PRS-350, Nexus S, Galaxy S, Nook Color, iPhone4, iPT4, iPad 2012
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, 06:55 AM   #2
Manichean
Wizard
Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!
 
Manichean's Avatar
 
Posts: 3,130
Karma: 80520
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
Old 03-03-2011, 08: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, 11: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: 26,436
Karma: 5383257
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, 01: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: 2,312
Karma: 5761596
Join Date: Jan 2009
Location: in the middle of nowhere
Device: PRS-350, Nexus S, Galaxy S, Nook Color, iPhone4, iPT4, iPad 2012
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 01:41 PM.
ilovejedd 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
Chapter Detection Tutorial ldolse Conversion 34 01-11-2012 07:32 PM
Help with Chapter detection ubergeeksov Calibre 0 09-02-2010 05:56 AM
chapter detection in any book yuki86 Calibre 9 05-06-2009 07:54 AM
Cant find help for chapter detection fallwood Calibre 6 12-10-2008 02:20 PM
BD: Auto pagebreak preceding chapter? Xsavior Sony Reader 5 07-15-2007 05:21 PM


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


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