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 06-19-2019, 02:50 PM   #1
battle_brother
Junior Member
battle_brother began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Jun 2019
Device: Kindle Paperwhite
Question Converting ePub to Mobi reducing margin-top on CSS class

Hi, long time (if casual) calibre user and I've visted the forum many times for help, but first post!

I'm hoping someone can help with an issue that's driving me up the wall. I usually download ebooks as epubs, but I read them on a Kindle (paperwhite now), so I have to convert them to mobi in order to do so - I've prettymuch just used default settings the whole time.
I'd noticed that section breaks / scene breaks (basically the blank line you see between two scenes) was barely noticeable on my paperwhite. I initially assumed it was to do with the device as I didn't remember it happening on my old kindle, but I investigated further today and I can see the issue in the calibre viewer, and found that calibre is greatly reducing the 'margin-top' of the CSS the book I was looking at uses (I'm guessing the others will be the same).

You can see here the original format:


However, when I convert to mobi, it's renaming the classes (I'm led to understand this is usual behaviour for this conversion) but also changing the top margin from 14px to 5pt, which is not equivalent - it's far smaller, and barely noticeable on the kindle.

You can see here the converted format:


Now I have tried fixing this, but I'm getting nowhere. I've tried adding in additional options using Styling and Transform styles:



Initially I had only the 5pt in and that didn't seem to change the output at all, just leaving it as 5pt as in the basic conversion, but when I have added 14px - 20pt conversion, even more bizarrely, Calibre has converted this to 1em:



This does sort of address the issue of not being able to see the breaks, but it also makes them bigger than other line breaks and looks wrong on the kindle - but more to the point, it's not what I specified! I can get them to be the same (15pt) by specifying that instead, but it still looks smaller on the kindle than I'd like, so ideally I need to adjust them both, but I feel I'll be just hitting the same issue again.

So I'm hoping someone can tell me if there's some option I'm missing or some easy way of converting this to actually reflect the options I want - or if it's not possible to convert it precisely, at least put me out of my misery.

tl:dr - I want to convert from epub to mobi without it adjusting the margins on the CSS, or at least be able to control it myself!

I'd also like to be able to... re-convert some of my existing mobi files for while I no longer have the epubs - another reason I need to work out how to do this properly.

Any help anyone can give is appreciated, happy to provide more details of my config if required, as whilst I'm fairly technically minded I'm a novice Calibre user at best.
battle_brother is offline   Reply With Quote
Old 06-19-2019, 08:51 PM   #2
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,858
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
How px are converted to pts depends on the DPI of the input and output profiles. Choose ones that match your expected device and the conversion will reserve visual appearance.
kovidgoyal is offline   Reply With Quote
Advert
Old 06-20-2019, 03:26 AM   #3
battle_brother
Junior Member
battle_brother began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Jun 2019
Device: Kindle Paperwhite
Thanks Kovid, appreciate the response, and I really appreciate all the work you've put into Calibre - it's a great tool and it's really enhanced my ebook experience for years.

I did do a little more experimentation and I found I was able to strike a kind of balance, converting to em values I managed to get the formatting more or less how I desired, but I'm not sure if that will work on future books I convert.

Are there any profiles in calibre which prevent the px-pts conversion? ideally I'd like to retain the original styles as much as possible, though I am aware that might be difficult to do when the ebook is being converted from one format to another - I don't even know if mobi support px values, to be honest.

I tried using AZW3 but when I did that, the nested ToC in the book only went to the second level on my kindle, so unfortunately that's not an option either.
battle_brother is offline   Reply With Quote
Old 06-20-2019, 04:05 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,858
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
No MOBI does not, azw3 is your best bet for formatting fidelity.
kovidgoyal is offline   Reply With Quote
Old 06-20-2019, 08:31 AM   #5
battle_brother
Junior Member
battle_brother began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Jun 2019
Device: Kindle Paperwhite
I was afraid that might be the case, perhaps if I can work out how to resolve the issue with ToC I will try AZW3, if not I will just have to manage with MOBI and fiddling the styling.

Anyway, thanks for your help!
battle_brother is offline   Reply With Quote
Advert
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
EPUB>MOBI: missing text when % used for margin-top odamizu Conversion 19 08-26-2017 09:55 AM
CSS: margin-top and margin Leonatus ePub 16 06-16-2014 04:29 AM
CSS margin instead of margin-top, etc. icallaci Conversion 24 10-19-2013 09:52 AM
Margin/word flow issues when converting from RAR(CSS?) to epub... camobmus Conversion 0 06-20-2013 04:20 PM
little issue converting from odt to epub (top and bottom margin) superanima Calibre 1 02-15-2010 04:15 PM


All times are GMT -4. The time now is 11:37 AM.


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