1

I'm using Notepad++ to format my first novel in HTML before converting it to MOBI and/or ePUB.

I've done the code to make the items on my Table of Contents into live links and they all take me to the in-book headings, both in the default viewer (Chrome) and in the Kindle Previewer. Yay! But I'd like to go one step further and enable a return link, so that the reader can click on the chapter or section head and go back to the TOC.

Here's my test code from the TOC:

<p class="small">
<a href="#authornote" id="authornoter">Author&rsquo;s Note</a>
</p>

and from the linked heading itself:

<h3 a href="#authornoter" id="authornote">
<p class="centeredhead">AUTHOR&rsquo;S NOTE</p>
</a></h3>

It works from the TOC to the heading, but not back again.

I imagine it has something to do with the order I've arranged things. But when I reorder them I lose the formatting (font family, size, alignment) included in the "centeredhead" tag.

Is what I want even possible? If so, how?

(BTW, I'd be willing to compromise and have all the return links point back to the heading of the Table of Contents. Just as long as they return.)

EDIT-- I redid it like this, and now it works:

<pre>
<p class="small">
   <a href="#authornote">
       Author&rsquo;s Note
   </a>
</p>
</pre>

With the target and backlink like this. All it needed was for me to close the > on the h3, and start a new one for the a href.

<pre>
<h3>
  <a href="#TOC" id="authornote">
    <p class="centeredhead">
      AUTHOR&rsquo;S NOTE
     </p>
  </a>
</h3>
</pre>

I'm taking it back to the TOC head, which makes more sense anyway.

4
  • Why do you want to do this? Most readers rely on the reading system's builtin navigation system (which they can open by clicking the TOC icon). The navigation system is constructed using the toc nav element. Is there something special about your content that requires the reader to go to the actual html page? Jul 25, 2018 at 15:00
  • If you are trying to do an bidirectional annotation/footnotes, check out 9.3.12 Footnote Guidelines of the Amazon Kindle Publishing Guidelines. Jul 25, 2018 at 15:07
  • Thanks for the referral to the Guidelines As to why, call it a fondness for redundancy. What's the use of having a live TOC in the book itself if it doesn't go both ways? Jul 30, 2018 at 3:24
  • At any rate, I figured out how to do it. That means I should edit my post for future reference, right? Jul 30, 2018 at 3:26

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy