View Single Post
Old 01-08-2009, 06:23 PM   #1
kiwik
Enthusiast
kiwik began at the beginning.
 
Posts: 33
Karma: 10
Join Date: Oct 2008
Device: Kobo Aura One (ex Kindle, Sony 505)
Calibre collapses paragraph margins - why?

I'm formatting a book in HTML, and I want to lay out my paragraphs with no text-indent, but a 6pt gap between paragraphs. If I code like this:

PHP Code:
<style>
margin-bottom:6pttext-indent:}
</
style>
<
p>Some text.</p>
<
p>Another paragraph.</p
My output looks like this, with no gaps between paragraphs:

Quote:
Some text.
Another paragraph.
(Before you think "Just use the '--blank-after-para' option", I want to be able to have gaps of a different size than 1em.)

But completely different <p> tags, say referring to a chapter title and body text will have gaps between them. After much fiddling around, I've discovered that any paragraph with the same attributes as the previous paragraph will be completely collapsed into each other, with all margin information discarded. For example, the following will give exactly the same result as the last example:

PHP Code:
<style>
p.margin-bottom:6pttext-indent:}
p.margin-bottom:6pttext-indent:}
</
style>
<
class="A">Some text.</p>
<
class="B">Another paragraph.</p
However, if you make a significant change for the style for the two paragraphs, you'll get the right result:

PHP Code:
<style>
p.margin-bottom:7pttext-indent:}
p.margin-bottom:6pttext-indent:}
</
style>
<
class="A">Some text.</p>
<
class="B">Another paragraph.</p

Quote:
Some text.
---- 7pt gap is here ----
Another paragraph.
Is there anything I'm doing wrong, or anything I can do to get the result that I want? The HTML files display perfectly in my browser, it's just when Calibre turns them to an LRF that they don't work. Interestingly enough, EPUB output produces them exactly right, but of course doesn't have justified text.



Thank you for any suggestions! At the moment I'm doing all my books with alternating paragraph classes, very clunky.
kiwik is offline   Reply With Quote