Bad Markup and How to Fix It
There are a number of problems that pop up consistently in self-published ebooks, where outputs just don't look as people expect. Very often, these problems are due to "bad" styling markup that has crept into the editing interface, often coming from MS Word, or from the user just doing a few things wrong.
Here is a quick list of the most common problems we see with users of Pressbooks, and how to fix them:
- Styling headings with Bold instead of Heading tags
- Not using blockquotes for letters, quotes etc.
- Forcing certain kinds of paragraphs not to indent
- Not using correct list formatting (for bullets & numbers)
- The dreaded MS Word
<span>
tag
- Funny spacing
- Paragraphs not being separated properly
Heading styles
DONT: Style headings with Bold instead of Heading tags.
DO: Make sure headings in chapters are tagged <h2>
or <h3>
... NOT <strong>
or <b>
... This causes all sports of heartache, because in many cases your "headings" will look like very short, indented paragraphs, which happen to be bold. Example of proper heading tagging:
The Background
A long, long time ago, in a galaxy far, far away, there lived a fine young man unaware of various things about his past, including: the Force, what his father was up to, how to use a lightsaber. All that, however, was about to change. Three things were about to happen: he would discover the Force, he would learn how to use a lightsaber, and he would meet his father.
The Update
Long after this fellow lived, a famous movie was made about his life. The movie was shot in Tunisia.
Example of using bold instead of heading tags:
The Background
A long, long time ago, in a galaxy far, far away, there lived a fine young man unaware of various things about his past, including: the Force, what his father was up to, how to use a lightsaber. All that, however, was about to change. Three things were about to happen: he would discover the Force, he would learn how to use a lightsaber, and he would meet his father.
The Update
Long after this fellow lived, a famous movie was made about his life. The movie was shot in Tunisia.
Ug! Make sure your headings are tagged properly with <h2>, <h3>, <h4>
etc.
Blockquotes (and <cite>)
For things like letters, poems, long quotations etc., they should be wrapped in <blockquote> tags.<blockquote>text text</blockquote>
If you want to get slightly fancy, you can wrap the quote source in a <cite> <cite>
tag:
<blockquote>To be, or not to be
That is the question.
<cite>Hamlet</cite>
</blockquote>
To be, or not to be That is the question. Hamlet
Lists (bulleted and numbered)
Make sure lists are proper lists. An unordered list looks like this:
<ul>
<li>item 1</li>
<li>item 2</li>
</li>
Which will give you:
A numbered/ordered list looks like this:
<ol>
<li>item 1</li>
<li>item 2</li>
</ol>
That code will give you:
- item 1
- item 2
NOTE: You can look at your markup using a TEXT editor (such as free-to-download Text Wrangler) to detect strange characters from Word; or the TEXT editor built into Pressbooks. You'll want to eradicate these characters before publishing your ebook.
Remove those <spans>
Microsoft Word has a very bad habit of bringing in a whole lot of bad markup that styles your document for MS Word but does terrible things in ebooks -- for instance, making your fonts too small or too big or the wrong color. Often this bad markup comes in the form of <span>
tags. So, it's a good idea to review your book using a text editor, and see if you see anything that looks like:
<span style="font-size: something; color: something else">
<span style="font-size: something; color: something else">
This should be deleted...along with the closing </span> </span>
tag... ...unless you are very sure you know what it is for. There are very few ebooks hurt by deleting spans.
Conclusions
There are plenty of tools for making ebooks, but if you want to make a beautiful ebook, it's a good idea to "look under the hood" and make sure the markup is right. There are a few basic things to look for -- <h> tags for headers being the biggest one -- and knowing just a tiny bit about HTML markup will help you make the beautiful book you want.