Monday, February 20, 2012

Kindle Formatting 6: Using Kindlegen and Calibre to form .mobi file

Again, read Helen Hanson's excellent explanation http://www.helenhanson.com/?p=1376 on how to use Kindlegen


See that .mobi file? This is the file you will load into Calibre to allow it to generate the Table of Contents for you. This is why we REMOVED the Table of Contents from our Word document. Otherwise we will end up with TWO Table of Contents, and only the Calibre one will work correctly with Kindle on PC and iPad. Interestingly enough, the Kindlegen one does work with Kindle Previewer. What I mean is that when you say "Go To Table of Contents" on the Kindle Previewer, it works for the Kindle versions, but not for iPad and iPod. For Kindle on PC, the menu item to go to "Table of Contents" is disabled on the non-Calibre version.

Using Calibre should be straightforward, but I will include some instructions in case it is not self-evident.

You load your .mobi file into Calibre, and do a Mobi to Mobi conversion. Fill in and fix anything you want. Check "Force use of auto-generated Table of Contents"
Type in Title of Table of Contents
Check "Put generated Table of Contents at start instead of end"

In Structure Detection add in "Detect Chapters at (Xpath Expression) [I added "cast" and "note"] This helps Calibre determine what is automatically a table of content entry

//*[((name()='h1' or name()='h2') and re:test(., '\s*((chapter|book|section|part)\s+)|((prolog|prologue|epilogue|cast|note)(\s+|$))', 'i')) or @class = 'chapter']

Hit "Okay" and there you go. Go to Path: click to open and file your .mobi file. This is the file you will upload to Amazon.

Check it with Kindle Previewer and any other Kindle apps. Make sure you can "go to start", "go to cover", "go to table of contents" and use the NCX View [which requires double-clicking]

And you should be good to go. Ask me any questions if anything is unclear.

No comments:

Post a Comment