Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Reply
 
Thread Tools Search this Thread
Old 02-17-2013, 02:34 AM   #1
Skydog
Wizard
Skydog ought to be getting tired of karma fortunes by now.Skydog ought to be getting tired of karma fortunes by now.Skydog ought to be getting tired of karma fortunes by now.Skydog ought to be getting tired of karma fortunes by now.Skydog ought to be getting tired of karma fortunes by now.Skydog ought to be getting tired of karma fortunes by now.Skydog ought to be getting tired of karma fortunes by now.Skydog ought to be getting tired of karma fortunes by now.Skydog ought to be getting tired of karma fortunes by now.Skydog ought to be getting tired of karma fortunes by now.Skydog ought to be getting tired of karma fortunes by now.
 
Skydog's Avatar
 
Posts: 2,243
Karma: 7400001
Join Date: Mar 2009
Location: Circling Earth @ Mach .83
Device: Elipsa 2E, Sage, Forma, Libra 2, Clara 2E, Kindle Oasis3, Voyage
Removing spaces between paragraphs

How does one remove spaces/lines only between paragraphs without simultaneously removing spaces in the chapter headings, TOC, dedication, etc? I have tried settings in "Look and Feel" as well as an option in Heuristic Processing but both methods remove spacing in places other than paragraphs. My solution has been to manually re-add spaces in the TOC, dedication, chapters headings, etc., and it is tedious. There must be an easier way.

Last edited by Skydog; 02-17-2013 at 02:36 AM.
Skydog is offline   Reply With Quote
Old 02-17-2013, 07:22 AM   #2
Agama
Guru
Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.
 
Agama's Avatar
 
Posts: 776
Karma: 2751519
Join Date: Jul 2010
Location: UK
Device: PW2, Nexus7
What format/s are you working with? For ePub I don't rely on any blank lines for spacing between elements, so the Look & Feel option to "remove spacing between paragraphs" is a good starting point. You can then introduce spacing for other elements, (headings etc.) by adding styles with margin-top/margin-bottom values (in Extra CSS), that only affect your tags for headings etc.

Alternatively you could Tweak an ePub, (it's on the right-click menu), and manually edit the stylesheet. Either way, CSS is definitley the easiest way to apply formatting to a book.

Margin-top/bottom are best in units of em, (so that they are affected by the zoom level), whereas left/right are best in pt, (so they don't increase with zoom level and consume lots of screen width.)

It's hard to be more specific without an example of your input and output.

What are you currently doing to re-add spacing?
Agama is offline   Reply With Quote
Advert
Old 02-17-2013, 12:51 PM   #3
Skydog
Wizard
Skydog ought to be getting tired of karma fortunes by now.Skydog ought to be getting tired of karma fortunes by now.Skydog ought to be getting tired of karma fortunes by now.Skydog ought to be getting tired of karma fortunes by now.Skydog ought to be getting tired of karma fortunes by now.Skydog ought to be getting tired of karma fortunes by now.Skydog ought to be getting tired of karma fortunes by now.Skydog ought to be getting tired of karma fortunes by now.Skydog ought to be getting tired of karma fortunes by now.Skydog ought to be getting tired of karma fortunes by now.Skydog ought to be getting tired of karma fortunes by now.
 
Skydog's Avatar
 
Posts: 2,243
Karma: 7400001
Join Date: Mar 2009
Location: Circling Earth @ Mach .83
Device: Elipsa 2E, Sage, Forma, Libra 2, Clara 2E, Kindle Oasis3, Voyage
Sorry, I should have included in my post - ePub. First, I must disclose that I am a complete, untrained noob with HTML and CSS. That said, I have learned to work with paragraphs, margins, indents, spacing, etc. by studying the stylesheets along with excellent information from those here on MR and tutorials on www.ws3.org.

The ePubs display fine when viewing in Calibre's viewer and Sigil but introduce additional line spacing when side-loading to a Kobo (Mini). So, I removed the unwanted spacing by converting ePub => ePub along with the method described in my original post. That's where the unwanted removal of spacing in other areas appeared resulting in my attempt to fix it. I copied what was in the original ePub to restore spacing. For example:

<p class="x2DED-FIRST">&nbsp;</p>

or this:

<p class="x2TTLPG-AU"><br /></p>

I'll next experiment as you recommend with Tweak, or adding styles (after a little more reading).

I have never encountered the added-spacing-from-sideloading problem before, either with ePub or AZW3. I suspect that there is something unique to Kobo's firmware to cause this and perhaps I should investigate further in the appropriate sub-forum.

Thank you for the very helpful info regarding margin-top/bottom in em (which I always use) vs. left/right in pt. I was not aware of the relationship with the zoom level.

Thank you again for your help -- it is greatly appreciated.
Skydog is offline   Reply With Quote
Old 02-17-2013, 01:27 PM   #4
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,782
Karma: 54830978
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 Skydog View Post

<p class="x2DED-FIRST">&nbsp;</p>

or this:

<p class="x2TTLPG-AU"><br /></p>

Thank you for the very helpful info regarding margin-top/bottom in em (which I always use) vs. left/right in pt. I was not aware of the relationship with the zoom level.

Thank you again for your help -- it is greatly appreciated.
This is a (mostly) empty paragraph (or forced Break) that some use because:
1)They don't know how to us top/bottom margin values
2)Their device ignores margins used in #1

The problem: is these margins are indistinguishable from Scene breaks, Header spacing and a host of other uses.

IMHO trying to sledge hammer fix with Calibre is asking for a mess.
This is a case where a EPUB editor like Sigil is handy.
first)
Replace the desired cases with a new selector to distinguish these.
Code:
class="x2TTLPG-AU" -> class="scenebreak"
all you need to do in the stylesheet if no other properties need changing

Code:
.x2TTLPG-AU, scenebreak
is add a comma and the additional selector to make a group
next)
adjust the top/bottom margins for those other styles that spacing is desired

Now you should be ready to remove those other 'empty lines')
theducks is offline   Reply With Quote
Old 02-17-2013, 04:39 PM   #5
Skydog
Wizard
Skydog ought to be getting tired of karma fortunes by now.Skydog ought to be getting tired of karma fortunes by now.Skydog ought to be getting tired of karma fortunes by now.Skydog ought to be getting tired of karma fortunes by now.Skydog ought to be getting tired of karma fortunes by now.Skydog ought to be getting tired of karma fortunes by now.Skydog ought to be getting tired of karma fortunes by now.Skydog ought to be getting tired of karma fortunes by now.Skydog ought to be getting tired of karma fortunes by now.Skydog ought to be getting tired of karma fortunes by now.Skydog ought to be getting tired of karma fortunes by now.
 
Skydog's Avatar
 
Posts: 2,243
Karma: 7400001
Join Date: Mar 2009
Location: Circling Earth @ Mach .83
Device: Elipsa 2E, Sage, Forma, Libra 2, Clara 2E, Kindle Oasis3, Voyage
Quote:
Originally Posted by theducks View Post
This is a (mostly) empty paragraph (or forced Break) that some use because:
1)They don't know how to us top/bottom margin values
2)Their device ignores margins used in #1

The problem: is these margins are indistinguishable from Scene breaks, Header spacing and a host of other uses.

IMHO trying to sledge hammer fix with Calibre is asking for a mess.
This is a case where a EPUB editor like Sigil is handy.
first)
Replace the desired cases with a new selector to distinguish these.
Code:
class="x2TTLPG-AU" -> class="scenebreak"
all you need to do in the stylesheet if no other properties need changing

Code:
.x2TTLPG-AU, scenebreak
is add a comma and the additional selector to make a group
next)
adjust the top/bottom margins for those other styles that spacing is desired

Now you should be ready to remove those other 'empty lines')
Thanks, theducks. So, If I edit the stylesheet as you've described, followed by an ePub => ePub conversion removing unwanted line spacing in the body, this will keep the others (TOC, chapter headings, etc.) unaltered?

The odd part of my problem is that the original is fine -- it's only when sideloaded to the Kobo that the extra spacing appears.

I am new at this and learning.
Skydog is offline   Reply With Quote
Advert
Old 02-17-2013, 04:58 PM   #6
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,782
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
A stylesheet edit by itself will not do it.
That is only a step to allow safer removal of the code at a later time.

What your Kobo is doing is
That original code should leave a gap on many devices.
What Kobo may be supplying its own Paragraph margins, then these lines ADD to that
theducks is offline   Reply With Quote
Old 02-17-2013, 07:09 PM   #7
Skydog
Wizard
Skydog ought to be getting tired of karma fortunes by now.Skydog ought to be getting tired of karma fortunes by now.Skydog ought to be getting tired of karma fortunes by now.Skydog ought to be getting tired of karma fortunes by now.Skydog ought to be getting tired of karma fortunes by now.Skydog ought to be getting tired of karma fortunes by now.Skydog ought to be getting tired of karma fortunes by now.Skydog ought to be getting tired of karma fortunes by now.Skydog ought to be getting tired of karma fortunes by now.Skydog ought to be getting tired of karma fortunes by now.Skydog ought to be getting tired of karma fortunes by now.
 
Skydog's Avatar
 
Posts: 2,243
Karma: 7400001
Join Date: Mar 2009
Location: Circling Earth @ Mach .83
Device: Elipsa 2E, Sage, Forma, Libra 2, Clara 2E, Kindle Oasis3, Voyage
Ok, thank you. So much for painless conversions to the Kobo.
Skydog is offline   Reply With Quote
Old 02-18-2013, 03:01 AM   #8
Agama
Guru
Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.
 
Agama's Avatar
 
Posts: 776
Karma: 2751519
Join Date: Jul 2010
Location: UK
Device: PW2, Nexus7
Quote:
Originally Posted by theducks View Post
This is a (mostly) empty paragraph (or forced Break) that some use because:
1)They don't know how to us top/bottom margin values
2)Their device ignores margins used in #1
Is #2 a problem with many devices?

This sounds so basic that it must be a design decision for some reason, but it's then harder to produce a single ePub which renders consistently, (though not necessarily identically), on all devices.
Agama is offline   Reply With Quote
Old 02-18-2013, 09:09 AM   #9
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,782
Karma: 54830978
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 Agama View Post
Is #2 a problem with many devices?

This sounds so basic that it must be a design decision for some reason, but it's then harder to produce a single ePub which renders consistently, (though not necessarily identically), on all devices.
I don't own one of those devices, but a common theme appears here at MR is 'We know better than you' and Basic EPUB is either not fully implemented or ignores/does wrong some styling.

Jst look at the ADE list down in EPUB forum.
Then there is the Apple flavor of EPUB. The Nook flavor, The Kobo flavor...

Why the EPUB (W3C) group did not require a minimum before someone could label as being 'EPUB'.

There are these requirements in Electronics. USB Must meet certain minimums to bear the USB 2.0 logo. HDMI has standards. BluRay has version standards. IEEE provides lots of industry standards

Why is software still in the standards dark ages after 30 years in the consumer marketplace?
theducks is offline   Reply With Quote
Old 02-19-2013, 11:05 AM   #10
jackie_w
Grand Sorcerer
jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.
 
Posts: 6,208
Karma: 16534692
Join Date: Sep 2009
Location: UK
Device: Kobo: KA1, ClaraHD, Forma, Libra2, Clara2E. PocketBook: TouchHD3
In defence of Kobo... I'm relatively new to Kobo world but can categorically say that calibre-sent standard epubs render margin-top/margin-bottom (as contained in internal epub css) perfectly.

Kobo allows user configuration of Line Spacing (line-height in css terms) but will override with the epub's own css, if present. Unfortunately the Kobo minimum setting for Line Spacing is rather larger (1.3) than many would probably prefer, so this could be an issue.

If you want to selectively change paragraph top/bottom margins the only option is to roll up the sleeves and surgically edit the relevant epub css classes with something like Sigil or calibre Tweak book. Unfortunately there is no automatic magic button called 'make my epub perfect'.
jackie_w is offline   Reply With Quote
Old 02-19-2013, 09:27 PM   #11
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 24,907
Karma: 47303748
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
Quote:
Originally Posted by jackie_w View Post
In defence of Kobo... I'm relatively new to Kobo world but can categorically say that calibre-sent standard epubs render margin-top/margin-bottom (as contained in internal epub css) perfectly.
I agree with this, but I have seen both of SkyDogs examples in epubs and the second one does what he described. I didn't play with it, just removed it and changed the class on the next paragraph. But since then, I have been wondering why this didn't work as I am sure I have seen it working at other times. I don't think I have the original version to retest with.
Quote:
Kobo allows user configuration of Line Spacing (line-height in css terms) but will override with the epub's own css, if present. Unfortunately the Kobo minimum setting for Line Spacing is rather larger (1.3) than many would probably prefer, so this could be an issue.
Unless this has changed in the latest firmware, the Kobo devices respect the line-height in the epub. I did some tests on this last year with different line-height values. From memory I started with 0.1 and it seemed to do what what was expected.

I don't mind the minimum that Kobo uses, but I think they should have allowed a minimum of 1. The annoying thing is that they actually allow a minimum of 1.225 (from memory) but you have to edit the conf file to set this.
davidfor is offline   Reply With Quote
Old 02-20-2013, 08:41 PM   #12
Skydog
Wizard
Skydog ought to be getting tired of karma fortunes by now.Skydog ought to be getting tired of karma fortunes by now.Skydog ought to be getting tired of karma fortunes by now.Skydog ought to be getting tired of karma fortunes by now.Skydog ought to be getting tired of karma fortunes by now.Skydog ought to be getting tired of karma fortunes by now.Skydog ought to be getting tired of karma fortunes by now.Skydog ought to be getting tired of karma fortunes by now.Skydog ought to be getting tired of karma fortunes by now.Skydog ought to be getting tired of karma fortunes by now.Skydog ought to be getting tired of karma fortunes by now.
 
Skydog's Avatar
 
Posts: 2,243
Karma: 7400001
Join Date: Mar 2009
Location: Circling Earth @ Mach .83
Device: Elipsa 2E, Sage, Forma, Libra 2, Clara 2E, Kindle Oasis3, Voyage
Quote:
Originally Posted by jackie_w View Post
In defence of Kobo... I'm relatively new to Kobo world but can categorically say that calibre-sent standard epubs render margin-top/margin-bottom (as contained in internal epub css) perfectly.

Kobo allows user configuration of Line Spacing (line-height in css terms) but will override with the epub's own css, if present. Unfortunately the Kobo minimum setting for Line Spacing is rather larger (1.3) than many would probably prefer, so this could be an issue.

If you want to selectively change paragraph top/bottom margins the only option is to roll up the sleeves and surgically edit the relevant epub css classes with something like Sigil or calibre Tweak book. Unfortunately there is no automatic magic button called 'make my epub perfect'.
My complaint with Kobo is that the line spacing is so unusually large that it cannot be adequately corrected by selecting the minimum setting on the device. Some complain about the Kindle but I have never had this problem when converting to AZW3 or mobi. In my experience, the only editing required on occasion is indent size and/or removal of spaces between paragraphs.
Skydog is offline   Reply With Quote
Old 02-20-2013, 08:52 PM   #13
Skydog
Wizard
Skydog ought to be getting tired of karma fortunes by now.Skydog ought to be getting tired of karma fortunes by now.Skydog ought to be getting tired of karma fortunes by now.Skydog ought to be getting tired of karma fortunes by now.Skydog ought to be getting tired of karma fortunes by now.Skydog ought to be getting tired of karma fortunes by now.Skydog ought to be getting tired of karma fortunes by now.Skydog ought to be getting tired of karma fortunes by now.Skydog ought to be getting tired of karma fortunes by now.Skydog ought to be getting tired of karma fortunes by now.Skydog ought to be getting tired of karma fortunes by now.
 
Skydog's Avatar
 
Posts: 2,243
Karma: 7400001
Join Date: Mar 2009
Location: Circling Earth @ Mach .83
Device: Elipsa 2E, Sage, Forma, Libra 2, Clara 2E, Kindle Oasis3, Voyage
Quote:
Originally Posted by davidfor View Post
I agree with this, but I have seen both of SkyDogs examples in epubs and the second one does what he described. I didn't play with it, just removed it and changed the class on the next paragraph. But since then, I have been wondering why this didn't work as I am sure I have seen it working at other times. I don't think I have the original version to retest with.

Unless this has changed in the latest firmware, the Kobo devices respect the line-height in the epub. I did some tests on this last year with different line-height values. From memory I started with 0.1 and it seemed to do what what was expected.

I don't mind the minimum that Kobo uses, but I think they should have allowed a minimum of 1. The annoying thing is that they actually allow a minimum of 1.225 (from memory) but you have to edit the conf file to set this.
As previously mentioned, I am truly a novice when it comes to HTML and CSS editing. Everything I have learned has been self-taught through trial and error thanks to Sigil and Calibre. Now that I know that Kobo's firmware behaves differently I am hoping to learn to recognize and fix the line spacing once as opposed to three or four attempts before getting it right. It is a major pain to have to do this for every side-loaded ePub.

And I, too, have found changing the line height value is indeed recognized.

P.S. I'm a she, not a he.
Skydog is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
RegEx: Removing Page Numbers that have Spaces captainslow Conversion 2 02-27-2011 04:14 PM
removing extra spaces - kills images wmeyer Sigil 4 01-14-2011 01:37 PM
Spaces between Paragraphs in FBReader? luqmaninbmore PocketBook 2 03-10-2010 09:09 AM
Huge Spaces Between Paragraphs diremommy Calibre 0 12-29-2009 06:30 PM
Mobi -> LRF, huge spaces between paragraphs Djehuty Calibre 3 04-22-2009 12:06 PM


All times are GMT -4. The time now is 04:47 PM.


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