Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Formats > Workshop

Notices

Reply
 
Thread Tools Search this Thread
Old 12-20-2012, 08:17 PM   #1
NeoRealist
Junior Member
NeoRealist began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Dec 2012
Device: none
Variable Leading, or Is Validation Necessary?

In a print book, one might have a space break between sections, which would typically be a carriage return.

Like this. In an ebook, you could specify this with a margin-top or margin-bottom of 1em.

On the other hand, you might want (and I do want) less space between body text and a block element, such as a block quotation, to show that it's part of the continuing narrative rather than a break in time, setting, or subject. Therefore, I specified a "spacer" tag with a margin-bottom of .7em.

It works fine in Kindle, though not in epub readers, but only if I use something like this:

<p class="spacer">

The problem is, if I run it through the W3 validator, it fails, because there's no closing </p> tag. But if I add the closing tag, Kindle no longer recognizes the .7em--it treats it as a full 1em carriage return.

I've tried using margin-top instead of margin-bottom, using percentages (both 70%, which actually looked like 700%, and .7%, which was just a carriage return), and adding the !important declaration, none of which worked. The Amazon Kindle Publishing Guide says that Kindle ignores line-height under 120%, so reducing line-height won't help.

So I ask you: is there a way to do this? And if not, do I really need validated HTML? I don't see any requirement for the latter in Amazon's Kindle Guidelines or B&N's Pubit Formatting Guide.

Last edited by NeoRealist; 12-20-2012 at 08:19 PM.
NeoRealist is offline   Reply With Quote
Old 12-21-2012, 05:47 AM   #2
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: 2,959
Karma: 3363559
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-300, PRS-T1
You can try making it autoclosing with <p class="spacer" />, but be aware that a lot of ePUB readers will ignore empty paragraphs.
Toxaris is offline   Reply With Quote
Old 12-21-2012, 06:06 AM   #3
Jellby
frumious Bandersnatch
Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.
 
Jellby's Avatar
 
Posts: 6,148
Karma: 4792399
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
If your only goal is creating a book for Kindle, you can ignore validation as long as you get the desired results.

But if you want an ePub book, then yes, you should care about validation, and you must include the closing tag, or make the tag self-closing:

<p class="spacer" />

but some readers might ignore empty paragraphs, so you can add some blank stuff:

<p class="spacer">&nbsp;</p>

Instead of line-space, you could try reducing font-size.
Jellby is offline   Reply With Quote
Old 12-21-2012, 10:03 PM   #4
NeoRealist
Junior Member
NeoRealist began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Dec 2012
Device: none
Thanks. You're right--the epub readers I used (ADE and BN) did ignore the empty paragraphs (including with &nbsp; ), as did the Kindle.

After further experimentation, I found that deleting the blank paragraphs and adding the margin-top or -bottom to the tags for the surrounding paragraphs with text fixed it in both mobi and epub.
NeoRealist is offline   Reply With Quote
Old 12-22-2012, 03:37 AM   #5
Jellby
frumious Bandersnatch
Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.
 
Jellby's Avatar
 
Posts: 6,148
Karma: 4792399
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
Quote:
Originally Posted by NeoRealist View Post
the epub readers I used (ADE and BN) did ignore the empty paragraphs (including with &nbsp; )
Really? I think I've never seen a <p>&nbsp;</p> ignored in ePub...
Jellby is offline   Reply With Quote
Old 12-22-2012, 04:41 AM   #6
Ripplinger
350 Hoarder
Ripplinger ought to be getting tired of karma fortunes by now.Ripplinger ought to be getting tired of karma fortunes by now.Ripplinger ought to be getting tired of karma fortunes by now.Ripplinger ought to be getting tired of karma fortunes by now.Ripplinger ought to be getting tired of karma fortunes by now.Ripplinger ought to be getting tired of karma fortunes by now.Ripplinger ought to be getting tired of karma fortunes by now.Ripplinger ought to be getting tired of karma fortunes by now.Ripplinger ought to be getting tired of karma fortunes by now.Ripplinger ought to be getting tired of karma fortunes by now.Ripplinger ought to be getting tired of karma fortunes by now.
 
Ripplinger's Avatar
 
Posts: 2,237
Karma: 2299170
Join Date: Dec 2010
Location: Midwest USA
Device: Sony PRS-350: 3 Silver, 2 Blue!; Kobo Glo
Quote:
Originally Posted by Jellby View Post
Really? I think I've never seen a <p>&nbsp;</p> ignored in ePub...
Same here, it's the method I use that seems most reliable, as well as safe from losing the spaces when you do a conversion in Calibre... even if you tell Calibre to delete blank lines for the conversion, they'll still remain.
Ripplinger is online now   Reply With Quote
Old 12-22-2012, 06:46 AM   #7
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: 2,959
Karma: 3363559
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-300, PRS-T1
It is not correct. A <p>&nbsp;</p> will be honored because it is not an empty paragraph. A <p /> will be ignored and sometimes also a <br />.

I have seen this behaviour on all Sony and Kobo readers.
Toxaris is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Using Class Variable in Def Agama Development 1 08-21-2012 07:05 AM
Variable payments come to eBooks WhichP News 4 08-04-2012 03:52 PM
PATH variable in Windows kapsi Calibre 3 05-16-2011 05:12 PM
Annoying Variable Font Size Brandon202000 Sony Reader 2 12-18-2007 03:36 AM


All times are GMT -4. The time now is 12:09 PM.


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