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

7
  • Is there a reason every footnote is in its own separate file? Why not have all footnotes in a single file and link to the footnote like this: href='fnfile.html#fn1'?
    – Bulrush
    Commented Apr 21, 2016 at 18:21
  • i'll consider it thanks. do you know how to display inline footnotes? Commented Apr 22, 2016 at 21:52
  • Sorry I do not use Calibre. I write in MultiMarkdown and convert that to an EPUB.
    – Bulrush
    Commented Apr 23, 2016 at 11:42
  • can you link a guide? Commented Apr 23, 2016 at 18:01
  • This is a real quick inline footnote how-to. pastebin.com/CvNxSJer. Once you click on the footnote in the text, it will take you to the footnote itself. Hit the browser BACK button to go back to the actual text you were reading.
    – Bulrush
    Commented Apr 25, 2016 at 11:10

1 Answer 1

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.

1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.