When you read an ePub (also known as an e-book, or electronic book), you’re actually viewing a collection of files. These are mostly HTML files, with CSS files (Cascading Style Sheets) to control the look and feel, and other, more esoteric formats as well. These are all hidden from view inside a container we experience as an ePub “file.”
Because ePubs are predominantly HTML, many of the concerns we have when exporting them are the same as when we export HTML without an ePub container.
Exported HTML can be viewed in any web browser program. But ePubs from InDesign require special applications to look at them afterward. Adobe makes its own called Adobe Digital Editions, but I prefer other applications. If you use a Mac, I’d suggest using Apple iBooks. The desktop version is a fabulous way to view ePubs after making them. There are others for both Mac and Windows (and sometimes Linux):
Calibre: https://calibre-ebook.com
The Nook app: https://www.barnesandnoble.com/h/nook/apps
Kobo: https://www.kobo.com/us/en/p/apps
Freda: http://www.turnipsoft.co.uk/freda
Of course, one cannot forget to include Amazon’s Kindle. The Kindle Previewer app is not only a good way to simulate a physical Kindle on your computer, but it can also convert an ePub to Amazon’s Kindle format (mobi). Get it from: https://amzn.to/2fXMAX0.
There are two kinds of ePub that can be generated from InDesign: fixed layout, which attempts to preserve the layout as closely as possible, and reflowable, the more typical form in which the reader can change the text’s font and size and for which we need to indicate the order in which content flows. Fixed layout ePubs are dependably viewable with only some devices and e-reader apps, whereas reflowable ePubs are viewable on any type of device.
There are three ways to control the order in which content is experienced when you export as reflowable ePub (or HTML): page layout (which needs some explanation), XML structure (a specialty beyond the scope of this book), or the Articles panel (by far the best choice).
Choosing page layout will order content by what is leftmost first, then, if multiple objects are the same distance from the left edge of a page, from the top downward. This is usually horrific, except in the very simplest of layouts. XML (eXtensible Markup Language) is a means of describing content structure and is often used when the content is supplied by databases. Large retailers, for example, use this to generate catalogs in a partially automated workflow. But for the vast majority of InDesign users, the Articles panel is both intuitive and easy to use.
It helps to bear in mind that the word “articles” is used to mean “items,” not “written pieces.” Let’s ensure that all of a novel’s articles are included.
Note that there are two entries in the Articles panel. We need one more for this title page so that it will be included when we export as ePub or HTML.
The new article appears at the end of the list, which means it would be the last thing in the ePub.
Now it’ll be first. The checkboxes, by the way, control whether something is exported or not. So if there’s content you’re unsure of, you can add it to the panel and decide later whether it should be part of the export.
But what will this look like in a reflowable ePub? Different e-readers might display different fonts, for example. To preserve the impression of a title page, and to display the text as we intend, we can export this frame as a graphic of relatively high quality on its own “page.”
I put the word page in quotes because, for the most part, if a reader changes the size of the text, the amount of text that appears on a device’s screen will change. Thus, the concept of a page in the world of ePubs is rather flexible.
Something that resembles a dialog box appears. It isn’t one, however. It’s more like a panel in that it can remain on screen while you perform other tasks. Let’s call it the Object Export Options window.
As you can see, I’ve already designated that to Preserve Appearance From Layout, I’d like to Rasterize Container—that is, to convert the text frame into a pixel-based image. For content other than photographs, we should choose PNG for the Format. I also chose a rather high Resolution (300 ppi) since this title page should be as crisp and lovely as possible, even on devices with screens of high resolution.
Also note that Custom Layout has been enabled to control where on the “page” the image appears. I chose to center it (horizontally) and I set its width to be 100% of the screen on which it’s viewed.
Although we could use this window’s controls on each object in a document, we will usually apply these settings with an object style. This novel has four illustrations, each with a caption. Each image-caption pair has been grouped and pasted into a frame with an object style applied. Except for the first pair, that style sets the Object Export Options similar to the one above, but with a width of 80%, and Insert Page Break is set to Before and After Image to keep it on a page of its own. The first image-caption pair has a page break only before it.
The third and final object in the Articles panel is the InDesign threaded story containing the entire text of the novel. Where are the other three images, then? They are part of the story, anchored to certain positions in the text near the references to them.
You should see a dashed line between it and the first paragraph on page 25. It has its own Object Export Options set with an object style, but it will show up in the ePub before the text to which it is anchored. If the images weren’t anchored to that story, they would all have to appear either before or after the story, each with its own entry in the Articles panel. Anchoring (see page 231) allows us to sprinkle content throughout the ePub with only one article entry.
To better control the appearance of section and chapter headers, we can choose which HTML tag is applied to their content. I’ve chosen the H1 tag for section headers, and the H2 tag for the chapter headers. To confirm this:
In the EPUB and HTML section, the chosen Tag is h2. Click OK. The board is set, let’s get the pieces moving!
During this process, you will be asked to supply an image for a cover (it’s provided in the same folder as the document you’re currently editing, 08 Output), indicate what controls the layout (the Articles panel), and choose the TOC style that creates the ePub’s internal table of contents (it’s called novel TOC).
The Object and Conversion Settings sections are stopgaps for any objects you have not managed with Object Export Options. All our objects are managed, so these sections can be ignored.