12-05-2010, 02:44 PM | #1 |
Junior Member
Posts: 2
Karma: 10
Join Date: Dec 2010
Device: Kindle 3
|
2 cm left margin
Hi!
I am trying to convert an epub book to mobi. The conversion seems to work but when I view the file on my Kindle 3 it has a 2 cm (1/2 inch I suppose) left margin on every line. The right margin is OK, ie more or less nothing. I have tried to adjust the margins when converting, but even setting them to 0 pt does not affect this. I assume there is an obvious setting somewhere which I am missing. Can someone please enlighten me as to what it is! Having a 6 inch Kindle screen is small enough, not using the entire screen seems utterly useless. Regards /Jesper |
12-05-2010, 05:36 PM | #2 |
Guru
Posts: 695
Karma: 822675
Join Date: May 2010
Device: Kobo Aura, Nokia Lumia 920 (Freda)
|
Perhaps the epub has the margin already set inside it? Try opening the epub using the "Tweak epub" option (shortcut: T) and look at the .css file to see if there are any large margins set. I find that a lot of epub books like to have 1em or even 2em margins, which depending on your font size could be around 2cm. Since I read on an iPhone and such large margins leave me with only 3-4 words per line on the small screen, I'm very sensitive to this and end up editing a lot of epubs to de-marginize them.
|
Advert | |
|
12-06-2010, 01:36 AM | #3 |
Junior Member
Posts: 2
Karma: 10
Join Date: Dec 2010
Device: Kindle 3
|
Thank you, you were right. There was a 1,5 em margin in the css.
|
12-06-2010, 02:52 AM | #4 |
Wizard
Posts: 3,720
Karma: 1759970
Join Date: Sep 2010
Device: none
|
could we have an idiots guide / step by step instructions for fixing this please i.e. for finding & then editing the css lines.
i have been fixing it by converting to .rtf and then to .mobi but ( as reported elsewhere) calibre's rtf output is buggy and sometimes creates a corrupt file. |
12-06-2010, 03:07 AM | #5 |
Guru
Posts: 695
Karma: 822675
Join Date: May 2010
Device: Kobo Aura, Nokia Lumia 920 (Freda)
|
Wow, that's about the most convoluted method I've ever heard of for fixing simple CSS issues
There are three ways you can go about doing this:
Within the CSS file, my solution to margin problems is generally to remove the lines entirely. If I want any margins, I'll let Calibre add them on convert (usually go with 5pt all around). Also, make sure you don't accidentally remove any intentional indentation margins, such as for blockquote-type text. Unfortunately this is pretty difficult to do without context, since the class names are never descriptive (calibreN, where N is a number). This is why I like using option 2 above. I can search for a class name across all files in the epub and see where it's being used. From that, I can get enough context to understand what the class is intended to do, and thus whether or not I should remove margins. Also note that this assumes all styles are put into a separate .css files. Most (all?) calibre conversions should not have any inline styles, but if you're working with a non-calibre-created epub (for example, an epub you've purchased from a store and liberated) you might find that some styles have been sprinkled around the HTML code. If this happens, you're basically screwed. You'll have to go through every single HTML file in the epub and verify that the inline styles are correct. |
Advert | |
|
12-06-2010, 03:14 AM | #6 | |
Wizard
Posts: 3,720
Karma: 1759970
Join Date: Sep 2010
Device: none
|
Quote:
PS mine may be convoluted but it's a hell of a lot simpler & needs no extra software - if it were a race to produce say 10 fixed up .mobi books I'd be over the finishing line while you were still on book 1. & the newer contestants were still googling & downloading sigil :-) but as my method occasionally fails it's good to know of an alternative. |
|
12-06-2010, 03:18 AM | #7 |
Wizard
Posts: 3,720
Karma: 1759970
Join Date: Sep 2010
Device: none
|
PS - one other thing I don't "get" about this issue.
When I view an offending book in it's .epub format with calibre viewer, there is no visible wide left margin, even though it contains css margins code. - does the calibre epub viewer intelligently ignore that code ? . IF so, then why does the calibre .mobi viewer not do the same thing ? or to put it another wy , why is it a .mobi specific problem |
12-06-2010, 03:26 AM | #8 |
US Navy, Retired
Posts: 9,865
Karma: 13806776
Join Date: Feb 2009
Location: North Carolina
Device: Icarus Illumina XL HD, Nexus 7
|
Because of the way Kindle renders the ebook. Here is Kovids quick explanation.
|
12-06-2010, 04:10 AM | #9 | |
Guru
Posts: 695
Karma: 822675
Join Date: May 2010
Device: Kobo Aura, Nokia Lumia 920 (Freda)
|
Quote:
Good thing it's not a race Also, why would anybody Google for Sigil? I provided a link. And I think you and I have had this discussion before, so obviously you're not going to change how you clean up your epubs. Just as I'm not going to change my view that you're pounding in a thumbtack with a sledgehammer. |
|
12-06-2010, 05:49 AM | #10 |
Wizard
Posts: 4,334
Karma: 4000000
Join Date: Oct 2008
Location: Paris
Device: Cybooks; Sony PRS-T1
|
I usually open the ePub with 7zip (or any program able to read zip, that most OS will provide out of the box), edit css directly, and voila.
And sigil when i want to do some more serious editing. |
12-06-2010, 05:51 AM | #11 |
Wizard
Posts: 3,720
Karma: 1759970
Join Date: Sep 2010
Device: none
|
OK - I'm trying your method but failing to find the tweak epub feature :-( I have calibre open at the relevant book - cant see a suitable menu option anywhere ?
so tried 2nd route - could not get 7z to work - used winzip - found the css file margins - they look ok in there at 1st glance (5pt) here's what is in the epub, ( via caliibre wizard) [code] </head> <body text="#000000" link="#0000ff" dir="LTR" class="calibre"> <p class="western"> <span class="calibre1"><b class="calibre2">Excession</b></span></p> <p class="calibre3"> Culture Book 4</p> <p class="calibre3"> Iain M. Banks</p> <p class="calibre4"> <br class="calibre5"/></p> <p class="calibre6"> Two and a half millennia ago, the artifact appeared in a remote corner of space, beside a trillion-year old dying sun from a different universe. It was a perfect black-body sphere, and it did nothing. Then it disappeared. Now it is back.</p> <p class="calibre6"> Silent, motionless, and resisting all efforts to make contact, the [code] everything after culture book 4 Iain Banks gets indented in mobi, but not in epub viewer ??? so is it something to do with calibre 6 class ?? back to the css file - i guess I have to edit & save this chunk: ( which is using inches, not pts ? ) .calibre6 { direction: ltr; display: block; margin-bottom: 0.02in; margin-left: 0.1in; margin-right: 0.1in; margin-top: 0.02in; orphans: 2; text-align: LEFT; text-indent: 0; widows: 2 NB the styles go all the way up to calibre 15, + some other western ones. would I have to edit every style for consistency - look complex ! Last edited by cybmole; 12-06-2010 at 06:04 AM. |
12-06-2010, 06:36 AM | #12 |
Wizard
Posts: 1,337
Karma: 123455
Join Date: Apr 2009
Location: Malaysia
Device: PRS-650, iPhone
|
The tweak epub feature is in the right-click menu for any given book, or just press the letter 't' on your keyboard.
The simplest approach is just to delete every line with 'margin-left' in the css file (it's highly unlikely to exist with every style), though if there was some book content that was actually supposed to be indented you will lose that - then again you've been losing it by converting to rtf, so it probably doesn't matter. |
12-06-2010, 06:38 AM | #13 | |
US Navy, Retired
Posts: 9,865
Karma: 13806776
Join Date: Feb 2009
Location: North Carolina
Device: Icarus Illumina XL HD, Nexus 7
|
Quote:
If you still don't see the option it means your version is older then 0.7.20 and you might want to consider upgrading. Last edited by DoctorOhh; 12-06-2010 at 06:47 AM. |
|
12-06-2010, 07:21 AM | #14 |
Wizard
Posts: 3,720
Karma: 1759970
Join Date: Sep 2010
Device: none
|
i see the menu option now, thanks & see how it works.
out of curiosity what happens if one just deletes the entire .css file ? |
12-06-2010, 07:43 AM | #15 |
Sigil & calibre developer
Posts: 2,487
Karma: 1063785
Join Date: Jan 2009
Location: Florida, USA
Device: Nook STR
|
|
Tags |
conversion, epub, mobi |
Thread Tools | Search this Thread |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[Old Thread] Convert epub to mobi with wide left margin on Kindle | victoria0217 | Conversion | 91 | 11-15-2011 05:25 PM |
Classic Any way to change left-right margin spacing? | tanzer21 | Barnes & Noble NOOK | 7 | 02-14-2011 04:38 AM |
New conversion questions: Getting rid of huge left margin Epub to Mobi | geekgeek | Calibre | 2 | 08-31-2010 11:00 PM |
calibre ignore margin-top and margin-bottom | bender | Calibre | 2 | 12-11-2009 06:58 AM |
Right Margin Control | TedPark | Sony Reader Dev Corner | 4 | 07-02-2008 07:41 AM |