Template:Sfn

A few articles create a custom ID using CITEREF, either in place of the Harvard citation template (e.g. [[#CITEREFSmith2006|(2006)]]) or as a value for |ref= in the citation template.A custom ID 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.
  • If CITEREF is used, then spaces in the |ref= field must be replaced with underscores
    • 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.

Examples:

Where cite_name is a name such as the publisher.

To avoid the sometimes difficult to remember syntax for links to CITEREF anchors, {{citeref}} can be used to create internal wikilinks with either small superscript-style labels (like this[n]) or plain free-text labels to such anchors. It can be used inside of other citations.

Note that the CITEREF prefix is necessary for the reference tooltips gadget (MediaWiki:Gadget-ReferenceTooltips.js) to detect that a link goes to a citation.

{{sfn}}'s ref name

Template {{sfn}} creates a named footnote, so that identical footnotes are combined automatically. The footnote name begins with FOOTNOTE followed by a concatenation of the arguments to {{sfn}}. E.g.: this template call {{sfn|Smith|2006|p=26}} should have exactly the same functionality as <ref name="FOOTNOTESmith200626">{{Harvnb}}</ref> which, in turn, has the same functionality as <ref name="FOOTNOTESmith200626">[[#CITEREFSmith2006|Smith (2006)]], p. 26</ref>.

The ref name becomes more complicated when the page (p) parameter includes a URL, e.g. {{sfn|Joyce|1903|p=213}}, which, once defined, can be called by <ref name="FOOTNOTEJoyce1903[httpsarchiveorgdetailsaconcisehistory00joycgoogpagen226 213]" />. The "p=" and the characters |,:,.,/,?,=; are therefore stripped out of the URL.

The call to {{harvnb}} has been subst'ed for quicker load times.

Tracking categories

Category:Pages using sfn with unknown parameters (0)

TemplateData

This is the TemplateData for this template used by TemplateWizard, VisualEditor and other tools. See a monthly parameter usage report for Template:Sfn in articles based on its TemplateData.

TemplateData for Sfn

This template creates a short author–date citation in a footnote. It allows you to link inline citation using Harvard citations (a form of short citations using parenthetical references) to their corresponding full bibliographic citations.

Template parametersEdit template data

This template prefers inline formatting of parameters.

ParameterDescriptionTypeStatus
Author last name1

Last name of first (or only) author

Example
Smith
Linerequired
Second author or year2

Year for citations with one author, or last name of second author for citations with two or more authors

Example
2006
Stringrequired
Third author or year3

Year for citations with two authors, or last name of third author for citations with three or more authors

Stringoptional
Fourth author or year4

Year for citations with three authors, or last name of fourth author for citations with four authors

Stringoptional
Year (if four authors included)5

Year for citations with four authors

Numberoptional
Pagep page

Page number in source, if the relevant information is on one page (use the «pp» parameter for multiple pages, and the «loc» parameter for other location data)

Example
42
Linesuggested
Pagespp pages

Page numbers in source

Example
23–24
Lineoptional
Postscriptps

Trailing text to replace period

Example
none
Stringoptional
Locationloc

Location in source

Example
section 7
Lineoptional

See also

  • {{p.}} – citing a page number
  • {{r}} – define and reference page(s)
  • {{rp}} – reference page(s)
  • {{Sfnm}} – for multiple sources
  • {{SfnRef}} – for the ref anchor
  • {{efn}} – for explanatory foot notes
🔥 Top keywords: Main PageSpecial:SearchIndian Premier LeagueWikipedia:Featured picturesPornhubUEFA Champions League2024 Indian Premier LeagueFallout (American TV series)Jontay PorterXXXTentacionAmar Singh ChamkilaFallout (series)Cloud seedingReal Madrid CFCleopatraRama NavamiRichard GaddDeaths in 2024Civil War (film)Shōgun (2024 miniseries)2024 Indian general electionJennifer PanO. J. SimpsonElla PurnellBaby ReindeerCaitlin ClarkLaverne CoxXXX (film series)Facebook2023–24 UEFA Champions LeagueYouTubeCandidates Tournament 2024InstagramList of European Cup and UEFA Champions League finalsJude BellinghamMichael Porter Jr.Andriy LuninCarlo AncelottiBade Miyan Chote Miyan (2024 film)