02-17-2013, 03:34 AM | #1 |
Wizard
Posts: 2,286
Karma: 7409537
Join Date: Mar 2009
Location: Circling Earth @ Mach .83
Device: Elipsa 2E, Sage, Libra Colour, Libra 2, Clara 2E, 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 03:36 AM. |
02-17-2013, 08:22 AM | #2 |
Guru
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? |
Advert | |
|
02-17-2013, 01:51 PM | #3 |
Wizard
Posts: 2,286
Karma: 7409537
Join Date: Mar 2009
Location: Circling Earth @ Mach .83
Device: Elipsa 2E, Sage, Libra Colour, Libra 2, Clara 2E, 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"> </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. |
02-17-2013, 02:27 PM | #4 | |
Well trained by Cats
Posts: 30,443
Karma: 58055868
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Quote:
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" Code:
.x2TTLPG-AU, scenebreak
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') |
|
02-17-2013, 05:39 PM | #5 | |
Wizard
Posts: 2,286
Karma: 7409537
Join Date: Mar 2009
Location: Circling Earth @ Mach .83
Device: Elipsa 2E, Sage, Libra Colour, Libra 2, Clara 2E, Oasis3, Voyage
|
Quote:
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. |
|
Advert | |
|
02-17-2013, 05:58 PM | #6 |
Well trained by Cats
Posts: 30,443
Karma: 58055868
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 |
02-17-2013, 08:09 PM | #7 |
Wizard
Posts: 2,286
Karma: 7409537
Join Date: Mar 2009
Location: Circling Earth @ Mach .83
Device: Elipsa 2E, Sage, Libra Colour, Libra 2, Clara 2E, Oasis3, Voyage
|
Ok, thank you. So much for painless conversions to the Kobo.
|
02-18-2013, 04:01 AM | #8 | |
Guru
Posts: 776
Karma: 2751519
Join Date: Jul 2010
Location: UK
Device: PW2, Nexus7
|
Quote:
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. |
|
02-18-2013, 10:09 AM | #9 | |
Well trained by Cats
Posts: 30,443
Karma: 58055868
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Quote:
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? |
|
02-19-2013, 12:05 PM | #10 |
Grand Sorcerer
Posts: 6,221
Karma: 16536676
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'. |
02-19-2013, 10:27 PM | #11 | ||
Grand Sorcerer
Posts: 24,905
Karma: 47303822
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
|
Quote:
Quote:
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. |
||
02-20-2013, 09:41 PM | #12 | |
Wizard
Posts: 2,286
Karma: 7409537
Join Date: Mar 2009
Location: Circling Earth @ Mach .83
Device: Elipsa 2E, Sage, Libra Colour, Libra 2, Clara 2E, Oasis3, Voyage
|
Quote:
|
|
02-20-2013, 09:52 PM | #13 | |
Wizard
Posts: 2,286
Karma: 7409537
Join Date: Mar 2009
Location: Circling Earth @ Mach .83
Device: Elipsa 2E, Sage, Libra Colour, Libra 2, Clara 2E, Oasis3, Voyage
|
Quote:
And I, too, have found changing the line height value is indeed recognized. P.S. I'm a she, not a he. |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
RegEx: Removing Page Numbers that have Spaces | captainslow | Conversion | 2 | 02-27-2011 05:14 PM |
removing extra spaces - kills images | wmeyer | Sigil | 4 | 01-14-2011 02:37 PM |
Spaces between Paragraphs in FBReader? | luqmaninbmore | PocketBook | 2 | 03-10-2010 10:09 AM |
Huge Spaces Between Paragraphs | diremommy | Calibre | 0 | 12-29-2009 07:30 PM |
Mobi -> LRF, huge spaces between paragraphs | Djehuty | Calibre | 3 | 04-22-2009 01:06 PM |