Wikipedia:Nesting footnotes

This page explains how to "nest" footnotes (references or notes) in Wikipedia articles, i.e. how to create a footnote within a footnote. It reflects the way the MediaWiki software operates as of July 2015.

Footnotes: reminder
Footnotes are used most commonly to provide:
 * References to reliable sources, published in print or online
 * Notes containing supplementary content.

The Footnotes system shows two elements on the page:
 * A Footnote marker is displayed in the article's content as a bracketed, superscripted number, letter, or word. Examples shown respectively are:  . This footnote label is linked to the full footnote.
 * A Footnote displays the full note or reference. The footnotes are displayed in an ordered list wherever the reference list markup (e.g., or ) is placed. Each entry begins with the footnote label in plain text.

Nesting footnotes
Sometimes, an editor wishes to insert (nest) a footnote within a footnote. We will call the inserted footnote a "subnote". Cases may include:

{| class="wikitable" ! Type of nesting !! Example
 * - style="vertical-align:top;"
 * Reference within a note || Lorem ipsum dolor sit amet. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
 * Reference within a note || Lorem ipsum dolor sit amet. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

Things to consider

 * 1) Is your subnote really necessary? Especially if the subnote is a short one, would it be more straightforward for the reader - as well as for you - to keep it as part of the main note, perhaps in brackets?
 * 2) If the subnote is a reference, should it appear within the main numbered list of references, or in a separate list?
 * 3) If the subnote appears in a separate list, where should that list be placed among the different lists of footnotes?
 * 4) Should the subnote marker be - numeric, a roman numeral, alphabetic, or user-defined? Could it be confusing to use the same system in different footnote lists? Bear in mind also that roman numeral is identical with alphabetic.

What does not work
You cannot nest a footnote within a footnote that uses tags, even if the footnotes belong to different groups.

1. Using tags within tags
Neither the subnote nor the preceding part of the main footnote is displayed. An error message is displayed in red font. The following part of the main footnote (if any) appears in the article text, with an unwanted tag.

{| class="wikitable" ! Case 1: Error message and missing text, using nested tags
 * - style="vertical-align:top;"
 * Lorem ipsum dolor sit amet. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
 * Lorem ipsum dolor sit amet. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

2. Using a template within tags
The subnote is not displayed. An error message is displayed in red font.

{| class="wikitable" ! Case 2: Error message and missing text, using within tags
 * - style="vertical-align:top;"
 * Lorem ipsum dolor sit amet. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
 * Lorem ipsum dolor sit amet. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

3. Using a template within tags
The subnote is not displayed. An error message is displayed in red font. {| class="wikitable" ! Case 3: Error message and missing text, using within tags
 * - style="vertical-align:top;"
 * Lorem ipsum dolor sit amet. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
 * Lorem ipsum dolor sit amet. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

4. Using a template within tags
The subnote is not displayed. An error message is displayed in red font.

{| class="wikitable" ! Case 4: Error message and missing text, using within tags
 * - style="vertical-align:top;"
 * Lorem ipsum dolor sit amet. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
 * Lorem ipsum dolor sit amet. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

5. List-defined references
Due to a long-standing bug (see T22707), list-defined references do not work correctly when references are nested. {| class="wikitable" ! Case 5: Error message and missing reference using list-defined references
 * - style="vertical-align:top;"
 * Lorem ipsum dolor sit amet.
 * Lorem ipsum dolor sit amet.

What does work
To nest a footnote within another, one or both footnotes should be enclosed within the, or  templates. You may also use  –  this is just a less user-friendly equivalent of.

and use a very similar calling syntax (with  supporting all named parameters of ), but  also supports shorter parameter aliases and is generally more flexible and powerful:

is equivalent to (or ), and the corresponding  is equivalent to. Likewise, is equivalent to  (or ), and the corresponding  is equivalent to ; similarly for the other variants.

The following are some examples of correct use of these templates for nesting footnotes. Other permutations are possible and will yield similar results.

Reference within note
The reference appears within the main list of numbered references, and the reference marker is a simple numeral.

Using
{{markup|width=90%
 * Mary had a little lamb.{{refn|group=lower-alpha|Mary's possessions are on record. }} Its fleece was white as snow.

Using
{{markup|width=90%
 * Mary had a little lamb.{{efn|Mary's possessions are on record. }} Its fleece was white as snow.

Using
{{markup|width=90%
 * Mary{{r|r=Bloggs, 1981.}} had a little lamb.{{r|g=lower-alpha|r=Mary's possessions are on record.{{r|r=Book, 1949.}}}} Its fleece was white as snow.{{r|r=Scroggs, 1983.}}

(1) In same list
A subnote may appear in the same list as the footnote in which it is nested, although the subnote will appear above the main note referring to it.

Using
{{markup|width=90%
 * Mary had a little lamb.{{refn|group=lower-alpha|Mary's possessions are on record.{{refn|group=lower-alpha|They have been itemised by Book and others.}} }} Its fleece was white as snow.

Using
{{markup|width=90%
 * Mary{{r|r=Bloggs, 1981.}} had a little lamb.{{r|g=lower-alpha|r=Mary's possessions are on record.{{r|g=lower-alpha|r=They have been itemised by Book{{r|r=Book, 1949.}} and others.}} }} Its fleece was white as snow.{{r|r=Scroggs, 1983.}}

(2) In separate list: non-numeric marker
The subnote appears in a separate list, above or below the list in which the main note appears. The subnote is given a non-numeric marker - e.g. or.

If the main note is also indexed in the same way, to keep the lists separate the two sets of markers must be different, e.g. one set alphabetic with the other set roman numerals. The full range of possible markers can be seen here.

Using
Note the use of rather than for both main note and subnote, so that the reference doubly nested within the subnote will display correctly.

{{markup|width=90%
 * Mary had a little lamb.{{refn|group=lower-alpha|Mary's possessions are on record.{{refn|group=lower-roman|They have been itemised by Book and others.}} }} Its fleece was white as snow.

Using
Note the use of rather than for both main note and subnote, so that the reference doubly nested within the subnote will display correctly.

{{markup|width=90%
 * Mary had a little lamb.{{efn|Mary's possessions are on record.{{efn-lr|They have been itemised by Book and others.}} }} Its fleece was white as snow.

Using
Note the use of rather than for both main note and subnote, so that the reference doubly nested within the subnote will display correctly.

{{markup|width=90%
 * Mary{{r|r=Bloggs, 1981.}} had a little lamb.{{r|g=lower-alpha|r=Mary's possessions are on record.{{r|g=lower-roman|r=They have been itemised by Book{{r|r=Book, 1949.}} and others.}} }} Its fleece was white as snow.{{r|r=Scroggs, 1983.}}

(3) In separate list: numeric marker with character string
The subnote appears in a separate list, above or below the list in which the main note appears. The subnote is given a numeral preceded by a character string, e.g., or.

Using
If the main note is also indexed in the same way, to keep the lists separate the two character strings must be different. The main note and subnote both use.

{{markup|width=90%
 * Mary had a little lamb.{{refn|group=main note|Mary's possessions are on record.{{refn|group=subnote|They have been itemised by Book and others.}} }} Its fleece was white as snow.

Main notes
Subnotes

Main notes
Subnotes

Using
If the main note is also indexed in the same way, to keep the lists separate the two character strings must be different. The main note and subnote both use.

{{markup|width=90%
 * Mary{{r|r=Bloggs, 1981.}} had a little lamb.{{r|g=main note|r=Mary's possessions are on record.{{r|g=subnote|r=They have been itemised by Book{{r|r=Book, 1949.}} and others.}} }} Its fleece was white as snow.{{r|r=Scroggs, 1983.}}

Main notes
Subnotes

Main notes
Subnotes

Using
The subnote appears in a separate list, below the main References list. The subnote uses with a predefined or user-defined group. Be aware that because nesting fails within tags, the reference bearing the subnote also has to use (without a group), not the more usual.

{{markup|width=90%
 * Mary had a little lamb.{{refn|Book, 1949.{{refn|group=lower-alpha|The relevant chapter does not appear in the paperback edition of 1955.}} }} Its fleece was white as snow.

Using
The subnote appears in a separate list, below the main References list. The subnote uses with a predefined or user-defined group. Be aware that because nesting fails within tags, the reference bearing the subnote also has to use (without a group), not the more usual.

{{markup|width=90%
 * Mary{{r|r=Bloggs, 1981.}} had a little lamb.{{r|r=Book, 1949.{{r|g=lower-alpha|r=The relevant chapter does not appear in the paperback edition of 1955.}} }} Its fleece was white as snow.{{r|r=Scroggs, 1983.}}

Using
{{markup|width=90%
 * Mary had a little lamb.{{refn|Book, 1949.{{refn|group=Note|The relevant chapter does not appear in the paperback edition of 1955.}} }} Its fleece was white as snow.

Using
{{markup|width=90%
 * Mary{{r|r=Bloggs, 1981.}} had a little lamb.{{r|r=Book, 1949.{{r|g=Note|r=The relevant chapter does not appear in the paperback edition of 1955.}} }} Its fleece was white as snow.{{r|r=Scroggs, 1983.}}