|
|
#1 | |||
|
Evangelist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 407
Karma: 3421956
Join Date: Sep 2009
Device: various Kobo's, Onyx Note2, Pocketbook 360, Kindle Keyboard
|
superfluous blank lines between paragraphs
Warning, this is a real beginner's question. I kind of know how html/xml works, *and* how CSS works, on a basic level. But not very systematically.
Now I have a number of ebooks from professional publishers where the text is formatted weirdly: paragraphs don't have the first line indented, but instead there's a blank line between every paragraph. I'd like to remedy this for myself by editing the epubs concerned in Sigil or some other software (hoping of course that it will be a simple matter of changing one or two lines in the css, or doing a search and replace for some code in the other files). However, when I look at the file in Sigil, I just can't find what is wrong with it. That is, I just can't see how the xml markup (*or* the css) differs from books that don't show this problem -- i.e. where there is no blank line between paragraphs, and their first line is indented. What would be the obvious place to look? Here's a sample of text from one of those books: Quote:
Quote:
Quote:
Should I look somewhere else? |
|||
|
|
|
|
|
#2 |
|
Evangelist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 407
Karma: 3421956
Join Date: Sep 2009
Device: various Kobo's, Onyx Note2, Pocketbook 360, Kindle Keyboard
|
Sorry about that smiley there, that should be a : and a p, obviously. Haven't quite figured out how to prevent that here.
|
|
|
|
|
|
#3 |
|
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,685
Karma: 9500498
Join Date: Sep 2021
Location: Australia
Device: Kobo Libra 2
|
First fix needs to be to distinguish between paragraphs that are indented and those that are not. Your sample shows that all paragraphs use the class="algemeen" so currently no way to distinguish between the two. I think they tried to do that with the algemein + algemein css code, but obviously not working for you. Actually I don't know if that is a valid method as I have never come across it.
As for the extra line spacing, obviously it is not in the algemeen css, so then it may be a level higher. Are there and <div> or <section> tags that capture all the paragraphs? Maybe the <body> tag contains the extra line spacing. Check the css code for these tags. Also, you don't need the language on every paragraph. Yep, I am aware you didn't code the book, just commenting. Same with the heading- should really use the <h> tags. Last edited by Karellen; 10-17-2025 at 04:04 PM. |
|
|
|
|
|
#4 | |
|
Evangelist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 407
Karma: 3421956
Join Date: Sep 2009
Device: various Kobo's, Onyx Note2, Pocketbook 360, Kindle Keyboard
|
I understand what you say, but it seems it doesn't work like this in these files. That's what has me stumped.
Here's some of the code from a book that *does* display fine. Quote:
And about the other failings of the book: I'm not looking to rectify all the xml, that's not my hobby. I'm looking for a way to rectify these books so they look the way I'd want. (Actually, I'd also like to find out why some of them look wrong.) |
|
|
|
|
|
|
#5 |
|
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,685
Karma: 9500498
Join Date: Sep 2021
Location: Australia
Device: Kobo Libra 2
|
There's not a lot more help with the minimal info you provided. Would need to see the ebook. Scramble the book and post the ebook here.
|
|
|
|
|
|
#6 |
|
A Hairy Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,394
Karma: 20212733
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 15/11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
|
What reader are you using to view this epub? Some of the ... less user friendly ... devices/apps ignore the epub's css altogether and substitute their own.
One tool you can use for troubleshooting is the code inspector. Sigil has this as part of the preview pane and I'm pretty sure Calibre Editor does as well. Just click in one of the paragraphs and then review the editor; it will tell you all the css that is effecting the paragraph. |
|
|
|
|
|
#7 |
|
Connoisseur
![]() Posts: 76
Karma: 10
Join Date: May 2025
Device: iPad
|
As Karellen mentioned, best way would be to provide a downstripped version of one of your ebooks, including one chapter with some paragraphs.
If you have concerns about content, just swap it with any lorem for the glorem... |
|
|
|
|
|
#8 |
|
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 9,070
Karma: 6361556
Join Date: Nov 2009
Device: many
|
It may be because of a descendant style in your stylesheet. Its Selector will use a space or a plus. Please copy and paste that stylesheet here and we can then see if that is the case.
Or alternatively just open that epub in Sigil and use Preview's Inspector to see exact which style rules are being applied in that line. Calibre can do the exact same thing with its inspection capabilities. |
|
|
|
|
|
#9 |
|
Evangelist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 407
Karma: 3421956
Join Date: Sep 2009
Device: various Kobo's, Onyx Note2, Pocketbook 360, Kindle Keyboard
|
Okay, here is a stripped version of the file. I've retained only one html file with some text, mostly lorem ipsum, but the code is the same and the entire css is there. Any tips would be welcome, I tried the inspector but didn't see what I was supposed to be looking for.
(There's a bunch of files that must have the exact same problem. As it happens, I also just bought an OUP edition of Fanny Burney's Cecilia, this one https://www.kobo.com/nl/nl/ebook/cec..._j5nCGK&cPos=1, which suffers from the same problem, but probably for different reasons. It's maddening, because other books in that World Classics series don't have those problems - although some have others. It seems it's hard to get it right.) |
|
|
|
|
|
#10 |
|
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,685
Karma: 9500498
Join Date: Sep 2021
Location: Australia
Device: Kobo Libra 2
|
@franklekens
The css file is not linked to the html files. Essentially there is no css file to control the display formatting. There should be an option to "Link Stylesheets" to the html files. Sorry, I don't know where that option is in Sigil. Try right-click on the xhtml files. |
|
|
|
|
|
#11 |
|
Evangelist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 407
Karma: 3421956
Join Date: Sep 2009
Device: various Kobo's, Onyx Note2, Pocketbook 360, Kindle Keyboard
|
Thanks. Of course, it's so obvious, now I see. When I compare with a similar file where all goes right, I see at the top of each xhtml file:
<link href="css/template.css" rel="stylesheet" type="text/css" /> That's what you mean, right? I'll go see if I can achieve that in Sigil without having to add it on each page manually. Otherways, maybe I'll just do that. Now I'm going to have a look at the OUP file as well. Although there the problem is probably different. Edit: YES! It's really simple in Sigil. Select all the files, right click, and then "link stylesheet". That solves it. Thanks a lot. Last edited by franklekens; 10-20-2025 at 02:55 PM. |
|
|
|
|
|
#12 |
|
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,685
Karma: 9500498
Join Date: Sep 2021
Location: Australia
Device: Kobo Libra 2
|
Yep, that is exactly what I mean. In addition you will also need the <title> tag.
So, at the top of the page you would add... PHP Code:
|
|
|
|
|
|
#13 |
|
Evangelist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 407
Karma: 3421956
Join Date: Sep 2009
Device: various Kobo's, Onyx Note2, Pocketbook 360, Kindle Keyboard
|
That definitely seems to be the case. The wrong files are the versions of the book that are free downloads for subscribers to a particular publication. Obviously that magazine's software somewhere mixes this up in transit. I've already complained about it, but I'm glad I can now give them a more specific pointer. Not to mention the fact that I can easily remedy this for myself.
|
|
|
|
|
|
#14 | |
|
Evangelist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 407
Karma: 3421956
Join Date: Sep 2009
Device: various Kobo's, Onyx Note2, Pocketbook 360, Kindle Keyboard
|
Now that OUP book is a different kettle of fish. The css link is there, but I get the impression that the css actually... doesn't contain any style *for* the paragraphs.
Consider this: the text in the xhtml looks like this: Quote:
Or is there something else wrong? I'm not sure it's easy to remedy. If I added something to the css in order to make paragraphs behave more book-like (no blank spaces and indentation for paragraphs), probably some paragraphs that *are* actually suppoed to have blank lines in between will suddenly also be glued together. I think this entire e-book was just not correctly set up from the get go. |
|
|
|
|
|
|
#15 |
|
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,685
Karma: 9500498
Join Date: Sep 2021
Location: Australia
Device: Kobo Libra 2
|
The epub file is easier to understand rather than a separate css list.
The para is here... PHP Code:
Your choice is to remove that margin-top value (might have unintended consequences in other parts of the book for the div.header.boxed-text use or remove .para from there and add it as a separate entry in the css without the spacing. eg... PHP Code:
Last edited by Karellen; 10-20-2025 at 05:24 PM. |
|
|
|
![]() |
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Add blank lines between paragraphs. | bn_el | KOReader | 5 | 11-02-2017 11:14 AM |
| blank lines between paragraphs | franklekens | Kobo Reader | 71 | 01-26-2015 12:52 PM |
| Blank lines between paragraphs? | ascherjim | OpenInkpot | 30 | 12-03-2009 12:19 AM |
| Removing blank lines between paragraphs? | corroonb | Workshop | 3 | 08-13-2009 04:23 PM |
| Insert Blank Lines Between Paragraphs | Timoleon | Calibre | 14 | 03-22-2009 02:43 PM |