View Single Post
Old 04-28-2013, 05:16 PM   #1
Man Eating Duck
Addict
Man Eating Duck juggles neatly with hedgehogs.Man Eating Duck juggles neatly with hedgehogs.Man Eating Duck juggles neatly with hedgehogs.Man Eating Duck juggles neatly with hedgehogs.Man Eating Duck juggles neatly with hedgehogs.Man Eating Duck juggles neatly with hedgehogs.Man Eating Duck juggles neatly with hedgehogs.Man Eating Duck juggles neatly with hedgehogs.Man Eating Duck juggles neatly with hedgehogs.Man Eating Duck juggles neatly with hedgehogs.Man Eating Duck juggles neatly with hedgehogs.
 
Posts: 254
Karma: 69786
Join Date: May 2006
Location: Oslo, Norway
Device: Kobo Aura, Sony PRS-650
List of epub formatting "don'ts"

In my library of 619 books, about 300 of which are retail productions, there are very few in which I haven't touched the code at all. Many changes I do are due to personal preference, for instance I prefer indented paragraphs to spacing. Some common formatting decisions, however, are just plain wrong, and should never be used in a straightforward novel for general consumption, because they will break rendering or functionality on some software and devices.

I'd like your help in compiling a short list of absolute don'ts when formatting epubs, with a short description of why this is a bad idea. I know there are a lot of epub tutorials out there, but the scope of this list is a lot smaller.

Please contribute your viewpoints, also comment on mine if you feel that I'm mistaken. Please avoid points which vary with personal preference, I'm after the things that probably never should be done. I've also tried not to be too nitpicky, for such a list to have any value it shouldn't be too long.

I'll start with a few points:

* Don't use fixed units like in, pt, or px for anything. When text size is adjusted the spacing will often stay fixed. The 0.8in text-indent or 1.5in margins might look fine on your computer screen, but will look very silly on a phone. Use em for indents (I prefer 1.2em myself, but 1-2 em is acceptable). Use % or em for margins, or leave margins to the renderer defaults. This includes blockquotes.

* Don't specify color for body text. Color:#000 might be detrimental to night reading modes on some readers. Also avoid grey, as it might render text almost unreadable on some e-ink screens, and usually adds little to the presentation. For charts and diagrams, don't rely on color to convey information, as it will be lost on b/w screens.

* Don't adjust font size in body text. If you need other sizes for things like quotes or headings, use % or size names. Around 70% is the smallest text you should use, and only sparingly.

* Don't adjust line-height. Leave it at default. Readers will render a sensible default, many can override it if desired, but a silly value here can make it difficult to hit the correct value if you adjust the view. Edit: One exception is in span styles for superscript, here a line height of 0 avoids extra spacing to the above line.

* Don't use inline styling, or <style type="text/css"> in each html file. This makes your job of styling the epub more complicated, and is annoying to those of us who actually tweak our epubs ourselves. It might also break text resize on some ADE-based devices. Instead, put all your definitions in a css file.

* Don't use any html/css whatsoever generated by MS Word. This should be obvious to anyone familiar with its output, but I still see a lot of mso-something styles and endlessly nested spans for no reason
Some devices will choke on the overly complex and often invalid code.

* Don't use empty paragraphs for spacing, or &nbsp; for indents. Specify the values in css. For section separators, consider inserting * * * or similar in it's own paragraph. Since you don't control where page breaks occur, a blank section separator might not always be apparent.
Quote:
Originally Posted by JSWolf View Post
* Don't use margins that are huge. If you want margins so the text doesn't bump the edge of the screen, use 5-9pt (no need for a bottom margin) and in this case, it's OK to to use pt as you want the margins to always stay the same.
I believe that this should be left as default - Man Eating Duck

Last edited by Man Eating Duck; 05-08-2013 at 05:17 AM. Reason: Clarified inclusion criteria (must break rendering or functionality)
Man Eating Duck is offline   Reply With Quote