View Single Post
Old 02-20-2010, 03:33 PM   #16
jimad
Connoisseur
jimad is on a distinguished road
 
Posts: 53
Karma: 52
Join Date: Apr 2008
Device: Kindle
Sorry, but this is what I think I've been able to figure out about this subject:

Both Epub and Mobi files can be generated using the set OPF files and by following their specs. Those specs say that NCX (section navigation) and TOC (Table of Contents) are not the same thing.

http://www.openebook.org/2007/opf/OP...inal_spec.html

EPUB as implemented for ADE (Adobe Digital Editions) uses NCX by default to navigate the document. If you also include a TOC then ADE will display two navigation structures, one simpler cleaner one representing the TOC and a more in-depth messier one for NCX. Since most implementers think it looks like a mistake to display two navigational structures within ADE, most EPUB implementors simply implement NCX and leave out the TOC.

Kindle instead by default uses TOC to navigate the document. Kindle specs for MOBI say "you must have a TOC" meaning NCX is optional. On a Kindle if you push the "TOC" button what you see is TOC not NCX. NCX, if present, is supposed to implement right-click left-click "fast forward" and "fast reverse" to next section, NOT TOC.

Now, I have not been able to get Kindlegen to correctly do the "fast forward" "fast reverse" thing via NCX, so maybe THAT aspect is broken in Kindlegen.

However, I CAN get Kindlegen to expressly implement TOC if I expressly implement TOC in the OPF Files. For example, I can take an EPUB document -- which is simply a zipped version of the OPF file set, add a TOC where a TOC clearly didn't exist previously, compile that OPF set using Kindlegen's option to build from OPF, and the TOC works correctly.

What I suggest Calibre does on EPUB to MOBI conversion is to understand the difference in the conventions used by the EPUB vs MOBI "communities" when implementing the OPF specs and automagically converts the EPUB NCX structure to a OPF TOC. This "works" but gives an "ugly" TOC -- one that has more detail than one would typically expect in a hand-written TOC.

One can manually add a TOC to an existing EPUB (unzipped to OPF file set) or perhaps what is easier one can add a single ref TOC which simply points to the TOC presumably already implemented within the doc files. Then when you push the TOC button on Kindle you get a page displayed with a single link "Table of Contents" you click on that link and it takes you to the TOC embedded within the document.

Unfortunately, most people have a hard time accepting that EPUB and MOBI can implement and expect slightly different versions of the same OPF spec!
jimad is offline   Reply With Quote