Help:Footnotes

From Wikipedia

This page explains how to create the Footnotes section for Wikipedia articles. In this context, the word "Footnotes" refers to the Wikipedia-specific manner of documenting an article's sources and providing tangential information, and should not be confused with the general concept of footnotes. This how-to does not cover the formatting of citations within the Footnotes section, which is reviewed in Citing sources.

Footnotes are used most commonly to provide:

The use of Footnotes is only one of several options for providing source information in the article. Other systems of inline citation, including Shortened footnotes and Template:Paren, may be used at the editor's discretion in accordance with the guideline on Variation in citation methods.

Only certain types of material on the English Wikipedia are required to have an inline citation. There is no requirement to provide a citation for every sentence, because multiple sentences may be supported by the same footnote. For advice on which material should be cited, see the guidelines on When you must use inline citations, the Good article criteria and When to cite. For advice on how to organize and format bibliographic citations, see the guideline on Citing sources and examples of Citation templates.

Footnotes are created using the Cite.php software extension. This extension adds the HTML-like elements <ref>...</ref>, <references /> and <references>...</references>. The elements are also used in a number of templates; for example, it is becoming more common to use {{reflist}} rather than <references /> as it can style the reference list.

Overview[edit]

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: [1] [a] [Note 1]. This footnote label is linked to the full footnote. Clicking on the footnote marker jumps the page down to the footnote and highlights the citation.
  • A Footnote displays the full citation for the source. Together the footnotes are displayed in an ordered list wherever the reference list markup {{reflist}} is placed. Each entry begins with the footnote label in plain text. The entire reference list is formatted in a slightly smaller font.
Each successive footnote label is automatically incremented. Thus the first footnote marker would be [1], the second would be [2] and so on. Custom labels are also incremented: [a][b][c], [Note 1] [Note 2] [Note 3].
For a single use footnote, the label is followed by a caret (^) that is a backlink to the matching footnote marker. For example:
1. ^ Citation
If a named footnote is used in the text multiple times, then the footnote has multiple backlinks shown as letters:
2. ^ a b c Citation
Clicking on the backlink or pressing backspace returns to the footnote marker.

Footnotes in action[edit]

This is a footnote marker.[1]

  1. This is a footnote that contains a citation or note.

Footnotes: the basics[edit]

To create the footnote marker, determine the point in the page content where the marker is desired and enter the markup with the citation or note inside the <ref>...</ref> tags. For example:

Markup Renders as
This is page content.<ref>LibreOffice For Starters, First Edition, Flexible Minds, Manchester, 2002, p. 18</ref>
{{reflist}}
This is page content.[1]
  1. LibreOffice For Starters, First Edition, Flexible Minds, Manchester, 2002, p. 18
The {{reflist}} template will be explained in the next section.

The content inside the <ref>...</ref> will show in the reference list. The ref tags can be added anywhere a citation or note is needed. There must be content inside the tags, else an error will show.

The content of the ref tags can be formatted using most wikimarkup or HTML markup, although techniques such as the pipe trick and template substitution, will not work in footnotes. For example:

Markup Renders as
This is page content.<ref>''LibreOffice For Starters'', First Edition, Flexible Minds, Manchester, 2002, p. 18</ref>
{{reflist}}
This is page content.[1]
  1. LibreOffice For Starters, First Edition, Flexible Minds, Manchester, 2002, p. 18

The ref tag content may also contain an internal or external link:

Markup Renders as
This is page content.<ref>''[http://www.example.org LibreOffice For Starters]'', First Edition, Flexible Minds, Manchester, 2002, p. 18</ref>
{{reflist}}
This is page content.[1]
  1. LibreOffice For Starters, First Edition, Flexible Minds, Manchester, 2002, p. 18

Template:MediaWiki URL rules

Reference lists: the basics[edit]

Once any number of footnotes have been inserted into the content, the reference list must be generated. For the basic reference list, add {{reflist}} wherever the list is desired. Once the page is saved and viewed, the footnotes will be automatically generated and numbered and the reference list will be generated. The main reference list is placed in a separate section, usually titled "References", "Notes" or the like.

Markup Renders as
This is page content.<ref>''LibreOffice For Starters'', First Edition, Flexible Minds, Manchester, 2002, p. 18</ref>

==References==
{{reflist}}
This is page content.[1]
References
  1. LibreOffice For Starters, First Edition, Flexible Minds, Manchester, 2002, p. 18
When editing, <references /> may be seen instead of {{reflist}}. This is valid, but <references /> does not offer the advanced features of {{reflist}}.

Footnotes: using a source more than once[edit]

You can cite the same source more than once on a page by using named footnotes. The syntax to define a named footnote is:

<ref name=name>content</ref>

To invoke the named footnote:

<ref name=name />

Names for footnotes and groups must follow these rules:

  • Names are case-sensitive
  • Names may not be purely numeric
  • Names must be unique—you cannot use the same name to define different groups or footnotes
  • Quotes are optional if the only characters used are letters A–Z, a–z, digits 0–9, and the symbols !$%&()*,-.:;<@[]^_`{|}~
  • The quote marks must be the standard keyboard marks ("); curly or other quotes will be parsed as part of the reference name.
  • Inclusion of any other characters, including spaces, requires that the name be enclosed in double straight quotes (")
  • If a name is quoted when defined, it must also be quoted for additional invocations (i.e. name="something" is not the same as name=something).
  • Quote-enclosed names may not include a less-than sign (<) or a double straight quote symbol (")
  • Please consider keeping names simple and restricted to the standard English alphabet and numerals.
  • (You may optionally provide names even when the name is not required.)
Markup Renders as
This is page content.<ref name=manchester2002>''LibreOffice for Starters'', First Edition, Flexible Minds, Manchester, 2002, p. 18</ref> This is more content.<ref name=manchester2002 />
{{reflist}}
This is page content.[1] This is more content.[1]
  1. 1.0 1.1 LibreOffice for Starters, First Edition, Flexible Minds, Manchester, 2002, p. 18

The actual name used can be almost anything, but it is recommended that it have a connection to the citation or note. A major practice is to use the author-year or publisher-year for the reference name. The name is visible to the reader, as it is built into the URL associated with the alphabetic labels at the start of each footnote.

Note that the footnote labels are incremented in the order they are used, and that they use the same label when reused, thus the labels can seem out of order:

Markup Renders as
This is page content.<ref name=manchester2002>''LibreOffice for Starters'', First Edition, Flexible Minds, Manchester, 2002, p. 18</ref> This is more content.<ref name=lexington2004>''OpenOffice for Experts'', Lexington, 2004, p. 18</ref> And even more content.<ref name=manchester2002 /> And again.<ref name=lexington2004 />
{{reflist}}
This is page content.[1] This is more content.[2] And even more content.[1] And again.[2]
  1. 1.0 1.1 LibreOffice for Starters, First Edition, Flexible Minds, Manchester, 2002, p. 18
  2. 2.0 2.1 OpenOffice for Experts, Lexington, 2004, p. 18

When using both names and groups, the syntax is:

<ref name=name group=groupname>Content</ref>

Care should be taken when deleting references to avoid creating a cite error. See Avoiding common mistakes

Reference lists: columns[edit]

When using {{reflist}}, the list can be split into columns.

{{reflist|xxem}} where xx is the column width in em.

By setting the width in em, the number of columns will automatically be adjusted to the width of the display.

For example:

30em wide columns
Markup Renders as
Lorem ipsum.<ref>Source name.</ref>
Lorem ipsum dolor sit amet.<ref>Source name.</ref>

==References==
{{reflist|20em}}
Lorem ipsum.[1]

Lorem ipsum dolor sit amet.[2]

References
  1. Source name.
  2. Source name.

There is no hard rule on the column width to use, but some major practices include:

List-defined references[edit]

Some or all of the footnotes can also be defined within the reference section/list, and invoked in the page content. This keeps those citations in one central location and avoids cluttering the text (and any infobox). This is purely a source code change - the actual display of the citation in the text to a reader is unaffected. For a more detailed evaluation of this method, see WP:LDRHOW. The syntax is:

{{reflist|refs=
<ref name=name1>Content</ref>
<ref name=name2>Content</ref>
<ref name=name...n>Content</ref>
}}

or, alternatively,

<references>
<ref name=name1>Content</ref>
<ref name=name2>Content</ref>
<ref name=name...n>Content</ref>
</references>

If you are not using any other features in the {{reflist}} template, then the second format may be slightly faster. If you are working on a wiki that does not have the {{reflist}} template, then the second format is your only option.

The footnote markers are included as usual for a named footnote. For example:

Markup Renders as
The quick brown fox jumps over the lazy dog.<ref name=LazyDog />
Amazingly few discotheques provide jukeboxes.<ref name=Jukeboxes />
How razorback-jumping frogs can level six piqued gymnasts.<ref name=JumpingFrogs />

==References==
{{reflist|
refs=
<ref name=LazyDog>This is the lazy dog reference.</ref>
<ref name=Jukeboxes>This is the jukeboxes reference.</ref>
<ref name=JumpingFrogs>This is the jumping frogs reference.</ref>
}}
The quick brown fox jumps over the lazy dog.[1]

Amazingly few discotheques provide jukeboxes.[2] How razorback-jumping frogs can level six piqued gymnasts.[3]

References
  1. This is the lazy dog reference.
  2. This is the jukeboxes reference.
  3. This is the jumping frogs reference.

The references will appear numbered in the order that they are referred to in the content, regardless of how they are ordered within the reference list, or if combined with inline ref tags within the body. All references which are defined in the reference list must be used, or else an error message will be shown.

Footnotes: embedding references[edit]

Explanatory notes may need to be referenced. Due to limitations in the Cite.php software, reference tags cannot be nested; that is, a set of <ref>...</ref> tags cannot be placed inside another pair of <ref>...</ref> tags. Attempting to do so will result in a cite error.

The template {{refn}} may be used to nest references. The markup is:

{{refn|name=name|group=group|content}} where name and group are optional. The content may include <ref> tags.

The other templates listed in Predefined groups are variants of {{refn}} that include a styled group and have a matching styled reference list template.

Example:

Markup Renders as
The quick brown fox jumps over the lazy dog.{{refn|group=nb|A footnote.<ref>A reference for the footnote.</ref>}}

==Notes==
{{reflist|group=nb}}

==References==
{{reflist}}
The quick brown fox jumps over the lazy dog.[nb 1]
Notes
  1. A footnote.[1]
References
  1. A reference for the footnote.

The use of the magic word #tag:ref is valid, but the sequence of parameters is invariant and nonintuitive. {{refn}} and its variants use this markup internally.

{{#tag:ref|refcontent|name=name|group=groupname}}

Footnotes: groups[edit]

Sometimes it is useful to group the footnotes into separate lists, for example to separate explanatory notes from references, or to list references for tables, image captions, infoboxes and navboxes. The sequence of footnote labels is independent in each group. The syntax to define a footnote with a group is:

<ref group=groupname>Content</ref>

The syntax for the reference list with a group is:

{{reflist|group=groupname}}
The group name must not be enclosed in quotes, which means that it cannot contain spaces or other symbols which would require quotes to be used.

Example:

Markup Renders as
This part of the text requires clarification,<ref group=note>Listed separately from the citation</ref> whereas the entire text is cited.<ref>Citation.</ref> And this needs even more clarification.<ref group=note>Another note</ref>

==Notes==
{{reflist|group=note}}

==References==
{{reflist}}
This part of the text requires clarification,[note 1] whereas the entire text is cited.[1] And this needs even more clarification.[note 2]
Notes
  1. Listed separately from the citation
  2. Another note
References
  1. Citation.
Note that the footnote labels in the reference list show only the numbers and not the group name.

When using both names and groups, the syntax is:

<ref name=name group=groupname>Content</ref>

For the repeated note:

<ref name=name group=groupname />

Footnotes: predefined groups[edit]

There are several predefined groups that can have a styled reference list such that the footnote labels match between the footnote marker and the footnote in the reference list. These predefined groups and reference lists have templates that make the markup simpler and also allow a standard reference to be inserted, so that an explanatory note can have a reference.

Template:Footnote labels

In these examples, the footnote labels match between the footnote marker and the reference list:

Markup Renders as
Lorem ipsum dolor sit amet.{{efn|Footnote 1}} Consectetur adipisicing elit.{{efn|Footnote 2}} Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.{{efn|Footnote3}}

{{notelist}}
Lorem ipsum dolor sit amet.[lower-alpha 1] Consectetur adipisicing elit.[lower-alpha 2] Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.[lower-alpha 3]
  1. Footnote 1
  2. Footnote 2
  3. Footnote3
Markup Renders as
Lorem ipsum dolor sit amet.{{efn-lr|Footnote 1}} Consectetur adipisicing elit.{{efn-lr|Footnote 2}} Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.{{efn-lr|Footnote3}}

{{notelist-lr}}
Lorem ipsum dolor sit amet.Template:Efn-lr Consectetur adipisicing elit.Template:Efn-lr Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.Template:Efn-lr

Issues

  • Backlink labels are always styled as lower-alpha. This can be confusing when {{efn}} is used.
  • The entries in the reference list will show the default decimal styling if:
    • The value for |group= does not exactly match one of the predefined values.
    • The value for |group= is enclosed by quotes.
    • {{reflist}} is indented with the ​:​ markup.
    • <references /> is used instead of {{reflist}}
  • The entries in the reference list will have no styling if:
    • A reference is included in {{navbox}} or one of the variants and the style is set to bodyclass=hlist; to resolve this, replace the style with listclass=hlist.

Reference lists: multiple use[edit]

Until 2014 multiple uses of {{reflist}} on the same page required use of a |close= parameter; that bug has been fixed and the|close= parameter may be removed.

Reference lists: automatically generated[edit]

A page with <ref> tags but no reference list markup used to show an error, except on talk and user pages. With the deployment of MediaWiki 1.24wmf12 on July 10, 2014 the error no longer shows; instead an automatically generated reference list (AGRL) is displayed at the bottom of the page.

It is recommended that the AGRL not be relied on. Proper reference list markup should always be included. Talk pages can use {{reflist-talk}}.

Footnotes: page numbers[edit]

Suppose you would like to cite one book, but different facts appear on different pages. You would like to cite the book again and again, but point each fact to the proper page. Suppose one fact is on page 8, a different fact on page 12, a third fact on page 18, a fourth fact on page 241. You could put a line in the "pages" parameter saying "see pages 8, 12, 18, 241" but a fact-checker might have to check all of them before figuring out the right one. Or, you could duplicate the entire citation for the book in each instance, but that would be redundant. One common approach is to use shortened citations, which requires the use of a References section following the footnotes section. Another approach is to attach a {{rp|8}} right after the footnote marker and replace the "8" with the appropriate page number.

For example:

Markup Renders as
Schudson said the Constitution shaped citizenship in fundamental ways.<ref name="Schudson">{{Cite book
 | last = Schudson
 | first = Michael
 | title = The Good Citizen: A Brief History of American Civic Life
 | publisher = Simon & Schuster
 | date = 1998
 | url = http://books.google.com/books?id=aawMAQAAMAAJ
 | isbn =0-684-82729-8 }}</ref>{{rp|8}} But elections in early American politics did not generate much interest<ref name="Schudson"/>{{rp|12}} while "open discussion of differences" was generally avoided.<ref name="Schudson"/>{{rp|18}} Citizenship later shifted to a polity of essentially "self-absorbed citizens", according to his analysis.<ref name="Schudson"/>{{rp|241}}
Schudson said the Constitution shaped citizenship in fundamental ways.[1]:8 But elections in early American politics did not generate much interest[1]:12 while "open discussion of differences" was generally avoided.[1]:18 Citizenship later shifted to a polity of essentially "self-absorbed citizens", according to his analysis.[1]:241
References
  1. 1.0 1.1 1.2 1.3 Schudson, Michael (1998). The Good Citizen: A Brief History of American Civic Life. Simon & Schuster. ISBN 0-684-82729-8.

When using list-defined references, {{r}} can be used for the same style of in-text page references.

Previewing edits[edit]

When you edit a single section of a page, the footnotes list will not be visible when you preview your edits. Thus you ordinarily cannot see how your footnotes will later appear when you save your edits.

You can insert a {{reflistp}} into the edited section temporarily and remove it before saving; you will still not be able to see named references which were defined in other sections.

Tools that can be used are the User:Anomie/ajaxpreview.js script or the wikEd gadget.

RefToolbar[edit]

Using the citation toolbar to name the first reference.
Using the citation toolbar to insert additional references to the first source.

You can use the citation toolbar to name references. When you first create a reference, you can enter a value in the "Ref name" box. When you want to reuse this reference, click the "Named references" button on the citation toolbar and choose which reference you would like to insert.

See also[edit]

Template:Help navigation