How can I compile a Table of Contents with Level1 titles only?

th
thesteve
Posts: 36
Joined: Sat Aug 09, 2014 11:41 am
Platform: Mac

Tue Aug 29, 2017 10:43 am Post

I am not talking about making a Table of Contents page inside the e-book.

I am talking about the Table of Contents shown on the left of a Kindle/Kobe/etc.

For example, I am uploading the new e-book to Kindle and ePub right now. The Table of Contents shows all the titles and subtitles. I would like to show titles only.

Hope the question is clear :)

User avatar
lunk
Posts: 2837
Joined: Wed Aug 21, 2013 4:24 pm
Platform: Mac + iOS
Location: Sweden 64° N

Tue Aug 29, 2017 11:04 am Post

I don't think you can control that, unless you edit the .mobi file in som other program afterwards. That ToC is essentially created by the reader software.
What you can experiment with is to change the organisation of your Binder structure, so that only top levels are folders and you have as few sub-levels as possible.
I am a user, writing non-fiction and science, using:
* Mac Scrivener 3 on a Macbook 12”, MacBook Pro 13”, and iMac 27”, all running the latest MacOS
* iOS Scrivener 1 on an iPhone 8, iPad Air 9.7”, and iPad Pro 12.9”, all running the latest iOS

th
thesteve
Posts: 36
Joined: Sat Aug 09, 2014 11:41 am
Platform: Mac

Tue Aug 29, 2017 11:15 am Post

lunk wrote:I don't think you can control that, unless you edit the .mobi file in som other program afterwards. That ToC is essentially created by the reader software.
What you can experiment with is to change the organisation of your Binder structure, so that only top levels are folders and you have as few sub-levels as possible.


Hi Lunk

in my Binder the titles are folders and the subtitles are pages. I don't think I can compress the binder more than that.

Thanks for the fast reply :)

User avatar
lunk
Posts: 2837
Joined: Wed Aug 21, 2013 4:24 pm
Platform: Mac + iOS
Location: Sweden 64° N

Tue Aug 29, 2017 11:55 am Post

thesteve wrote:subtitles are pages


Everything that has a title in the ebook will end up in the automatic toc, irrespective if they are folders or files in the Binder.

In my latest ebook the Binder has three levels: parts (titles checked in Compile), chapters (titles checked in Compile) and chapter content (text checked in Compile). Parts and Chapters end up in the automatic toc in both the .mobi and .epub files.
I am a user, writing non-fiction and science, using:
* Mac Scrivener 3 on a Macbook 12”, MacBook Pro 13”, and iMac 27”, all running the latest MacOS
* iOS Scrivener 1 on an iPhone 8, iPad Air 9.7”, and iPad Pro 12.9”, all running the latest iOS

th
thesteve
Posts: 36
Joined: Sat Aug 09, 2014 11:41 am
Platform: Mac

Tue Aug 29, 2017 12:18 pm Post

lunk wrote:Everything that has a title in the ebook will end up in the automatic toc, irrespective if they are folders or files in the Binder.

In my latest ebook the Binder has three levels: parts (titles checked in Compile), chapters (titles checked in Compile) and chapter content (text checked in Compile). Parts and Chapters end up in the automatic toc in both the .mobi and .epub files.


That's an issue for our latest book. Wish it was possible to do otherwise

User avatar
lunk
Posts: 2837
Joined: Wed Aug 21, 2013 4:24 pm
Platform: Mac + iOS
Location: Sweden 64° N

Tue Aug 29, 2017 12:20 pm Post

It is, if you edit the .mobi or .epub file using software made for that, like Calibre.
I am a user, writing non-fiction and science, using:
* Mac Scrivener 3 on a Macbook 12”, MacBook Pro 13”, and iMac 27”, all running the latest MacOS
* iOS Scrivener 1 on an iPhone 8, iPad Air 9.7”, and iPad Pro 12.9”, all running the latest iOS

User avatar
KB
Site Admin
Posts: 20507
Joined: Tue Jun 13, 2006 11:23 pm
Platform: Mac
Location: Truro, Cornwall
Contact:

Wed Aug 30, 2017 9:46 am Post

There should be more control over this with Scrivener 3, which imports ePub 3. In ePub 2, the sidebar contents is a separate entity from the HTML table of contents that can optionally be included at the start of the book. The sidebar is generated from an NCX XML file, whereas the contents the user sees inside the book is HTML. It would have been added a layer of complexity to allow the user to determine the NCX (which wasn't shown by many e-readers anyway), so Scrivener generates that automatically, while allowing the user to override the HTML contents.

The NCX file is deprecated in ePub 3. The sidebar contents are now taken directly from the HTML file which is built around a <nav> block. This means that when you override the HTML file in ePub 3 in Scrivener 3, then you also override the sidebar navigation. This also affects Kindle export since Kindle files are generated from the raw ePub files internally. (Scrivener 3 will still include an NCX file in its ePub 3 files for backwards-compatibility with older readers, but Kindle and ePub 3-supporting readers - which is most of them these days - will use the user-defined HTML table of contents everywhere.)

In the meantime, however, until Scrivener 3 is released, the only way is indeed to edit the file using a third-party tool such as Calibre.
"You can't waltz in here, use my toaster, and start spouting universal truths without qualification."

me
melindakraft
Posts: 4
Joined: Fri Feb 16, 2018 6:06 pm
Platform: Mac

Thu Mar 01, 2018 3:32 pm Post

In the last comment in this thread, @KB said,
There should be more control over this (NCX ToC) with Scrivener 3...Scrivener 3 will still include an NCX file in its ePub 3 files for backwards-compatibility with older readers, but Kindle and ePub 3-supporting readers - which is most of them these days - will use the user-defined HTML table of contents everywhere.


In my testing in different previewers, e-readings apps, it seems that the presence of the NCX in my epub3 export, which is there for backwards compatibility, is always displayed in the app.

If this is the case, S3 should give us the option to shut it off if we don't want it there, knowing that we will take the risk of our book not working on older devices.

Thoughts?

User avatar
KB
Site Admin
Posts: 20507
Joined: Tue Jun 13, 2006 11:23 pm
Platform: Mac
Location: Truro, Cornwall
Contact:

Thu Mar 01, 2018 3:54 pm Post

Any app conforming to ePub 3 specs should use the navigable table of contents rather than the NCX file - this would be a bug in the reader app if not. The inclusion of the NCX for compatibility with older readers is something recommended in the ePub 3 specs:

https://idpf.github.io/a11y-guidelines/ ... v/toc.html

But, as I say, ePub 3 readers should just use the ToC nav document (the table of contents file). In all of my tests, e-readers have displayed the table of contents as expected for ePub 3 files and have not unexpectedly used the NCX. Perhaps you could provide a sample epub file or Scrivener project that shows the issue along with information about in which readers you are seeing the problem?

All the best,
Keith
"You can't waltz in here, use my toaster, and start spouting universal truths without qualification."