title_body: writing inline footnotes for html to mobi conversion using calibre 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 &lt;a id="footnote1" href='footnotes/1.html'&gt;[1]&lt;/a&gt;
  
  
  footnotes/1.html:
  
  Here is a footnote &lt;a href="text.html#footnote1&gt;[..]&lt;/a&gt;
  
  
  For Calibre's HTML to .mobi conversion, what HTML code should I write to use in-line footnotes instead of endnotes?
  
  Thanks
upvoted_answer: I've figured it out. To make the inline footnote works, must put the footnotes in the &quot;Footnotes&quot; section. Here is the example:
  I have the file: &quot;HDN is the best.html&quot;
  &lt;html&gt;
  &lt;head&gt;
      &lt;title&gt;HDN is the best&lt;/title&gt;
  &lt;/head&gt;
  
  &lt;body&gt;
  &lt;h1&gt;Best of HDN&lt;/h1&gt;
  &lt;p&gt;&lt;sup&gt;&lt;a id='fs-1' href='#ft-1'&gt;[1]&lt;/a&gt;&lt;/sup&gt; HDN is the best&lt;/p&gt;
  &lt;p&gt;&lt;sup&gt;&lt;a id='fs-2' href='#ft-2'&gt;[2]&lt;/a&gt;&lt;/sup&gt; HDN is the best&lt;/p&gt;
  &lt;p&gt;HDN is the best&lt;/p&gt;
  &lt;p&gt;HDN is the best&lt;/p&gt;
  &lt;p&gt;HDN is the best&lt;/p&gt;
  &lt;p&gt;HDN is the best&lt;/p&gt;
  &lt;p&gt;HDN is the best&lt;/p&gt;
  &lt;p&gt;HDN is the best&lt;/p&gt;
  &lt;p&gt;HDN is the best&lt;/p&gt;
  &lt;p&gt;HDN is the best&lt;/p&gt;
  &lt;p&gt;HDN is the best&lt;/p&gt;
  &lt;p&gt;HDN is the best&lt;/p&gt;
  &lt;p&gt;HDN is the best&lt;/p&gt;
  &lt;p&gt;HDN is the best&lt;/p&gt;
  &lt;p&gt;HDN is the best&lt;/p&gt;
  &lt;p&gt;HDN is the best&lt;/p&gt;
  &lt;p&gt;HDN is the best&lt;/p&gt;
  &lt;p&gt;HDN is the best&lt;/p&gt;
  &lt;p&gt;HDN is the best&lt;/p&gt;
  
  &lt;h1&gt;Footnotes&lt;/h1&gt;&lt;br&gt;
  &lt;sup&gt;&lt;a id='ft-1' href='#fs-1'&gt;[1]&lt;/a&gt;&lt;/sup&gt; It's true.&lt;br&gt;
  &lt;sup&gt;&lt;a id='ft-2' href='#fs-2'&gt;[2]&lt;/a&gt;&lt;/sup&gt; It's double true.&lt;br&gt;
  
  &lt;/body&gt;
  &lt;/html&gt;
  
  There, just convert the file &quot;HDN is the best.html&quot; and see for yourself.
  Now here is the tip: when you convert this file &quot;HDN is the best.html&quot; 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 &quot;E:\temp\TempMisc\HDN is the best.html&quot; &quot;E:\temp\TempMisc\HDN is the best.mobi&quot; --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.