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 03-26-2011, 02:48 PM   #1
Jafo
Enthusiast
Jafo , Klaatu Barada Niktu!Jafo , Klaatu Barada Niktu!Jafo , Klaatu Barada Niktu!Jafo , Klaatu Barada Niktu!Jafo , Klaatu Barada Niktu!Jafo , Klaatu Barada Niktu!Jafo , Klaatu Barada Niktu!Jafo , Klaatu Barada Niktu!Jafo , Klaatu Barada Niktu!Jafo , Klaatu Barada Niktu!Jafo , Klaatu Barada Niktu!
 
Posts: 28
Karma: 5012
Join Date: Jul 2010
Device: Kobo (original)
Change Margins With Calibre

Hi all,
I've read through some threads but I still don't understand what I'm doing wrong. I have an ePub book that has left and right margins that are too wide for me. I've gone to Page Setup in Calibre and lowered the values all the way down to zero but it makes no change at all when I open the book on my Kobo. Am I doing something wrong or is there just some epub's that can't be modified?
Thanks
Jafo is offline   Reply With Quote
Old 03-26-2011, 03:03 PM   #2
theducks
Grand Sorcerer
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 14,870
Karma: 5654321
Join Date: Aug 2009
Location: (The original) Silicon Valley, USA
Device: Galaxy Tab 2, Astak Pocket Pro, K4NT
Quote:
Originally Posted by Jafo View Post
Hi all,
I've read through some threads but I still don't understand what I'm doing wrong. I have an ePub book that has left and right margins that are too wide for me. I've gone to Page Setup in Calibre and lowered the values all the way down to zero but it makes no change at all when I open the book on my Kobo. Am I doing something wrong or is there just some epub's that can't be modified?
Thanks
There can be more than 1 Margin in effect (and padding)

Page (body) margin is the one controlled by the setting.

there may be separate paragraph margins, padding, and indents.

IMHO: Sigil
You can look at the Code and the stylesheet entry

One last thing.
Margins (any of them), will not change (reduce) a Margin within an Image (a picture of a page)
theducks is offline   Reply With Quote
Old 03-26-2011, 03:25 PM   #3
Jafo
Enthusiast
Jafo , Klaatu Barada Niktu!Jafo , Klaatu Barada Niktu!Jafo , Klaatu Barada Niktu!Jafo , Klaatu Barada Niktu!Jafo , Klaatu Barada Niktu!Jafo , Klaatu Barada Niktu!Jafo , Klaatu Barada Niktu!Jafo , Klaatu Barada Niktu!Jafo , Klaatu Barada Niktu!Jafo , Klaatu Barada Niktu!Jafo , Klaatu Barada Niktu!
 
Posts: 28
Karma: 5012
Join Date: Jul 2010
Device: Kobo (original)
Thanks for the quick response theducks. This is just a regular non-drm epub. There's about a half inch of margin on each side. It makes it so it's like reading a column in a magazine rather than a book. I've seen Sigil mentioned in other threads but I didn't know what it was and assumed it was some kind of inside joke or acronym or something. I googled it and I guess you are referring to the epub editor. I wouldn't know what the code or stylesheet entries are or what to change. I was just looking for an easy way to reduce the size of the margins and thought I was doing something wrong.
Thanks again
Jafo is offline   Reply With Quote
Old 03-26-2011, 03:47 PM   #4
itimpi
Wizard
itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.
 
Posts: 4,072
Karma: 777825
Join Date: Nov 2008
Device: Sony PRS-950, iphone/ipad (Marvin/iBooks/QuickReader)
You would lose very little by downloading and installing Sigil to see if it would help you. Sigil is a WISWYG editor for ePub books, so it could provide an easy way to determine what is setting the margins (and possibly correcting them). Some people get on with Sigil and others do not

Only caveat - make sure you experiment with a copy of the epub file so that you always have the orginal to revert to if you mess things up.
itimpi is offline   Reply With Quote
Old 03-26-2011, 04:01 PM   #5
theducks
Grand Sorcerer
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 14,870
Karma: 5654321
Join Date: Aug 2009
Location: (The original) Silicon Valley, USA
Device: Galaxy Tab 2, Astak Pocket Pro, K4NT
Quote:
Originally Posted by Jafo View Post
Thanks for the quick response theducks. This is just a regular non-drm epub. There's about a half inch of margin on each side. It makes it so it's like reading a column in a magazine rather than a book. I've seen Sigil mentioned in other threads but I didn't know what it was and assumed it was some kind of inside joke or acronym or something. I googled it and I guess you are referring to the epub editor. I wouldn't know what the code or stylesheet entries are or what to change. I was just looking for an easy way to reduce the size of the margins and thought I was doing something wrong.
Thanks again
It is the next forum down from Calibre

EPUB XHTML is not difficult (for the basic stuff most books have. Drop in at the EPUB group to see the really stuff the Gurus can do)
find your text that is not optimum
EPUB is boxes within boxes...
all you have to do is find what controls the box that makes it go wrong.
You are usually looking for a class="name" statement in the tag
looking in the stylesheet, you locate:
Code:
.name {  stuff.; margin-left: 1in; more stuff..}
The red is the item, the green is the value (NB 1in is not a good choice as it does not scale. Use pt or em. 0 values have no units).
if you see a "padding" value, that may affect things also (I sometimes put padding around images, so that the text does not start right against them)

all you need to do is reverse engineer the nested classes (inside to outer)

body
div (optional)
p
span? (I don't think margin applies)
Margin starts at the next layer OUT
theducks is offline   Reply With Quote
Old 03-26-2011, 04:24 PM   #6
Jafo
Enthusiast
Jafo , Klaatu Barada Niktu!Jafo , Klaatu Barada Niktu!Jafo , Klaatu Barada Niktu!Jafo , Klaatu Barada Niktu!Jafo , Klaatu Barada Niktu!Jafo , Klaatu Barada Niktu!Jafo , Klaatu Barada Niktu!Jafo , Klaatu Barada Niktu!Jafo , Klaatu Barada Niktu!Jafo , Klaatu Barada Niktu!Jafo , Klaatu Barada Niktu!
 
Posts: 28
Karma: 5012
Join Date: Jul 2010
Device: Kobo (original)
Quote:
Originally Posted by itimpi View Post
You would lose very little by downloading and installing Sigil to see if it would help you.
OK. Maybe I'll give it a try. Thanks.
Jafo is offline   Reply With Quote
Old 03-26-2011, 04:25 PM   #7
Jafo
Enthusiast
Jafo , Klaatu Barada Niktu!Jafo , Klaatu Barada Niktu!Jafo , Klaatu Barada Niktu!Jafo , Klaatu Barada Niktu!Jafo , Klaatu Barada Niktu!Jafo , Klaatu Barada Niktu!Jafo , Klaatu Barada Niktu!Jafo , Klaatu Barada Niktu!Jafo , Klaatu Barada Niktu!Jafo , Klaatu Barada Niktu!Jafo , Klaatu Barada Niktu!
 
Posts: 28
Karma: 5012
Join Date: Jul 2010
Device: Kobo (original)
Quote:
Originally Posted by theducks View Post
It is the next forum down from Calibre

EPUB XHTML is not difficult (for the basic stuff most books have. Drop in at the EPUB group to see the really stuff the Gurus can do)
find your text that is not optimum
EPUB is boxes within boxes...
all you have to do is find what controls the box that makes it go wrong.
You are usually looking for a class="name" statement in the tag
looking in the stylesheet, you locate:
Code:
.name {  stuff.; margin-left: 1in; more stuff..}
The red is the item, the green is the value (NB 1in is not a good choice as it does not scale. Use pt or em. 0 values have no units).
if you see a "padding" value, that may affect things also (I sometimes put padding around images, so that the text does not start right against them)

all you need to do is reverse engineer the nested classes (inside to outer)

body
div (optional)
p
span? (I don't think margin applies)
Margin starts at the next layer OUT
LOL. You lost me at XHTML!
But thanks anyway!
Jafo is offline   Reply With Quote
Old 03-26-2011, 07:03 PM   #8
Purple Lady
Wizard
Purple Lady ought to be getting tired of karma fortunes by now.Purple Lady ought to be getting tired of karma fortunes by now.Purple Lady ought to be getting tired of karma fortunes by now.Purple Lady ought to be getting tired of karma fortunes by now.Purple Lady ought to be getting tired of karma fortunes by now.Purple Lady ought to be getting tired of karma fortunes by now.Purple Lady ought to be getting tired of karma fortunes by now.Purple Lady ought to be getting tired of karma fortunes by now.Purple Lady ought to be getting tired of karma fortunes by now.Purple Lady ought to be getting tired of karma fortunes by now.Purple Lady ought to be getting tired of karma fortunes by now.
 
Purple Lady's Avatar
 
Posts: 2,459
Karma: 3612376
Join Date: Feb 2010
Location: Pennsylvania
Device: Nexus 7 LTE, Nexus 7 3g, Sony PRS-950, K3 3G, Nexus 5, Boyue T62
the margins could also be set in another file - this drove me crazy until I found it, but not all books use it. In Calibre, right mouse click on your book and choose Tweak ePub and then Explode ePub. If you use Windows, a Windows Explorer window will pop up. Look for a folder named OEBPS and look for a file name of page-template.xpgt in that folder. If you double-click it you will probably need to choose what to open it with - I use notepad.

Look for a line in the file like this
Quote:
<fo:simple-page-master master-name="single_column" margin-bottom="1.5em" margin-top="1.5em" margin-left="1.5em" margin-right="1.5em" >
you can change it to
Quote:
<fo:simple-page-master master-name="single_column" margin-bottom="0" margin-top="0" margin-left="0" margin-right="0" >
save the file and close Windows Explorer and go back to Calibre and Rebuild ePub should now be available for you to choose. If you convert your book and use Page Setup to size your margins, they should be ok.

I have found times when this didn't work either and then had to edit the css, but it sounds like that might be too much for you now. As if this isn't enough already
Purple Lady is offline   Reply With Quote
Old 03-26-2011, 07:55 PM   #9
Jafo
Enthusiast
Jafo , Klaatu Barada Niktu!Jafo , Klaatu Barada Niktu!Jafo , Klaatu Barada Niktu!Jafo , Klaatu Barada Niktu!Jafo , Klaatu Barada Niktu!Jafo , Klaatu Barada Niktu!Jafo , Klaatu Barada Niktu!Jafo , Klaatu Barada Niktu!Jafo , Klaatu Barada Niktu!Jafo , Klaatu Barada Niktu!Jafo , Klaatu Barada Niktu!
 
Posts: 28
Karma: 5012
Join Date: Jul 2010
Device: Kobo (original)
Thank you Purple Lady. That worked. I'm grateful to all of you who tried to help me! I will slowly learn more about this with the help of this forum. I'll try to learn how to use Sigil too. In the mean time, Purple Lady's solution is something I can understand. I'll get better as I go!
Thanks again!
Jafo is offline   Reply With Quote
Old 03-26-2011, 08:05 PM   #10
Purple Lady
Wizard
Purple Lady ought to be getting tired of karma fortunes by now.Purple Lady ought to be getting tired of karma fortunes by now.Purple Lady ought to be getting tired of karma fortunes by now.Purple Lady ought to be getting tired of karma fortunes by now.Purple Lady ought to be getting tired of karma fortunes by now.Purple Lady ought to be getting tired of karma fortunes by now.Purple Lady ought to be getting tired of karma fortunes by now.Purple Lady ought to be getting tired of karma fortunes by now.Purple Lady ought to be getting tired of karma fortunes by now.Purple Lady ought to be getting tired of karma fortunes by now.Purple Lady ought to be getting tired of karma fortunes by now.
 
Purple Lady's Avatar
 
Posts: 2,459
Karma: 3612376
Join Date: Feb 2010
Location: Pennsylvania
Device: Nexus 7 LTE, Nexus 7 3g, Sony PRS-950, K3 3G, Nexus 5, Boyue T62
you're welcome Jafo. I'm glad I wrote it in a way you could understand. I hope it helps other people too because this really drove me crazy - I use a pretty large font, so anything but a really small margin doesn't leave me many words on a page.
Purple Lady is offline   Reply With Quote
Old 03-26-2011, 10:58 PM   #11
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: 8,861
Karma: 12755553
Join Date: Feb 2009
Location: North Carolina
Device: Nexus 7
1st, Sigil is a great tool and has many fine features that help fine tune any epub. That said there was a new feature added.

Quote:
Originally Posted by Jafo View Post
I have an ePub book that has left and right margins that are too wide for me. I've gone to Page Setup in Calibre and lowered the values all the way down to zero but it makes no change at all when I open the book on my Kobo.
What version of calibre are you using? As of 0.7.51 those margins should be zeroed out automatically. I tested this with a epub book that had left and right margins and it worked fine in eliminating the original margins.

Quote:
Release: 0.7.51 [25 Mar, 2011]

New Features
  • Conversion: Detect and remove fake page margins that are specified as a margin on (nearly) every paragraph. This can be turned off via an option under Structure Detection, in case it removes margins that should have been kept.

Last edited by DoctorOhh; 03-26-2011 at 11:00 PM.
DoctorOhh is offline   Reply With Quote
Old 03-27-2011, 01:51 AM   #12
Purple Lady
Wizard
Purple Lady ought to be getting tired of karma fortunes by now.Purple Lady ought to be getting tired of karma fortunes by now.Purple Lady ought to be getting tired of karma fortunes by now.Purple Lady ought to be getting tired of karma fortunes by now.Purple Lady ought to be getting tired of karma fortunes by now.Purple Lady ought to be getting tired of karma fortunes by now.Purple Lady ought to be getting tired of karma fortunes by now.Purple Lady ought to be getting tired of karma fortunes by now.Purple Lady ought to be getting tired of karma fortunes by now.Purple Lady ought to be getting tired of karma fortunes by now.Purple Lady ought to be getting tired of karma fortunes by now.
 
Purple Lady's Avatar
 
Posts: 2,459
Karma: 3612376
Join Date: Feb 2010
Location: Pennsylvania
Device: Nexus 7 LTE, Nexus 7 3g, Sony PRS-950, K3 3G, Nexus 5, Boyue T62
I just tried it with two different books and it didn't work. They both had the margins set in the page-template.xpgt file. I made another copy of one and edited the page-template.xpgt as above and the margins were gone after converting. The books were U is for Undertow by Sue Grafton and The Strain by Guillermo del Toro.

used Calibre 0.7.52
Purple Lady is offline   Reply With Quote
Old 03-27-2011, 02:14 AM   #13
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: 8,861
Karma: 12755553
Join Date: Feb 2009
Location: North Carolina
Device: Nexus 7
Quote:
Originally Posted by Purple Lady View Post
I just tried it with two different books and it didn't work. They both had the margins set in the page-template.xpgt file. I made another copy of one and edited the page-template.xpgt as above and the margins were gone after converting. The books were U is for Undertow by Sue Grafton and The Strain by Guillermo del Toro.

used Calibre 0.7.52
Fortunately books with a page-template.xpgt file seem to be the exception at this point.

I'm guessing Kovid is examining the css. Maybe you could submit a request to add your technique for dealing with page-template.xpgt files to this new feature.
DoctorOhh is offline   Reply With Quote
Old 03-27-2011, 02:48 AM   #14
Purple Lady
Wizard
Purple Lady ought to be getting tired of karma fortunes by now.Purple Lady ought to be getting tired of karma fortunes by now.Purple Lady ought to be getting tired of karma fortunes by now.Purple Lady ought to be getting tired of karma fortunes by now.Purple Lady ought to be getting tired of karma fortunes by now.Purple Lady ought to be getting tired of karma fortunes by now.Purple Lady ought to be getting tired of karma fortunes by now.Purple Lady ought to be getting tired of karma fortunes by now.Purple Lady ought to be getting tired of karma fortunes by now.Purple Lady ought to be getting tired of karma fortunes by now.Purple Lady ought to be getting tired of karma fortunes by now.
 
Purple Lady's Avatar
 
Posts: 2,459
Karma: 3612376
Join Date: Feb 2010
Location: Pennsylvania
Device: Nexus 7 LTE, Nexus 7 3g, Sony PRS-950, K3 3G, Nexus 5, Boyue T62
Quote:
Originally Posted by dwanthny View Post
Fortunately books with a page-template.xpgt file seem to be the exception at this point.

I'm guessing Kovid is examining the css. Maybe you could submit a request to add your technique for dealing with page-template.xpgt files to this new feature.
Fortunately?? I happen to think it's unfortunate, but that's just me.

So how do I submit a request?
Purple Lady is offline   Reply With Quote
Old 03-27-2011, 02:59 AM   #15
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: 8,861
Karma: 12755553
Join Date: Feb 2009
Location: North Carolina
Device: Nexus 7
Quote:
Originally Posted by Purple Lady View Post
So how do I submit a request?
Follow these instructions.
DoctorOhh 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
Calibre language change? mago55 Calibre 5 10-24-2012 04:49 PM
Can't seem to change epub margins Desertway Calibre 7 01-19-2012 04:28 AM
Calibre Look Change? Rand Brittain Calibre 11 11-15-2010 06:41 PM
Calibre collapses paragraph margins - why? kiwik Calibre 2 01-08-2009 11:47 PM
PDF scaling gets lost when margins change dna2z Sony Reader 5 11-29-2006 10:20 PM


All times are GMT -4. The time now is 08:33 PM.


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