Difference between revisions of "Template:Harvard citation documentation"

From blackwiki
Jump to navigation Jump to search
test>CharlesGillingham
(→‎Usage: Another typo! Jeez.)
test>CharlesGillingham
(More info for clarity; merging material from template sfn. More to do later.)
Line 20: Line 20:
  
 
==Usage==
 
==Usage==
: <tt><nowiki>{{</nowiki>harv</tt>'' or ''<tt>harvnb</tt>'', etc.'' | ''Last name of author(s)'' | ''Year''  | <tt>loc =</tt> ''Location in the text''<tt><nowiki>}}</nowiki></tt>
+
All of the templates {{tl|harv}}, {{tl|harvnb}}, {{tl|harvtxt}}, {{tl|harvcol}}, {{tl|harvcolnb}}, {{tl|harvcoltxt}} and {{tl|sfn}} have the same parameters and functionality.
  
Instead of using the optional {{para|loc}} parameter, you may also use one of the following parameters:
+
In the body of the article:
 +
: <code><nowiki>{{</nowiki> ''Template name'' | ''Last name of author(s)'' | ''Year''  | p= ''Page number''<nowiki>}}</nowiki></code>
 +
Instead of using the optional parameter {{para|p}}, you may also use either{{para|pp}} ("pages") or {{para|loc}} ("location")
  
*<tt>p =</tt> ''page''
+
In the references section (or in an earlier footnote):
*<tt>pp =</tt> ''pages''
+
: <code><nowiki>{{</nowiki>cite book | '''ref=harv''' | ... ''other appropriate parameters'' ... <nowiki>}}</nowiki></code>  
 +
and similarly for other citation templates.
  
; Usage notes
+
; Parameters
 
*The first parameter is the author's last name.
 
*The first parameter is the author's last name.
 
*Up to four authors can be given as parameters (see the examples). If there are more than 4 authors only the first 4 should be listed; listing more will cause odd things to happen.
 
*Up to four authors can be given as parameters (see the examples). If there are more than 4 authors only the first 4 should be listed; listing more will cause odd things to happen.
 
*The next parameter is the year of publication.
 
*The next parameter is the year of publication.
*The parameter {{para|loc}} is the location of the cited material within the reference. This parameter is optional.
+
*The parameter {{para|p}} is an optional page parameter; thus "<tt><nowiki>{{harv|Smith|2006| p=25}}</nowiki></tt>" yields "{{harv|Smith|2006|p=25}}".
*The parameter {{para|p}} is an optional page parameter; thus "<tt><nowiki>{{Harv|Smith|2006| p=25}}</nowiki></tt>" yields "{{Harv|Smith|2006|p=25}}".
+
*The parameter {{para|pp}} is an optional page range parameter; thus "<tt><nowiki>{{harv|Smith|2006| pp=25&amp;ndash;26}}</nowiki></tt>" yields "{{Harv|Smith|2006|pp=25–26}}".
*The parameter {{para|pp}} is an optional page range parameter; thus "<tt><nowiki>{{Harv|Smith|2006| pp=25&amp;ndash;26}}</nowiki></tt>" yields "{{Harv|Smith|2006|pp=25–26}}".
+
*The parameter {{para|loc}} is the location of the cited material within the reference. This parameter is optional; thus "<tt><nowiki>{{harv|Smith|2006| loc=Chapter 3}}</nowiki></tt>" yields "{{harv|Smith|2006|loc=Chapter 3}}".
 
*The parameter {{para|Ref}} is used to specify the reference value that links the short citation to the full citation. This parameter is optional and is usually not necessary. If you specify {{para|Ref|none}} no hyperlink is created. (See the [[#Examples|examples]].)
 
*The parameter {{para|Ref}} is used to specify the reference value that links the short citation to the full citation. This parameter is optional and is usually not necessary. If you specify {{para|Ref|none}} no hyperlink is created. (See the [[#Examples|examples]].)
*To avoid the brackets surrounding the citation, use {{tl2|Harvard citation no brackets}} or {{tl2|Harvnb}}.
+
 
*To use the author name(s) in the text, use {{tl2|Harvard citation text}} or {{tl2|Harvtxt}}.
+
; Variations
 +
*To avoid the brackets surrounding the citation, use {{tl2|Harvard citation no brackets}} or {{tl2|Harvnb}}. This is especially useful when there are several citations together (e.g. "<tt>(<nowiki>{{</nowiki>harvnb|Einstein|1915|p=844}}; <nowiki>{{</nowiki>harvnb|Misner|Thorne|Wheeler|1973|p=41<nowiki>}}</nowiki>)</tt>" yields "({{harvnb|Einstein|1915|p=844}}; {{harvnb|Misner|Thorne|Wheeler|1973|p=41}})"
 +
*To use the author name(s) in the text, use {{tl2|Harvard citation text}} or {{tl2|Harvtxt}} (e.g. "<tt>A similar argument was made by <nowiki>{{</nowiki>harvtxt|Rawls|1973<nowiki>}}</nowiki></tt>" yields "A similar argument was made by {{harvtxt|Rawls|1973}}... ")
 +
*To place a harvard citation in a footnote (i.e. a [[WP:CITESHORT|shortened footnote]], you may use {{tl2|sfn}} (a newer method) or <tt><nowiki><ref>{{harvnb| ... }}</ref></nowiki></tt> (a more common method).
 
*For more complicated Harvard citations with multiple links use {{tl2|Harvard citations}} or its abbreviation {{tl2|harvs}}.
 
*For more complicated Harvard citations with multiple links use {{tl2|Harvard citations}} or its abbreviation {{tl2|harvs}}.
*For authors who have published more than one work in the same year, the standard way to differentiate such works is to put a lowercase letter after the year. For example, "<tt><nowiki>{{harv|Smith|2007a| p=25}}</nowiki></tt>" yields "{{harv|Smith|2007a| p=25}}" and "<tt><nowiki>{{harv|Smith|2007b| p=37}}</nowiki></tt>" yields "{{harv|Smith|2007b| p=37}}"
+
 
 +
; Possible issues
 +
*For authors who have published more than one work in the same year, the standard way to differentiate such works is to put a lowercase letter after the year (e.g. place {{para|year|2006a}} and {{para|year|2006b}} in the citation templates and use <code><nowiki>{{sfn|Smith|2006a}}</nowiki></code> and <code><nowiki>{{sfn|Smith|2006b}}</nowiki></code>in the article body).
 
*A space before or after the author name or before the year ''is'' significant; they produce an underscore in the hyperlink. So, "<tt><nowiki>{{Harvnb|Smith| 2006| p=25}}</nowiki></tt>" yields "{{Harvnb|Smith| 2006| p=25}}" which links to #CITEREFSmith_2006.
 
*A space before or after the author name or before the year ''is'' significant; they produce an underscore in the hyperlink. So, "<tt><nowiki>{{Harvnb|Smith| 2006| p=25}}</nowiki></tt>" yields "{{Harvnb|Smith| 2006| p=25}}" which links to #CITEREFSmith_2006.
 
*When using [[:Category:Citation templates|citation templates]] such as <tt>{{tl|cite book}}</tt> for references, include the parameter <tt>|ref=harv</tt> in the citation template to add the target of the footnote link to each reference. This is not necessary for {{tlx|citation}}, but is normally necessary for the others.
 
*When using [[:Category:Citation templates|citation templates]] such as <tt>{{tl|cite book}}</tt> for references, include the parameter <tt>|ref=harv</tt> in the citation template to add the target of the footnote link to each reference. This is not necessary for {{tlx|citation}}, but is normally necessary for the others.
 +
*Either the {{para|year}} or {{para|date}} of a citation can be matched – the template logic can extract the year of from a full date. However if only the year is known the {{para|year}} field must be used  in the citation for the link to work correctly (i.e. {{para|date|2005}} may not work correctly).
  
 
Editors editing this template are requested to make parallel changes to the other versions.
 
Editors editing this template are requested to make parallel changes to the other versions.

Revision as of 00:21, 16 November 2010

Harvard citation templates

Templates that create Harvard citations in text:

Template that creates a Harvard citation in a footnote:

  • {{Sfn}} (shortened footnote template)

Templates that create a full citation for the References section of an article:

This page describes the first three; for the others see their documentation pages.

Usage

All of the templates {{harv}}, {{harvnb}}, {{harvtxt}}, {{harvcol}}, {{harvcolnb}}, {{harvcoltxt}} and {{sfn}} have the same parameters and functionality.

In the body of the article:

{{ Template name | Last name of author(s) | Year | p= Page number}}

Instead of using the optional parameter |p=, you may also use either|pp= ("pages") or |loc= ("location")

In the references section (or in an earlier footnote):

{{cite book | ref=harv | ... other appropriate parameters ... }}

and similarly for other citation templates.

Parameters
  • The first parameter is the author's last name.
  • Up to four authors can be given as parameters (see the examples). If there are more than 4 authors only the first 4 should be listed; listing more will cause odd things to happen.
  • The next parameter is the year of publication.
  • The parameter |p= is an optional page parameter; thus "{{harv|Smith|2006| p=25}}" yields "(Smith 2006, p. 25)".
  • The parameter |pp= is an optional page range parameter; thus "{{harv|Smith|2006| pp=25&ndash;26}}" yields "(Smith 2006, pp. 25–26)".
  • The parameter |loc= is the location of the cited material within the reference. This parameter is optional; thus "{{harv|Smith|2006| loc=Chapter 3}}" yields "(Smith 2006, Chapter 3)".
  • The parameter |Ref= is used to specify the reference value that links the short citation to the full citation. This parameter is optional and is usually not necessary. If you specify |Ref=none no hyperlink is created. (See the examples.)
Variations
  • To avoid the brackets surrounding the citation, use {{Harvard citation no brackets}} or {{Harvnb}}. This is especially useful when there are several citations together (e.g. "({{harvnb|Einstein|1915|p=844}}; {{harvnb|Misner|Thorne|Wheeler|1973|p=41}})" yields "(Einstein 1915, p. 844; Misner, Thorne & Wheeler 1973, p. 41)"
  • To use the author name(s) in the text, use {{Harvard citation text}} or {{Harvtxt}} (e.g. "A similar argument was made by {{harvtxt|Rawls|1973}}" yields "A similar argument was made by Rawls (1973)... ")
  • To place a harvard citation in a footnote (i.e. a shortened footnote, you may use {{sfn}} (a newer method) or <ref>{{harvnb| ... }}</ref> (a more common method).
  • For more complicated Harvard citations with multiple links use {{Harvard citations}} or its abbreviation {{harvs}}.
Possible issues
  • For authors who have published more than one work in the same year, the standard way to differentiate such works is to put a lowercase letter after the year (e.g. place |year=2006a and |year=2006b in the citation templates and use {{sfn|Smith|2006a}} and {{sfn|Smith|2006b}}in the article body).
  • A space before or after the author name or before the year is significant; they produce an underscore in the hyperlink. So, "{{Harvnb|Smith| 2006| p=25}}" yields "Smith 2006, p. 25" which links to #CITEREFSmith_2006.
  • When using citation templates such as {{cite book}} for references, include the parameter |ref=harv in the citation template to add the target of the footnote link to each reference. This is not necessary for {{citation}}, but is normally necessary for the others.
  • Either the |year= or |date= of a citation can be matched – the template logic can extract the year of from a full date. However if only the year is known the |year= field must be used in the citation for the link to work correctly (i.e. |date=2005 may not work correctly).

Editors editing this template are requested to make parallel changes to the other versions.

Examples

Markup Result
{{Harv |Smith|2006| loc=&sect;8.5}} (Smith 2006, §8.5)
{{Harv |Smith|2006| p=25}} (Smith 2006, p. 25)
{{Harv |Smith|2006| pp=25&ndash;26}} (Smith 2006, pp. 25–26)
{{Harv |Smith|2006| pp=25&ndash;26 | Ref=none}} (Smith 2006, pp. 25–26)
{{Harv |Smith|Jones|2006| p=25}} (Smith & Jones 2006, p. 25)
{{Harv |Smith|Jones|Brown|2006| p=25}} (Smith, Jones & Brown 2006, p. 25)
{{Harv |Smith|Jones|Brown|Black|2006| p=25}} (Smith et al. 2006, p. 25)
{{Harvnb |Smith|2006| p=25}} Smith 2006, p. 25
{{Harvtxt |Smith|2006| p=25}} Smith (2006, p. 25)

Recommended style

The recommended Harvard referencing style potentially uses all four templates. Each automatically generates a hypertext link based on the name(s) and date. Here is an example

Markup
Some works on gravitation are so massive they warp spacetime themselves {{Harv|Misner|Thorne|Wheeler|1973}}; yet {{Harvtxt|Einstein|1915}} presented essential equations with notable brevity. The essential ingredients are the curvature tensor and the stress-energy tensor ({{Harvnb|Einstein|1915|loc=p.&nbsp;844}}; {{Harvnb|Misner|Thorne|Wheeler|1973|loc=p.&nbsp;41}}).
Result
Some works on gravitation are so massive they warp spacetime themselves (Misner, Thorne & Wheeler 1973); yet Einstein (1915) presented essential equations with notable brevity. The two ingredients are the curvature tensor and the stress-energy tensor (Einstein 1915, p. 844; Misner, Thorne & Wheeler 1973, p. 41).

In short:

  1. For a single work with no author in the text (the most common case), use {{Harv}}.
  2. For a single work with the author named in the text, use {{Harvtxt}}.
  3. For multiple works at the same point, use explicit parentheses and {{Harvnb}} separated by semicolons.
  4. For anything more complicated use {{Harvs}}.

#CITEREF

More exotic Harvard citations can be constructed using the {{harvs}} template. If even this is not enough, then as a last resort one can use #CITEREF as in the following example:

[[Property (T)]] was introduced by [[David Kazhdan]] ([[Property T#CITEREFKazhdan1967|1967]]).

which produces

Property (T) was introduced by David Kazhdan (1967)

with a link to the author, and a link to a citation on a different page. #CITEREF should be followed by the last names of up to 4 authors and the year (with no spaces), and if the link is to a different page it should be preceded by the name of the page (with spaces allowed). The citation template marks the reference using #CITEREF; see the source of template:citation/core for details.

Use with citation templates

The {{Citation}}, {{Cite book}}, {{Cite journal}}, {{Cite web}} family of templates can be used to format the citations in the References section. Links from the Harvard citation to the full citation are provided using a #CITEREF link. The {{Harvard citation}} template creates a link #CITEREF followed by the concatenation of the author names and the year. {{Citation}} creates an anchor <a name="CITEREF"></a> followed by the concatenation of the following parameters:

  • last or last1 or surname or surname1 or author or author1 or authors,
  • last2 or surname2 or author2,
  • last3 or surname3 or author3,
  • last4 or surname4 or author4,
  • editor-last or editor-surname or editor1-last or editor1-surname or editor or editors,
  • editor2-last or editor2-surname,
  • editor3-last or editor3-surname,
  • editor4-last or editor4-surname,
  • year.

Please note that the above list does not include the coauthor parameter, which is ignored in generating the citation's CITEREF anchor. It is recommended that, when used with the harv family templates, citation templates always use the numbered last parameters instead of coauthor so that a more accurate CITEREF anchor may be generated. If coauthor is used, it will not be possible to generate a Harvard citation that displays the authors' names correctly and that generates a link to the correct CITEREF anchor.

{{Cite book}}, {{Cite journal}} and {{Cite web}} can also create a similar anchor by setting the "ref" property to "harv". For example: {{Cite book|last=Smith|first=John|year=2006|title=My Life|ref=harv}}

For example {{Harv|Smith|2006| p=25}} produces a link #CITEREFSmith2006 and {{Citation|last=Smith|first=John|date=27 January 2006|title=My Life}} produces an anchor CITEREFSmith2006.

Use of the date parameter in place of the year parameter in citation templates is preferred when full dates are known. The date parameter should not be used to simply encode a year, as this can fail to generate a viable #CITEREF link.

References

  • Smith, John (2006), My Life
  • Smith, John; Jones, Jack (2006), Our life together
  • Smith; Jones; Brown (2006), Three's a crowd
  • Smith; Jones; Brown; Black (2006), All together now
  • Misner, Charles W.; Thorne, Kip S.; Wheeler, John Archibald (1973), Gravitation, San Francisco: W. H. Freeman, ISBN 0-7167-0344-0 Unknown parameter |month= ignored (help)
  • Einstein, Albert (1915), "Die Feldgleichungen der Gravitation (The Field Equations of Gravitation)", Königlich Preussische Akademie der Wissenschaften: 844–847

See also