|
|
#1 |
|
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,293
Karma: 7409537
Join Date: Mar 2009
Location: Circling Earth @ Mach .83
Device: Elipsa 2E, Sage, Libra Colour, Libra 2, Clara 2E, Oasis3, Voyage
|
Removing Spacing Between Paragraphs: Ignored by Kobo
After some 15+ years of self-taught epub editing, thanks almost entirely to MR, I have hit a brick wall with removal of spacing between paragraphs on one particular epub.
All my usual fixes are not being recognized by my Libra Colour and the double spacing throughout remains. However, in Calibre's editor paragraphs display normally with no spacing. Here is what I typically use: body { font-size: 1em; margin-top: 0; margin-right: 5pt; margin-bottom: 0; margin-left: 5pt; orphans: 1; widows: 1; } p { display: block; margin-top: 0; margin-bottom: 0; text-indent: 1.2em; } Here is the CSS from the book which I replaced where applicable: Body Code:
body { line-height: 1.4; margin-left: 4%; margin-right: 4%; font-family: "Times New Roman", serif; }
img { max-width: 100%; max-height: 98%; }
small { font-size: 80%; }
sup { line-height: 80%; font-size: 80%; }
sub { line-height: 80%; font-size: 80%; }
.shyphen { word-break: break-all; }
.hrline { margin-top:10%; margin-bottom:2%; margin-left:0%; text-align:left; width:30%; }
.Smallcaps { font-variant: small-caps; }
.Underline { text-decoration: underline; }
.Overline { text-decoration: overline; }
.Strike { text-decoration: line-through; }
table { border-collapse: collapse; border-spacing: 0 }
.P18 { text-align:justify; text-indent:7%; margin-top:0%; margin-bottom:0%; font-size:100%; } I am missing something somewhere and am not knowledgeable enough to figure out why the Kobo does not display it correctly but the Calibre editor does. I'm chomping at the bit to read my (600+ page) book but absolutely cannot tolerate looking at the spacing between paragraphs! Where do I go from here to solve this? Thank you very much! |
|
|
|
|
|
#2 |
|
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,872
Karma: 9600930
Join Date: Sep 2021
Location: Australia
Device: Kobo Libra 2
|
It may not be in the CSS. It might be a style="" tag somewhere.
Check the <html ...> tag at the top of the page and also the <body> tag. |
|
|
|
|
|
#3 |
|
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 84,070
Karma: 153695583
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
The problem is very simple to fix. I fixed the body code and I added the p code. The problem is there is no code telling the paragraphs not to have spaces without the p code.
CSS {code]body { widows: 1; orphans: 1; margin-top: 0; margin-right: 0; margin-bottom: 0; margin-left: 0; text-align: justify; } img { max-width: 100%; max-height: 98%; } p { margin-top: 0; margin-bottom: 0; widows: 1; orphans: 1; text-indent: 1.2em; } small { font-size: 80%; } sub { line-height: 80%; font-size: 80%; } sup { line-height: 80%; font-size: 80%; } table { border-collapse: collapse; border-spacing: 0; } .hrline { margin-top: 10%; margin-bottom: 2%; margin-left: 0%; text-align: left; width: 30%; } .Overline { text-decoration: overline; } .shyphen { word-break: break-all; } .Smallcaps { font-variant: small-caps; } .Strike { text-decoration: line-through; } .Underline { text-decoration: underline; }[/code] |
|
|
|
|
|
#4 |
|
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,293
Karma: 7409537
Join Date: Mar 2009
Location: Circling Earth @ Mach .83
Device: Elipsa 2E, Sage, Libra Colour, Libra 2, Clara 2E, Oasis3, Voyage
|
Thank you Karellen. I'm trying to figure out what I am looking for.
@Jon- Thank you for taking the time to offer the fix (which I am about to try). While exploring a single page, as suggested by Karellen, I also noticed that there exists a "hidden" code that is also being ignored as there are small, consecutive numbers that appear above the paragraphs. Clearly not "hidden." This whole book is one big mess (independent publisher) that I do not understand. Again, these problems appear on the Libra, not in Calibre's editor. I will report back (fingers crossed). Many thanks. Update: Sorry, Jon, I replaced the body with yours and there was no change to my Libra whatsoever. Spacing remains between paragraphs and there is no indentation. Calibre editor displays fine with indentations and no spacing. : ( Last edited by Skydog; Yesterday at 10:30 PM. Reason: Update |
|
|
|
|
|
#5 |
|
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,872
Karma: 9600930
Join Date: Sep 2021
Location: Australia
Device: Kobo Libra 2
|
A screenshot of the page might help, but scrambling the book and uploading it here would be a whole lot more helpful.
|
|
|
|
|
|
#6 | |
|
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,293
Karma: 7409537
Join Date: Mar 2009
Location: Circling Earth @ Mach .83
Device: Elipsa 2E, Sage, Libra Colour, Libra 2, Clara 2E, Oasis3, Voyage
|
Quote:
Meanwhile, I think I've found the code that is creating the random numbering from 1-572 throughout the paragraphs. The Libra is ignoring "hidden" and displays the numbers. From a sample page: Code:
<span aria-labelledby="pg4" epub:type="pagebreak" id="page_4" role="doc-pagebreak"/><span hidden="hidden" id="pg4">4</span> Edit: Located the plugin but the book is a large one - 48MB Last edited by Skydog; Yesterday at 11:54 PM. |
|
|
|
|
|
|
#7 |
|
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,872
Karma: 9600930
Join Date: Sep 2021
Location: Australia
Device: Kobo Libra 2
|
If you look in the CSS, you should see a class named .hidden. It should have something like display:none; speak:none; or something similar. Is it there?
Do you want those page numbers there at all? Maybe just create a regex to remove the span completely. Scramble books... https://www.mobileread.com/forums/sh...d.php?t=267998 |
|
|
|
|
|
#8 |
|
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,293
Karma: 7409537
Join Date: Mar 2009
Location: Circling Earth @ Mach .83
Device: Elipsa 2E, Sage, Libra Colour, Libra 2, Clara 2E, Oasis3, Voyage
|
I've made a couple of attempts to submit my reply with the scrambled book attached. The result is a "504 Gateway Time-out" so I'll keep trying.
|
|
|
|
|
|
#9 | |
|
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,293
Karma: 7409537
Join Date: Mar 2009
Location: Circling Earth @ Mach .83
Device: Elipsa 2E, Sage, Libra Colour, Libra 2, Clara 2E, Oasis3, Voyage
|
Quote:
Code:
body {
font-size: 1em;
margin-top: 0;
margin-right: 5pt;
margin-bottom: 0;
margin-left: 5pt;
text-align: justify;
orphans: 1;
widows: 1;
}
Code:
p {
font-size: 1em;
text-indent: 1.2em;
orphans: 1;
widows: 1;
padding: 0;
}
Thank you very much, Karellen, for your assistance. It is greatly appreciated. |
|
|
|
|
|
|
#10 |
|
Bibliophagist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 52,944
Karma: 180988376
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
|
For removing the page numbers, try the following which I tested in Sigil:
Code:
<span aria-labelledby="pg.*?" epub:type="pagebreak" id="page_.*?" role="doc-pagebreak"></span><span hidden="hidden" id="pg.*?">.*?</span> Please note that running this will cause issues for the index since those page numbers are used there. Also note that if I send the ebook as a kepub, I don't see the blank lines. Last edited by DNSB; Today at 01:24 PM. |
|
|
|
|
|
#11 |
|
Bibliophagist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 52,944
Karma: 180988376
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
|
I spent a few minutes more on the scrambled ePub. When I opened it in Sigil and checked the CSS, it complained about 4 errors. Those errors were C195 has margin-top: %;, C188 has margin-bottom: %;, C203 has margin:0.3 -0.3 0.03 0.0; and C245 also has margin:0.3 -0.3 0.03 0.0;. All of these are invalid which is likely to cause RMSDK to trash the CSS. I also noted that nav.xhtml has a reference to a Kobo javascript which does not seem to exist in the scrambled ePub and likely could be removed.
After I corrected the 4 errors (changed the missing #s in the first 2 to 3% and the margin the next to to use em as the unit. I sent the epub to my Sage and the gaps between paragraphs were no longer visible. I've attached the modified epub.css and an image of a page on my Kobo's screen. The epub.css is renamed to epub.css.txt to allow it to be attached. I'd suggest opening it and copy/pasting the contents into the epub.css in the ePub file. |
|
|
|
|
|
#12 | |
|
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 84,070
Karma: 153695583
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Quote:
|
|
|
|
|
|
|
#13 |
|
Bibliophagist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 52,944
Karma: 180988376
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
|
Jon. no matter what he does with your suggested CSS, it ain't going to work. The issue is the 4 errors in the CSS. Do you remember what RMSDK does with a stylesheet with errors in it?
Once I corrected those 4 errors, the scrambled ePub displayed on my Sage though those "hidden" items in the aria-labelledby were not hidden since that is an ePub3 item which RMSDK does not support. My workaround for that was to run the following regex to remove the visible characters: Code:
Find: <span aria-labelledby="pg(.*?)" epub:type="pagebreak" id="page_(.*?)" role="doc-pagebreak"></span><span hidden="hidden" id="pg(.*?)">.*?</span Replace:<span aria-labelledby="pg\1" epub:type="pagebreak" id="page_\2" role="doc-pagebreak"></span><span hidden="hidden" id="pg\3"></span> |
|
|
|
|
|
#14 |
|
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 84,070
Karma: 153695583
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
All I was doing was fixing the paragraph spacing which I did. I was not trying to fix anything else.
|
|
|
|
|
|
#15 |
|
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,293
Karma: 7409537
Join Date: Mar 2009
Location: Circling Earth @ Mach .83
Device: Elipsa 2E, Sage, Libra Colour, Libra 2, Clara 2E, Oasis3, Voyage
|
David,
I am almost there. I am so very grateful for your time and assistance. The corrected CSS looks beautiful on both my Sage and Libra Colour. The only addition I made was orphans: 1 and widows: 1 to eliminate the large gaps on random page bottoms. However, I have not yet been successful in applying your solution for removing the numbers (and two associated blank pages). I know nothing about regex. I copied and pasted the codes you provided following "Find:" and "Replace." But which options do I select? Everything I've tried results in "no match found." Thank you very much! P.S. Regarding your first comment - I've been around here long enough to know better.
|
|
|
|
![]() |
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| spacing between paragraphs | franklekens | Kobo Reader | 9 | 04-05-2025 04:01 PM |
| There's no spacing between paragraphs | Tior500 | Conversion | 1 | 12-02-2019 10:18 AM |
| Spacing between paragraphs not converting | beccas716 | Conversion | 4 | 10-11-2013 10:25 AM |
| Removing spacing between paragraphs, not between sections | jlbfoot | Calibre | 4 | 12-03-2010 10:41 PM |
| removing spacing between paragraphs WITHOUT touching indent? | ferossan | Calibre | 2 | 12-24-2009 02:12 PM |