EPUB Production Workflow

I’ve been a book nerd for longer than I’ve been interested in the web. In fact, some of my first jobs were working in bookstores and libraries. I grew up around the musty smell of ink on paper and still love the feel of a matte finished paperback in my hand. It may not surprise you then, that while I eagerly digitize most of my life, I was reluctant to dive into the world of e-books.

My wife, unaware of my book-luddite position, purchased a Kindle ((I love my iPad too, but don’t find it all that attractive as an e-reader)) as an anniversary gift. With my Kindle in hand, a funny thing started to happened; I began to read more than I had in years. If anything, this little plastic device had reignited a love for reading that had, in all honesty, grown a bit stagnant.

Around the time of my ebook conversion, Joe Clark published “Web Standards for E-books” in A List Apart. This article served as an “a-ha!” moment, as I realized the same standards (HTML & CSS) I so passionately put to use on the web could also be used to create semantic and beautiful e-books.

Over the past year, e-book production has slowly grown to become a part of my freelancing business. Unfortunately, the process and tools are a bit rudimentary (I am often reminded of duct taping together my first web sites in the late 90’s). Sadder even is that e-book production is often cheaply outsourced by publishers, leading to poor formatting and inconsistencies. As a reader, I have a vested interest in improved EPUB production, so here is my process for developing digital books. I hope you find it helpful.

EPUB Production

  1. Export the text. In an ideal world, publishers would send the books as clean and semantic HTML. In reality though, publishers typically provide the completed copy of the text as Adobe InDesign or Microsoft Office files. The first step, is to export these files as EPUB. To do this, I follow the process outlined in Elizabeth Castro’s “EPUB Straight to the Point”. InDesign CS5.5 has some new EPUB output tools that look to aid in this step of the process. For titles that are text driven, such as fiction, I sometimes find it simpler to copy and paste the text into Text Edit and use markdown to convert it to HTML.

  2. Clean up the markup. If you’ve ever seen the HTML markup generated by InDesign or Word, you can imagine the tag soup that results.

  3. Style with CSS. While device consistencies vary widely, the current EPUB spec supports CSS 2.1. and the draft EPUB 3 spec proposes adopting CSS3.

  4. Create the EPUB file. An EPUB file is essentially a zipped folder containing all the book’s files ((as well as a few EPUB specific files. I recommend reading this EPUB Format Construction Guide if you are interested in learning more.)). Initially I had bee using Terminal to create this file, until I discovered this handy AppleScript that adds drag and drop simplicity to the process. One of the nice features of the AppleScript is that it removes the pesky .DS_Store file that OSX places within your folders.

  5. Validate. If you’re a web designer/developer, you’ve probably grown accustomed to validating your HTML & CSS. Epubcheck is an online tool from ThreePress Consulting for doing just that with EPUB books. If you are regularly producing EPUB files, you can (and should) install epubcheck locally on your machine.

  6. Test. Support for CSS varies widely, so it is crucial to test your book on a variety of devices and applications. Warning: this will make IE6 compliance look like a piece of cake. On my machine, I always test in Adobe Digital Editions and Stanza on my MacBook before installing the book on any physical devices.

Kindle Production

If you (or the publisher) would like to sell the title through the Amazon Kindle store, you need to follow a few extra steps. This is because for now the Kindle uses the Amazon owned .mobi format rather than supporting the EPUB standard.

  1. Duplicate your folder.

  2. Apply Kindle specific CSS. Really, this should read “remove unnecessary CSS.” The Kindle’s CSS support is fairly minimal and not well documented. This book is a decent, but outdated resource.

  3. Create EPUB. Using the same steps as above, create your EPUB file.

  4. Create .Mobi file. KindleGen is a command line tool from Amazon that allows you to convert your EPUB file to .mobi

  5. .mobi strip Unfortunately, KindleGen packages the existing EPUB file within the .mobi file, doubling the file size of the ebook. Luckily a kind user of the MobileReads forums created Kindlestrip, an Applescript that removes the offending EPUB file.

  6. Test. I begin by testing with the Kindle Preview application and tweaking my CSS/markup as needed. I then device test on both my Kindle and the Kindle for iPad application.

Recommended Reading

If you are interested in learning more about digital book production, here are a few of the sites that I find indispensable.