Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Formats > Kindle Formats

Notices

Reply
 
Thread Tools Search this Thread
Old 01-21-2016, 08:12 AM   #1
tinmug
Member
tinmug began at the beginning.
 
Posts: 17
Karma: 10
Join Date: Jan 2016
Device: iPad, Kindle Paperwhite
Trouble with TOC

What I have:
  1. A clean INDD file
  2. A clean and fully functional ePub
  3. Embedded Contents page, clickable (inline?) TOC working with iBooks

Now I need all that in a Mobi file. But no matter what I try I simply cannot get the TOC button in Kindle Previewer to display a TOC (I understand this is called a Logical TOC?).

I work with InDesign, Sigil and Kindle Previewer. Have successfully generated a TOC with Sigil, but this simply duplicates the all-ready-in-place Contents page in the book. The ePub contains a toc.xhtml (yes, checked in Semantics – Table of Contents).

So my question is ... how to get that toc.xhtml to speak Kindle.


Last edited by tinmug; 01-21-2016 at 08:49 AM.
tinmug is offline   Reply With Quote
Old 01-21-2016, 09:43 AM   #2
Doitsu
Grand Sorcerer
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 5,727
Karma: 24031401
Join Date: Dec 2010
Device: Kindle PW2
Quote:
Originally Posted by tinmug View Post
Now I need all that in a Mobi file. But no matter what I try I simply cannot get the TOC button in Kindle Previewer to display a TOC (I understand this is called a Logical TOC?).
If it's an ePub2 book, you'll need to add a toc guide item to the .opf file. If it's an ePub3 book, you'll need to add a toc landmarks item.
For more information see the Kindle Publishing Guidelines.

Doitsu is offline   Reply With Quote
Advert
Old 01-22-2016, 12:36 AM   #3
tinmug
Member
tinmug began at the beginning.
 
Posts: 17
Karma: 10
Join Date: Jan 2016
Device: iPad, Kindle Paperwhite
Thanks.
I've been using ePub 3. The resulting ePub yields (of course) a doc.xhtml. Establishing that as the Table of Contents file (Add Semantics ... Table of Contents) does create an entry in the OPF file. But this alone doesn't appear to be enough (or entirely) correct for the Kindle to see it/link to it.

The OPF entry reads:
<reference href="Text/toc.xhtml" title="Table Of Contents" type="toc"/>

Whereas the standards document refers to (an example of):
<item id="toc" properties="nav" href="xhtml/toc.xhtml" media-type="application/xhtml+xml"/>

Another ePub that I have looked into, and one that does successfully convert all elements to Mobi, has the same elements in the OPF TOC entry, except that it refers to HTML, not XHTML.

Haven't had luck with variations on this. Any comments from your side in this regard much appreciated.

Thanks.

Last edited by tinmug; 01-22-2016 at 12:46 AM.
tinmug is offline   Reply With Quote
Old 01-22-2016, 03:04 AM   #4
Doitsu
Grand Sorcerer
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 5,727
Karma: 24031401
Join Date: Dec 2010
Device: Kindle PW2
Quote:
Originally Posted by tinmug View Post
Thanks.
I've been using ePub 3.
In that case, you'll need to add a toc landmarks item. If a book contains both an .opf file with a guide section and nav xhtml file with a landmarks section the nav xhtml file takes precedence over the .opf file. (The nav xhtml file has a properties="nav" attribute in the .opf file.)

Quote:
Originally Posted by tinmug View Post
Whereas the standards document refers to (an example of):
<item id="toc" properties="nav" href="xhtml/toc.xhtml" media-type="application/xhtml+xml"/>
That's the required nav landmarks item for ePub3 books.
That's the required nav file manifest entry in the .opf file.

BTW, if you've opened an ePub3 book generated by InDesign with an older Sigil version, it might have saved it as an ePub2 file.

Check your ePub with the IDPF Online Validator.
If it says Detected version: EPUB 2.0.1 , Sigil has saved your epub3 book as an epub2 book and the .opf guide item should work otherwise check the landmarks section of the nav xhtml file.

Last edited by Doitsu; 01-22-2016 at 10:18 AM.
Doitsu is offline   Reply With Quote
Old 01-22-2016, 07:48 AM   #5
tinmug
Member
tinmug began at the beginning.
 
Posts: 17
Karma: 10
Join Date: Jan 2016
Device: iPad, Kindle Paperwhite
Hi Doitsu,
The OPF does set toc.xhtml as properties="nav" (inside manifest).
The OPF does list the to.xhtml inside the guide tags.
The doc.xhtml is set as Table of Contents (Add Semantics ...)

The IDPF validator lists the epub as 3.0.1 (thanks for the links, I appreciate that), and gives the file a clean bill of health.

The Table of Contents button in Kindle Previewer remains greyed out (Cmd+T/Ctrl+T). But ... when I load the .mobi file onto my wife's Paperwhite the Go To menu does list everything as it should.



Should the lack of the TOC button in Kindle Previewer concern me?
Where should
<item id="toc" properties="nav" href="xhtml/toc.xhtml" media-type="application/xhtml+xml"/>
be placed? In OPF? Inside <guide>?

Many thanks for your input. Hugely appreciated.

Edit: I am using the current (0.9.2) version of Sigil.
tinmug is offline   Reply With Quote
Advert
Old 01-22-2016, 08:09 AM   #6
Doitsu
Grand Sorcerer
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 5,727
Karma: 24031401
Join Date: Dec 2010
Device: Kindle PW2
Quote:
Originally Posted by tinmug View Post
The OPF does list the to.xhtml inside the guide tags.
As I've aleady pointed out, .opf guide elements are ignored for ePub3 books. You'll need to add a toc landmarks item to the NAV xhtml file. For example:

Spoiler:
Code:
    <nav id="landmarks" epub:type="landmarks">
      <h2>Guide</h2>
      <ol>
        <li>
          <a epub:type="cover" href="../Text/cover.xhtml">Cover</a>
        </li>
        <li>
          <a epub:type="bodymatter" href="../Text/chapter1.xhtml">Start reading</a>
        </li>
        <li>
          <a epub:type="toc" href="../Text/nav.xhtml">Table of Contents</a>
        </li>
      </ol>
    </nav>


For a working example book download this ePub3 book from MR. It has the proper NAV xhtml landmarks and compiles OK with KindleGen. If you format your book in the same way the TOC menu item will no longer be greyed out.

Quote:
Originally Posted by tinmug View Post
Should the lack of the TOC button in Kindle Previewer concern me?
Yes, because it means that the nav xhtml is missing a toc landmarks item; it also means that users of older Kindle models won't be able to access the HTML TOC:

Quote:
Originally Posted by tinmug View Post
Where should
<item id="toc" properties="nav" href="xhtml/toc.xhtml" media-type="application/xhtml+xml"/>
be placed? In OPF? Inside <guide>?
No, in the nav xhtml file. (See the above example.)

I've replied too quickly that declaration should be in the .opf file.

Last edited by Doitsu; 01-22-2016 at 10:17 AM.
Doitsu is offline   Reply With Quote
Old 01-22-2016, 08:47 AM   #7
tinmug
Member
tinmug began at the beginning.
 
Posts: 17
Karma: 10
Join Date: Jan 2016
Device: iPad, Kindle Paperwhite
A-ha! Thank you – will create the nav.xhtml and integrate that ... will report back. Thanks for your patience.
tinmug is offline   Reply With Quote
Old 01-22-2016, 09:50 AM   #8
tinmug
Member
tinmug began at the beginning.
 
Posts: 17
Karma: 10
Join Date: Jan 2016
Device: iPad, Kindle Paperwhite
Thanks for that – have it doing what I hoped it would. I added the 'nav id="landmarks"' string, and that seems to have sorted it all out.

I know have a horribly formatted TOC that appears between cover and title page (followed by copyright page and the original internal TOC page). Quick question: instead of styling the new nav/toc xhtml, is it possible to set the original (internal – part of the INDD doc) TOC page as the nav/toc xhtml (not going to rename it, simply set as TOC (Add Semantics) and add the Landmark values?
tinmug is offline   Reply With Quote
Old 01-22-2016, 10:09 AM   #9
Doitsu
Grand Sorcerer
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 5,727
Karma: 24031401
Join Date: Dec 2010
Device: Kindle PW2
Quote:
Originally Posted by tinmug View Post
is it possible to set the original (internal – part of the INDD doc) TOC page as the nav/toc xhtml (not going to rename it, simply set as TOC (Add Semantics) and add the Landmark values?
If by internal TOC, you mean the TOC displayed in the Table of Contents window in Sigil the answer is no. That information is stored in the .ncx (XML) file, which can't be styled and can't be linked to in the landmarks section of the nav file, because the nav file is intended as the replacement for the ncx file and can only contain links to other .xhtml files.
(ePub3 files can contain an .ncx file for backwards compatibility, but it's not required.)
Doitsu is offline   Reply With Quote
Old 01-22-2016, 11:11 AM   #10
tinmug
Member
tinmug began at the beginning.
 
Posts: 17
Karma: 10
Join Date: Jan 2016
Device: iPad, Kindle Paperwhite
The NCX file aside, my original InDesign document features a Contents page; and all parts of the book are exported as separate XHTML file. Therefore the Contents XHTML file might be a candidate to serve as a nav/toc file (given the correct syntax). Will have to try ...
tinmug is offline   Reply With Quote
Old 01-22-2016, 11:30 AM   #11
Doitsu
Grand Sorcerer
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 5,727
Karma: 24031401
Join Date: Dec 2010
Device: Kindle PW2
Quote:
Originally Posted by tinmug View Post
Therefore the Contents XHTML file might be a candidate to serve as a nav/toc file (given the correct syntax). Will have to try ...
It certainly can reuse the toc nav as a table of contents, however, the toc nav file must be formatted as an ordered list and contain a landmarks section.
Doitsu is offline   Reply With Quote
Old 01-23-2016, 09:43 AM   #12
tinmug
Member
tinmug began at the beginning.
 
Posts: 17
Karma: 10
Join Date: Jan 2016
Device: iPad, Kindle Paperwhite
Thanks for that. Current file not an ordered list, and not likely to become one (I am loathe to change the styling). Thanks for your help though – have enough up and running for the time being, might revisit this in the next few days ...

Last edited by tinmug; 01-29-2016 at 12:46 AM.
tinmug is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Trouble creating toc FDG Conversion 7 08-14-2015 10:01 AM
Trouble with TOC pastorjamie Calibre 1 12-10-2013 01:47 PM
Sigil Trouble w TOC & Upgrading sandrajonas Sigil 6 10-26-2013 11:10 AM
Trouble with TOC in Mobipocket Creator Frustrated Kindle Formats 4 08-13-2011 12:39 PM
Trouble generating a TOC foghat Calibre 2 05-07-2010 06:00 PM


All times are GMT -4. The time now is 03:03 PM.


MobileRead.com is a privately owned, operated and funded community.