Lessons Learned: Formatting an Ebook

Writing was the easy part. Although it took me years, writing Map the Future was relatively straightforward because I was in control: If I didn’t like something, I could change it, and control the results precisely.

Things got frustrating when I started trying to format the book for publication. I had this stereotype in my head that I could produce an ebook the same way as I’d produce a PDF file: hit “save as” in Microsoft Word. That turned out to be horribly naive. You can fairly easily produce a bad-looking ebook that’s text-only, but if you want to use anything other than plain text (footnotes, illustrations, tables, unusual formatting), things rapidly become mind-numbingly complex. 

I was lucky in that I found two resources that helped me learn.  APE, the e-publishing how-to book by Guy Kawasaki and Shawn Welch, taught me how the e-publishing ecosystem works and pointed me toward several useful tools. It’s well worth buying. The second resource was MobileRead.com, a discussion forum on everything e-publishing. I used it to research particular problems I ran into during the formatting process. Generally someone on Mobile Read had already answered my question.

Despite this help, I ended up spending about a month part-time dinking around with various tools and formatting approaches for Map the Future, going down numerous blind alleys and learning through repeated failure. I’d like to spare other people some of that pain, so here’s a summary of what I learned:

1. Ebook file formats are primitive and mutually incompatible. The leading formats are PDF, mobi (used by Kindle) and epub (used by most other book readers). Microsoft Word can export directly only to PDF. For the other two, you have to export to an intermediate format and then convert to mobi or epub.

PDF lets you control the exact appearance of your book, including font choice and size, page breaks, headers, footnotes, etc.  The other formats are more like suggestions; the ebook reader software feels free to override you choices on font, text size, etc. Handling of graphics can also vary enormously, headers and footers are not allowed, and footnotes are handled very badly.

2. As suggested by APE, you can’t just use one master Word file and convert it to all three formats.  Instead, you need to create one master for PDF, which you can format precisely, and a second master for the e-formats, which you tweak to accommodate their limitations.

3. For ebook format, replace footnotes with hyperlinks. Footnotes work badly in the e-formats. The superscripting of the footnote adds extra space between the lines of text that include the footnote, and looks terrible. Instead, indicate your footnote with a good old asterisk * and use Word’s Hyperlink feature to link that asterisk to the text of your footnote. Put each footnote on a separate page at the back of the book. The nice thing about this is that you don’t have to number the footnotes, since each one is linked to directly.

4. Render all your graphics as high-resolution images.  I saved all of mine as 200-dpi PNG files and then placed them in the text using Word.  This seems to produce fairly smooth-looking graphics in the finished book. Before I learned to do this, I ended up with some terrible-looking graphics: jagged, blurry, etc.

5. Convert tables to graphics. Sometimes tables work well in ebooks, but it’s like playing the lottery. You’re safer if you make them into graphics.

6. Use styles for all the formatting. I’m used to setting fonts, line spacing, and other characteristics directly with Word’s formatting controls. This is a problem in ebooks because all of those individual formatting commands can easily go wrong. Instead, use styles. Chapter headings are Heading 1, subchapters are Heading 2. Body text is Normal. Create new styles for anything else you want to format (I created styles for bulleted lists and indented text, for example). You can use the normal Word commands to do italic and bold, but for everything else you are safest if you use styles.

Using styles makes it easier for the ebook formats to detect the structure of your book, and makes it easier for you to make global changes when changing your formatting between PDF and the other formats.

7. My conversion workflow was as follows: Save from Word to HTML Filtered format. Then use Calibre (an ebook management program) to convert the HTML file to epub. In Calibre, attach the cover image and author information. Then choose Convert books. Under Table of Contents, set level one of the TOC to h1, and level 2 to h2. In Structure Detection, set breaks to h1.

After you have created the epub file, open it with Sigil (an epub editing program) and choose Tools : Validate Epub. This will give you a list of the HTML commands created by Microsoft Word in its conversion process that are not acceptable in the epub standard. In most cases, they will be tags that you can safely delete. Fix the errors and revalidate until there are no more errors. Then save and return to Calibre.

In Calibre, convert to mobi format. Then use Amazon's Kindle Previewer to check the conversion.

This process will not be survivable unless you have some technical skills. You don’t have to be a programmer, but you must be at least a little comfortable with HTML. I find it outrageous and irresponsible that the tech industry has not made it easier for authors to create ebooks. We pontificate long and loud about empowering people to do great things, then don't bother to carry out the simple basic steps needed to enable a normal person to actually do it. I am embarrassed on behalf of my industry.

8. The alternative to the sort of workflow I described above is to either hire somebody to do the conversion for you, or flow the document into Adobe’s InDesign, which does a more automatic job of conversion. I tried InDesign but dropped it because it messed up many of the styles I had carefully created in Word. 

APE gives more advice on both of those options.


After doing all of this stuff, I have finally reached the point where my book looks fairly good in PDF, mobi, and epub.  I have a nasty feeling that I’m going to learn more hard lessons as time goes on; when I do, I’ll update this post.

Good luck with your ebook, and feel free to post questions and suggestions.

0 comments: