Quote:
Originally Posted by dordale
I prefer no line spacing between my paragraphs, but haven't found a way to easily remove it with Calibre while still leaving the spacing between section breaks. If I tell Calibre to remove the line spacing between paragraphs, it seems that usually the additional space between sections is also removed.
Does anybody have any hints for me? I'd prefer to have something automated because I'm not really very knowledgeable in ePub formatting. But if the steps are simple enough I'd be willing to delve into the code and make changes.
|
The problem there is there are many ways to generate the spacing between paragraphs and sections. Some ebooks add extra bottom/top margin for the paragraph tag before or after a section break while others add a blank line between the two paragraphs. Yet others use a mix or replace the blank line with something such as "* * *".
Samples would be
Code:
<p class="para">Paragraph text goes here</p>
<p class="sectionbreak"> </p>
<p class="para_nonindent">Next paragraph text goes here</p>
<p class="para_before">Yet more paragraph text goes here</p>
<p class="para_after">And more paragraph text here</p>
.para {
display: block;
margin-bottom: 0.2em;
margin-left: 0;
margin-right: 0;
margin-top: 0em;
text-indent: 5%;
}
.para_nonindent {
display: block;
margin-bottom: 0.2em;
margin-left: 0;
margin-right: 0;
margin-top: 0em;
text-indent: 0;
}
.para_before {
display: block;
margin-bottom: 1.5em;
margin-left: 0;
margin-right: 0;
margin-top: 0em
text-indent: 5%;
}
.para_after {
display: block;
margin-bottom: 0.2em;
margin-left: 0;
margin-right: 0;
margin-top: 1.5em
text-indent: 0;
}
.sectionbreak {
display: block;
margin-bottom: 1em;
margin-left: 0;
margin-right: 0;
margin-top: 1em
}
Using Calibre to remove the top/bottom margins in the first case would reduce the section break to the default line height by removing the top and bottom margins while also removing the 0.2em spacing between the paragraphs so you would still have a visible section break. In the second case, the top/bottom margin removal would also remove the entire section break leaving only the unindented paragraph to indicate a section break had existed.
After a bit of practice using Sigil or Calibre's built-in editor, looking at the stylesheets from ebooks you find attractive or unattractive (as much to learn from a bad example as a good example) and generally reading with a critical eye for the typography, it all becomes much easier to modify your ebooks for legibility and readibility.