View Single Post
Old 07-11-2022, 06:30 PM   #11
Tex2002ans
Wizard
Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.
 
Posts: 2,306
Karma: 13057279
Join Date: Jul 2012
Device: Kobo Forma, Nook
Quote:
Originally Posted by bookman156 View Post
If I make a sort of table of contents like that [...] will it still be displayed at the back, is that the 'proper' place for it?
"Proper place" for a TOC is at the front. Exactly where you would place it in a Print book:
  • Cover
  • Title Page
  • Copyright
  • TOC <--- Right here in the frontmatter.
  • [... Rest of book files.]

- - - - -

Note: If this ebook is for personal usage? You can put this TOC file wherever you want.

But if you are putting this ebook up for sale? DO NOT stick the TOC at the end of the book. This will get you dinged.

(For example, see my comment in /r/selfpublish: "Going from academic writing to self-publishing" where I linked to a 2017 article describing the Amazon crackdown.)

- - - - -

Side Note: If your book is "continuous", or is very small, like a single article, stick the TOC in the front of the book as soon as possible:

- Cover.xhtml
- TOC.xhtml
- Title.of.Article.xhtml

Even if the TOC only has a single entry, this is fine.

Just give it the name of the book/pamphlet/article/chapter, and you'll be good.

TOC.xhtml:

Code:
<p class="toc"><a href="../Text/Example.Article.xhtml">“Example Article” by Tex</a></p>
Quote:
Originally Posted by bookman156 View Post
Yes, I can see the accessibility reasons.
Yes. Accessibility is one of the huge reasons why TOC files are great + needed.

This allows you to navigate around the document in alternate ways.

In the case of an extremely short, single-chapter book, it doesn't feel like a one-line TOC makes much sense, but all ebooks should be navigated the same way.

There are also a few other reasons too:
  • Some devices have a "Go to Table of Contents" button, which will jump you directly to the nav.xhtml / TOC.xhtml file.
  • Some stores "start"/open the book directly after the TOC.

Quote:
Originally Posted by bookman156 View Post
I guess I could have:

Code:
nav#toc {
display:none;
}
in the sgc-nav.css file, but is this good practice, will it interfere with the use of the epub?
No. Do not use display: none.

I described a lot of this just a few days ago in:

Some people try to "hide" footnotes/endnotes in the book, but this is horrible for Accessibility, and brings lots of bugs to things like Search/Text-to-Speech, etc.

Just leave the TOC as it is. There is no harm in a single line of text in your TOC, and only benefits from having it available + visible for all users.

Do not try to purposefully hide things from readers because you think you know better.

Quote:
Originally Posted by bookman156 View Post
I guess coming from print book publishing I find the idea of putting the cover etc in a table of contents a bit weird. Probably be better if it was called something else, like book elements or something. But I probably have to adjust. Though I may end up with display none if I can't in the end see the point of it.
There's no need to add "Cover" or "Table of Contents" in the actual toc.ncx or nav.xhtml file...

This has been discussed to death many ties over the years. (As one example, see Hitch's posts in the 2015 topic above.)

- - - - -

Complete Side Note / Rant

Has anyone else been getting really garbage search results from Google lately?

I've been doing in-depth searches for things like:

Code:
cover NCX Tex2002ans site:mobileread.com
and getting LOTS of irrelevant (and/or incomplete) results.

Another frustrating thing has been search results which DO NOT include my damn keywords. I want the EXACT THING I SEARCHED FOR, not "Well, here's a flood of results missing the word 'NCX'.".

I know this self-referential "Cover" or "Table of Contents" in the NCX has been discussed at least a dozen times over the years... but I can't seem to find my older posts on the topic.

(And yesterday, it was me looking up "Syntax Highlighting" + Tex2002ans... I had to dig through my notes to actually find the original 2019 topic!)

Last edited by Tex2002ans; 07-11-2022 at 06:46 PM.
Tex2002ans is offline