Bookshelf | Reports | Community | KDP Select

Home » Amazon KDP Support » Ask the Community » Formatting

Thread: Odd ncx toc behavior with workaround


Reply to this Thread Reply to this Thread Search Forum Search Forum Back to Thread List Back to Thread List

Permlink Replies: 2 - Pages: 1 - Last Post: Jan 11, 2017 9:56 AM Last Post By: Thomas Michael Threads: [ Previous | Next ]
Thomas Michael

Posts: 7
Registered: 12/30/16
Odd ncx toc behavior with workaround
Posted: Jan 5, 2017 2:41 PM
Click to report abuse...   Click to reply to this thread Reply
So I found some weird behavior with my ncx toc and I found a workaround and I thought I'd post it here in case anyone's having a similar problem.

THE PROBLEM
The first navpoint in the ncx toc was taking the reader to the wrong location.
I'd set the first navPoint to take the reader to the titlePage, and instead it was taking the reader to the cover (the one generated by kindlegen). This problem was happening on all kindle fires but not on the e-ink devices (as simulated in kindle preview). Here's a clip of the beginning of my ncx file:

<navPoint id="titlePage" playOrder="1">
<navLabel>
<text>Title Page</text>
</navLabel>
<content src="title-page.xhtml" />
</navPoint>

<navPoint id="copyright" playOrder="2">
<navLabel>
<text>Copyright</text>
</navLabel>
<content src="copyright.xhtml" />
</navPoint>

etc...

THE WORKAROUND
was to add an id to the first displayed tag in the title-page.xhtml file, and to redo the navPoint in the ncx file to go straight to the anchor instead of just to the file.

<navPoint id="titlePage" playOrder="1">
<navLabel>
<text>Title Page</text>
</navLabel>
<content src="title-page.xhtml#top" />
</navPoint>

Note that kindlegen puked when I tried to put id="top" in the <body> tag of the title-page.xhtml. The id must be put inside a tag that gets displayed, as far as I can tell. Also note that the rest of the nav points work fine without the workaround.

If anyone knows anything about this issue please let me know.

Notjohn

Posts: 20,192
Registered: 02/27/13
Re: Odd ncx toc behavior with workaround
Posted: Jan 5, 2017 4:05 PM   in response to: Thomas Michael in response to: Thomas Michael
Click to report abuse...   Click to reply to this thread Reply
I let Sigil generate the OPF and NCX files. I've never seen a problem with what it supplies.

Good luck! -- NJ

The book: Notjohn's Guide to E-Book Formatting (revised and updated for 2017)

The blog: http://notjohnkdp.blogspot.com
Thomas Michael

Posts: 7
Registered: 12/30/16
Re: Odd ncx toc behavior with workaround
Posted: Jan 11, 2017 9:56 AM   in response to: Notjohn in response to: Notjohn
Click to report abuse...   Click to reply to this thread Reply
Ah yes.
I'll have to try sigil at some point.
I'm doing everything from scratch right now.
Didn't install sigil on linux because no binaries are available yet.
My Current process:
I create an epub2 from scratch, run it through Epubcheck, then convert it with kindlegen into a dual KF8, then I look at the output in Calibre, Kindle previewer, and Kindle for PC.
Most of the work is done on linux, but previewer and Kindle for Pc are on windows 7.
Legend
Helpful Answer
Correct Answer

Point your RSS reader here for a feed of the latest messages in all forums