02-21-2011, 03:34 AM | #1 |
Wizard
Posts: 3,720
Karma: 1759970
Join Date: Sep 2010
Device: none
|
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 ? |
02-21-2011, 09:56 AM | #2 |
Grand Sorcerer
Posts: 6,212
Karma: 16534894
Join Date: Sep 2009
Location: UK
Device: Kobo: KA1, ClaraHD, Forma, Libra2, Clara2E. PocketBook: TouchHD3
|
I don't know whether this would work but you could try this in ExtraCSS:
Code:
h2 {page-break-before: always;} |
02-21-2011, 10:16 AM | #3 |
Wizard
Posts: 3,130
Karma: 91256
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?
|
02-21-2011, 10:57 AM | #4 | |
Wizard
Posts: 3,720
Karma: 1759970
Join Date: Sep 2010
Device: none
|
Quote:
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. |
|
02-21-2011, 10:59 AM | #5 |
Wizard
Posts: 3,720
Karma: 1759970
Join Date: Sep 2010
Device: none
|
|
02-21-2011, 12:00 PM | #6 |
Wizard
Posts: 3,130
Karma: 91256
Join Date: Feb 2008
Location: Germany
Device: Cybook Gen3
|
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.
|
02-21-2011, 12:10 PM | #7 | |
Wizard
Posts: 3,720
Karma: 1759970
Join Date: Sep 2010
Device: none
|
Quote:
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 ? |
|
02-21-2011, 12:16 PM | #8 | |
Wizard
Posts: 3,130
Karma: 91256
Join Date: Feb 2008
Location: Germany
Device: Cybook Gen3
|
Quote:
|
|
02-21-2011, 02:17 PM | #9 |
Wizard
Posts: 3,720
Karma: 1759970
Join Date: Sep 2010
Device: none
|
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> 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. |
02-21-2011, 03:20 PM | #10 |
Wizard
Posts: 3,130
Karma: 91256
Join Date: Feb 2008
Location: Germany
Device: Cybook Gen3
|
|
02-22-2011, 09:18 AM | #11 |
Wizard
Posts: 3,720
Karma: 1759970
Join Date: Sep 2010
Device: none
|
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. |
02-22-2011, 09:28 AM | #12 |
Guru
Posts: 655
Karma: 64171
Join Date: Sep 2010
Location: Kent, England, Sol 3, ZZ9 plural Z Alpha
Device: Sony PRS-300, Kobo Aura HD, iPad (Marvin)
|
Is your default actually set to //*[name()='h1' or name()='h2']
Could be a moment. |
02-22-2011, 09:32 AM | #13 | |
Wizard
Posts: 3,720
Karma: 1759970
Join Date: Sep 2010
Device: none
|
Quote:
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 |
|
02-22-2011, 09:48 AM | #14 | |
Guru
Posts: 655
Karma: 64171
Join Date: Sep 2010
Location: Kent, England, Sol 3, ZZ9 plural Z Alpha
Device: Sony PRS-300, Kobo Aura HD, iPad (Marvin)
|
Quote:
|
|
02-22-2011, 10:06 AM | #15 |
Wizard
Posts: 3,720
Karma: 1759970
Join Date: Sep 2010
Device: none
|
well if Kovid reads this he can pick up on it , my bug reporting seems jinxed :-)
|
|
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 |