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.
5 Answers
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.
-
2+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.– WolfJun 6, 2014 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 ModJun 6, 2014 at 9:53
-
1
-
5Any one know of a way to anchor the footnote and link to it? Aug 8, 2016 at 7:35
-
@G.AllenMorrisIII, the anchor seems does not work for footnote. A least I can not make it work.– jdhaoMay 15, 2019 at 4:01
-
I think
<sub>
looks great for purely url footnote content (but agree, it's not useful for sentences).– stevecJan 17, 2021 at 14:47 -
Suggested edits are not allowed on non-tag-wiki posts on meta sites. - Too bad for me when I wanted to see (not edit) the markdown source code. In this case I figured it out anyway.– HenkeFeb 1, 2021 at 9:20
-
-
one problem with these tags is that it disables markdown after them. E.g. I'm yet to figure out how to format
some code
there Nov 15 at 13:23
I used to 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
These days I do what Jon does (with a horizontal line before the footnotes), as I agree that adding <sup>
makes the text too small.
-
-
1The dagger is definitely preferable when answering a question about a language that uses asterisks to mean something special (e.g. pointers).– Cody Gray - on strike ModJun 6, 2014 at 9:53
-
@CodyGray sure, but subscript numbers are easier to write for programmers, provided there is always a <sup> in the clipboard ;)– WolfJun 6, 2014 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.– WolfJun 6, 2014 at 10:09
-
@Wolf: sure, not a problem. Reflowed the formatted portion.– Martijn Pieters ModJun 6, 2014 at 10:13
-
-
FYI, while editing a question (that included keyboard shortcuts using
<kbd>
), trying to add footnotes resulted in the dreaded "Your post appears to contain code that is not properly formatted as code" error. Presumably due to the density of HTML tags. I played around with it for a bit, ended up dropping the idea of using footnotes. Oct 24, 2022 at 18:15
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.– WolfAug 11, 2014 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.– SensefulDec 22, 2018 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.– WolfOct 30, 2018 at 10:26