Help:List-defined references

From Wikipedia, the free encyclopedia

List-defined references (LDR) are a type of reference footnote used in some Wikipedia articles. In the source code of a Wikipedia page, the contents of most footnotes are written where the citation number appears in the article. In contrast, list-defined references are written where the list of references appears near the bottom of an article. Where the footnotes are defined (either in the article's body text or references list) has no effect on how the footnotes appear in the rendered article; it only affects how the source code is written.

Some editors feel this makes referencing and generally editing articles easier because it makes the main body wikitext less cluttered. It does create the possibility of references in the end list that are unused in the article text. LDR makes viewing and editing references more difficult for users of the VisualEditor. You may wish to consider this before implementing it. LDR was implemented in September 2009.

This page is a continuation from a section of Help:Footnotes. This guide assumes you are familiar with the tools explained there, such as the features of <ref>...</ref> tags, and the <ref name="REFNAME" /> parameter.

Overview

LDR uses named references where each individual reference has a unique name and is defined within the reference list markup:

<references>
  <ref name="name1">reference</ref>
  <ref name="name2">reference2</ref>
</references>

Alternatively, references can be defined using the 'referencing' wrapper template {{r}} (for brevity the parameter names |name= and |ref= can be abbreviated to |n= and |r=):

<references>
  {{r|name="name1"|ref=reference}}
  {{r|name="name2"|ref=reference2}}
</references>

Each reference is invoked in the body of the text using <ref name="name1" /> or {{r|name}}.

Names for footnotes and groups must follow these rules:

  • Names are case-sensitive. Please do not use raNdOM capitalization.
  • Names must not be purely numeric; the software will accept something like ":31337" (which is punctuation plus a number), but it will ignore "31337" (purely numeric).
  • Names should have semantic value, so that they can be more easily distinguished from each other by human editors who are looking at the wikitext. This means that ref names like "Nguyen 2010" are preferred to names like ":31337".
  • Names must be unique. You may not use the same name to define different groups or footnotes. Try to avoid picking a name that someone else is likely to choose for a new citation, such as ":0" or "NYT".
  • Please consider keeping reference names short, simple, and restricted to the standard English alphabet and numerals. If spaces are used, the following technical restrictions become relevant:
    • Quotation marks are preferred but optional if the only characters used are letters A–Z, a–z, digits 0–9, and the symbols !$%&()*,-.:;<@[]^_`{|}~. That is, all printable ASCII characters except #"'/=>?\ and space.
    • Inclusion of any other characters, including spaces, requires that the reference name be enclosed in quotes; for example, name="John Smith". But quote-enclosed reference names may not include a less-than sign (<) or a double straight quote symbol ("), which may, however, be included by escaping as &lt; and &quot; respectively.
    • The quote marks must be the standard, straight, double quotation marks ("); curly or other quotes will be parsed as part of the reference name.
  • You may optionally provide reference names even when the reference name is not required. This makes later re-use of the sourced reference easier.

Guidelines

  • All list-defined references must be named. Any name complying with the technical limitations above may be used; however, they should be consistent so that they can be edited by other users. A well-used practice is author-date, author-title or publication-date.
  • Additionally, any unused references will generate an error. All list-defined references must be used in the body and vice versa, all <ref name="ABC">...</ref> tags must have defining information.
  • List-defined references and references defined in the body of the article may be mixed on a page—this is not a technical limitation of the template. However, this may be confusing to ongoing editors, and should be normalized to a single style, per WP:CITEVAR.
  • Reference lists may be ordered in any manner (e.g. alphabetical by reference name), but the generated list will be in the order in which the references are invoked.

Examples

Usage notes

Errors

Converting

VisualEditor

See also

References

Related Articles

Wikiwand AI