34 Common Formatting Problems in Pressbooks
There are a number of problems that pop up consistently with Pressbooks users, 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 imported from MS Word, or from the user just doing a few things wrong.
Here is a quick list of common problems, 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 - Funky 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 sorts of heartache, because in many cases your “headings” will look like very short, indented paragraphs, which happen to be bold.
So instead of getting (good!):
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.
You might get (in certain outputs) (bad!):
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>text text</blockquote>
If you want to get slightly fancy, you can wrap the quote source in a <cite>
tag, so:
<blockquote>To be, or not to be
That is the question.
<cite>Hamlet</cite>
</blockquote>
And this will give you something like:
To be, or not to be
That is the question.
Hamlet
Non-indented Paragraphs
Pressbooks will automatically indent paragraphs correctly, and NOT indent them correctly as well (for instance, after Chapter Titles, and headings throughout a chapter).
However, sometimes you want paragraphs that aren’t indented… for instance … if you were quoting Hamlet, you wouldn’t want new paragraphs indented so you would have:
<p class="no-indent">Hamlet. But what is your affair in Elsinore? ...</p>
<p class="no-indent">Horatio. My lord, I came to see your father's funeral.</p>
<p class="no-indent">Hamlet. I pray thee, do not mock me, fellow-student;
I think it was to see my mother's wedding.</p>
NOTES:
- you don’t need <p> tags around regular paragraphs…
- you can do the above in the VISUAL editor by selecting the paragraphs you want not indented, then using the Styles Dropdown.
- this will be styled as: no indent, with a space between paragraphs.
Lists (Bulleted and Numbered)
Make sure lists are proper lists, so …
Bullet/Unordered Lists
<ul>
<li>item 1</li>
<li>item 2</li>
</ul>
Which will give you:
- item 1
- item 2
Numbered/Ordered Lists
<ol>
<li>item 1</li>
<li>item 2</li>
</ol>
Which will give you:
- item 1
- item 2
NOTE: this can be done with the VISUAL editor — just a good idea to check the TEXT editor for strange bullet characters from Word.
Remove Those <spans>!!!!!
Microsoft Word has a very bad habit of bringing in a whole lot of crappy markup that styles your document for MS Word but does terrible things in ebooks and Pressbooks PDFs–for instance, making your fonts too small or too big or the wrong color etc.
Often this bad markup comes in the form of <span>
tags.
So, it’s a good idea to review your book using the TEXT editor, and see if you see anything that looks like:
<span style="font-size: something; color: something else">
This should be deleted… along with the closing </span>
tag….
… unless you are very sure you know what it is for. There are very few ebooks hurt by deleting spans.