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 05-03-2012, 12:27 PM   #1
PortMan
Junior Member
PortMan began at the beginning.
 
Posts: 6
Karma: 10
Join Date: May 2012
Device: Nook Touch
Question Remove Blank Lines

First of all, I'm extremely new to both Calibre and the epub format, so please be patient with my ignorance. Also, I tried searching for this in the forums, but didn't find it. (Likely because I didn't know enough to know what to search for.)

I have some EPubs that have a blank line in between each and every paragraph. I do not like this.

How can I fix these epubs so that I don't have all of this useless white space on my tiny reader screen? Can I do it with Calibre? Do I need to install something like Sigil to do it?

Is this something I can do by extracting the contents of the epub and editing with a text editor?

Thank you.

Last edited by PortMan; 05-03-2012 at 01:57 PM. Reason: incorrect title
PortMan is offline   Reply With Quote
Old 05-03-2012, 12:30 PM   #2
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: 36,155
Karma: 17161828
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Sony Reader PRS-650, iPad, nook STR
If the ePub has DRM, you'll need to remove the DRM first. Go find Apprentice Alf via Google and learn how.

If the ePub is without DRM, you can use Tweak ePub from within Calibre and use a good text editor like Notepad++ (Windows) to edit the CSS to fix the problem.
JSWolf is offline   Reply With Quote
Old 05-03-2012, 12:47 PM   #3
PortMan
Junior Member
PortMan began at the beginning.
 
Posts: 6
Karma: 10
Join Date: May 2012
Device: Nook Touch
OK, I've done that, and opened the *.css files for two different books. Could you look at them and tell me what I need to add/remove/change to make it display without the blank lines?

The first one has multiple *.css files for each sub-book in it, but they're all the same, and look like this:
Code:
.verseNumber
{
    font-size:large;
    margin: 15px 15px 15px 15px;
}


ul
{
    list-style-type:none;
}
The second one looks like this:
Code:
@namespace h "http://www.w3.org/1999/xhtml";
.MsoNormal {
    display: block;
    font-family: Calibri;
    font-size: 0.85714em;
    line-height: 1.2;
    margin-bottom: 0.0001pt;
    margin-left: 0;
    margin-right: 0;
    margin-top: 0;
    text-align: center
    }
.MsoNormal1 {
    display: block;
    font-family: Calibri;
    font-size: 0.85714em;
    line-height: 1.2;
    margin-bottom: 0.0001pt;
    margin-left: 0;
    margin-right: 0;
    margin-top: 0
    }
.MsoNormal2 {
    display: block;
    font-family: Calibri;
    font-size: 0.85714em;
    line-height: 1.2;
    margin-bottom: 0.0001pt;
    margin-left: 0;
    margin-right: 0;
    margin-top: 0;
    text-indent: 0.5in
    }
.Section {
    display: block;
    page: Section1
    }
.SpellE {
    line-height: 1.2
    }
.calibre {
    display: block;
    font-size: 0.875em;
    line-height: 1.2;
    margin-bottom: 0;
    margin-left: 5pt;
    margin-right: 5pt;
    margin-top: 0;
    padding-left: 0;
    padding-right: 0
    }
.calibre1 {
    color: inherit;
    cursor: inherit;
    text-decoration: inherit
    }
.calibre2 {
    font-weight: bolder
    }
.calibre3 {
    font-size: 1.33333em;
    line-height: 1.2
    }
.calibre4 {
    display: block;
    line-height: 1.2
    }
.calibre5 {
    font-style: italic;
    line-height: 1.2
    }
.calibre6 {
    font-style: italic
    }
PortMan is offline   Reply With Quote
Old 05-03-2012, 12:48 PM   #4
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: 36,155
Karma: 17161828
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Sony Reader PRS-650, iPad, nook STR
What does the code in the XML look like for the normal paragraphs?

Also, remove all the line-height: 1.2.
JSWolf is offline   Reply With Quote
Old 05-03-2012, 12:51 PM   #5
PortMan
Junior Member
PortMan began at the beginning.
 
Posts: 6
Karma: 10
Join Date: May 2012
Device: Nook Touch
Are you asking for the XML from the first book or the 2nd?
PortMan is offline   Reply With Quote
Old 05-03-2012, 12:54 PM   #6
HarryT
eBook Enthusiast
HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.
 
HarryT's Avatar
 
Posts: 62,578
Karma: 40125235
Join Date: Nov 2006
Location: UK
Device: PW2, iPad Retina Mini, iPhone 4, MS Surface Pro, Onyx T68, N7,
The easiest way to do it is to do an "ePub to ePub" conversion in Calibre and, in the conversion options dialogue, go to the "Look and Feel" page and check the "Remove spacing between paragraphs" box.

This won't work in 100% of cases, but it does work for the vast majority of books.
HarryT is online now   Reply With Quote
Old 05-03-2012, 01:14 PM   #7
PortMan
Junior Member
PortMan began at the beginning.
 
Posts: 6
Karma: 10
Join Date: May 2012
Device: Nook Touch
The epub to epub conversion, after a little bit of fiddling around, worked! Thank you!

Now that it's modified in my library, what do I need to do to get the updated version onto my Nook touch?
PortMan is offline   Reply With Quote
Old 05-03-2012, 08:39 PM   #8
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: 36,155
Karma: 17161828
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Sony Reader PRS-650, iPad, nook STR
ePub > ePub doesn't always work well. IMHO, it's better to learn to edit the code.
JSWolf is offline   Reply With Quote
Old 05-04-2012, 04:00 AM   #9
HarryT
eBook Enthusiast
HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.
 
HarryT's Avatar
 
Posts: 62,578
Karma: 40125235
Join Date: Nov 2006
Location: UK
Device: PW2, iPad Retina Mini, iPhone 4, MS Surface Pro, Onyx T68, N7,
Quote:
Originally Posted by JSWolf View Post
ePub > ePub doesn't always work well. IMHO, it's better to learn to edit the code.
I've done it for dozens of books and it generally works well. Of course, you always have the original ePub to revert to in the rare cases that it doesn't.
HarryT is online now   Reply With Quote
Old 05-04-2012, 11:47 AM   #10
PortMan
Junior Member
PortMan began at the beginning.
 
Posts: 6
Karma: 10
Join Date: May 2012
Device: Nook Touch
Quote:
Originally Posted by JSWolf View Post
ePub > ePub doesn't always work well. IMHO, it's better to learn to edit the code.
I would love to learn how to edit the code.

Earlier, you asked me what the XML looks like for normal paragraphs. Were you asking that for the first book, the 2nd, or for both?
PortMan is offline   Reply With Quote
Old 05-06-2012, 09:02 PM   #11
unboggling
by the bootstraps
unboggling ought to be getting tired of karma fortunes by now.unboggling ought to be getting tired of karma fortunes by now.unboggling ought to be getting tired of karma fortunes by now.unboggling ought to be getting tired of karma fortunes by now.unboggling ought to be getting tired of karma fortunes by now.unboggling ought to be getting tired of karma fortunes by now.unboggling ought to be getting tired of karma fortunes by now.unboggling ought to be getting tired of karma fortunes by now.unboggling ought to be getting tired of karma fortunes by now.unboggling ought to be getting tired of karma fortunes by now.unboggling ought to be getting tired of karma fortunes by now.
 
Posts: 1,052
Karma: 858115
Join Date: Jan 2011
Location: Southeast US
Device: PRS-T2, Nexus 7, KindleT, iPad1, Kindle3KB
Quote:
Originally Posted by HarryT View Post
The easiest way to do it is to do an "ePub to ePub" conversion in Calibre and, in the conversion options dialogue, go to the "Look and Feel" page and check the "Remove spacing between paragraphs" box.

This won't work in 100% of cases, but it does work for the vast majority of books.
I apply the OriginalFormat to ePub conversion using Look&Feel "Remove spacing between paragraphs" to all newly added books (except image or complex PDFs) to standardize the line and indent spacing across my libraries.

The "Remove spacing between paragraphs" doesn't work when the source uses Line Feed rather than Paragraph markers. I find it easiest to fix these by converting to RTF, search/replace Line Feeds to Paragraphs in Open Office or Word, save as ODT or RTF, then add that back to calibre and convert to ePub using the "Remove spacing between paragraphs" box.

Here's a question related to avoiding all that work on the LF exceptions: Is there an easy way to replace the HTML tags for LF (whatever they are) with the HTML tags for Paragraph (whatever they are), using search/replace regular expressions during the first conversion?

Last edited by unboggling; 05-06-2012 at 09:07 PM.
unboggling is offline   Reply With Quote
Old 05-07-2012, 12:26 AM   #12
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,230
Karma: 5495470
Join Date: Aug 2009
Location: The (original) Silicon Valley, USA
Device: Galaxy Tab 2, Astak Pocket Pro, K4NT
Quote:
Originally Posted by unboggling View Post
I apply the OriginalFormat to ePub conversion using Look&Feel "Remove spacing between paragraphs" to all newly added books (except image or complex PDFs) to standardize the line and indent spacing across my libraries.

The "Remove spacing between paragraphs" doesn't work when the source uses Line Feed rather than Paragraph markers. I find it easiest to fix these by converting to RTF, search/replace Line Feeds to Paragraphs in Open Office or Word, save as ODT or RTF, then add that back to calibre and convert to ePub using the "Remove spacing between paragraphs" box.

Here's a question related to avoiding all that work on the LF exceptions: Is there an easy way to replace the HTML tags for LF (whatever they are) with the HTML tags for Paragraph (whatever they are), using search/replace regular expressions during the first conversion?
You really need to look at the HTML code

There is no LF or CR-LF tag in HTML
There is a <p> tag, or a <div> tag. Either of those could contain a <br /> tag (forces to a new line).

Code:
<p>
Now
 Is 
 the 
 time
 for 
 all
 Good Men</p>
is the same as:
Code:
<p>Now is the time for all Good Men</p>
theducks is offline   Reply With Quote
Old 05-07-2012, 01:14 AM   #13
unboggling
by the bootstraps
unboggling ought to be getting tired of karma fortunes by now.unboggling ought to be getting tired of karma fortunes by now.unboggling ought to be getting tired of karma fortunes by now.unboggling ought to be getting tired of karma fortunes by now.unboggling ought to be getting tired of karma fortunes by now.unboggling ought to be getting tired of karma fortunes by now.unboggling ought to be getting tired of karma fortunes by now.unboggling ought to be getting tired of karma fortunes by now.unboggling ought to be getting tired of karma fortunes by now.unboggling ought to be getting tired of karma fortunes by now.unboggling ought to be getting tired of karma fortunes by now.
 
Posts: 1,052
Karma: 858115
Join Date: Jan 2011
Location: Southeast US
Device: PRS-T2, Nexus 7, KindleT, iPad1, Kindle3KB
theducks, thanks. I'll look at the code the next time I see one of those problem formats.
unboggling is offline   Reply With Quote
Old 05-07-2012, 02:25 AM   #14
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: 36,155
Karma: 17161828
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Sony Reader PRS-650, iPad, nook STR
Quote:
Originally Posted by HarryT View Post
I've done it for dozens of books and it generally works well. Of course, you always have the original ePub to revert to in the rare cases that it doesn't.
Another issue is the code does get changed. If you are converting an ePub that has @page and/or embedded fonts, you get a nightmare in return due to Calibre's placing all the CSS @ code in almost every XML file. I prefer to know how to edit the code. In fact, it's not that difficult to do. Sometimes all it takes is removing @page & body if either/both exist and putting in a new body style. Sometimes all you need is a body style with the margin as you want them.

Code:
body {
  font-family: serif;
  widows: 0;
  orphans: 0;
  margin-top: 0;
  margin-bottom: 0;
  margin-left: 0;
  margin-right: 0;
  text-align: justify
}

Last edited by JSWolf; 05-07-2012 at 02:28 AM.
JSWolf is offline   Reply With Quote
Old 05-07-2012, 02:29 AM   #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: 36,155
Karma: 17161828
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Sony Reader PRS-650, iPad, nook STR
Quote:
Originally Posted by PortMan View Post
I would love to learn how to edit the code.

Earlier, you asked me what the XML looks like for normal paragraphs. Were you asking that for the first book, the 2nd, or for both?
For the code for the paragraphs that went with the CSS code. Please post both in another message.
JSWolf 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
Do not remove paragraph spaces in Kindle output module andrewdru Conversion 15 08-29-2011 11:29 AM
WTB: Ability to change indent without ticking 'remove spaces between lines' gweminence Calibre 9 08-27-2011 09:05 AM
expression to remove double spacing between paragraphs ktj Calibre 4 07-26-2011 02:38 PM
How can I remove spaces from folder and file names? jusmee Calibre 1 11-06-2009 10:36 PM
Anyway to remove paragraph spaces in pdb files? twister Other formats 3 03-12-2009 09:36 PM


All times are GMT -4. The time now is 10:24 AM.


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