Rudy's Blog

   Buy Rudy's books! Click covers for info.      Blog text and images copyright (C) Rudy Rucker 2019.

Make Ebook for Amazon with Good ToC

My old friend and surfpunk-SF-tale collaborator Marc Laidlaw is putting all of his old novels up on Amazon as Kindle ebooks these days.

My wife Sylvia and I recently visited Haena on the north shore of Kauai, and we saw a lot of Marc and his wife Geraldine. And I have a lot of good pictures from that trip. But today I’m going to clean out my backlog of photos—which have nothing to do with Kauai or with what I’m posting about today. Many are from a recent visit to Pinedale, Wyoming, to see our daughter Isabel. And some are from other spots.

I’m posting about a somewhat dull and technical topic—but I know it’s a topic that will be of great interest to a few self-publishing authors.

How do you convert your book document into a file that you can post on Amazon as an ebook? And how do you make it have a proper Amazon-style Table of Contents?

I’ve posted about this before, in 2014, in a series called “How to Make an Ebook.” And, as kind of a self-referential joke, I combined these posts into an ebook called How to Make an Ebook. But the method I describe there is fairly complicated. I wanted to find a way to put a ToC into your ebook that’s easy and fairly non technical and and reliable and it doesn’t take more than a couple of hours. And none of the Google links I found for “Make TOC for Amazon” seemed to yield something really simple and useful.

As I said, I got into this topic while I was talking to Marc in Kauai. Idiotic of me to work on such a thing in a tropical paradise, but I did piss away a few hours on it, and I thought about it some more when I got home.

Marc had used Abbyy FineReader to convert a PDF of his insanely gnarly and profound and readable book The 37th Mandala into a Word DOC. Sick and ill in all the best kinds of ways. And then he was having trouble getting the DOC into the format of an Amazon-style Kindle ebook with a built-in table of contents, or ToC. The ToC — that’s the part that’s tricky. As the classic poet Virgil wrote in the Aeneid, relative to exploring Hell or Avernus. “Easy is the gradual descent to the underworld, but to retrace your steps and return to the breezes above—ah, there is the bringdown, there is the drag.”

Marc was saving his DOC as a Filtered HTML from Word, and then uploading the HTML to Amazon KDP, and sometimes the Amazon ebook would have a Kindle style ToC, and sometimes it wouldn’t. And I got curious about how to make it work. And I kind of wanted to avoid the HTML step.

I didn’t solve the question in Kauai, but when I got home I wanted to email Marc an ebook version of the rough draft of my Million Mile Road Trip novel, and I got curious as to whether I could make it into an EPUB with Calibre, with a good ToC. I wondered if I could do it without going through InDesign—which is what I normally do these days. But a beginner doesn’t want to deal with InDesign.

And now it seems like I found a way to get from a Word DOC to an Amazon ebook using just the free Calibre program.

* Give all your chapter headings the same style in your DOC. The standard Word style Heading 1 is fine. Or you can create a similar h1 style and that’s fine too. You don’t have to start with Word, you can use any word-processor.

*Save the edited document file for safekeeping. And then save it as an RTF file, that is, in the so-called Rich Text Format. If the document has a built-in table of contents that you generated, like with Word, go ahead and delete that from the RTF. It’ll just get in the way. Now open Calibre and do “Add a Book” based in the RTF file. (You can’t add DOC files to Calibre).

* Set the Metadata fields in Calibre if you like. Like put in your name, or comments or tags or even a cover image. Then then go into the Convert Books dialog in Calibre and set output to EPUB In the Convert Books dialog. This dialog has some buttons for subdialogs on the left.

*Go to the Convert Books | Look and Feel | Layout and put a checkmark by “Remove Spacing between paragraphs” The default paragraph first line indent is set to 1.5 em, which is reasonable. It looks better to have indents than to skip lines.

* Go to the Convert Books | Table of Contents put a check mark by “Force use of aut0-generated Table of Contents.” My impression is that the other settings in this dialog don’t reliably matter. Don’t waste a lot time sweating about them. Just accept that the automatic ToC probably isn’t going to work if you’re a beginner starting from an RTF document. But never mind, you’re going to easily fix the ToC in a second. While still in the Table of Contents dialog, go way down at the bottom of the dialog, and put a checkmark by “Manually fine-tune the T0C after conversion is completed.”

* Calibre will open an “Edit the ToC” dialog after building the EPUB. More than likely the autogenerated ToC sucks. Again, don’t sweat it, don’t even waste time worrying why. Just click the “Generate ToC from major headings” button in the “Edit the ToC” dialog and probably you’ll see a full book ToC then, possibly with a couple of bogus entries, and possibly with a couple of chapter headers missing. You can fix these using the the “Remove this Entry” and/or the “New Entry” buttons.

* Now you’re good. Close the “Edit the ToC” dialog, and click on the “Path: Click to Open” line in the lower right corner of the Caliber screen. This directs you to some obscure directory holding your new-built EPUB with the good ToC. Copy this EPUB file to somewhere where you can find it easily again.

* Test your file in, say, the EPUBReader add-on of Firefox, or Google Play on Chrome, or directly in Safari, or in iBooks.

* And test it with the downloadable Kindle Previewer tool if you like. In the Kindle Previewer, the ToC will not seem to work, but this is misleading. The NCX View over at the right side of the Kindle Previewer menu bar does work . And this means that Amazon will in fact be able to build a working ebook with a proper ToC from your EPUB.

Rudy Sr. and Rudy Jr. on Father’s Day 2016.

* The Kindle Previewer saves a MOBI version of your EPUB to your disk, you’ll find it in a subdirectory of the directory where your EPUB lives. You can copy this MOBI to your Kindle device to test it some more. The ToC will work on your Kindle.

* But what if Kindle Previewer finds errors or warnings in your EPUB? What if Amazon KDP won’t convert it? Open the book in Calibre. Select Edit Book. In that dialog there should be a pane for “Check Book.” Click on “Run Check.” If it finds errors, click, “Try to correct all fixable errors automatically.” If that works, resubmit the EPUB.

* If the automatic error fixing doesn’t work, Calibre allows you to “Edit your Book,” that is, edit the EPUB files, which are basically a bunch of HTML files. This is tricky for a beginner, as these edits may break things, but going back to the “Check Book” can often fix things.

* If you don’t like how your EPUB looks, you can poke around in the Calibre settings, The Convert Books | Look and Feel dialog has a number of panes. Try Googling about them or try looking at the Calibre documentation. Note however that the Kindle ignores some of these settings—also many settings can be adjusted by the individual Kindle user. It’s also worth knowing that it may make a nicer output if go to Convert Books | Heuristic Processing and check the box by “Turn On Heuristic Processing.”

* When you’re done, upload the EPUB to Amazon KDP! Alternately you can upload the MOBI to Amazon, as long as you use the MOBI that was created by the Kindle Previewer. (KDP won’t accept a MOBI made by Calibre.)

Peace at last.

Or maybe not. What if the Amazon KDP dialog rejects your EPUB? Without telling you what’s actually wrong with it? Well, then you try opening up your EPUB in the Sigil software, and running the Check procedure in there. This “check” is more rigorous than the one in Calibre. You can click on the error messages and Sigil will show you the broken spots in the *aaack* HTML code that’s zipped up inside that EPUB. Maybe you can fix the probs. This is where Googling can help, like try Googling your error message’s text.

If you need to get even deeper into the guts of your epub, there’s a free industry-standard program called epubcheck that you can download and run on your EPUB…this fella runs from a command-line interface, double *aack.” I won’t get into details here, but you might go back to my three or four old
How to Make an Ebook posts if you need to get this funky.

The one bright spot to keep in mind is that the first time you post an ebook will be by far the hardest time. Eventually you’ll develop a workflow, and (the hardest part) a mental image of what you’re actually doing, and it’ll be pretty smooth. And I guess this is where I put in a plug for all the ebooks I’ve published on Transreal Books!

5 Responses to “Make Ebook for Amazon with Good ToC”

  1. Gary Gibson Says:

    Can I offer an alternative suggestion for those reading that, while not free, is at least free of a great deal of hassle? I found myself facing many of the same problems trying to build an ebook to give away from my website, and got a recommendation from a fellow writer to buy an ebook called ‘How to Format Your Novel for Kindle, iBooks…’ By Ed Ditto. It recommends using the writing tool Scrivener, which also costs money, but at least gives you a one month fully usable demo. Instead of struggling for days, as I had been, to get the results I wanted, I got by ebook done and dusted in under half an hour.

  2. Rudy Says:

    Thanks for the comment, Gary. I’ve heard others say that Scrivener is good for creating ebooks. Checking online however, I see that some Scrivener users end up using the older EPUB editing tool Sigil to finalize their ebook ToC. See And others suggest using Calibre instead of Sigil—Sigil has gone a bit out of fashion lately.

    What I’m recommending in this post is to use the Calibre ToC editor to finalize your ebook ToC. The whole issue of what word processor to use in the first place is a bit of “religious war” and I don’t want to get into that here! There are many many paths to the goal, and whatever one works for your personal workflow is fine. By the way, here’s a web post by David Kudler that gives a good overview of some of the options.

    Anyway, the MAIN thing about my post is meant to be the photos! 🙂

  3. geebert Says:

    Can you say FUN? ; ) Nice pics!

  4. Steve H Says:

    I’ve been using Calibre for several years – it’s a great program for free.

  5. Rudy Says:

    Success story: Marc Laidlaw used the technique described here (that is, use Calibre to convert your doc to EPUB and then run the Calibre Edit the ToC dialog) — and he’s got all his old books up as ebooks with functioning ToCs. See Marc’s ebooks on his Amazon author page.
    or on his own home page

Rudy's Blog is powered by WordPress