List-defined references (LDR) are references that are defined in the reference list markup, as opposed to being defined in the body of the article. LDR was implemented in September 2009 as a way to make referencing articles easier and with less clutter.
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.
LDR uses named references where each individual reference has a unique name and is defined within the reference list markup:
The LDR method removes any citation details or notes that could disrupt the edit window while editing the body of the text, which is especially useful if they are vertical or otherwise span multiple lines. Additionally, this centralised reference list section can be opened by itself if any of the citation entries need modification, which can be especially helpful if attempting to modify a reference that is used multiple times—avoiding any need to search the entire source for it.
A drawback of the approach is that these references can be harder to insert into the source, because they are separated from the text. The editor must either open the entire document to see the source for both the text and the reference list, or alternatively use a two-step procedure, first entering the identifier
<ref name="name" /> in the main text and then opening the reference listing section to enter the source or footnote as
<ref name="name">content</ref>. Another overhead of this approach is that the list at the end of the article must be organised so that they can be found easily by an editor—most likely arranged alphabetically in the edit window by refname as this is most likely to retain source integrity and usefulness, even if the sections of the text are changed.
While it is often tidier to remove all citations from the source text, an acceptable compromise (especially for small articles) could be to only use LDR for citations used multiple times. This is because they already use the refname code so that they can be in multiple places—a simple move of the reference's source code from its first appearance to the reflist is a minor change. Additionally, these citations are more likely to need reviewing or modification, because they are more important to the article and contain more details, and making them easier to find and modify can be very helpful. Finally, this also maintains source integrity if the first instance of the reference changes, as noted above.
Additionally, a user-made script User:PleaseStand/References segregator allows you to automatically separate citations from the edit window, and temporarily collect them in a separated "inline citation" window. In this format the citations can be manually inserted into the reference list. This can have some of the benefits of permanent LDRs where their use is not practical or is against consensus. However, please note that before saving the page, any contents of this window will be replaced into the main text source at the first matching
<ref name="name" /> tag unless it is manually emptied. As outlined on its page and below, it has an automatic conversion script that can process existing citations into a reference list by itself, but it is uncertain whether it can do this migration while editing.
Sometimes referencing can produce errors that show up in red text. Please refer to Help:Cite errors to help diagnose and solve these errors. Alternatively, check your code against the example above or the reflist documentation at Template:Reflist § List-defined references. Notably, errors at either the named ref tag or the reflist code can cause issues, as an entries must be defined and used in both for a LDR to work.
Reference styles may be converted from or to list-defined references, following the same rules for other major changes to citation style, at WP:CITEVAR. User:PleaseStand/segregate-refs.js has an option to assist conversion.