Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Reply
 
Thread Tools Search this Thread
Old 11-10-2019, 08:59 AM   #1
Tior500
Junior Member
Tior500 began at the beginning.
 
Posts: 7
Karma: 10
Join Date: Jul 2019
Device: kindle paperwhite
How to make the margins smaller in ePub?

Hello!
I'm quite new so I'm hoping that I'm writing this in the correct thread.
My question would be: how am I able to convert my ePub into an ePub with smaller margins using Calibre? Basically, I have an ePub book on my MacBook and I'm hoping to make the margins smaller and send it to my iPad iBooks.
Thank you!
Tior500 is offline   Reply With Quote
Old 11-10-2019, 09:42 AM   #2
theducks
Well trained by Cats
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: 29,754
Karma: 54401244
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Did you set the device profile to Tablet? That does a number of things, including make the images not shrink.

An ebook is boxes within boxes (AKA the box model). So you also need to know at which nested level, the 'excessive' margins are being applied.

The profile tends to affect the Body. But you could have a nest.
<div
<p
<blockquote

In addition, your device (app) may ignore the publishers (that in the book), and use its settings Or a combination.

So, the basic Q: Are all the books the same? 1)device, 2) Profile
anything else is the individual book
Time to learn some basic CSS (ebooks don't use much above the basic stuff)
theducks is offline   Reply With Quote
Advert
Old 11-10-2019, 10:48 AM   #3
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,835
Karma: 128597114
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by Tior500 View Post
Hello!
I'm quite new so I'm hoping that I'm writing this in the correct thread.
My question would be: how am I able to convert my ePub into an ePub with smaller margins using Calibre? Basically, I have an ePub book on my MacBook and I'm hoping to make the margins smaller and send it to my iPad iBooks.
Thank you!
Use the Calibre eBook editor to edit the eBook. Edit the CSS and remove any @page and change the left/right margins for body, p, and the classes used for p for indented and non-indented paragraphs.

I know this is not the easiest thing to do right away as a novice, but it really helps to learn HTML/CSS and once you do, you will be able to do more modification to the ePub. It's a lot better then going ePub > ePub.
JSWolf is offline   Reply With Quote
Old 11-14-2019, 11:43 AM   #4
deback
Book E d i t o r
deback ought to be getting tired of karma fortunes by now.deback ought to be getting tired of karma fortunes by now.deback ought to be getting tired of karma fortunes by now.deback ought to be getting tired of karma fortunes by now.deback ought to be getting tired of karma fortunes by now.deback ought to be getting tired of karma fortunes by now.deback ought to be getting tired of karma fortunes by now.deback ought to be getting tired of karma fortunes by now.deback ought to be getting tired of karma fortunes by now.deback ought to be getting tired of karma fortunes by now.deback ought to be getting tired of karma fortunes by now.
 
Posts: 432
Karma: 288184
Join Date: May 2015
Device: Laptop
In the Editor, you only need to change the left and right margins for the body class (in the *.css file), which is normally "calibre," but not always. If you change the body class and then change the left and right margins in the classes for the paragraphs, you will not have the results you intended.

Another way to change any of the four margins is to use Convert. Open the preferences from the main Calibre window (ctrl-P). Click on Common Options and then click on Page Setup. Over near the bottom on the right, fill in the left and right margin lines with the values you prefer. Click Apply and then when you convert, your margins will be what you've set under Page Setup--and you won't need to edit the page_styles.css or the stylesheet.css files.

Last edited by deback; 11-14-2019 at 11:47 AM.
deback is offline   Reply With Quote
Old 11-18-2019, 09:21 PM   #5
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,835
Karma: 128597114
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by deback View Post
In the Editor, you only need to change the left and right margins for the body class (in the *.css file), which is normally "calibre," but not always. If you change the body class and then change the left and right margins in the classes for the paragraphs, you will not have the results you intended.

Another way to change any of the four margins is to use Convert. Open the preferences from the main Calibre window (ctrl-P). Click on Common Options and then click on Page Setup. Over near the bottom on the right, fill in the left and right margin lines with the values you prefer. Click Apply and then when you convert, your margins will be what you've set under Page Setup--and you won't need to edit the page_styles.css or the stylesheet.css files.
Converting ePub > ePub is a bad idea. Don't do it.

As to what needs to be changed in the ePub depends on the ePub's code. @page has to go in the CSS. Body has to have the margins set to 0. if there is a p, it has to have the margins set to 0. If there are p modifying classes, they have to have the margins changed depending on what they do. You might also want to reduce the indent and the space used for offset text.

There is not a one size fits all solution. But the more you work with the HTML/CSS, the easier it will get.
JSWolf is offline   Reply With Quote
Advert
Old 11-19-2019, 08:58 AM   #6
deback
Book E d i t o r
deback ought to be getting tired of karma fortunes by now.deback ought to be getting tired of karma fortunes by now.deback ought to be getting tired of karma fortunes by now.deback ought to be getting tired of karma fortunes by now.deback ought to be getting tired of karma fortunes by now.deback ought to be getting tired of karma fortunes by now.deback ought to be getting tired of karma fortunes by now.deback ought to be getting tired of karma fortunes by now.deback ought to be getting tired of karma fortunes by now.deback ought to be getting tired of karma fortunes by now.deback ought to be getting tired of karma fortunes by now.
 
Posts: 432
Karma: 288184
Join Date: May 2015
Device: Laptop
Quote:
Converting ePub > ePub is a bad idea. Don't do it.
I do it all the time and am able to fix many things doing it. It works fine for me and saves me a lot of time not having to manually edit lots of CSS entries.
deback is offline   Reply With Quote
Old 11-19-2019, 09:46 AM   #7
theducks
Well trained by Cats
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: 29,754
Karma: 54401244
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Quote:
Originally Posted by deback View Post
I do it all the time and am able to fix many things doing it. It works fine for me and saves me a lot of time not having to manually edit lots of CSS entries.
I would use the words: Avoid doing it .

Look at the code on a book before Calibre, then look after a same format conversion. I'd much rather just touch up the CSS in an editor, than risk side effects.

Yes it works. And usually it creates little to no issues. But the dust bunnies that were created if you are a lean-mean coder will drive you to tears
I save the same format conversion route for those books so corrupt that neither Sigil nor the Calibre-editor can open them. Kovid has some miracle code that brings a book back from the dead pile
theducks is offline   Reply With Quote
Old 11-19-2019, 04:54 PM   #8
ps67
Guru
ps67 ought to be getting tired of karma fortunes by now.ps67 ought to be getting tired of karma fortunes by now.ps67 ought to be getting tired of karma fortunes by now.ps67 ought to be getting tired of karma fortunes by now.ps67 ought to be getting tired of karma fortunes by now.ps67 ought to be getting tired of karma fortunes by now.ps67 ought to be getting tired of karma fortunes by now.ps67 ought to be getting tired of karma fortunes by now.ps67 ought to be getting tired of karma fortunes by now.ps67 ought to be getting tired of karma fortunes by now.ps67 ought to be getting tired of karma fortunes by now.
 
Posts: 731
Karma: 7000000
Join Date: Aug 2017
Location: Italy
Device: Kindle Paperwhite, Kobo Elipsa, Pocketbook Color PB633, Inkpad Color
I seldom use that technique. Almost never. I agree with @theducks and @JSWolf: it should be avoided.

But if I have 52 hypertrophic css files in a fiction book (one for each chapter, I did not check if they are all equal but I think they are) with no particular formatting, except for titles, the time I would loose is more important than a clean work.

So: Epub to Epub with "remove spaces from paragraph" and 1.5em of indentation et voilà.

ps: I would like to know who is that made this horrible work. (may be the author itself).

Last edited by ps67; 11-19-2019 at 05:13 PM.
ps67 is offline   Reply With Quote
Old 11-19-2019, 05:32 PM   #9
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 35,219
Karma: 145277352
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Forma, Clara HD, Lenovo M8 FHD, Paperwhite 4, Tolino epos
Quote:
Originally Posted by ps67 View Post
ps: I would like to know who is that made this horrible work. (may be the author itself).
In the case of one local author, a 4 book omnibus with 134 CSS files—every bleeping XHTML file had it's own stylesheet so the text display was not consistent from chapter to chapter, never mind within the omnibus. Most of this was due to recovering her early books from her ex-publisher. Ghod alone knows who actually did the formatting or what program they used. I suspected a summer intern from embedding 5 font files for displaying cursive chapter headers and mixing graphics and text dropcaps. A couple of hours later, we were down to 1 CSS file, one embedded font, scene breaks that matched, etc. The miracles of regex/search and replace for the most part.

A bit boring layout but that's my personal preference and the author was happy enough to pay the remainder of the bill on time when Amazon accepted the upload on the first try.
DNSB is offline   Reply With Quote
Old 11-20-2019, 11:09 AM   #10
deback
Book E d i t o r
deback ought to be getting tired of karma fortunes by now.deback ought to be getting tired of karma fortunes by now.deback ought to be getting tired of karma fortunes by now.deback ought to be getting tired of karma fortunes by now.deback ought to be getting tired of karma fortunes by now.deback ought to be getting tired of karma fortunes by now.deback ought to be getting tired of karma fortunes by now.deback ought to be getting tired of karma fortunes by now.deback ought to be getting tired of karma fortunes by now.deback ought to be getting tired of karma fortunes by now.deback ought to be getting tired of karma fortunes by now.
 
Posts: 432
Karma: 288184
Join Date: May 2015
Device: Laptop
Quote:
Originally Posted by theducks View Post
I would use the words: Avoid doing it .

Look at the code on a book before Calibre, then look after a same format conversion. I'd much rather just touch up the CSS in an editor, than risk side effects.
I spent a lot of time coming up with my system of using Convert to fix many things. I have many entries in the Extra CSS and Transform sections. I'm a perfectionist and a lean-mean coder, and yes, I also spend a lot of time (sometimes) manually editing CSS classes, when it's impossible to fix things running Convert. The result after I run Convert is the best looking books and most readable books I've seen anywhere, using very simple coding and a lot less time than if I had manually edited everything I wanted to change. So, the result really depends on how you have all the conversion options set up.

Last edited by deback; 11-21-2019 at 10:57 AM.
deback is offline   Reply With Quote
Old 11-20-2019, 11:14 AM   #11
deback
Book E d i t o r
deback ought to be getting tired of karma fortunes by now.deback ought to be getting tired of karma fortunes by now.deback ought to be getting tired of karma fortunes by now.deback ought to be getting tired of karma fortunes by now.deback ought to be getting tired of karma fortunes by now.deback ought to be getting tired of karma fortunes by now.deback ought to be getting tired of karma fortunes by now.deback ought to be getting tired of karma fortunes by now.deback ought to be getting tired of karma fortunes by now.deback ought to be getting tired of karma fortunes by now.deback ought to be getting tired of karma fortunes by now.
 
Posts: 432
Karma: 288184
Join Date: May 2015
Device: Laptop
Quote:
Originally Posted by ps67 View Post
So: Epub to Epub with "remove spaces from paragraph" and 1.5em of indentation et voilà.
I never use the "remove spaces from paragraphs" option. I use the Extra CSS and Transform sections to accomplish that and to change all the indents to 1.2em. But, once in a while, I'll have to manually edit the CSS class for paragraphs to change the top and bottom margins to zero.
deback is offline   Reply With Quote
Old 11-21-2019, 08:25 AM   #12
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,835
Karma: 128597114
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
The first thing I do is remove all extra XHTML files like an internal ToC, reviews, list of other books, other publisher stuff and most of the time, the embedded fonts. Then I remove all extra CSS. If it's an eub 3, I fix it so it's an ePub 2. Then I add in my own body and p classes and from there I fix up the CSS. In most cases, it's very easy to do. Check for % in the CSS and replace that with more reasonable em umong other things,

When I am done, the code is fairly clean and the ePub is smaller.
JSWolf is offline   Reply With Quote
Old 11-21-2019, 11:16 AM   #13
deback
Book E d i t o r
deback ought to be getting tired of karma fortunes by now.deback ought to be getting tired of karma fortunes by now.deback ought to be getting tired of karma fortunes by now.deback ought to be getting tired of karma fortunes by now.deback ought to be getting tired of karma fortunes by now.deback ought to be getting tired of karma fortunes by now.deback ought to be getting tired of karma fortunes by now.deback ought to be getting tired of karma fortunes by now.deback ought to be getting tired of karma fortunes by now.deback ought to be getting tired of karma fortunes by now.deback ought to be getting tired of karma fortunes by now.
 
Posts: 432
Karma: 288184
Join Date: May 2015
Device: Laptop
I remove the TOC, because I make my own when I'm done with everything else (using the TOC function--add from files--and use my macro for adding the chapter titles using the XPath). I leave in the pages for titlepage, copyright, reviews, dedication, epigraph, and other books, if they exist, because I format everything to look like the real book.

My paragraph class is simple: text. My first paragraph class is simple: ni. Chapter title is: chapter. I use different classes for each front matter page and never use the same class for all the different sections (using simple class names like, copy, desc, epi, ded, acks).

I have a master CSS file that I copy/paste over the "calibre" class in the stylesheet.css file when I begin editing and formatting a book (then beautify and sort the CSS file). I have about 200 or more saved searches that I go through to find errors. I scroll through any PDF available to add paragraph breaks, italics, and sections that need formatting. I use the Reports feature to edit/fix various symbols that need to be deleted. I use the ABC spellcheck list to fix spelling errors.

When editing and formatting an ePub file, my basic steps are:

(1) Format all the pages. Change all current classes to my classes, remove all lines that need to be removed, and lots more.
(2) Use Reports to fix errors found.
(3) Use Spellcheck to fix errors found.
(4) Use Saved Searches to fix errors found.
(5) Scroll through the PDF to do what I said above.
(6) Run modify ePub and conversion to have Calibre do its thing.
(7) Create the TOC and edit it to look like I want it to look.
(8) Edit the margins for the cover image and edit a few font sizes that Calibre Convert changed (only if needed, and it usually isn't necessary).
deback is offline   Reply With Quote
Old 11-21-2019, 05:58 PM   #14
ps67
Guru
ps67 ought to be getting tired of karma fortunes by now.ps67 ought to be getting tired of karma fortunes by now.ps67 ought to be getting tired of karma fortunes by now.ps67 ought to be getting tired of karma fortunes by now.ps67 ought to be getting tired of karma fortunes by now.ps67 ought to be getting tired of karma fortunes by now.ps67 ought to be getting tired of karma fortunes by now.ps67 ought to be getting tired of karma fortunes by now.ps67 ought to be getting tired of karma fortunes by now.ps67 ought to be getting tired of karma fortunes by now.ps67 ought to be getting tired of karma fortunes by now.
 
Posts: 731
Karma: 7000000
Join Date: Aug 2017
Location: Italy
Device: Kindle Paperwhite, Kobo Elipsa, Pocketbook Color PB633, Inkpad Color
I remove page margins, paragraph margins in main text, give justification and indentation of 1.5em. I usually spend some minutes, no more, but sometimes I commit myself more, if the book is complex or I need to learn something (about calibre or css).

In rare occasion I remove and Create again the TOC because it is so poor that I need to change it - for example a dictionary of metric and rhetoric had no TOC for alphabetical order - but generally I don't do it.

May also be that I buy a book from Kobo and I am satisfied enough with its formatting so I simply read it. And of course it also depends on how much time I have available.
ps67 is offline   Reply With Quote
Old 11-21-2019, 09:58 PM   #15
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,835
Karma: 128597114
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by deback View Post
I remove the TOC, because I make my own when I'm done with everything else (using the TOC function--add from files--and use my macro for adding the chapter titles using the XPath). I leave in the pages for titlepage, copyright, reviews, dedication, epigraph, and other books, if they exist, because I format everything to look like the real book.

My paragraph class is simple: text. My first paragraph class is simple: ni. Chapter title is: chapter. I use different classes for each front matter page and never use the same class for all the different sections (using simple class names like, copy, desc, epi, ded, acks).

I have a master CSS file that I copy/paste over the "calibre" class in the stylesheet.css file when I begin editing and formatting a book (then beautify and sort the CSS file). I have about 200 or more saved searches that I go through to find errors. I scroll through any PDF available to add paragraph breaks, italics, and sections that need formatting. I use the Reports feature to edit/fix various symbols that need to be deleted. I use the ABC spellcheck list to fix spelling errors.

When editing and formatting an ePub file, my basic steps are:

(1) Format all the pages. Change all current classes to my classes, remove all lines that need to be removed, and lots more.
(2) Use Reports to fix errors found.
(3) Use Spellcheck to fix errors found.
(4) Use Saved Searches to fix errors found.
(5) Scroll through the PDF to do what I said above.
(6) Run modify ePub and conversion to have Calibre do its thing.
(7) Create the TOC and edit it to look like I want it to look.
(8) Edit the margins for the cover image and edit a few font sizes that Calibre Convert changed (only if needed, and it usually isn't necessary).
For the majority of paragraphs, I just use <p> as I don't need classes as I have <p> correctly set in CSS. So I remove all those useless classes.

I do delete the internal ToC as ePub doesn't need it. I go back to ePub 2 because ePub 3 (in most cases) is useless.

I remove all extra XHTML files that I don't need.

I fix all the extra screen space wasted in CSS. Those % are silly and I convert them to a reasonable em value.

I do delete extra lines in CSS because they are in multiple classes and don't need to be there. ePub from InDesign has a number of them.

But once you get used to cleaning up publisher ePub, it's pretty fast to do in most cases.

I refuse to convert from PDF. The hassle just isn't worth it.
JSWolf is offline   Reply With Quote
Reply

Tags
calibre, epub, margins

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Make mobis downloaded via a recipe smaller sup Conversion 2 11-06-2018 11:55 PM
Make the size from 200MB 400pp epub .. smaller? How? hlk123 Calibre 9 02-09-2018 04:40 PM
Smaller margins at kindle touch MarkFalk Amazon Kindle 3 03-21-2016 02:03 PM
How to make line spacing smaller Waylander Amazon Kindle 1 11-28-2013 01:37 PM
Can I make it smaller? jennaclaire Sony Reader 6 01-14-2008 09:10 AM


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


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