Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Reply
 
Thread Tools Search this Thread
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
Old 01-08-2009, 06:49 PM   #2
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,858
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
That's an optimization, creating too many text blocks in an LRF file results in the sony reader rebooting on longer files. Unfortunately, that means you cant achieve the effect you want, except with the alternate classes.
kovidgoyal is offline   Reply With Quote
Advert
Old 01-08-2009, 11:47 PM   #3
kiwik
Enthusiast
kiwik began at the beginning.
 
Posts: 33
Karma: 10
Join Date: Oct 2008
Device: Kobo Aura One (ex Kindle, Sony 505)
Well that explains it, glad I wasn't doing anything wrong. Thank you very much!
kiwik is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Each sentence treated as a paragraph in new versions of calibre jidiot008 Calibre 3 11-16-2010 06:00 PM
Prevent Calibre to paragraph each line armkbdotcom Calibre 3 05-29-2010 03:15 PM
Paragraph question shrktank Calibre 2 11-29-2009 12:07 AM
What is so unusual about this paragraph? Madam Broshkina Lounge 11 04-24-2008 03:04 PM


All times are GMT -4. The time now is 07:01 AM.


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