Is there a way to format footnote references in questions or answers. I try [1]
as I usually do in my plain-text e-mails, but this doesn't look good, here is a live example.
I typically use a horizontal rule in combination with <sup>
. I don't use <sub>
for the content as per Martijn's answer though1.
1 Because it make the footnotes too small, IMO.
-
1+1 good point, I used <sup>[1]</sup> now also under the <hr> different fonts make it easier to get. Ah, only now I see that this was your original suggestion. – Wolf Jun 6 '14 at 9:52
-
1Yeah, and when you have to use backticks in the footnote, the fixed-width font tends to get too large as well. – Martijn Pieters♦ Jun 6 '14 at 9:53
-
1
-
5Any one know of a way to anchor the footnote and link to it? – G. Allen Morris III Aug 8 '16 at 7:35
-
@G.AllenMorrisIII, the anchor seems does not work for footnote. A least I can not make it work. – jdhao May 15 '19 at 4:01
I use some superscript / subscript formatting; <sup>
tags for the reference, then combining that with <sub>
in the footnote:
Markdown does not have explicit footnote support, so I use
HTML<sup>*</sup> instead. Personally, I prefer using `*` or `†` for
footnote markers, but you can use numbered<sup>[1]</sup> markers if
you really want.
<sup>*<sub> This is the footnote text</sub></sup>
<sup>[1]<sub> Number them any way you like</sub></sup>
which is rendered as
Markdown does not have explicit footnote support, so I use HTML* instead. Personally, I prefer using
*
or†
for footnote markers, but you can use numbered[1] markers if you really want.* This is the footnote text
[1] Number them any way you like
-
-
1The dagger is definitely preferable when answering a question about a language that uses asterisks to mean something special (e.g. pointers). – Cody Gray♦ Jun 6 '14 at 9:53
-
@CodyGray sure, but subscript numbers are easier to write for programmers, provided there is always a <sup> in the clipboard ;) – Wolf Jun 6 '14 at 9:57
-
2It looks great, but the font is small indeed. My +1 is valid, but for pragmatic reasons, Jon's answer is the more acceptable for me. Thanks for your effort with including the source as well. BTW: the length of the first line causes a horizontal scrollbar. – Wolf Jun 6 '14 at 10:09
-
Just a small modification of Martijn Pieters' answer: if the footnote spans more than one line, his sub-within-sup approach gives too large line spacing compared with font size. Also, the text is perhaps too small. For example,
Example body text. Now, surprise, comes a footnote<sup>1</sup>.
<sup>1<sub> This is the footnote text, which spans several lines. Compare the
rendered text in the first and second approaches. I find the second one more
pleasing, and easier to read. What do you think? </sub></sup>
is rendered as
Example body text. Now, surprise, comes a footnote1.
1 This is the footnote text, which spans several lines. Compare the rendered text in the first and second approaches. I find the second one more pleasing, and easier to read. What do you think?
I prefer the following approach, which gives better-looking line spacing. Also, the text is slightly larger, and thus easier to read.
Example body text. Now, surprise, comes a footnote<sup>1</sup>.
<sup><sup>1</sup> This is the footnote text, which spans several lines. Compare
the rendered text in the first and second approaches. I find the second one more
pleasing, and easier to read. What do you think? </sup>
is rendered as
Example body text. Now, surprise, comes a footnote1.
1 This is the footnote text, which spans several lines. Compare the rendered text in the first and second approaches. I find the second one more pleasing, and easier to read. What do you think?
-
1
-
-
I thought of the ol HTML tag. I think the text should better not float around the number... but this is only a minor issue not worth the trouble. – Wolf Aug 11 '14 at 7:47
-
@Wolf: If you use a real numbered list at the bottom, someone might confuse it for a continuation of the body. By using a tiny
1
in<sup>
tags, the list is clearly a footnote section. To further help the cause, a horizontal line should be used too. See this answer for more info. – Senseful Dec 22 '18 at 18:36 -
Apologies for a another response, but I've found the perfect combination to incorporate elements of all the recommendations above.
Namely:
- Use
<sup>1</sup>
for the footnote references. Using numbers is a lot easier to remember than a list of symbols, and looks nicer, since their heights will always be equal (as opposed to*
and†
, for example). - Use a horizontal line to separate the footnotes section, making it clear that it's not just a continuation of the body.
- Use a
<sup>
tag to render the footnote definitions in small text, again making it clear that it's a footnote section. Don't use<sub>
as it won't wrap as nicely. - Use a second
<sup>
tag for each number in the footnote section, again making it clear that it's a footnote definition and not part of the body. - Use double spaces to separate footnote lines, so that the definition numbers line up.
Template
Example<sup>1</sup> text.<sup>2</sup>
---
<sup><sup>1</sup> Definition goes here.</sup>
<sup><sup>2</sup> Definition goes here.</sup>
Rendered Template
Example1 text.2
1 Definition goes here.
2 Definition goes here.
Recipe:
Although the there is a relevant post elsewhere in the network with
`status-declined`<sup>1</sup>, the markdown help page here<sup>2</sup> can indeed... help.
<hr>
1. <sub><sup>[Markdown footnotes?][^1]</sup></sub>
2. <sub><sup>[Markdown help: Advanced Links][^2]</sup></sub>
[^1]: https://meta.stackexchange.com/questions/5017/markdown-footnotes "Meta Stack Exchange"
[^2]: https://stackoverflow.com/editing-help#advanced-links "Stack Overflow"
Results:
Although the there is a relevant post elsewhere in the network with
status-declined
1, the markdown help page here2 can indeed... help.
-
The font for the footnote text is really very small. This approach is sadly also just a hack, at least in the present MD implementation. The footnotes are not classified as such, So you can not apply CSS on it to fix the the font sizes. – Wolf Oct 30 '18 at 10:26