![]() |
#1 |
Member
![]() Posts: 12
Karma: 10
Join Date: May 2013
Device: Kindle
|
MOBI to EPUB conversion in calibre adds page breaks
I currently have this HTML that I'm passing into kindlegen to create a mobi:
Code:
<h4 id='foo' class='chapter'>Here's my heading</h4> Code:
page-break-before: always; Code:
<div class="calibre3"></div><h4 class="calibre6" id="foo"> Is there something I can do to make sure that extra <div> isn't added? Or, alternately, is there any way I can collapse multiple empty <div> tags that have page-break-before so that there's only one page break? |
![]() |
![]() |
![]() |
#2 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,219
Karma: 27110894
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Look under the structure detection section of the conversion dialog and disable all insertion of page breaks.
|
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Member
![]() Posts: 12
Karma: 10
Join Date: May 2013
Device: Kindle
|
Hm, so in Common Options > Structure Detection I've put
Code:
/ |
![]() |
![]() |
![]() |
#4 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,219
Karma: 27110894
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
No that's it. With those two settings, calibre will not insert any page breaks itself. The page breaks must be present in the input document.
|
![]() |
![]() |
![]() |
#5 |
Member
![]() Posts: 12
Karma: 10
Join Date: May 2013
Device: Kindle
|
So I just used calibre's Tweak Book (thanks again for pointing that feature out to me) to explode the MOBI file and you're totally right -- *kindlegen* is adding a ghost <div> before the <h4> tag with page-break-before: always styling hard-coded to it. I know that's not your code but have you seen anything like that? It even turns HTML like
<h4 style="page-break-before: always">Foo bar</h4> to <div style="page-break-before: always"></div><h4 style="page-break-before: always">Foo bar</h4> And when I remove that style, it just goes away completely. |
![]() |
![]() |
Advert | |
|
![]() |
#6 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,219
Karma: 27110894
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
I'm afraid the last time I used kindlegen was when I was developing KF8 support for calibre, I never use it myself. So I cant tell you anything useful about its quirks.
|
![]() |
![]() |
![]() |
#7 |
Member
![]() Posts: 12
Karma: 10
Join Date: May 2013
Device: Kindle
|
Actually, I just ran one more test -- I unzipped the MOBI I generated from kindlegen and see this as the HTML.
Code:
<div></div><mbp:pagebreak/><a id="filepos228387" /><h4 > ![]() |
![]() |
![]() |
![]() |
#8 |
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 79,247
Karma: 145488788
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Use the HTML as the source for the ePub and see what you get.
|
![]() |
![]() |
![]() |
#9 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,219
Karma: 27110894
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Importing books does not change them in any way whatsoever.
|
![]() |
![]() |
![]() |
#10 |
Member
![]() Posts: 12
Karma: 10
Join Date: May 2013
Device: Kindle
|
Hm, but it does something to change the structure -- does Tweak Book for a MOBI add a different HTML structure? Because when I use KindleUnpack, there are MOBI specific tags there that don't show up when I Explode Book in calibre.
|
![]() |
![]() |
![]() |
#11 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,219
Karma: 27110894
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Remember that MOBI generated by kindlegen actually contain two books one in MOBI6 and one in KF8. when converting/tweaking these books, calibre uses the KF8 part. You are probably looking at the MOBI6 part with KindleUnpack.
|
![]() |
![]() |
![]() |
#12 |
Member
![]() Posts: 12
Karma: 10
Join Date: May 2013
Device: Kindle
|
Hey Kovid,
You're totally correct! That was exactly what was happening -- I posted to the Kindle forums to ask why Kindlegen wasn't handling that correctly. Is there a way in the mean time to use the MOBI6 part of the MOBI file instead of the KF8 one? |
![]() |
![]() |
![]() |
#13 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,219
Karma: 27110894
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
I believe there is a kindlesplit tool floating around somewhere that can split up joint mobi files, but I've never needed to use it myself.
|
![]() |
![]() |
![]() |
#14 |
Junior Member
![]() Posts: 5
Karma: 10
Join Date: Oct 2013
Device: Kindle Fire
|
Trouble w/Conversion
Hi,
I imported some mobis and prcs to Calibre (which is great), and then bulk converted them all to mobi, so I may read them as "books" in my Kindle Fire. Many of the files 1) lack breaks between paragraphs, 2) lack breaks between lines of dialogue, 3) have square boxes in place of symbols, such as apostrophes. Please let me know if there is a way to bulk correct these conversion errors in Calibre. Excuse me for tagging onto this thread, but it seemed like the most relevant one I could find. Thank you for any inputs. -AJM |
![]() |
![]() |
![]() |
#15 |
Junior Member
![]() Posts: 1
Karma: 10
Join Date: Feb 2017
Device: kobo
|
Hi,
I know it's been many (3.75) years since anyone commented on this thread. I had the same issue - the problem was caused by entries in the stylesheet.css - comment (/* ... */ out the lines that mention either pagebreak before or pagebreak after. Fixed for me. Cheers Earle |
![]() |
![]() |
![]() |
Tags |
epub, page-break;css |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
MOBI -> EPUB conversion removes scene breaks | tlangner | Conversion | 7 | 01-26-2013 12:37 AM |
Conversion from mobi (to mobi, or epub) breaks internal links | bounder | Conversion | 1 | 10-09-2012 11:56 AM |
HTML to MOBI conversion ignores page breaks | LeftHanded Matt | Conversion | 2 | 12-21-2011 12:25 PM |
epub to mobi h1 page breaks not starting on new page | wannabee | Conversion | 4 | 08-02-2011 12:46 AM |
epub to mobi loses page breaks | stevent10993 | Conversion | 5 | 07-20-2011 12:43 AM |