
One of the things that make books ugly at PG is the problem of simple paragraph formatting, which sounds like a simple issue under HTML, but which in practice becomes a mess particularly in EPUB and even more so in MOBI (Kindle). For people who don't understand or don't believe this yet, example files will be provided at the bottom of this posting. People who believe they know HTML believe they know how this issue works, namely one can specify top and bottom margins for one's paragraphs using units one chooses, and similarly choose to indent the first line, or not, and then the HTML browser goes off and does what you ask. And if you specify both top and bottom margins then the browser "merges" those margins so that a paragraph followed by a paragraph doesn't end up with a double-wide margin between those paragraphs. And that is how it works, more or less, in HTML browsers, except, not really, not necessarily, not even there, because even in HTML browsers style specifications are *hints*, not firm rendering commands, and need not be followed the way you specified them. Even in HTML browser land there are still people running HTML browsers old-enough not to merge top and bottom margins, for example, or who have overridden these specifications. But, the situation becomes much worse in EPUB, and especially MOBI land. In EPUB land there is common EPUB rendering software out there that simply ignores paragraph formatting specifications, and substitutes their own. Like Aldiko, for example. [Adobe Digital Editions and its derivative such as Sony and Nook seem to get this right] In MOBI land -- read Kindle and kindlegen (which is pretty much how everyone including PG is force to make MOBI files) there are two big problems: 1) Top and bottom margins are NOT merged. When a paragraph follows a paragraph then the vertical whitespace between those two paragraphs is added to each other. 2) Top and bottom margins are ROUNDED to the closest 1em. So, say for example you take a "split the baby" approach of specifying a top-margin of 0.5em (or the equivalent in one or another of the measures) and a bottom-margin of 0.5em. What do you get displayed on a Kindle? You get two full vertical "blank lines" between every two adjacent paragraph. Now if this doesn't sound to bad to you, consider what happens when a "dialog" happens between two characters in your book: You get two full vertical "blank lines" between each line of dialog. And what happens when you specify poetry using the "one paragraph per line" approach? You get two full vertical "blank lines" between each line of poetry. Does this look attractive? No it does not. It looks d*mned ugly. Barely readable, in fact. How then does one work around these problems? Once one recognizes that there really is a problem, then three (partial) work-around solutions come to mind: 1) Do not even specify paragraph formatting, but rather allow the built-in paragraph formatting in each HTML, EPUB, or MOBI device to do its job. 2) Specify (say) a 1.0em top margin and a 0.0em bottom margin. 3) *Almost* "Split the Baby" by specifying a 0.51 top margin and a 0.49 bottom margin. Finally, understand that all paragraph style specifications are *hints* and if you are relying on details of paragraph formatting to make your book "work" then you are going to have disappointed readers on one or another device. IE: use the <p> tag to specify paragraphs, not things which are not paragraphs. Example test files demonstrating the problem: http://freekindlebooks.org/Dev/marginstestpg.mobi http://freekindlebooks.org/Dev/marginstestpg.epub -- not sure why, but my browser likes to rename marginstestpg.epub into marginstestpg.zip on downloads. Rename it back to marginstestpg.epub to make most epub display software happy playing with it again. PS: I have verified that the problems discusses are not problems introduced by epubmaker per say.