Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Formats > ePub

Notices

Reply
 
Thread Tools Search this Thread
Old 11-17-2015, 05:27 AM   #1
JLius
Village idiot
JLius ought to be getting tired of karma fortunes by now.JLius ought to be getting tired of karma fortunes by now.JLius ought to be getting tired of karma fortunes by now.JLius ought to be getting tired of karma fortunes by now.JLius ought to be getting tired of karma fortunes by now.JLius ought to be getting tired of karma fortunes by now.JLius ought to be getting tired of karma fortunes by now.JLius ought to be getting tired of karma fortunes by now.JLius ought to be getting tired of karma fortunes by now.JLius ought to be getting tired of karma fortunes by now.JLius ought to be getting tired of karma fortunes by now.
 
JLius's Avatar
 
Posts: 157
Karma: 519566
Join Date: Mar 2014
Location: Belgium
Device: sony PRS T-1
paragraph margins

Dear all

I have an epub with paragraphs that are either without blank space between them, or with a blank line. The latter are separated with
Code:
<p>& # 160;</p>
or just
Code:
<p> </p>
I know that's not good practice, you should define your paragraph style in css, not by adding a blank line in the html.
But it is way too much work to fix this, because when I define the blank line in css, I have to make a separate class for all those paragraphs without a blank line (and it's a big epub).

Does anybody know of a quick fix? Or is the empty paragraph okay and should I just leave it at that? Will it give trouble with some reader-software?

Thanks for the help!
JLius is offline   Reply With Quote
Old 11-17-2015, 09:29 AM   #2
Turtle91
A Hairy Wizard
Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.
 
Turtle91's Avatar
 
Posts: 3,303
Karma: 20171571
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
You are correct, you want to style your paragraph using css. How much you style is up to debate...

Use search/replace to remove them!

search:<p>& # 160;</p>
replace: (nothing)

or

search:<p> </p>
replace: (nothing)

It should only take a few seconds. Before doing that though, I would check all of your non-chapter files...back matter, ToC, Also From, etc. ...to make sure they don't have those blank lines that you actually want to keep.

Cheers,
Turtle91 is offline   Reply With Quote
Old 11-17-2015, 10:39 AM   #3
phillipgessert
Addict
phillipgessert ought to be getting tired of karma fortunes by now.phillipgessert ought to be getting tired of karma fortunes by now.phillipgessert ought to be getting tired of karma fortunes by now.phillipgessert ought to be getting tired of karma fortunes by now.phillipgessert ought to be getting tired of karma fortunes by now.phillipgessert ought to be getting tired of karma fortunes by now.phillipgessert ought to be getting tired of karma fortunes by now.phillipgessert ought to be getting tired of karma fortunes by now.phillipgessert ought to be getting tired of karma fortunes by now.phillipgessert ought to be getting tired of karma fortunes by now.phillipgessert ought to be getting tired of karma fortunes by now.
 
phillipgessert's Avatar
 
Posts: 312
Karma: 3196258
Join Date: Oct 2015
Location: Madison, WI
Device: Kindle 5th Gen
paragraph margins

I would make a separate class only for the paragraphs that include the extra space (I assume there are fewer of them). For the ones that don't, I'd just style the <p> (no additional class needed).

Alternately, if the gaps represent scene breaks or similar, I am fairly sure it is semantically appropriate to use <hr> there. If so, that's probably the fastest way to resolve the issue (and you can style <hr> to just be a vertical gap).

Last edited by phillipgessert; 11-17-2015 at 10:48 AM.
phillipgessert is offline   Reply With Quote
Old 11-17-2015, 10:53 AM   #4
JLius
Village idiot
JLius ought to be getting tired of karma fortunes by now.JLius ought to be getting tired of karma fortunes by now.JLius ought to be getting tired of karma fortunes by now.JLius ought to be getting tired of karma fortunes by now.JLius ought to be getting tired of karma fortunes by now.JLius ought to be getting tired of karma fortunes by now.JLius ought to be getting tired of karma fortunes by now.JLius ought to be getting tired of karma fortunes by now.JLius ought to be getting tired of karma fortunes by now.JLius ought to be getting tired of karma fortunes by now.JLius ought to be getting tired of karma fortunes by now.
 
JLius's Avatar
 
Posts: 157
Karma: 519566
Join Date: Mar 2014
Location: Belgium
Device: sony PRS T-1
@Turtle91 that solution will only mess up the entire document, because then all paragraphs will be the same style.
JLius is offline   Reply With Quote
Old 11-17-2015, 11:02 AM   #5
JLius
Village idiot
JLius ought to be getting tired of karma fortunes by now.JLius ought to be getting tired of karma fortunes by now.JLius ought to be getting tired of karma fortunes by now.JLius ought to be getting tired of karma fortunes by now.JLius ought to be getting tired of karma fortunes by now.JLius ought to be getting tired of karma fortunes by now.JLius ought to be getting tired of karma fortunes by now.JLius ought to be getting tired of karma fortunes by now.JLius ought to be getting tired of karma fortunes by now.JLius ought to be getting tired of karma fortunes by now.JLius ought to be getting tired of karma fortunes by now.
 
JLius's Avatar
 
Posts: 157
Karma: 519566
Join Date: Mar 2014
Location: Belgium
Device: sony PRS T-1
@phillipgessert I could do that, but the <hr> tag isn't really intended for that. I might as well stick with the <p> </p>, no? Epub validator doesn't complain, and it looks just fine on my sony.
JLius is offline   Reply With Quote
Old 11-17-2015, 11:07 AM   #6
phillipgessert
Addict
phillipgessert ought to be getting tired of karma fortunes by now.phillipgessert ought to be getting tired of karma fortunes by now.phillipgessert ought to be getting tired of karma fortunes by now.phillipgessert ought to be getting tired of karma fortunes by now.phillipgessert ought to be getting tired of karma fortunes by now.phillipgessert ought to be getting tired of karma fortunes by now.phillipgessert ought to be getting tired of karma fortunes by now.phillipgessert ought to be getting tired of karma fortunes by now.phillipgessert ought to be getting tired of karma fortunes by now.phillipgessert ought to be getting tired of karma fortunes by now.phillipgessert ought to be getting tired of karma fortunes by now.
 
phillipgessert's Avatar
 
Posts: 312
Karma: 3196258
Join Date: Oct 2015
Location: Madison, WI
Device: Kindle 5th Gen
Quote:
Originally Posted by JLius View Post
@phillipgessert I could do that, but the <hr> tag isn't really intended for that. I might as well stick with the <p> </p>, no? Epub validator doesn't complain, and it looks just fine on my sony.
I'm basing my <hr> suggestion on this:

http://www.idpf.org/accessibility/gu...ml/context.php

"A context break represents a shift in thought, time, location, etc. in a work of fiction or non-fiction below the level of a section. These changes are typically represented by an extra blank line between paragraphs, sometimes including asterisms and other decorations (traditionally when the shift occurs immediately at the bottom of a print page).

"In the past, CSS margins and images have been used to include context breaks, but the HTML5 specification has redefined the semantics of the hr element specifically for this purpose. The element should now always be used to represent these context changes. CSS styling can be applied to change the default appearance."

Though I could totally be misreading it. If I'm reading it right, though, the benefit of <hr> over sticking with the empty paragraphs is that <hr> is semantically meaningful, but empty paragraphs aren't. That said though, I shouldn't try to guess at the semantics of this specific book, the <hr> stuff may not even apply here.
phillipgessert is offline   Reply With Quote
Old 11-17-2015, 11:20 AM   #7
JLius
Village idiot
JLius ought to be getting tired of karma fortunes by now.JLius ought to be getting tired of karma fortunes by now.JLius ought to be getting tired of karma fortunes by now.JLius ought to be getting tired of karma fortunes by now.JLius ought to be getting tired of karma fortunes by now.JLius ought to be getting tired of karma fortunes by now.JLius ought to be getting tired of karma fortunes by now.JLius ought to be getting tired of karma fortunes by now.JLius ought to be getting tired of karma fortunes by now.JLius ought to be getting tired of karma fortunes by now.JLius ought to be getting tired of karma fortunes by now.
 
JLius's Avatar
 
Posts: 157
Karma: 519566
Join Date: Mar 2014
Location: Belgium
Device: sony PRS T-1
In this specific book, about 70% of the paragraphs are separated by an empty line, so it would make sense to define p with a margin. This is a very long book though, and I'm not looking forward the tedious work of applying another class for the other 30% of the paragraphs so they display without this empty line (I'm not lazy, it is just a waste of time when it's not really necessary).
I have no pickle with the <p> <\p>, my only worry is that it won't display properly on some readers. If that's a non-issue, I just leave it as it is.
JLius is offline   Reply With Quote
Old 11-17-2015, 12:44 PM   #8
Toxaris
Wizard
Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.
 
Toxaris's Avatar
 
Posts: 4,520
Karma: 121692313
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-T1, Kobo Touch, Kobo Aura
Quote:
Originally Posted by JLius View Post
Dear all

I have an epub with paragraphs that are either without blank space between them, or with a blank line. The latter are separated with
Code:
<p>& # 160;</p>
or just
Code:
<p> </p>
I know that's not good practice, you should define your paragraph style in css, not by adding a blank line in the html.
But it is way too much work to fix this, because when I define the blank line in css, I have to make a separate class for all those paragraphs without a blank line (and it's a big epub).

Does anybody know of a quick fix? Or is the empty paragraph okay and should I just leave it at that? Will it give trouble with some reader-software?

Thanks for the help!
What you can do is create a special class for that and then do the following replace (Sigil!):

Search for: "<p>&nbsp;</p>\s+<p>"
Replace: <p class="emptylineabove">

Of course you can also use & #160;
Toxaris is offline   Reply With Quote
Old 11-17-2015, 02:36 PM   #9
JLius
Village idiot
JLius ought to be getting tired of karma fortunes by now.JLius ought to be getting tired of karma fortunes by now.JLius ought to be getting tired of karma fortunes by now.JLius ought to be getting tired of karma fortunes by now.JLius ought to be getting tired of karma fortunes by now.JLius ought to be getting tired of karma fortunes by now.JLius ought to be getting tired of karma fortunes by now.JLius ought to be getting tired of karma fortunes by now.JLius ought to be getting tired of karma fortunes by now.JLius ought to be getting tired of karma fortunes by now.JLius ought to be getting tired of karma fortunes by now.
 
JLius's Avatar
 
Posts: 157
Karma: 519566
Join Date: Mar 2014
Location: Belgium
Device: sony PRS T-1
Brilliant, thank you! This would work even better if all the paragraph tags were the same. Still, saves me a lot of time!
JLius is offline   Reply With Quote
Old 11-17-2015, 07:58 PM   #10
Turtle91
A Hairy Wizard
Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.
 
Turtle91's Avatar
 
Posts: 3,303
Karma: 20171571
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
Sorry, I missed that only some paragraphs had a line above

Definitely go with Toxaris' suggestion!
Turtle91 is offline   Reply With Quote
Old 11-18-2015, 04:00 AM   #11
JLius
Village idiot
JLius ought to be getting tired of karma fortunes by now.JLius ought to be getting tired of karma fortunes by now.JLius ought to be getting tired of karma fortunes by now.JLius ought to be getting tired of karma fortunes by now.JLius ought to be getting tired of karma fortunes by now.JLius ought to be getting tired of karma fortunes by now.JLius ought to be getting tired of karma fortunes by now.JLius ought to be getting tired of karma fortunes by now.JLius ought to be getting tired of karma fortunes by now.JLius ought to be getting tired of karma fortunes by now.JLius ought to be getting tired of karma fortunes by now.
 
JLius's Avatar
 
Posts: 157
Karma: 519566
Join Date: Mar 2014
Location: Belgium
Device: sony PRS T-1
No, it's about 70% of them.
After a lot of search and replace (there were also a lot of <i>'s , and <p class=...> to take into acount) it still looks kinda messed up.
Right now I'm thinking 'fuck it, just level up all paragraphs and to hell with the original layout' ;-)
JLius is offline   Reply With Quote
Old 11-18-2015, 10:04 AM   #12
Toxaris
Wizard
Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.
 
Toxaris's Avatar
 
Posts: 4,520
Karma: 121692313
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-T1, Kobo Touch, Kobo Aura
Usually you need a few runs for it. I have made a group of SR rules in Sigil to work through this. I just need to run the group which will run all the rules.
Toxaris is offline   Reply With Quote
Old 11-18-2015, 10:53 AM   #13
JLius
Village idiot
JLius ought to be getting tired of karma fortunes by now.JLius ought to be getting tired of karma fortunes by now.JLius ought to be getting tired of karma fortunes by now.JLius ought to be getting tired of karma fortunes by now.JLius ought to be getting tired of karma fortunes by now.JLius ought to be getting tired of karma fortunes by now.JLius ought to be getting tired of karma fortunes by now.JLius ought to be getting tired of karma fortunes by now.JLius ought to be getting tired of karma fortunes by now.JLius ought to be getting tired of karma fortunes by now.JLius ought to be getting tired of karma fortunes by now.
 
JLius's Avatar
 
Posts: 157
Karma: 519566
Join Date: Mar 2014
Location: Belgium
Device: sony PRS T-1
That's why you're the wizard and I'm the village idiot :-)
JLius is offline   Reply With Quote
Old 11-23-2015, 06:05 AM   #14
JLius
Village idiot
JLius ought to be getting tired of karma fortunes by now.JLius ought to be getting tired of karma fortunes by now.JLius ought to be getting tired of karma fortunes by now.JLius ought to be getting tired of karma fortunes by now.JLius ought to be getting tired of karma fortunes by now.JLius ought to be getting tired of karma fortunes by now.JLius ought to be getting tired of karma fortunes by now.JLius ought to be getting tired of karma fortunes by now.JLius ought to be getting tired of karma fortunes by now.JLius ought to be getting tired of karma fortunes by now.JLius ought to be getting tired of karma fortunes by now.
 
JLius's Avatar
 
Posts: 157
Karma: 519566
Join Date: Mar 2014
Location: Belgium
Device: sony PRS T-1
Okay, so I'm even more of an idiot than I thought I was...
Anyway, I have this:
Code:
p {
  text-indent: 0;
  line-height: normal;
  margin-bottom: 1em;
}
and this:
Code:
.nomargin {
  margin-bottom: 0em;
}
But when I write this:
Code:
<p class="nomargin">Blablabla</p>
<p class="nomargin">Blablabla</p>
<p>Blablabla</p>
There's still a margin-bottom between these three paragraphs. The "nomargin" class ain't doing shit.
What am I missing here?
JLius is offline   Reply With Quote
Old 11-23-2015, 06:09 AM   #15
Terisa de morgan
Grand Sorcerer
Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.
 
Terisa de morgan's Avatar
 
Posts: 6,595
Karma: 12595249
Join Date: Jun 2009
Location: Madrid, Spain
Device: Kobo Clara/Aura One/Forma,XiaoMI 5, iPad, Huawei MediaPad, YotaPhone 2
And margin-top?
Terisa de morgan is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem: Merge two ebooks paragraph by paragraph... akayacik80 Workshop 5 09-23-2014 09:05 AM
Paragraph breaks when removing margins Canorka Conversion 3 03-30-2012 02:00 AM
Preference: Paragraph indent or a little paragraph spacing? 1611mac General Discussions 48 11-11-2011 12:43 AM
Paragraph question shrktank Calibre 2 11-29-2009 12:07 AM
Calibre collapses paragraph margins - why? kiwik Calibre 2 01-08-2009 11:47 PM


All times are GMT -4. The time now is 06:51 PM.


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