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 07-28-2010, 07:21 PM   #1
victoria0217
Junior Member
victoria0217 began at the beginning.
 
Posts: 8
Karma: 10
Join Date: Jul 2010
Device: Kindle
[Old Thread] Convert epub to mobi with wide left margin on Kindle

Hello everybody,
I just got a kindle, and started to convert my epub to mobi to read on Kindle, but I found this common problem exactly the same as described here:
http://bugs.calibre-ebook.com/ticket/1944

I converted my book and it looked fine on the computer viewer, but when I upload it to Kindle, it gets wide left margin which makes it looks weird.

I'll attach the two files I have, the original epub and the mobi I converted. I can get kindle screenshots too if necessary.

Thank A LOT!!!!!

Victoria
victoria0217 is offline   Reply With Quote
Old 07-29-2010, 12:55 AM   #2
DoctorOhh
US Navy, Retired
DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.
 
DoctorOhh's Avatar
 
Posts: 9,864
Karma: 13806776
Join Date: Feb 2009
Location: North Carolina
Device: Icarus Illumina XL HD, Nexus 7
Quote:
Originally Posted by victoria0217 View Post
Hello everybody,
I just got a kindle, and started to convert my epub to mobi to read on Kindle, but I found this common problem exactly the same as described here:
http://bugs.calibre-ebook.com/ticket/1944

I converted my book and it looked fine on the computer viewer, but when I upload it to Kindle, it gets wide left margin which makes it looks weird.
After I did a epub to epub conversion (to extract the css file and put it in an epub form Sigil could open) and then opened it in Sigil I discovered that your epub has a a left margin of 1em. As I understand this it means the margin will be equal to one character. If it is 12pt font the margin will be 12pt if you increase font to medium or large it can increase to a 24 or 36 pt margin.

According to the ticket you cite the margins in the epub need to be cleaned up prior to conversion. Use Sigil to change the margins, save it and convert it again. Info on Sigil (epub editor) can be found in the Sigil forum.
DoctorOhh is offline   Reply With Quote
Advert
Old 07-29-2010, 08:50 AM   #3
victoria0217
Junior Member
victoria0217 began at the beginning.
 
Posts: 8
Karma: 10
Join Date: Jul 2010
Device: Kindle
Thank for your reply...yeah I noticed the magin-left:1em, I manually changed it to 0 in a webpage editor but it didn't do anything...
another thing I've noticed with my issue is if I convert the epub books that have HTML pages, it works just fine, but every epub I have that has XHTML pages have problem with left margin...could that have anything to do with it?
victoria0217 is offline   Reply With Quote
Old 07-29-2010, 10:27 AM   #4
victoria0217
Junior Member
victoria0217 began at the beginning.
 
Posts: 8
Karma: 10
Join Date: Jul 2010
Device: Kindle
Quote:
Originally Posted by dwanthny View Post
After I did a epub to epub conversion (to extract the css file and put it in an epub form Sigil could open) and then opened it in Sigil I discovered that your epub has a a left margin of 1em. As I understand this it means the margin will be equal to one character. If it is 12pt font the margin will be 12pt if you increase font to medium or large it can increase to a 24 or 36 pt margin.

According to the ticket you cite the margins in the epub need to be cleaned up prior to conversion. Use Sigil to change the margins, save it and convert it again. Info on Sigil (epub editor) can be found in the Sigil forum.
so I did what you said, I changed the epub's css file and everything, but after conversion, it still added a left margin of 1em in the Mobi file...why did it get added automatically?
victoria0217 is offline   Reply With Quote
Old 07-29-2010, 05:43 PM   #5
DoctorOhh
US Navy, Retired
DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.
 
DoctorOhh's Avatar
 
Posts: 9,864
Karma: 13806776
Join Date: Feb 2009
Location: North Carolina
Device: Icarus Illumina XL HD, Nexus 7
Quote:
Originally Posted by victoria0217 View Post
so I did what you said, I changed the epub's css file and everything, but after conversion, it still added a left margin of 1em in the Mobi file...why did it get added automatically?
You have 3 margins set at 5pt in your html that are additive.

First at the top of each page you have the margin that calibre sets based on your device setting.

@page { margin-bottom: 5.000000pt; margin-top: 5.000000pt; }

Then in the css file itself you have various classes where the margins are set at 5pt. Two primary <body class="calibre3"> <p class="calibre4"> each of these add another 5pt for a total margin of 15pt.

Prior to conversion to mobi change every left and right margin in the css file to "0". This will leave just the @page margin (the one controlled by page setup under conversion settings) left for transfer.

I may be off but start with all of them at 0 in the css file and see what effect that has.

Last edited by DoctorOhh; 07-29-2010 at 05:45 PM.
DoctorOhh is offline   Reply With Quote
Advert
Old 07-30-2010, 03:04 AM   #6
dogbreath999
Junior Member
dogbreath999 began at the beginning.
 
Posts: 6
Karma: 46
Join Date: Jul 2010
Device: kindle 2
I am having the same problem... any luck victoria???
dogbreath999 is offline   Reply With Quote
Old 07-30-2010, 08:23 AM   #7
victoria0217
Junior Member
victoria0217 began at the beginning.
 
Posts: 8
Karma: 10
Join Date: Jul 2010
Device: Kindle
Quote:
Originally Posted by dogbreath999 View Post
I am having the same problem... any luck victoria???
Yeah, I kinda got it figured out. Dwanthny has the right direction to go with this...convert all the epub to epub in Calibre so you can use Sigil to edit the CSS style sheet. then look at all the <p> see which CSS class it is using, change all the margins to 0, and sometimes the <div> has something to do with it too...well if you don't want to bother with which is which, you can just simply change every left-margin and right-margin to 0...hope it works for you
victoria0217 is offline   Reply With Quote
Old 07-30-2010, 01:09 PM   #8
dogbreath999
Junior Member
dogbreath999 began at the beginning.
 
Posts: 6
Karma: 46
Join Date: Jul 2010
Device: kindle 2
Yeah, perfect. Its a little bit of work, but that is soooooo much less annoying once that left margin is gone. Great results. Just have to play with it a little bit.

Thanks guys.
dogbreath999 is offline   Reply With Quote
Old 07-30-2010, 09:37 PM   #9
DoctorOhh
US Navy, Retired
DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.
 
DoctorOhh's Avatar
 
Posts: 9,864
Karma: 13806776
Join Date: Feb 2009
Location: North Carolina
Device: Icarus Illumina XL HD, Nexus 7
Quote:
Originally Posted by dogbreath999 View Post
Yeah, perfect. Its a little bit of work, but that is soooooo much less annoying once that left margin is gone. Great results. Just have to play with it a little bit.

Thanks guys.
You're welcome.

My preferred format is epub and it is so much easier with the addition of Sigil.
DoctorOhh is offline   Reply With Quote
Old 07-31-2010, 12:16 PM   #10
jesscat
Groupie
jesscat has a complete set of Star Wars action figures.jesscat has a complete set of Star Wars action figures.jesscat has a complete set of Star Wars action figures.jesscat has a complete set of Star Wars action figures.
 
Posts: 156
Karma: 354
Join Date: Mar 2009
Location: US
Device: iPad mini, iPad 2, Kindle 3
Every epub I've ever converted in Calibre has had this issue. What I've always done is unzip the epub, edit each and every xhtml file inside the epub individually to remove the entire stylesheet, and then rezip the files and rename to epub again. I also, while I'm at it, get rid of the extra <p></p> that, in every epub I've ever encountered, cause there to be an extra space between paragraphs that Calibre will not (or at least I've been unable to make it) delete.

Is there any possibility of creating within Calibre some sort of shortcut for solving this, rather than having to go through this laborious process every time? I can't figure out a way to create css to override the epub margins, or a way to delete the extra space between paragraphs - but since this seems, in my own experience at least, to be a universal problem with epub->mobi conversion (again, I have never *not* encountered this when doing such a conversion), perhaps Calibre might be able to accommodate it?
jesscat is offline   Reply With Quote
Old 07-31-2010, 09:57 PM   #11
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 73,510
Karma: 126422064
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
I did report the issue of the @page margins not bing fixed if I specify no margins in the conversion. I do think this needs to be fixed.
JSWolf is offline   Reply With Quote
Old 08-02-2010, 11:24 AM   #12
dogbreath999
Junior Member
dogbreath999 began at the beginning.
 
Posts: 6
Karma: 46
Join Date: Jul 2010
Device: kindle 2
Quote:
Originally Posted by jesscat View Post
Is there any possibility of creating within Calibre some sort of shortcut for solving this, rather than having to go through this laborious process every time?
I was hoping that this would be a possibility but I don't think so. I reported the problem to the staff at Calibre, and they let me know the following:
http://bugs.calibre-ebook.com/ticket/6343

"calibre is designed TO PRESERVE THE FORMATTING OF THE INPUT FILE IN THE OUTPUT FILE. That means that if your input file specifies margins for elements then the OUTPUT FILE WILL ALSO HAVE THEM."
dogbreath999 is offline   Reply With Quote
Old 08-02-2010, 11:37 AM   #13
dogbreath999
Junior Member
dogbreath999 began at the beginning.
 
Posts: 6
Karma: 46
Join Date: Jul 2010
Device: kindle 2
Fixing this problem for Dummies:

If anyone wanted to know the quick step by step I am doing to solve the problem I'll describe it below.

-First go to Calibre and convert Epub to Epub (yes the same format), making sure to go to "Page Setup" and change the left margin to 0.

-Then go into Sigil and open the new Epub file (it should automatically update or save in a new location). If it doesn't open or has an error it might be the old file you are opening, not the new one.

-Go under the folder "Styles" under the Book Browser, and open the Stylesheet.css

-In the style sheet, all I do is look for every single thing that says marginleft OR marginright and make sure the value is 0 for everything. If it says 1em I change it to 0em. If it says 5pt, I change it to 0pt. If its 0 I leave it at 0. If it says auto I leave it saying auto.

-Control S (Command S for mac) to save. Then exit Sigil

-Back in Calibre all I do is click convert to Mobi this time to make a Kindle compatible file format. Again make sure under "Page setup" it has 0 for the left margin value (it should if you did this before).

-Now when you put the file on the device it should be in a nice normal format. Everytime i've followed this procedure it has worked very nicely. I DO wish that Calibre could do this by itself, as it takes like a minute per book conversion, but its not the worst thing in the world.

Since I'm somewhat computer illiterate this HOWTO would have at least saved ME a ton of time figuring out how to fix this problem when I first had it.

Last edited by dogbreath999; 08-02-2010 at 11:59 AM.
dogbreath999 is offline   Reply With Quote
Old 08-02-2010, 09:46 PM   #14
DoctorOhh
US Navy, Retired
DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.
 
DoctorOhh's Avatar
 
Posts: 9,864
Karma: 13806776
Join Date: Feb 2009
Location: North Carolina
Device: Icarus Illumina XL HD, Nexus 7
Quote:
Originally Posted by dogbreath999 View Post
-First go to Calibre and convert Epub to Epub (yes the same format), making sure to go to "Page Setup" and change the left margin to 0.

-Then go into Sigil and open the new Epub file (it should automatically update or save in a new location). If it doesn't open or has an error it might be the old file you are opening, not the new one.
Just for clarification once you do a epub to epub conversion the file in calibre is over written. there is no new or old file in calibre.

Good directions just click to open in the book details panel then open the epub in Sigil.

It is interesting how often people seem to run into this. I have converted 2300+ books to epub and I have had maybe 1% of my books have margins set for the book. I have had another .5% that had weird margins for certain text of emphasis that I have had to adjust.

Those 2300+ books I have converted come from a wide variety of legitimate and questionable sources.

Bottom line is your advice will work fine if anyone runs into this problem.
DoctorOhh is offline   Reply With Quote
Old 09-01-2010, 10:07 AM   #15
mvdarend
Member
mvdarend doesn't littermvdarend doesn't litter
 
Posts: 11
Karma: 106
Join Date: Aug 2010
Device: Kindle
As I had a lot of files to convert from EPUB to MOBI (and they were all giving me the left margin problem) I decided to write a small program to overwrite the stylesheet.css file with one of my own definition.

If anyone wants a copy let me know.

Last edited by mvdarend; 09-09-2010 at 04:11 AM.
mvdarend 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
Can't remove wide margin left side :( allowingtoo Sigil 2 10-02-2011 01:57 PM
.mobi conversion adding unwanted left margin Skydog Conversion 3 05-01-2011 07:43 PM
EPub>Mobi>Kindle 3 large left margins Zenthor Calibre 14 11-02-2010 08:37 AM
New conversion questions: Getting rid of huge left margin Epub to Mobi geekgeek Calibre 2 08-31-2010 11:00 PM
Wide left margins in epub to kindle conversion jchrist Calibre 0 02-02-2010 09:13 PM


All times are GMT -4. The time now is 11:31 PM.


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