![]() |
#1 |
Junior Member
![]() Posts: 4
Karma: 10
Join Date: Nov 2024
Device: Samsung Tablet
|
TOC and NAV in Apple Books
Hi
I am trying to finish my first e-book in Sigil and just struggling with TOC & nav. My book is epub3.0. With just a nav.xhtml for TOC, everything looked fine with Kindle Previewer with a TOC where I expected, but in Apple Books there was no TOC displaying. So I generated an HTML TOC from: Tools / Table of Contents / Create HTML from Table of Contents. Now in Apple Books I get a TOC....but on Kindle Previewer I get 2 TOCs! I did put the nav.xhtml at the end of the book but it's still weird to have 2. Can anyone help me please - I'm pretty new to Sigil, but really like using it. Thanks Jonathan Would I be better doing it in epub 2? One other thing I noticed: With the nav.xthml, the TOC is nicely numbered but the TOC.htlml created under Tools has no numbering. (Minor issue) |
![]() |
![]() |
![]() |
#2 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,735
Karma: 5703586
Join Date: Nov 2009
Device: many
|
There are many kinds of Tables of Contents (TOCs) and that makes things confusing.
There are: 1. html TOCs that you completely control and are meant to be seen by the reader just like any other chapter. They are not used to generate any internal navigation in the e-reader. 2. epub2 has an xml based TOC typically called the toc.ncx that is meant to be machine read by the e-reader and used to build an internal TOC for navigation. 3. epub3 removes the need for the toc.ncx (but you can add it back for compatibility with older epub2 only e-readers). It instead adds the nav.xhtml and it is machine read by the e-reader to build internal TOC for navigation. But if you add the nav.xhtml to the OPF spine fo the book, it can double as an html TOC as well. So you control which type of TOC you want, and if you want to add an html TOC or not. As for kindles, I really have no idea as I gave up on kindles a long time ago. It is not an open standard. Perhaps someone that produces ebooks for Kindles can tell you which is the best way to create a TOC for a kindle. As for Apple Books, epub3 with the nav.xhtml properly specified in the OPF should create the Apple Books internal TOC, and if you add it to the OPF spine it should also appear as an html TOC. There is no reason to create a second HTML TOC for Apple Books. Last edited by KevinH; 12-11-2024 at 01:35 PM. |
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Junior Member
![]() Posts: 4
Karma: 10
Join Date: Nov 2024
Device: Samsung Tablet
|
Thanks very much Kevin for all the detail.
I think I have got confused now. Whatever I do there isn't a TOC in when I open the epub file in Apple Books unless I create an html one in tools. I have the nav.xhtml and I can see in the OEBPS/content.opf that it references the Text/nav.xhtml file: <meta name="Sigil version" content="2.3.1"/> <meta name="cover" content="cover_png"/> </metadata> <manifest> <item id="nav_xhtml" href="Text/nav.xhtml" media-type="application/xhtml+xml" properties="nav"/> <item id="Intro_xhtml" href="Text/Intro.xhtml" media-type="application/xhtml+xml"/> <item id="Style0001_css" href="Styles/Style0001.css" media-type="text/css"/> <item id="Chapter1_xhtml" href="Text/Chapter1.xhtml" media-type="application/xhtml+xml"/> I'm a beginner with this and not quite sure what you mean by: But if you add the nav.xhtml to the OPF spine for the book, it can double as an html TOC as well. Apologies if this is obvious but how do I and the nav.xhtml to the OPF spine? Many thanks Jonathan |
![]() |
![]() |
![]() |
#4 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,735
Karma: 5703586
Join Date: Nov 2009
Device: many
|
If you created this epub with Sigil it will default to adding the nav.xhtml to the spine with linear="no" as its attribute.
The spine is a tag in the content.opf that lists the ids of the chapters in the order you want them to appear in the e-reader. Have you tried validating your epub using the epubcheck plugin? If you look at the content.opf, you should see the spine tag and inside it you should see an itemref tag with the idref="nav_xhtml" which is the manifest id for your nav.xhtml according to the snippet above. When you say the nav TOC did not appear in Apple's Books app, are you referring to not seeing it like any other chapter, or that the Books TOC tool is empty? |
![]() |
![]() |
![]() |
#5 |
Junior Member
![]() Posts: 4
Karma: 10
Join Date: Nov 2024
Device: Samsung Tablet
|
Hi Kevin - thank you this seems to have done the trick.
I changed linear= to "yes" - is that what you had in mind. TOC now shows in Apple Books I also installed the epubcheck plugin which found a few html tags but also flagged that the css file linked to in nav.xhtml did not exist. So I created a new one and linked it. So now I have no errors and will test again. Thank you for the tips. Jonathan |
![]() |
![]() |
Advert | |
|
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
How to generate a Nav or TOC w/Pictures | Kabukikaiser | Sigil | 7 | 02-07-2022 01:50 PM |
using nav.xhtml for TOC | hobnail | Sigil | 40 | 11-12-2021 02:00 PM |
Can nav be a TOC? | AlanHK | ePub | 4 | 02-25-2020 02:41 PM |
Link to nav.xhtml in TOC | cges30901 | Sigil | 11 | 01-22-2020 12:01 PM |
TOC nav.xhtml issue | ebookscovers | Conversion | 1 | 05-06-2017 11:12 AM |