Loading AI tools
From Wikipedia, the free encyclopedia
Template harvtxt creates a short author–date citation with a one-directional link to the first matching citation template on the same page.
This is a documentation subpage for Template:Harvard citation text. It may contain usage information, categories and other content that is not part of the original template page. |
This template uses Lua: |
This template is used on approximately 7,000 pages and changes may be widely noticed. Test changes in the template's /sandbox or /testcases subpages, or in your own user subpage. Consider discussing changes on the talk page before implementing them. |
{{harvtxt}} is designed to be used to create shortened footnotes, a citation style which pairs a short, author-date citation in a footnote with a complete citation in the references section at the end of the article (see example below). This citation style is used to reduce clutter in the edit window and to combine multiple citations to the same source.
Common problems and known workarounds are given in the section possible issues section below.
There are several other templates that are designed for use with shortened footnotes. They differ slightly in the way they format the author-date citation and how much of their functionality is automated. A full list of these related templates is below.
Note that the use (or even non-use) of these templates is an element of citation "style", and adding or removing them in articles with an established style should be consistent with that style. See WP:CITEVAR.
Also note that inline use of these templates, i.e. use of {{harv}} without <ref>...</ref>
tags around it, was deprecated in September 2020. See also WP:PAREN.
The first four author surnames (or all authors if fewer than four; use the values from |lastN=
or |authorN=
) are required, followed by the year of publication (from |year=
or |date=
). Authors past the fourth must be omitted or an error will result.
The possible issues section below describes workarounds for various common problems, such as large number of authors, no author name, multiple works in the same year, multiple authors with same last name and others.
Markup | Renders as |
---|---|
Article text.<ref>{{harvtxt|Smith|2020|p=25}}</ref> |
Article text.[1]
|
Article text.<ref>{{harvtxt|Smith|Jones|2020|p=25}}</ref> |
Article text.[1]
|
Article text.<ref>{{harvtxt|Smith|Jones|Brown|2020|p=25}}</ref> |
Article text.[1]
|
Article text.<ref>{{harvtxt|Smith|Jones|Brown|Black|2020|p=25}}</ref> |
Article text.[1]
|
The optional parameters |p=
, |pp=
and |loc=
can be used to indicate the location in the source, such as page numbers. For single pages, use |p=
; for multiple pages (such as ranges), use |pp=
. Use of |p=
for multiple pages or |pp=
for single pages can cause cite errors. |loc=
can be used to specify a location in the source in another way, such as section numbers or chapters. The parameters |page=
and |pages=
exist as aliases for |p=
and |pp=
, respectively.
Markup | Renders as |
---|---|
Article text.<ref>{{harvtxt|Smith|2020|p=25}}</ref> |
Article text.[1]
|
Article text.<ref>{{harvtxt|Smith|2020|pp=25–26}}</ref> |
Article text.[1]
|
Article text.<ref>{{harvtxt|Smith|2020|loc=chpt. 3}}</ref> |
Article text.[1]
|
Article text.<ref>{{harvtxt|Smith|2020|loc=section 7}}</ref> |
Article text.[1]
|
The optional parameter |postscript=
or |ps=
can be used to change the text which appears at the end of the note in the reference list. (See § Adding additional comments or quotes and § No closing period, below.) The postscript is only effective the first time {{sfn}}
is used for a particular author, year and location.
Not available in {{sfn}}
and similar templates.
The optional parameter |ref=
is used to create an unusually named link from the short citation to the full citation. This parameter is usually not necessary, and it is more common to use {{sfnRef}}
or {{harvid}}
in the reference section. If you specify |ref=none
, no hyperlink is created. However, if one does not want the link, it is always possible to simply use plain text instead of the template. The parameter |Ref=
is an alias for |ref=
.
The templates {{harvnb}}
or {{harvtxt}}
can be used to add quotes or additional comments into the footnote. Examples are below.
Markup | Renders as |
---|---|
Some information.<ref>{{harvnb|Smith|2011|p=2}}: "A quote verifying the information."</ref> == Notes == {{reflist}} |
|
"A quote in a secondary source."<ref>{{harvtxt|Smith|2011|p=2}} quoted in {{harvtxt|Jones|2010|p=343}}</ref> == Notes == {{reflist}} |
|
Nota bene: In the past, the use of |ps=
has been advised to hold this additional information, but it is not suitable for this purpose. Two or more {{sfn}}
templates with the same authors, same year, and same page, but different |ps=
will result in a Cite error: The named reference ... was defined multiple times with different content message. This message happens because the reference names that {{sfn}}
creates will be the same, but the content between the <ref name="FOOTNOTE...">
tag and the </ref>
tag will be different. A workaround is to convert one or some of the {{sfn}}
templates to {{harvnb}}
wrapped in <ref>...</ref>
tags.
{{sfn}}
or {{harvnb}}
Template {{harvnb}}
inside a <ref>
span can be used to create a shortened footnote that is linked to the full citation at the bottom of the article. Template {{sfn}}
(without the use of <ref>
) has the same effect, automatically adds a period (full stop) after the page number, and combines identical footnotes automatically.
Markup | Renders as |
---|---|
Article text.{{sfn|Smith|2007|p=25}} More article text.{{sfn|Smith|2007|p=25}} Still more article text.{{sfn|Smith|2007|p=26}} ==Notes== {{reflist}} ==References== * {{cite book | last = Smith | first = John | date = 2007 | title = Smith's Book }} |
Article text.[1] More article text.[1] Still more article text.[2] Notes
References
|
Article text.<ref name=Smith2008p25>{{harvnb|Smith|2008|p=25}}.</ref> More article text.<ref name=Smith2008p25/> Still more article text.<ref>{{harvnb|Smith|2008|p=26}}.</ref> ==Notes== {{reflist}} ==References== * {{cite book | last = Smith | first = John | date = 2008 | title = Smith's Book }} |
Article text.[1] More article text.[1] Still more article text.[2]
Notes
References
|
{{harvtxt}}
Template {{harvtxt}}
can be used to link an in-text attribution to the full citation at the bottom of the page.
Markup | Renders as |
---|---|
According to {{harvtxt|Smith|2009|p=25}} ... ==References== * {{citation | last = Smith | first = John | date = 2009 | title = Smith's Book }} |
|
{{harvnb}}
or {{sfnm}}
Template {{harvnb}}
can be used to bundle citations. {{sfnm}}
also produces bundled citations.
Markup | Renders as |
---|---|
Article text ({{harvnb|Smith|2010|p=25}}; {{harvnb|Jones|2010}}). |
Article text (Smith 2010, p. 25; Jones 2010). |
Article text.<ref>{{harvnb|Smith|2010|p=25}}; {{harvnb|Jones|2010}}</ref> |
|
Article text.{{sfnm|la1=Smith|y1=2010|p1=25|la2=Jones|y2=2010}} |
|
==References== * {{cite book |last = Smith |first = John ... Smith's book}} * {{cite book |last = Jones |first = Mary ... Jones' book}} |
References
|
Note that {{sfn}}
is inappropriate for bundled citations; use {{harvnb}}
or {{sfnm}}
.
{{harv}}
Template {{harv}}
creates a parenthetical reference with a link to the full citation. It should only be used within footnotes or on internal pages. Use of inline parenthetical referencing within the body text of articles has been deprecated by the Wikipedia community since 2022. This usage has not been deprecated within internal pages such as Wikipedia documentation, user pages, or wikiprojects, though there is rarely a practical use for it instead of just using normal citation footnotes.
Markup | Renders as |
---|---|
Article text.<ref>{{harv|Smith|2006|p=25}}</ref> ==Notes== {{reflist}} ==References== * {{cite book | last = Smith | first = John | title = Smith's book | date = 2006 }} |
|
{{harvid}}
or {{harvs}}
More exotic Harvard citations can be constructed using the {{harvs}}
template, such as multiple papers by the same author, using both the first and last names, links to articles about the author, and others. Any kind of unusual link can also be constructed using the idiom [[#{{harvid|
parameters}}|
link name]]
. ({{citeref}} is a wrapper for {{harvid}} making it easier to consistently create such internal links in small superscript[n] or plain-text label styles.)
Markup | Renders as |
---|---|
The theory was developed by {{harvs|txt|first=F. J.|last=Murray|author1-link=F. J. Murray|first2=J.|last2=von Neumann|author2-link=John von Neumann|year=1936|year2=1937|year3=1943}}. |
The theory was developed by F. J. Murray and J. von Neumann (1936, 1937, 1943). |
The theory was developed by [[F. J. Murray]] and [[John von Neumann|J. von Neumann]] ([[#{{harvid|Murray|von Neumann|1936}}|1936]],[[#{{harvid|Murray|von Neumann|1937}}|1937]],[[#{{harvid|Murray|von Neumann|1943}}|1943]]). |
The theory was developed by F. J. Murray and J. von Neumann (1936, 1937, 1943). |
== References == * {{citation | last1 = Murray | first1 = F. J. | date = 1936 | ...}} * {{citation | last1 = Murray | first1 = F. J. | date = 1937 | ...}} * {{citation | last1 = Murray | first1 = F. J. | date = 1943 | ...}} |
References
|
Some articles use this idiom [[#CITEREF
id | link name ]]
. See notes on implementation details below.
The most common citation templates are Citation Style 1 or Citation Style 2. By default, Module:Citation/CS1 creates an anchor <a name="CITEREF">
followed by the concatenation of the following parameters:
This covers the most common templates. Information about all of the templates is available at Wikipedia:Citation templates and reference anchors.
Use of the date parameter in place of the year parameter in citation templates is preferred.
Category:Pages using sfn with unknown parameters (0)
Seamless Wikipedia browsing. On steroids.
Every time you click a link to Wikipedia, Wiktionary or Wikiquote in your browser's search results, it will show the modern Wikiwand interface.
Wikiwand extension is a five stars, simple, with minimum permission required to keep your browsing private, safe and transparent.