View Single Post
Old 10-27-2024, 02:26 AM   #456
AlanHK
Guru
AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.
 
AlanHK's Avatar
 
Posts: 681
Karma: 929286
Join Date: Apr 2014
Device: PW-3, iPad, Android phone
Quote:
Originally Posted by KevinH View Post
2. create the css necessary and link it to the nav so that the nav appears just like a desired xhtml toc in appearance and remove the linear="no" associated with the nav so that the nav itself functions like a directly linked user xhtml toc file (ie it plays 2 roles - both machinereadable nav and user toc). But not everyone wants a user xhtml toc.
If I'm working on an epub3, and the nav has (or can be made to have) all the links I want to display as a TOC, I delete the HTML TOC if there is one and paste the below CSS into the header of the NAV, and set its semantics to be also "Table of Contents". Less hassle then if I add, delete, move things about.

If on the other hand the visible TOC needs things that can't be put in the NAV, I delete it from the spine and make a HTML toc. This omits it from the Kindle conversion so I don't need to worry about how it looks. (If that's going to alarm ePubCheck, I'll have to rethink, as many publishers insist on no EpubCheck errors.)


Code:
<style type="text/css">
body {font-family: serif; }
h1 {font-style: italic;  text-align: center;  font-weight: normal;  font-size: 1.8em;}
ol { list-style-type: none;}
li {font-weight: normal; text-align: left;  margin-left: 0;  font-size: 1rem; text-indent: -2em;  margin-top:.5em;}
li li {margin-top:0;}
a {  text-decoration: none;}
    </style>
Quote:
Originally Posted by philja View Post
To do this, replacing the author HTML toc, would, in my case involve serious editing effort to add loads of anchors to the entries because all my chapters have links back to the HTML toc.
I don't know why headings need a link back to the toc. I remove such links if there are any. Simplifies the code. Every ebook reader has direct buttons to the toc.
AlanHK is offline   Reply With Quote