# Footnotes Spec This spec is partially based on: - - ----- A [footnote][@] is a numbered reference that appears at the bottom of the document which contains additional information or context around text elsewhere in the document. These are typically paired with one or more [footnote references](@) which "references" the [footnote] later in the document: ```````````````````````````````` example Here is a footnote reference,[^1] and another. [^2] [^1]: Here is the footnote [^2]: Here is yet another footnote .

Here is a footnote reference,1 and another. 2


  1. Here is the footnote 

  2. Here is yet another footnote 

```````````````````````````````` A [footnote] is denoted by a `[^`, followed by a [footnote identifier], then `]:`, plus optional text. ```````````````````````````````` example Foo[^foo] bar[^bar] [^foo]: This footnote has text, but the next one doesn't (and it's equally valid) [^bar]: .

Foo1 bar2


  1. This footnote has text, but the next one doesn't (and it's equally valid) 

  2.  
```````````````````````````````` A [footnote] may span multiple lines per the rules shown in the next example: ```````````````````````````````` example Here's an example of a long footnote[^longnote]. [^longnote]: This footnote has multiple blocks. Subsequent paragraphs are indented to show that they belong to the previous footnote. // This has additional indentation and would be treated as code The whole paragraph can be indented, or just the first line. In this way, multi-paragraph footnotes work like multi-paragraph list items. This paragraph won't be part of the note, because it isn't indented. .

Here's an example of a long footnote1.

This paragraph won't be part of the note, because it isn't indented.


  1. This footnote has multiple blocks.

    Subsequent paragraphs are indented to show that they belong to the previous footnote.

    // This has additional indentation and would be treated as code
    

    The whole paragraph can be indented, or just the first line. In this way, multi-paragraph footnotes work like multi-paragraph list items. 

```````````````````````````````` A [footnote] may be referenced multiple times within the document: ```````````````````````````````` example My favorite foods are pizza[^1], ice cream[^1], and smoothies. [^1]: Though delicious, these are not healthy. .

My favorite foods are pizza1, ice cream1, and smoothies.


  1. Though delicious, these are not healthy.  

```````````````````````````````` A [footnote identifier](@) may not contain spaces, tabs, or newlines. ```````````````````````````````` example Invalid[^spaces are not allowed] [^spaces are not allowed]: Sorry, this won't work .

Invalid[^spaces are not allowed]

[^spaces are not allowed]: Sorry, this won't work

```````````````````````````````` A [footnote identifier] can come immediately after a word, or have a space between the word and identifier, but cannot come immediately after an exclamation mark (`!`): ```````````````````````````````` example - No spaces[^1] - One space [^2] - Exclamation mark with space! [^3] - Exclamation mark with no space![^4] - Another exclamation mark![^5](not allowed) [^1]: Allowed [^2]: Allowed [^3]: Allowed [^4]: Not allowed [^5]: Not allowed .

  1. Allowed 

  2. Allowed 

  3. Allowed 

```````````````````````````````` These identifiers are used only to correlate the footnote reference with the note itself; in the output, footnotes will be numbered sequentially. ```````````````````````````````` example This reference uses a string identifier[^foo] [^foo]: This will be rendered as a number in the output; you won't see "foo" .

This reference uses a string identifier1


  1. This will be rendered as a number in the output; you won't see "foo" 

```````````````````````````````` The footnotes themselves need not be placed at the end of the document. They may appear anywhere except inside other block elements (lists, block quotes, tables, etc.). ```````````````````````````````` example Donec sed odio dui[^ref]. Donec id elit non mi porta gravida at eget metus. Maecenas sed diam eget risus varius blandit sit amet non magna. Nullam quis risus eget urna mollis[^ref2] ornare vel eu leo. Donec id elit non mi porta gravida at eget metus. Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit. [^ref2]: Etiam porta sem malesuada magna mollis euismod. Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Maecenas faucibus mollis interdum. Maecenas faucibus mollis interdum. > Cras mattis consectetur purus sit amet fermentum[^ref3]. > > [^ref3]: This footnote is not allowed because it's in a blockquote [^ref]: Risus Euismod Pharetra .

Donec sed odio dui1.

Donec id elit non mi porta gravida at eget metus. Maecenas sed diam eget risus varius blandit sit amet non magna. Nullam quis risus eget urna mollis2 ornare vel eu leo. Donec id elit non mi porta gravida at eget metus. Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit.

Cras mattis consectetur purus sit amet fermentum3.


  1. Risus Euismod Pharetra 

  2. Etiam porta sem malesuada magna mollis euismod. Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Maecenas faucibus mollis interdum. Maecenas faucibus mollis interdum. 

  3. This footnote is not allowed because it's in a blockquote 

```````````````````````````````` Footnotes should be separated from other blocks with blank lines: ```````````````````````````````` example This[^1] is[^2] a[^3] paragraph[^4]. [^1]: This footnote will not be parsed since it's not separated from the paragraph above - it's considered a lazy continuation line [^2]: This one is separated from above [^3]: This one isn't, but it's clearly another footnote which is fine [^4]: But this one will be parsed, even though it spans multiple lines because it's a lazy paragraph continuation. .

This[^1] is1 a2 paragraph3. [^1]: This footnote will not be parsed since it's not separated from the paragraph above - it's considered a lazy continuation line


  1. This one is separated from above 

  2. This one isn't, but it's clearly another footnote which is fine 

  3. But this one will be parsed, even though it spans multiple lines because it's a lazy paragraph continuation. 

```````````````````````````````` [Inline footnotes](@), also known as "anonymous footnotes", are also allowed. Though, unlike regular notes, they cannot contain multiple paragraphs. The syntax is slightly different - the caret goes before the opening brace as follows: ```````````````````````````````` example Here is an inline note.^[Inline notes are easier to write, since you don't have to pick an identifier and move down to type the note.] .

Here is an inline note.1


  1. Inline notes are easier to write, since you don't have to pick an identifier and move down to type the note. 

````````````````````````````````