How to Make an E-Book: EPUB 3 from InDesign CS6

It’s not always possible to prepare the InDesign files you create for a print edition in a manner that translates perfectly to EPUB. But a few tricks can smooth the process.
To get started, I make a duplicate set of InDesign files from the final print files. Next I verify that all text and images are properly linked in the text flow, and remove any text or design elements that I don’t want to show up in the EPUB.

I find setting up the URL hyperlinks to be one of the most challenging issues in the EPUB conversion. The hyperlinks for all web addresses must be preceded by “http://www.” or the files won’t make it through the EPUB 3 validation. Problems occur when InDesign mistakes non-URL text for web addresses when it generates the hyperlinks. The errors must be fixed—either in InDesign before making the EPUB or using an html editor after the EPUB is made.

Here are the main stages in my EPUB conversion process:
It’s important to prepare as much as possible for the EPUB while working on the print edition (which is still published before the electronic edition). The easy part is making sure there are no spaces in any of the file names, including linked images. It can be diffiicult and time consuming to link all of the text and images at typesetting, but relatively easy to paste elements into the flow of a document in “dummy” InDesign files used only to make the EPUB. Since there’s no need to worry about pagination for the EPUB, these files can be far from perfect, as long as all of the elements are linked in the order you want them to appear in the book.
The EPUB table of contents lists chapters by the file names from the original  InDesign files. You can make changes to the table of contents by opening the toc.ncx file (located in the OEBPS folder in the unzipped EPUB directory) using a text editor (such as Text­Edit on the Mac) to retain its file type. You will probably always have to modify the toc.ncx file as spaces aren’t allowed in the InDesign file names. You can use whatever names you want for chapters and sections, but some characters (like & and ’) aren’t allowed; for these you will need to use the appropriate html code in their place.

To fix the appearance of elements in the EPUB, you modify the .css file (cascading style sheets), which is located in the “css” folder in the unzipped EPUB folder. You must use a text editor program to retain the file type/exension. It may be a feature or a flaw, but InDesign doesn’t include extra spacing above text or images in the EPUB. I use spacing above or below elements for the print edition depending on whether I want the extra spacing in the EPUB. To add spacing, modify the .css file by adding the following line of code to each style affected: margin-top:20px (paste directly above the margin-bottom line).
The content.ncx file contains a directory or “manifest” of all the image/text files in the EPUB. The lines of code that InDesign automatically generates at the top of this file won’t pass the EPUB 3 validation. I use a standard code template and update the text with each book’s data.

One thought on “How to Make an E-Book: EPUB 3 from InDesign CS6”

Thank you! Andrea