Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Formats > Workshop

Notices

Reply
 
Thread Tools Search this Thread
Old 07-02-2014, 02:28 PM   #1
mattst
Enthusiast
mattst began at the beginning.
 
Posts: 32
Karma: 10
Join Date: Nov 2011
Device: Kindle
Inserting a larger than normal gap between SOME paragraphs

Hi,

First up my development files are EPUB but I am creating .epub files and .mobi files. I use kindlegen with the 'content.opf' file to generate my .mobi files.

I've been having some difficulty inserting a larger than normal gap between some paragraphs. That is to say I am NOT trying to change the default spacing between paragraphs but trying to insert gaps of different sizes between some paragraphs. e.g. In some books an extra large gap is introduced between 2 paragraphs in a chapter; sometimes a symbol is used, sometimes not. It denotes a change of scene or tone, or is used for a variety of reasons to tell the reader that the sections on either side of the larger-than-normal gap are to be considered separate. In other cases introducing smaller or larger gaps can also be useful.

The following HTML and CSS works as expected with my .epub files but NOT with my .mobi files.

The idea is that I use CSS to change the font size and output a single space entity to introduce various sized gaps. By using em for the font size the gaps can remain relative to the text size the user has chosen. By having small, medium, and large versions a gap of various standard sizes can be easily introduced (and of course I can change the sizes this is all at the testing stage).

The problem is that the gap sizes are not the sizes I expect with my .mobi files. They are as I expect with the .epub files.

With the .mobi files 'small' instead of being about half a line (0.5em) of the text lines above and below them (1em) looks about 1 line. 'Medium' looks like at least 2 lines instead of 1. 'Large' about 3 lines instead of 2.

Code:
HTML:

<p class='InsertGapSmall'>&nbsp;</p>
<p class='InsertGapMedium'>&nbsp;</p>
<p class='InsertGapLarge'>&nbsp;</p>

CSS:

.InsertGapSmall {
    display: block;
    font-size: 0.5em;
    margin: 0;
}

.InsertGapMedium {
    display: block;
    font-size: 1em;
    margin: 0;
}

.InsertGapLarge {
    display: block;
    font-size: 2em;
    margin: 0;
}

.ParaNormal {
    display: block;
    font-size: 1em;
    margin-top: 0.25em;
    margin-left: 0;
    margin-right: 0;
    margin-bottom: 0;
    text-align: justify;
    text-indent: 5pt;
}

Real world usage:

<p class='ParaNormal'>A full paragraph of text before the gap...</p>
<p class='InsertGapMedium'>&nbsp;</p>
<p class='ParaNormal'>A full paragraph of text after the gap...</p>
Can anyone tell me what I am doing wrong with this approach please? Why it works with .epub files but not with .mobi files? Any suggestions for an alternative method to achieve what I want would also be greatly appreciated.

Many thanks.

Last edited by mattst; 07-02-2014 at 03:00 PM.
mattst is offline   Reply With Quote
Old 07-02-2014, 02:56 PM   #2
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
Posts: 19,422
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
Don't use non-breaking-space filler paragraphs. Use a default:

Code:
p {
    display: block;
    font-size: 1em;
    margin-top: 0.25em;
    margin-left: 0;
    margin-right: 0;
    margin-bottom: 0;
    text-align: justify;
    text-indent: 5pt;
}
and whenever you need extra space use:

Code:
.spacerMedium {
    margin: 1em 0 0 0;
}
Example:

Code:
<p>A full paragraph of text before the gap...</p>
<p class='spacerMedium'>This paragraph has some space before it.</p>
Never use blank paragraphs for spacing. That is what margins are for. It's much cleaner that way.

Last edited by eschwartz; 07-02-2014 at 07:44 PM.
eschwartz is offline   Reply With Quote
Advert
Old 07-02-2014, 04:10 PM   #3
radius
Lector minore
radius ought to be getting tired of karma fortunes by now.radius ought to be getting tired of karma fortunes by now.radius ought to be getting tired of karma fortunes by now.radius ought to be getting tired of karma fortunes by now.radius ought to be getting tired of karma fortunes by now.radius ought to be getting tired of karma fortunes by now.radius ought to be getting tired of karma fortunes by now.radius ought to be getting tired of karma fortunes by now.radius ought to be getting tired of karma fortunes by now.radius ought to be getting tired of karma fortunes by now.radius ought to be getting tired of karma fortunes by now.
 
radius's Avatar
 
Posts: 649
Karma: 1738720
Join Date: Jan 2008
Device: Aura One, Samsung Galaxy Tab S5e, Google Pixel Slate
@eschwartz shouldn't that be
Quote:
<p class='spacerMedium'>
?

Personally, I prefer describing something like that as "scenebreak", "firstpara" or something that describes what it is versus something like "spacer" that describes what it does.
radius is offline   Reply With Quote
Old 07-02-2014, 04:16 PM   #4
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 74,015
Karma: 129333114
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
I use spacebreak as the class name for scene breaks.
JSWolf is offline   Reply With Quote
Old 07-02-2014, 07:44 PM   #5
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
Posts: 19,422
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
Quote:
Originally Posted by radius View Post
@eschwartz shouldn't that be ?

Personally, I prefer describing something like that as "scenebreak", "firstpara" or something that describes what it is versus something like "spacer" that describes what it does.
It should. I changed my mind halfway through and decided to use names more similar to the OP. Since I don't know what the OP wishes to use it for, I assumed we could all change the name to suit ourselves. Then I forgot to go back and change it in the example.

(I only use "scenebreak" and it uses asterisks or pictures in it. One-size-fits-all.)

Last edited by eschwartz; 07-02-2014 at 07:47 PM.
eschwartz is offline   Reply With Quote
Advert
Old 07-05-2014, 10:17 AM   #6
mattst
Enthusiast
mattst began at the beginning.
 
Posts: 32
Karma: 10
Join Date: Nov 2011
Device: Kindle
Thanks for your help. I understand and see the sense of what eschwartz explained, that's what I'll do.

But in the interest in furthering my understanding, what is the reason it does not work?

Thanks again.
mattst is offline   Reply With Quote
Old 07-07-2014, 01:31 AM   #7
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
Posts: 19,422
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
It is just an ugly hack, leads the reader to see blank paragraphs (like when highlighting things) and can potentially do weirdly unexpected things at weird times. And depending on the conversion used, blank paragraphs may get stripped unexpectedly -- I believe Sigil has endless fun with nbsp AND empty paragraphs.

It is also much easier to just add in a declaration to the paragraph itself to add spacing.
eschwartz is offline   Reply With Quote
Old 07-07-2014, 06:40 AM   #8
mrmikel
Color me gone
mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.
 
Posts: 2,089
Karma: 1445295
Join Date: Apr 2008
Location: Central Oregon Coast
Device: PRS-300
Either the conversion software or the reader can throw away what are clearly empty, and by their reasoning, meaningless paragraphs.

That is why it is better, theoretically, to put a class into the paragraph tag of the paragraph you want space around.

From an editing point of view, it is safer to NOT have empty paragraphs, as they may not be purposeful, but accidentally created by a search and replace gone amok, and indicate a paragraph what was full of stuff, but which you gutted in error.
mrmikel is offline   Reply With Quote
Old 07-07-2014, 12:28 PM   #9
mattst
Enthusiast
mattst began at the beginning.
 
Posts: 32
Karma: 10
Join Date: Nov 2011
Device: Kindle
Okay, thanks again all.
mattst is offline   Reply With Quote
Old 07-07-2014, 04:31 PM   #10
HarryT
eBook Enthusiast
HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.
 
HarryT's Avatar
 
Posts: 85,544
Karma: 93383043
Join Date: Nov 2006
Location: UK
Device: Kindle Oasis 2, iPad Pro 10.5", iPhone 6
Personally I would advise against simply using a larger gap between paragraphs for a scene break, because it doesn't show up if the reader breaks the page at that point. I would always use a visual indicator, such as three centred asterisks.
HarryT is offline   Reply With Quote
Old 07-07-2014, 06:08 PM   #11
mrmikel
Color me gone
mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.
 
Posts: 2,089
Karma: 1445295
Join Date: Apr 2008
Location: Central Oregon Coast
Device: PRS-300
It does pay to be consistent, though. One book I just worked on used the three asterisks to indicate missing material. It was fairly obvious from the context jumping from 4 to 8, but if you are going to do it, have it mean the same thing whatever it is.
mrmikel is offline   Reply With Quote
Old 07-07-2014, 06:39 PM   #12
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
Posts: 19,422
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
Quote:
Originally Posted by HarryT View Post
Personally I would advise against simply using a larger gap between paragraphs for a scene break, because it doesn't show up if the reader breaks the page at that point. I would always use a visual indicator, such as three centred asterisks.
+1 definitely.
eschwartz is offline   Reply With Quote
Old 07-07-2014, 07:03 PM   #13
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 74,015
Karma: 129333114
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by HarryT View Post
Personally I would advise against simply using a larger gap between paragraphs for a scene break, because it doesn't show up if the reader breaks the page at that point. I would always use a visual indicator, such as three centred asterisks.
I use a 2em gap for section breaks. But that's not an issue because I also use widows and orphans at 0. I don't mind it with a printed book, but I mind it with an eBook. What I find annoying is when eBooks that use blank space for section breaks also keep in the * * * for when the section breaks fall at the end of the page on a pBook. That's just silly to have such.
JSWolf is offline   Reply With Quote
Old 07-07-2014, 08:06 PM   #14
mrmikel
Color me gone
mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.
 
Posts: 2,089
Karma: 1445295
Join Date: Apr 2008
Location: Central Oregon Coast
Device: PRS-300
Don't know that you can fault asterisks for goofy stuff that comes from it being reflowable. I have been just reading a book with pictures whose captions don't always stick to the picture which can be made worse by increasing text size.
mrmikel is offline   Reply With Quote
Old 07-07-2014, 10:23 PM   #15
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 74,015
Karma: 129333114
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by mrmikel View Post
Don't know that you can fault asterisks for goofy stuff that comes from it being reflowable. I have been just reading a book with pictures whose captions don't always stick to the picture which can be made worse by increasing text size.
Pictures captions not sticking with the picture can happen easily. But the * * * left in because of the print version is just stupid.
JSWolf is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Stop Sigil from inserting unwanted lines between paragraphs Benasam Sigil 16 05-28-2014 03:16 PM
gap between paragraphs moonshot General Discussions 5 02-09-2014 02:43 PM
Closing The Gap indie Self-Promotions by Authors and Publishers 6 09-25-2010 02:04 AM
any way to solve the writing 'gap' of the stylus? booklover iRex 10 05-05-2008 06:05 PM
Missile Gap by C. Stross Liviu_5 Reading Recommendations 0 04-22-2007 08:55 PM


All times are GMT -4. The time now is 09:44 AM.


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