2

I'm generating html code that I convert to .mobi format using Calibre. I have implemented endnotes with backlinks as follows:

text.html:

this is some text <a id="footnote1" href='footnotes/1.html'>[1]</a>

footnotes/1.html:

Here is a footnote <a href="text.html#footnote1>[..]</a>

For Calibre's HTML to .mobi conversion, what HTML code should I write to use in-line footnotes instead of endnotes?

Thanks

Walrus the Cat
  • 217
  • 1
  • 6

1 Answers1

2

I've figured it out. To make the inline footnote works, must put the footnotes in the "Footnotes" section. Here is the example:

I have the file: "HDN is the best.html"

<html>
<head>
    <title>HDN is the best</title>
</head>

<body> <h1>Best of HDN</h1> <p><sup><a id='fs-1' href='#ft-1'>[1]</a></sup> HDN is the best</p> <p><sup><a id='fs-2' href='#ft-2'>[2]</a></sup> HDN is the best</p> <p>HDN is the best</p> <p>HDN is the best</p> <p>HDN is the best</p> <p>HDN is the best</p> <p>HDN is the best</p> <p>HDN is the best</p> <p>HDN is the best</p> <p>HDN is the best</p> <p>HDN is the best</p> <p>HDN is the best</p> <p>HDN is the best</p> <p>HDN is the best</p> <p>HDN is the best</p> <p>HDN is the best</p> <p>HDN is the best</p> <p>HDN is the best</p> <p>HDN is the best</p>

<h1>Footnotes</h1><br> <sup><a id='ft-1' href='#fs-1'>[1]</a></sup> It's true.<br> <sup><a id='ft-2' href='#fs-2'>[2]</a></sup> It's double true.<br>

</body> </html>

There, just convert the file "HDN is the best.html" and see for yourself.

Now here is the tip: when you convert this file "HDN is the best.html" to mobi file, Calibre may count footnotes as chapters, that'd be a mess for your table of content. So you need to prevent Calibre from doing this by using the cmd (using the option --toc-threshold 0) instead of using UI, here is the cmd:

ebook-convert.exe "E:\temp\TempMisc\HDN is the best.html" "E:\temp\TempMisc\HDN is the best.mobi" --toc-threshold 0

location of ebook-convert.exe is .\[Your installed Calibre folder]\Calibre\ebook-convert.exe

Note: this tested and work on my Kindle Paperwhite (second generation), but doesn't work on Kindle app for my iPhone. But it's good enough for me because I read mainly on Kindle Paperwhite.

123iamking
  • 136
  • 4