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

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Reply
 
Thread Tools Search this Thread
Old 01-08-2009, 07:23 PM   #1
kiwik
Junior Member
kiwik began at the beginning.
 
Posts: 8
Karma: 10
Join Date: Oct 2008
Device: PRS-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, 07: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: 26,454
Karma: 5383257
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 online now   Reply With Quote
 
Advertisement
Old 01-09-2009, 12:47 AM   #3
kiwik
Junior Member
kiwik began at the beginning.
 
Posts: 8
Karma: 10
Join Date: Oct 2008
Device: PRS-505
Well that explains it, glad I wasn't doing anything wrong. Thank you very much!
kiwik 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
Each sentence treated as a paragraph in new versions of calibre jidiot008 Calibre 3 11-16-2010 07:00 PM
Prevent Calibre to paragraph each line armkbdotcom Calibre 3 05-29-2010 04:15 PM
Paragraph question shrktank Calibre 2 11-29-2009 01:07 AM
What is so unusual about this paragraph? Madam Broshkina Lounge 11 04-24-2008 04:04 PM


All times are GMT -4. The time now is 12:37 AM.


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