When most people think of ebooks, they imagine the ephemeral thing they download from Amazon for their Kindle, or from the Apple Store for their iPad. But what actually goes into making an ebook? What are its components? Could you make one if you wanted to?
Basically, an EPUB (the free and open standard developed by the International Digital Publishing Forum) is a zip archive that’s remarkably similar to a website, except it exists on a device and not on a web server. Both EPUBs and websites have the same fundamental parts: content files, which provide the words; media files, which provide images, sound, or video; and a stylesheet, which tells everything exactly what it’s supposed to look like. Toss in a few other required pieces (all of which are standardized and can be found online), and you’ve got yourself a reflowable document readable on most smartphones, tablets, and computers. It’ll even adapt to differently sized screens, have modifiable text sizes, feature a chapter list, and support highlighting and bookmarking on some devices.
The most time-consuming part of creating an ebook is generating the content files. Unfortunately, you can’t simply copy the text into a document and call it good. As with a website, if you want your stylesheet to actually affect the text, you have to tag it. EPUBs use a language called XML (eXtensible Markup Language), similar to the HTML (HyperText Markup Language) used in websites. XML is easy to use: you tag each paragraph with variants of <p>, depending on how you want it to look. If you don’t want the first paragraph in a every chapter to be indented or you want the first letter to be a dropcap, you would wrap the element in separate tags—<firstpara> instead of <p>—then use CSS to notate that in your stylesheet. Italicized words get a tag of their own; bolded words get another. Even images and captions get their own sets of tags.
Once you have your fully tagged document, you have to go through the repetitive but relatively simple task of creating your table of contents. You’ll also want to make sure any multimedia objects are in the right file formats and compressed enough that they don’t take up obscene amounts of room. It’s incredibly frustrating when you can’t add a file or app to your device because it’s out of space. Finally, make sure all your metadata is in place—author, date created, and hundreds of other bits of information can be added as metadata.
After all that’s complete, you have to package your EPUB correctly. This can be a challenge because the files have to be error-free. Luckily, there are many programs available to download that will both check for errors (and spit out an easy-to-read list if they exist) and package your EPUB. My personal favorite is Pagina. Once everything checks out . . . BOOM! You have an EPUB, ready to drop onto your favorite device.