Kindle Forum banner

trouble with added space between paragraphs - MIGHT APPLY TO YOU

6.9K views 14 replies 3 participants last post by  Eltanin Publishing  
#1 ·
EDITED TO UPDATE - I solved my problem and it might affect you, too, if you don't want extra space between paragraphs when viewing ePubs on the nook simple touch. See my post a ways down, with a screenshot.
---------
I'm going nuts here. I've made an ePub the same way I have dozens of times before, but it is adding extra space between paragraphs that I don't want. I've gone from Word to HTML, tweaked HTML in Dreamweaver, import into Calibre, make ePub. I DID check off "remove extra space between lines." I know how to tweak the ePub. I can't find anything in the CSS that would cause the extra space. Here's the CSS below. If you want the ePub, I'll email it to you, just ask.

.MsoNormal {
border-bottom: 0;
border-top: 0;
display: block;
font-size: 1em;
padding-bottom: 0;
padding-top: 0;
text-indent: 1.5em;
margin: 0
}
.MsoNormal1 {
border-bottom: 0;
border-top: 0;
display: block;
font-size: 1em;
padding-bottom: 0;
padding-top: 0;
text-align: center;
text-indent: 0.4in;
margin: 0
}
.blockquote {
border-bottom: 0;
border-top: 0;
display: block;
font-size: 1em;
padding-bottom: 0;
padding-top: 0;
text-indent: 1.5em;
margin: 0 0.4in 0 0.5in
}
.bold18center {
border-bottom: 0;
border-top: 0;
display: block;
font-size: 1.41667em;
font-weight: bold;
padding-bottom: 0;
padding-top: 0;
text-align: center;
text-indent: 0;
margin: 0
}
.calibre {
display: block;
font-size: 1em;
orphans: 0;
padding-left: 0;
padding-right: 0;
widows: 0;
margin: 0 5pt
}
.calibre1 {
height: auto;
width: auto
}
.calibre2 {
display: block;
page-break-before: always
}
.calibre3 {
font-style: italic
}
.calibre4 {
color: black
}
.calibre5 {
font-weight: bold
}
.centerbold {
border-bottom: 0;
border-top: 0;
display: block;
font-size: 1.125em;
font-weight: bold;
padding-bottom: 0;
padding-top: 0;
text-align: center;
text-indent: 0;
margin: 0
}
.image-cen-noindent {
border-bottom: 0;
border-top: 0;
display: block;
font-size: 1em;
padding-bottom: 0;
padding-top: 0;
text-align: center;
text-indent: 0;
margin: 0
}
.image-center {
border-bottom: 0;
border-top: 0;
display: block;
font-size: 0.75em;
padding-bottom: 0;
padding-top: 0;
text-align: center;
text-indent: 0;
margin: 0
}
.rt-aligned-normal {
border-bottom: 0;
border-top: 0;
display: block;
font-size: 1em;
padding-bottom: 0;
padding-top: 0;
text-align: right;
text-indent: 0.4in;
margin: 0
}
.pcalibre:visited {
color: purple;
text-decoration: underline
}
.pcalibre1:link {
color: blue;
text-decoration: underline
}
 
#2 ·
It probably doesn't have to do with what's in your CSS but in what's missing.

The default p tag has space between paragraphs.  If the p tag defaults are not defined, then it will insert a space unless it's told not to.  While your CSS defines a lot of those class tags as not having any margin, that doesn't necessarily cover everything.

Try inserting this line (preferably before the class tags you've listed, but after any "body" definitions):

p {margin: 0;}


This is one of the reasons I do not like to let MS Word (or any other word processor) create my html for me.  However, creating a workflow that does what you want tends to be pretty personal.  I type in "Markdown" in plain text or Scrivener, and let Scrivener compile the Markdown to html.  (However, even there Scrivener likes to insert code you don't want -- it takes some tweaking to get the settings and the process right.)  Then I use a CSS template I've created in Dreamweaver to apply styles.

This can be a lot of work up front, and it's best for those of us who like very simple, very clean stylings.

Camille
 
#3 ·
Do you upload html to B&N etc. or do you use something to make your ePub. I use Calibre. When the ePub opens in Adobe digital editions on my PC, there isn't any extra space between paragraphs, but it's there on the Nook simple touch. Books I made a month ago in the exact same way don't have it.

Are you recommending I add that line in the HTML before I import it into Calibre, or tweak the ePub after Calibre has made it? I tried the latter and it didn't help.
 
#5 ·
Eltanin Publishing said:
My HTML before I import it to Calibre already has:

p
{margin:0in;
margin-top:.000pt;
margin-bottom:.000pt;
text-indent:.4in;
font-size:12.0pt;
}
Okay... I don't know why you have all of that excess info for the margin, but that should be okay.

So we'll move on to assuming you don't have an error, but rather you have a bug. Often that doesn't show up in your html, but it affect the conversion. I've had two such weird, unexplainable problems, with relatively easy solutions:

1.) It could be a Calibre problem. I've fixed one weird problem by upgrading.

2.) You could have an invisible gremlin in your CSS. If you have a document with identical CSS which works, you might resolve the problem by copying and pasting the header of the working file to the non-working one. (Remember to change the title metadata.)

You have very complex CSS, so that second one may be it. I've had that happen even with my very simple CSS. I went over that that file's CSS letter by letter, space by space, and could find no difference, but when I copied the whole header from one to the other, suddenly the file worked.

Given all the junk that Word inserts into html it would not be surprising if an occasional invisible character doesn't show up in an inconvenient location. You can't see it, but the conversion software is trying to figure out what it means, and it's possible that, if it can't figure it out, it ignores that element.

(If that doesn't work, you may have to look to using what Smashwords calls "The nuclear option" which is to wipe out all hidden formatting by copying your text out to a text document and the copying it back in -- this will lose your italics along with the rest of the formatting, but I know a trick (for Word) that will help you get them back. Let me know if you need to do that one.)

Camille
 
#7 ·
Sandra K. Williams said:
What does the calibre class apply to? A div.calibre around your p's would add top and bottom margins.

Oops, i don't remember whether div margins are inherited by p's and am too sleepy to look it up. Hope you find your problem.
I don't really know what the calibre class applies to. I didn't make it; Calibre did. I've got my HTML file (which, even though produced by Word, it's really not bad at all. I save as HTML-filtered) with style definitions at the beginning. When I dump that into Calibre and make an ePub, Calibre creates a style sheet (you only see this if you "tweek" and "explode") the ebook.

I've determined that it's something Calibre is doing differently, unfortunately. I took an ePub that I had made (from HTML) in Calibre several months ago (which looks fine on the nook) and reimported the SAME HTML file (with a different file name), made a new epub using the same settings as the previous one, and the new ePub has space between paragraphs. Maybe I can roll back Calibre...

I'm off to try and compare the two ePubs Calibre made (exploding it and looking at the CSS that Calibre made...)
 
#9 ·
Sandra K. Williams said:
I suggest looking at the HTML to see where the calibre class is applied.
The calibre class/style isn't the problem. Calibre creates it's own styles whenever you have formatting in your HTML other than a style. For instance, if in the midst of your normal style paragraph, you use or tags, Calibre removes them and creates a class that is the style of the paragraph + the formatting you had applied with tags. This is normal. It's fine. So in the CSS file that Calibre creates, in addition to your own styles that you had in your original HTML, you'll see several calibre styles.

I found the problem, and everyone should be aware of it, if you don't want space between your paragraphs. Note that this problem did NOT show up when viewing the ePub in Adobe Digital Editions or the Nook for PC app. It only showed up on the actual Nook (I'm using a Simpletouch, non-lighted). This is not the first time a problem has shown up on the device itself and not in any emulators - I highly recommend authors/publishers spring for an actual nook device - I bought this used on eBay for like $40.

So, in one of the updates to Calibre in the past few months, it has changed how it creates the CSS file. Below is a comparison of two CSS files that Calibre made from the SAME HTML file - one (the BADcss) made today and one (GOODcss) made several months ago.

Image


So, basically, the latest version of Calibre is using a line like:

Code:
margin: 0 0 0.0001pt
that the nook is not interpreting correctly. It has to be replaced with:

Code:
margin-bottom: 0.0001pt;
margin-left: 0;
margin-right: 0;
margin-top: 0;
(BTW, does anyone know why Calibre uses 0.0001 instead of 0?) I've learned that this is called "margin shorthand". Apparently the nook can't handle "margin shorthand". Comparing the two CSS files, I had to replace several "margin" lines, such as replacing:

Code:
margin: 0 0 0.0001pt 0.3in
with

Code:
margin-bottom: 0.0001pt;
    margin-left: 0.3in;
    margin-right: 0;
    margin-top: 0;
So, I guess I'll try to find where to submit a bug report to Calibre. Luckily it's not too hard to fix by tweaking the ePub in Calibre. But I bet that many people who don't test on an actual nook now have spaces between paragraphs that they don't want, and aren't aware of it. If anyone wants me to test their ePub, you can send it to me and I'd be happy to do so. The extra spaces aren't too bad in the body of a chapter, but title pages, chapter headings, etc., look pretty bad to me when every line has extra space between it.

This webpage describes these two ways of specifying margins in CSS: http://www.w3schools.com/css/css_margin.asp
 
#10 ·
Kovid of Calibre quickly responded to my bug report:

Shorthand margins are perfectly valid, however the next calibre release
will have an option to switch back to long form, feel free to use it.

status: wontfix
Well, they might be valid CSS, but they don't work on the nook simpletouch... I understand that it's more a nook problem than a Calibre problem since it's the nook that is not properly interpreting valid CSS, but it was a Calibre update that broke my process. Anyway - test your books carefully, everyone!
 
#13 ·
Sandra K. Williams said:
Thanks for following up, Eltanin Publishing.

Have you noticed any problems with the Nook and line-height? I've found if a line-height isn't set, the lines of text scrunch together when the Publisher Default setting is used.
Yeah, it's quite tight if you select "publisher defaults". I'm not going to worry about that, because readers can just uncheck that (and unchecked is the default). I wonder why it changes it to a serif font when the reader picks publisher defaults, when I haven't specified a font at all. I don't care what font readers use. So although it does look like crap when publisher defaults is selected, I'm not going to worry about it, because there's only so many hours in a day! :)

Things get even worse if you decide to test on a Kobo - both with line height and also widow/orphan control (it tries to keep paragraphs together so you get extra space at the bottom of the screen when it bumps text to the next page). And all the apps - Kindle app shrinks images if I don't put a page break before them. For instance, if there's half a screen of text, then a big image, it shrinks it to fit it on the page. Such a headache...

Oh, and both nook and kobo do NOT shrink images, the way kindle does, if they don't fit a certain screen - it chops them off. So although some kobos and nooks can display large images (they are higher resolution), I have to only include smaller ones that won't be chopped off on the basic nooks/kobos...
 
#14 ·
Eltanin Publishing said:
Kindle app shrinks images if I don't put a page break before them. For instance, if there's half a screen of text, then a big image, it shrinks it to fit it on the page. Such a headache...
You are making sure the export options for Mobi have the right image options set, right?

Currently I'm not using images, but it is good to know about your weird occurences -- some additional things to watch for.

Camille
 
#15 ·
daringnovelist said:
You are making sure the export options for Mobi have the right image options set, right?

Camille
What image options are you referring to? Nook and Kobo are ePub, not mobi. When you explode an ePub in Calibre, you can see the image files. If they are bigger than 600x730 pixels, they get chopped when viewed on a nook or kobo. It unfortunately took me a while to learn this because I was testing on a color nook, which has a bigger screen.