Friday, April 27, 2012

Word for Mac can't generate linked TOCs for Kindle

I've been trying to document the simplest way to create an ebook with a tool that most folks already own. The tool I've chosen, Microsoft Word, is a bloated, impossibly complicated piece of software that for some inexplicable reason, is used by a huge proportion of the populace. Feel free to enlighten me about its virtues in the comments.

Anyways, I want to call your attention to one particularly important failing of Microsoft Word for Macintosh: it will only create linked or active TOCs if the TOC contains page numbers. It's really important to include linked TOCS in ebooks, and particularly in Kindle books since most of Kindle devices don't have device-generated or navigational tables of contents, but it doesn't make sense to include page numbers (since they don't make any sense in a digital landscape).

Note that Microsoft Word for Windows is happy to automatically generate a useful TOC, sans page numbers, for an ebook.

Table of Contents

Simply uncheck Show page numbers and then check Use hyperlinks instead of page numbers.

Now look at the corresponding dialog box in the latest version of Word for Macintosh:

Table of Contents

You can hide the page numbers, but you can't convert them to hyperlinks, and I assure you, after much testing (and confirmation from @ljndawson), that without page numbers, no page links will be created. The TOC is there, but will take you nowhere in the converted ebook.

Kindle Fire Previewer - testerTOC7

It makes Word for Mac a much less powerful tool for creating ebooks. Of course, there are solutions (like manually creating bookmarks for each TOC entry), but it's nothing like a one-button solution (!).

Why should anyone care about how Word creates TOCs? Because Word (.doc or .docx) is the one styled format that can be read and converted automatically into Kindle format (using KDP, Send to Kindle, and by emailing the document to a Kindle device). More on that soon.

23 comments:

  1. One possible workaround is to open the doc file in LibreOffice and make the changes there. The TOC interface is clumsy, but it works. http://help.libreoffice.org/Writer/Formatting_an_Index_or_a_Table_of_Contents

    ReplyDelete
    Replies
    1. Downloading, thanks for the tip!

      Delete
    2. Wow. The Libre Office documentation is REALLY bad. Hardly any information and no explanation of why you might want to do it. I don't see how to create a TOC without page numbers... any clues welcome.

      Delete
    3. Yes, it's really bad. To create a TOC go to "Insert > Indexes and Tables > Indexes and Tables". Really counterintuitive, but that's it.

      The secret to create hyperlinks only, without page numbers, is to put the cursor on the empty areas before and after the entries and click the "Hyperlink" button. This will insert the opening and closing tags. You find the entry description by hovering the mouse over the field.

      You can also delete entries like tab stop, page nº and others simply by selecting the field and pressing the delete key. Ugh.

      Delete
    4. I can't make it work :( I click the tab stop and page numbers and then Delete, but they don't go away. What a pain! Who knew there could be something worse than Word? :)

      Delete
    5. At least it's free :) It took me a while too to know how it works, it's really strange. Here's a screenshot. Hope it helps. https://skitch.com/pagelab/8sqax/insert-index-table

      Delete
    6. It works!!! I cannot believe it!! Many manyb thanks, you saved my life :)

      Delete
  2. I’m enlightening you about its virtues here in the comments.

    Word is very easy to use for straight word processing: bold, italic, colored text, highlighting, indents, hanging indents, superscript, subscript, endnotes, headings, cut-and-paste, drag-and-drop, find-and-replace. All of these are easy to do in Word, and you can customize it to match your personal working methods. And you’re right: most people already own it, or have access to it (in school, for example), and are thus very familiar with it.

    The problems that people have with it, and this includes the PC version, seem to arise when attempting to do fancier stuff, Tables of Content being among them.

    So, what’s the solution? How do you take your manuscript that you’ve lovingly created in that “bloated, impossibly complicated piece of software,” where you’ve spent hours getting your text formatting just the way you want it, and turn it into a well-made Kindle book without personally struggling with any HTML or CSS code?

    Easy. You save it as HTML, and then ask Calibre, which is free, to create the MOBI file for you, including a well-formatted Table of Contents… even a multi-level one, if that’s what you want.

    It works. I know because I’ve done it. I still do it. After writing two conventionally formatted e-books that I put up for sale on Amazon, Barnes and Noble, and Apple—one an enhanced fixed layout picture book with audio files, the other a 133-chapter book with a bunch of hyperlinks—I realized that the usual method was just too technical for most authors, who merely want to be writers, not programmers.

    So, I worked out an easier way. One that works, that works very well, and is extremely easy. In fact, if you can write up a decent-looking school term paper, you can make a Kindle book with this method. I wrote a book about how to do it, “Anyone Can Make a Kindle Book,” that’s getting five-star reviews on Amazon.

    I wrote the book using the method that I speak about in the book, and I designed the free sample specifically to give people a chance to really see what can be done with a Kindle book if you get just a little bit of help.

    You can check it out here: http://www.amazon.com/dp/B007F14XM8/

    ReplyDelete
    Replies
    1. I'm hoping to be able to offer a solution that does not require any other tools besides Word (and KDP).

      Delete
    2. This comment has been removed by the author.

      Delete
    3. I agree that it would be nice, but your efforts may prove to be fruitless.

      There is no better way to upload a book to Amazon with fewer chances of conversion errors than as a MOBI file. That’s just a fact. And I know of no better or easier way than Calibre to create a MOBI file that can be quickly checked for errors and corrected prior to uploading.

      If I find one, I’ll let you know, but I’m not holding out any hope anytime soon.

      Delete
  3. Couldn't you make the TOC in Word for Mac with pagenumbers and then use regex on the toc.ncx file to scrub them?

    ReplyDelete
    Replies
    1. Yes, but only if you can deal with code. My work in this area is geared towards those who mostly want to write a book and then have an ebook version of their work without having to get into the technical side of it very much at all.

      Delete
  4. Liz, I have to admit, I don't understand your extreme concern. Using Word for the Mac, I always construct my tables of contents manually, always link them manually, and don't find it takes that much time or trouble. I'd rather do that than struggle with modifying Word's automatic TOC styling. It also allows me to use the Heading1 style on items I don't want in the TOC. So, it suits my workflow just fine.

    ReplyDelete
    Replies
    1. I'm just trying to save people the complication of creating all those bookmarks. I know you *can* do it by hand.

      Delete
  5. And are you using 2007? Or the "newer" version? I started off, years ago, with Word Perfect (I mourn its loss), then went to Mariner Write - anything to avoid Word, if only because everybody else was using it. But when I took my .rtf to InD, Mariner didn't seem to interface well. I should try it again; Word drives me up a wall. I wonder if you can save a .doc in that program? I like the company. Not sure I love the visual interface. It's worth taking a look, but of course, I won't do that until I'm finished with the project load I'm dealing with now - the one that lead me to you in the first place. Which means, I can't take a pause to learn - until I'm finished and don't need to know anything anymore.

    ReplyDelete
    Replies
    1. I have Word for Mac 2011, and I have a slightly older version for PC. Yes, the pace is making me crazy too.

      Delete
  6. i especially hate the image handling in the Word2011 for mac. and heavin forbid if you want to cross over to pages or an old msword in pc and back. you always run the risk of having the file suddenly explode in size. i discovered this the hard way. http://digitalapplejuice.com/quickfix-pages-creates-huge-files/

    one question - does anyone know why .mobi files are so much bigger than .epubs?

    ReplyDelete
  7. They didn’t used to be. What has happened with the advent of KF8, the MOBI files that Amazon creates actually contain your book as both MOBI and EPUB all packed together.

    As an example, if I unpack (see Liz’s earlier post about the Mobi Unpack uitility) April Hamilton’s book, “From Concept to Community,” which was created quite a while ago and which I purchased from Amazon back in March, 2011, I get a single folder named “mobi7” inside of which is:

    B001TOC9X2_EBOK.html
    B001TOC9X2_EBOK.ncx
    B001TOC9X2_EBOK.opf
    images (folder)

    However, when I open one of my own books, “MEMOGRAMS,” which was created using the latest Kindlegen, I get two folders, named “mobi7” and “mobi8,” and a file named:

    kindlegensrc.zip

    …which I can further unzip if I want, and I get:

    kindlegensrc (folder) in which are the files:

    META-INF (folder)
    mimetype
    OEBPS (folder)

    But I still have the two “mobi” folders to look at:

    In the mobi7 folder I get:

    MEMOGRAMS.html
    MEMOGRAMS.ncx
    MEMOGRAMS.opf
    images (folder)

    …which is the same group of files as one got from the era prior to Amazon’s KF8 format.

    In the mobi8 folder I get:

    MEMOGRAMS.epub
    META-INF (folder)
    mimetype
    OEBPS (folder)

    It is the creation and inclusion of all of these extra files that make a recent MOBI book created by Amazon’s KindleGen about twice as big as one would expect.

    ReplyDelete
  8. I agree with the earlier poster, just make your TOC with Word bookmarks and links. It's actually simple/fast, and nearly bulletproof if you follow Mark Coker's instructions in "Smashwords Style Guide" (steps 20b-20d).

    And regarding KindleGen creating big mobi files from docs, yeah they include both k7 format for older Kindle devices + KF8 format for the Fire & Touch modles. A recent book I did was a 9.7 Mb EPUB, however upon conversion to mobi via KindleGen and upload they only calculate your delivery charge on 1 conversion size (it went down to 7.8 Mb) as they only deliver the single appropriate final version to the purchaser.

    ReplyDelete
  9. You can get around that by adding the links in OpenOffice. I did that, then tested the links when I opened the modified document in Word again.

    Make a copy of the document first, because saving the revised document with OpenOffice will reset any styles you've used—meaning you have to go back through your styles and modify them to change back to your intended settings.

    ReplyDelete
  10. Scratch my earlier comment—it didn't work. However, there's a quick explanation of how to do it at the end of this article by the Smashwords people: http://blog.smashwords.com/2013/11/how-to-add-navigation-to-smashwords.html

    ReplyDelete
  11. Hi there,
    I am resigned to doing this manually. How do you make the table of contents work properly when someone in kindle clicks the "go to" pulldown?

    ReplyDelete

More of my books