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 02-21-2011, 03:34 AM   #1
cybmole
Wizard
cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.
 
Posts: 2,596
Karma: 1065018
Join Date: Sep 2010
Device: Kobo aura HD, Kobo Arc, Sony T2, Kindle Fire HDX 8.9 , Kindle for PC
epub to mobi page break on chapters

my workflow is epub to mobi to read on kindle.

if my epub has chapter tags ok but is in a single xhtml file, then that workflow fails to insert page breaks between chapters on kindle i.e. structure detect in epub to mobi conversion is not doing its add page break thing ?

it will work fine if I convert the same book in 2 steps: 1. epub-epub THEN 2. epub-mobi. so is there a bug affecting the single step route or Am I misreading the spec ?

& is there a 1 step option where I add something to extra-css which adds pagebreaks before <H2 tags. if so I can place that in my default conversion preferences & forget about it ?
cybmole is offline   Reply With Quote
Old 02-21-2011, 09:56 AM   #2
jackie_w
Wizard
jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.
 
Posts: 2,689
Karma: 3818505
Join Date: Sep 2009
Location: UK
Device: Sony PRS-350, PB360, Kobo Glo/AuraHD/Aura6"
I don't know whether this would work but you could try this in ExtraCSS:
Code:
h2 {page-break-before: always;}
jackie_w is offline   Reply With Quote
 
Enthusiast
Old 02-21-2011, 10:16 AM   #3
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: 80446
Join Date: Feb 2008
Location: Germany
Device: Cybook Gen3
I'd guess there's something wrong with the chapter detection XPath. Do you adapt it accordingly for each book, or do you just run the defaults?
Manichean is offline   Reply With Quote
Old 02-21-2011, 10:57 AM   #4
cybmole
Wizard
cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.
 
Posts: 2,596
Karma: 1065018
Join Date: Sep 2010
Device: Kobo aura HD, Kobo Arc, Sony T2, Kindle Fire HDX 8.9 , Kindle for PC
Quote:
Originally Posted by Manichean View Post
I'd guess there's something wrong with the chapter detection XPath. Do you adapt it accordingly for each book, or do you just run the defaults?
see post 1. there IS something wrong with xpath - it does not kick in for epub to mobi, yet the same settings do work for epub to epub followed by epub to mobi

I'd call it a bug but my track record on reporting bugs is 0 for 3 , I've yet to raise on that's considered valid, so I'll leave this open for others to comment

NB I tried another book with exactly the same outcome - defaults work when i do epub to epub not when I do epub to mobi!

PS if the xpath the defaults dont work then I try open + save in sigil, oftentimes that fixes stuff, if that still does not work I manually fix in sigil as I've yet to get good with xpath.
cybmole is offline   Reply With Quote
Old 02-21-2011, 10:59 AM   #5
cybmole
Wizard
cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.
 
Posts: 2,596
Karma: 1065018
Join Date: Sep 2010
Device: Kobo aura HD, Kobo Arc, Sony T2, Kindle Fire HDX 8.9 , Kindle for PC
Quote:
Originally Posted by jackie_w View Post
I don't know whether this would work but you could try this in ExtraCSS:
Code:
h2 {page-break-before: always;}
yes that's what I wanted thanks - it can go into my default extra-css as a safety net.
cybmole is offline   Reply With Quote
Old 02-21-2011, 12:00 PM   #6
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: 80446
Join Date: Feb 2008
Location: Germany
Device: Cybook Gen3
Quote:
Originally Posted by cybmole View Post
see post 1. there IS something wrong with xpath - it does not kick in for epub to mobi, yet the same settings do work for epub to epub followed by epub to mobi
I'm guessing that the XPath works in the second ePub->MOBI step? In that case, the original ePub would have some deviation from what Calibre expects that breaks the XPath. The first ePub->ePub conversion would fix that deviation, so it works in the ePub->MOBI step. Try taking a close look at the structure of your original ePubs and comparing that with what the XPath expects.
Manichean is offline   Reply With Quote
Old 02-21-2011, 12:10 PM   #7
cybmole
Wizard
cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.
 
Posts: 2,596
Karma: 1065018
Join Date: Sep 2010
Device: Kobo aura HD, Kobo Arc, Sony T2, Kindle Fire HDX 8.9 , Kindle for PC
Quote:
Originally Posted by Manichean View Post
I'm guessing that the XPath works in the second ePub->MOBI step? In that case, the original ePub would have some deviation from what Calibre expects that breaks the XPath. The first ePub->ePub conversion would fix that deviation, so it works in the ePub->MOBI step. Try taking a close look at the structure of your original ePubs and comparing that with what the XPath expects.
no the xpath seems to work in the 1st step IF output type is EPUB. after step 1 ( inspecting in sigil )- the epub structure is one file per chapter.
I can then turn xpath off in the 2nd conversion as the book is already sorted.

I still don't get the difference between 1 pass epub to epub _ all OK, and 1 pass epub to mobi - not OK, starting both times with the exact same source.

as I understand calibre pipeline, the xpath stuff is in both cases done on intermediate HTML, before handing off to the output module ?
cybmole is offline   Reply With Quote
Old 02-21-2011, 12:16 PM   #8
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: 80446
Join Date: Feb 2008
Location: Germany
Device: Cybook Gen3
Quote:
Originally Posted by cybmole View Post
I still don't get the difference between 1 pass epub to epub _ all OK, and 1 pass epub to mobi - not OK, starting both times with the exact same source.

as I understand calibre pipeline, the xpath stuff is in both cases done on intermediate HTML, before handing off to the output module ?
Yes. Did you try having a look at the HTML (via the wand in search & replace, for example) to see what Calibre sees at that stage? I'm still guessing the XPath doesn't do anything and you're seeing some other effect.
Manichean is offline   Reply With Quote
Old 02-21-2011, 02:17 PM   #9
cybmole
Wizard
cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.
 
Posts: 2,596
Karma: 1065018
Join Date: Sep 2010
Device: Kobo aura HD, Kobo Arc, Sony T2, Kindle Fire HDX 8.9 , Kindle for PC
no yet - not really sure what I'd be looking for, as the only thing missing is the pagebreak-before marker .

my source ( picking a smilar unconverted epub ) has chapter code like
Code:
<h1 class="calibre15"><a class="calibre16" id="_Toc67228692">Chapter 2 - COLLEGE</a></h1>
already tagged but no pagebreak-before entires in its calibre styles.


both epub and mobi, ( after one shot convert) look good in calibre viewer - toc looks good & works. it's just that when sent to kindle & read sequentially, the text fails to page break as each new chapter is encountered. all other Kindle navigation stuff does work, and if I co to a new chapter on Kindle via the toc , it will put that chapter onto a fresh page..

the previous test book has now been overwritten via the epub to epub convert. I'd have to find another epub in order to reproduce the bug. i do now see that that epub ( after the epub to epub) stage has picked up a page break before - always setting in the appropriate calibre tag.

it is not a big issue as I have a workable work-around, so if there's no known obvious answer I'll move on.
cybmole is offline   Reply With Quote
Old 02-21-2011, 03:20 PM   #10
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: 80446
Join Date: Feb 2008
Location: Germany
Device: Cybook Gen3
Quote:
Originally Posted by cybmole View Post
Code:
<h1 class="calibre15"><a class="calibre16" id="_Toc67228692">Chapter 2 - COLLEGE</a></h1>
Hm. That definitely should be picked up by the XPath, if I'm reading it right.
Manichean is offline   Reply With Quote
Old 02-22-2011, 09:18 AM   #11
cybmole
Wizard
cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.
 
Posts: 2,596
Karma: 1065018
Join Date: Sep 2010
Device: Kobo aura HD, Kobo Arc, Sony T2, Kindle Fire HDX 8.9 , Kindle for PC
hey I've found the cause, but can't explain it.

below the chapter detextr formula is another xpath formula for insert pagebreak before

the default code there should be //*[name()='h1' or name()='h2']
that is what is set in my default preferences.

but in the test book preferences, EVEN AFTER , delete stored conversion settings,
all I have in the pagebreak-before field is a single / ( which means do nothing in xpath speak, yes ? )

I have no idea how, when, why that field got changed, it is possible to nudge it with mouse wheel & it moves between single slash & the true default value so maybe that is what happened -
anyway, what I don't now get is why it is not now resetting when I wipe the old convert settings,, or when I go that screen for the book & click restore defaults.

its looking like each book's preference will have to be reset by hand

is "restore defaults" broken for that one field ?

can someone else confirm before I dare call it a bug please

Last edited by cybmole; 02-22-2011 at 09:33 AM.
cybmole is offline   Reply With Quote
Old 02-22-2011, 09:28 AM   #12
Perkin
Guru
Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.
 
Perkin's Avatar
 
Posts: 642
Karma: 64171
Join Date: Sep 2010
Location: Kent, England, Sol 3, ZZ9 plural Z Alpha
Device: Sony PRS-300, Kobo Aura HD
Is your default actually set to //*[name()='h1' or name()='h2']
Could be a moment.
Perkin is offline   Reply With Quote
Old 02-22-2011, 09:32 AM   #13
cybmole
Wizard
cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.
 
Posts: 2,596
Karma: 1065018
Join Date: Sep 2010
Device: Kobo aura HD, Kobo Arc, Sony T2, Kindle Fire HDX 8.9 , Kindle for PC
Quote:
Originally Posted by Perkin View Post
Is your default actually set to //*[name()='h1' or name()='h2']
Could be a moment.
yep - been 3 time around the loop - I also tried restore defaults inside of the default preferences screen to check that really was the default

please please test it - set it to single slash for a specific book, then try to get it to revert to default , by wiping saved conversion settings and/or clicking reset defaults on the screen for that specific book
cybmole is offline   Reply With Quote
Old 02-22-2011, 09:48 AM   #14
Perkin
Guru
Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.
 
Perkin's Avatar
 
Posts: 642
Karma: 64171
Join Date: Sep 2010
Location: Kent, England, Sol 3, ZZ9 plural Z Alpha
Device: Sony PRS-300, Kobo Aura HD
Quote:
Originally Posted by cybmole View Post
yep - been 3 time around the loop - I also tried restore defaults inside of the default preferences screen to check that really was the default

please please test it - set it to single slash for a specific book, then try to get it to revert to default , by wiping saved conversion settings and/or clicking reset defaults on the screen for that specific book
Confirmed. ( you can happily report a bug )
Perkin is offline   Reply With Quote
Old 02-22-2011, 10:06 AM   #15
cybmole
Wizard
cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.
 
Posts: 2,596
Karma: 1065018
Join Date: Sep 2010
Device: Kobo aura HD, Kobo Arc, Sony T2, Kindle Fire HDX 8.9 , Kindle for PC
well if Kovid reads this he can pick up on it , my bug reporting seems jinxed :-)
cybmole 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
Mobi to epub page break mr.ninja13 Calibre 23 08-09-2011 02:06 PM
[Old Thread] Force page break in Mobi Dark123 Conversion 16 05-04-2011 04:38 AM
Can I fix ePub page break formatting? arcane_scholar Calibre 3 02-02-2011 04:01 PM
azw to mobi: Not detecting chapters/page break at chapters and no TOC RachDvn Calibre 3 01-16-2011 09:53 AM
How do I create chapters without a page-break between? bfollowell Sigil 22 01-02-2011 12:38 PM


All times are GMT -4. The time now is 05:56 PM.


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