Go Back to the EPUB and Check Who’s There

(Continued from earlier post)

4. Create a table of contents, again.

Wait, didn’t we already do that? Yes, but that was a HUMAN table of contents. We made it “by hand” and it both looks good and works well. However, most E-readers won’t specifically recognize that ToC as a ToC. So now, we need to make what’s called a “logical” ToC.

Aesthetic disclaimer: This technique kind of sucks. It comes into play because there are three (3!) different kinds of Tables of Contents for E-books.

  • Traditional Table of Contents: The thing you think we’re talking about? That’s what we’re talking about. This is a list of sections, or chapters, or poem titles, typed up by a human and positioned in the first few pages of a book (let’s not argue, now) so that people browsing the book can find out where to go.
  • A Logical or Metadata Table of Contents: This is a list in outline format that lists the contents of your book by header <hx> elements. It usually is not styled, typed, or formatted so much as it is generated by an E-book editor. This list is where people will go when they click on the “Table of Contents” button or menu option in their E-reader. It should go at the end of your E-book so it doesn’t clog up your frontmatter (which already has a ToC).
  • An NCX file. The NCX file is a series of bookmarks or milestones (EPUB 2.1 and Kindle .mobi) in an E-book that helps some readers on some devices jump around inside the book. For example, a proper NCX file will allow a reader to jump around in the E-book in exact, one-chapter increments. The NCX file is created automatically by an E-book editor.

Fortunately, our E-book editor Sigil will handle most of this for us.

screenshot of selected files from Sigil

Select the files in the “Book Browser” pane. This is your last chance to make sure they’re in the right order. Then go to the menu and select “ToolsTable Of Contents → Generate Table Of Contents.

You’ll get a window such as this one:

screenshot sigil generate table of contents window

This is a list of all heading elements in your E-book. From the biggest <h1> to the meekest <h6>. If you’ve been structuring your document properly from the beginning, you should have a great starting point for your poetry anthology’s table of contents.

screenshot of table of contentsOf particular note for poetry anthologies, notice the little cha-cha dance of Jennifer Riggle’s “Donnec Elementum” poem, which takes its first line as its title. This can appear to be out of order in our “logical” Table of Contents, but it makes sense semantically, given that in this poem, the <h3> tag really does follow the <h4> tag that would normally be superior to it.

Once you’ve generated the Table of Contents, you might not realize it, because it won’t be too obvious. To make it obvious,  return to the menu and select “Tools → Table Of Contents → Create HTML Table Of Contents.”

screenshot of logical table of contents

screenshot of table of contentsPresto! There it is. As you can see from the preview pane on the right side of the Sigil window, the HTML Table of Contents is plain and boring. As you can see from the left side, the HTML ToC is also in the front of the book. That’s going to seem redundant for someone reading your book, and it’s going to crowd out meaningful content from your “free preview” section in the Amazon Kindle store. So, just move it to the back of the book. (Please note, you should not rearrange actual sections of your book at this point. You can move the file TOC.xhtml, but leave the rest alone. Should you need to adjust, update, replace, or arrange any actual book files, I recommend you delete the TOC.xhtml and redo this step, to ensure you have a fresh and accurate listing.)

I’ve saved this file as “YBR_No1_2.epub” so that you can download it and compare it with the earlier “YBR_No1_1.epub.”

5. Validate the files with FlightCrew.

FlightCrew is a built-in EPUB validator for Sigil. It looks for common HTML or organization errors and checks files against the EPUB 2.1 standard. EPUB 2.1 is fine as of this writing, but which will eventually be replaced by EPUB 3. One hopes that if you’ve used my files and followed along this whole way, then this part will be easy and uneventful. Go to the menu and select “Tools → Validate EPUB With FlightCrew” and Presto! You get a full report on your errors:

screenshot of sigil validator

No errors! That’s only FlightCrew’s word for it. We already validated our HTML5 and our CSS against W3C standards, and now we’ve validated our EPUB against EPUB 2.1 standards. So far, so good!

If you do find errors, I recommend that you don’t fix them in Sigil. Fixing them in Sigil will only fix the new EPUB you’ve created; it won’t do a thing to fix the errors in your original HTML files. Should you go to those HTML files for new editions or purposes, you’ll have to trust yourself to remember the errors you found and the fixes you made.

That kind of typesetting optimism almost never works out.

6. Rinse and Repeat.

Let’s assume you will find errors at some point. A graphic is wrong or a left-justified line ought to be right-justified, whatever. As just noted, please note the change in Sigil, but make the change in your HTML editor, on your source files. The sanity you save may be your own.

Once you’ve made the change, be in in Dreamweaver or TextEdit or whatever, you should

  • Save changes to the .html or .css file (no kidding)
  • Delete the old file from the Sigil EPUB list
  • Delete the old TOC.xhtml file from  the Sigil EPUB list
  • Import the new file to the Sigil EPUB list
  • Create a new TOC file (see #4, up above)
  • Run the validator again (see #5, up above)

Rinse and Repeat. Is it a pain? Yes. Short term, it is a pain. But that’s part of digital publishing. Nobody has ever said “I did too many preflight QA’s on my E-book, and it came out with too few errors.” The ToCs, NCX, and underlying validity of your HTML/CSS constitute the “interface” of your E-book. People do not often read poetry anthologies cover-to-cover. You owe it to your readers, and ultimately to your contributing poets, to make your book’s interface easy and error-free. If your table of contents gets ignored by Kobo, if the clickable links don’t work on Nook, or if your E-book flat-out won’t open in iBooks, your readers are not going to blame Kobo, Nook, or iBooks. They are going to blame you. You owe it to your readers to get it right on their devices.

Quo Vadimus, EPUB?

Once we’ve finished this step, we technically have a functional EPUB that we could publish/distribute on Nook, Kobo, Sony Reader, and Google Play. There are a few more steps for iBooks and Kindle. However, there are a few more steps I’d recommend, such as adding covers for some services and checking your book with FlightDeck, a commercial validation service.

But really, Kindle is the biggest market for E-books by far, so we’re really not done until we have a Kindle-ready version. I’ll cover those steps in future posts.



Filed under Organization and Data

2 responses to “Go Back to the EPUB and Check Who’s There

  1. Reblogged this on e-poetry/d-lights and commented:
    Total ToC for eBooks…

  2. Pingback: Swimming Against the Current | The Yellow Buick Review

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s