Difference between revisions of "Template:Harvard citation no brackets/doc"
test>Erik (→Usage: Added ref=harv note; feel free to improve wording) |
test>John Cardinal (Made this more consistent with the docs for {{harv}}, re-organized examples, and provided targets for the links.) |
||
| Line 2: | Line 2: | ||
<!-- EDIT TEMPLATE DOCUMENTATION BELOW THIS LINE --> | <!-- EDIT TEMPLATE DOCUMENTATION BELOW THIS LINE --> | ||
==Usage== | ==Usage== | ||
| − | < | + | : <tt><nowiki>{{</nowiki>Harvard citation no brackets|''Last name of author(s)''|''Year''| loc=''Location in the text''}}</tt> |
| − | {{Harvard citation no brackets | + | or |
| − | + | : <tt><nowiki>{{</nowiki>Harvnb|''Last name of author(s)''|''Year''| loc=''Location in the text''}}</tt> | |
| − | |||
| − | |||
| − | }} | ||
| − | </ | ||
| − | + | Instead of using the optional <tt>loc</tt> parameter, you may use one of the following parameters: | |
| − | p = ''page'' | + | *<tt>p=''page''</tt> |
| − | pp = ''pages'' | + | *<tt>pp=''pages''</tt> |
| − | ; | + | ;Usage notes |
| − | |||
*The first parameter is the author's last name. | *The first parameter is the author's last name. | ||
| − | *The | + | *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 | + | *The next parameter is the year of publication. |
| − | *The | + | *The <tt>loc=</tt> parameter is the location of the cited material within the reference. This parameter is optional. |
| − | *The parameter | + | *The <tt>p=</tt> is an optional page parameter; thus "<tt><nowiki>{{Harvnb|Smith|2006| p=25}}</nowiki></tt>" yields "{{Harvnb|Smith|2006|p=25}}". |
| − | *If | + | *The <tt>pp=</tt> parameter is an optional page range parameter; thus "<tt><nowiki>{{Harvnb|Smith|2006| pp=25&ndash;26}}</nowiki></tt>" yields "{{Harvnb|Smith|2006|pp=25–26}}". |
| − | *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 | + | *If you specify <tt>Ref=none</tt> no hyperlink is created. (See the [[#Examples|examples]].) |
| − | *A space before or after the author name or before the year ''is'' significant; they produce an underscore in the hyperlink | + | *To include brackets surrounding the citation, use {{tl2|Harvard citation}} or {{tl2|Harv}}. |
| − | *When using [[:Category:Citation templates|citation templates]] for references, include the | + | *To use the author name(s) in the text, use {{tl2|Harvard citation text}} or {{tl2|Harvtxt}}. |
| + | *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>{{Harvnb|Smith|2007a| p=25}}</nowiki></tt>" yields "{{Harvnb|Smith|2007a| p=25}}" and "<tt><nowiki>{{Harvnb|Smith|2007b| p=37}}</nowiki></tt>" yields "{{Harvnb|Smith|2007b| p=37}}" | ||
| + | *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> to add the target of the footnote link to each reference. | ||
==Examples== | ==Examples== | ||
| + | {| class="wikitable" | ||
| + | |- | ||
| + | ! Code | ||
| + | ! Result | ||
| + | |- | ||
| + | |<tt><nowiki>{{Harvard citation no brackets|Smith|2006| loc=ch. 10}}</nowiki></tt> | ||
| + | |{{Harvard citation no brackets|Smith|2006| loc=ch. 10}} | ||
| + | |- | ||
| + | |<tt><nowiki>{{Harvnb|Smith|2006| p=25}}</nowiki></tt> | ||
| + | |{{Harvnb|Smith|2006| p=25}} | ||
| + | |- | ||
| + | |<tt><nowiki>{{Harvnb|Smith|2006| pp=25–26}}</nowiki></tt> | ||
| + | |{{Harvnb|Smith|2006| pp=25–26}} | ||
| + | |- | ||
| + | |<tt><nowiki>{{Harvnb|Smith|2006| pp=25–26 | Ref=none}}</nowiki></tt> | ||
| + | |{{Harvnb|Smith|2006| pp=25–26 | Ref=none}} | ||
| + | |- | ||
| + | |<tt><nowiki>{{Harvnb|Smith|2007a| p=25}}</nowiki></tt> | ||
| + | |{{Harvnb|Smith|2007a| p=25}} | ||
| + | |- | ||
| + | |<tt><nowiki>{{Harvnb|Smith|2007b| p=37}}</nowiki></tt> | ||
| + | |{{Harvnb|Smith|2007b| p=37}} | ||
| + | |- | ||
| + | |<tt><nowiki>{{Harvnb|Smith|Jones|Brown|2008 | p=25}}</nowiki></tt> | ||
| + | |{{Harvnb|Smith|Jones|Brown|2008| p=25}} | ||
| + | |- | ||
| + | |<tt><nowiki>{{Harvnb|Smith|Jones|Brown|Black|2009 | p=25}}</nowiki></tt> | ||
| + | |{{Harvnb|Smith|Jones|Brown|Black|2009| p=25}} | ||
| + | |} | ||
| − | + | ;Full references for examples | |
| − | + | The following references are provided as targets for the {{tl|Harvnb}} templates used in the examples above. If you click on a link in the '''Result''' column, the browser will highlight the proper entry below and scroll to the page to make it visible. | |
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | + | * {{cite book |last=Smith |first=John |year=2006 |title=His First Book |ref=harv}} | |
| − | + | * {{cite book |last=Smith |first=John |year=2007a |title=His Second Book |ref=harv}} | |
| − | *{{ | + | * {{cite book |last=Smith |first=John |year=2007b |title=His Third Book |ref=harv}} |
| − | *{{ | + | * {{cite book |last=Smith |first=John |year=2008 |last2=Jones |first2=Ann |last3=Brown |first3=Shelby |title=Multiple Authors Example Book One |ref=harv}} |
| − | + | * {{cite book |last=Smith |first=John |year=2009 |last2=Jones |first2=Ann |last3=Brown |first3=Shelby |last4=Black |first4=Joseph |title=Multiple Authors Example Book Two |ref=harv}} | |
| − | *{{ | ||
| − | *{{ | ||
| − | |||
| − | *{{ | ||
| − | |||
==Purpose== | ==Purpose== | ||
| − | + | When using [[WP:Parenthetical referencing|parenthetical referencing]] there are some situations in which it is undesirable to surround the citation with brackets. Also, Harvnb is sometimes used with [[WP:Inline citation|inline citations]] (<tt><ref>…</ref></tt>) to create short footnotes in a '''Notes''' section that link to full footnotes in a '''References''' section. | |
| − | + | ;Multiple citations | |
A useful example of the Harvard no brackets template is when creating multiple cites using different pages of the same book. For a worked example, see [[User:RexxS/Cite_multiple_pages]]. | A useful example of the Harvard no brackets template is when creating multiple cites using different pages of the same book. For a worked example, see [[User:RexxS/Cite_multiple_pages]]. | ||
| + | ==See also== | ||
| + | * [[:Template:Harvard citation]] | ||
<includeonly> | <includeonly> | ||
{{esoteric}} | {{esoteric}} | ||
Revision as of 23:20, 3 November 2009
Template:Template doc page viewed directly
Contents
Usage
- {{Harvard citation no brackets|Last name of author(s)|Year| loc=Location in the text}}
or
- {{Harvnb|Last name of author(s)|Year| loc=Location in the text}}
Instead of using the optional loc parameter, you may use one of the following parameters:
- p=page
- pp=pages
- Usage notes
- 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 loc= parameter is the location of the cited material within the reference. This parameter is optional.
- The p= is an optional page parameter; thus "{{Harvnb|Smith|2006| p=25}}" yields "Smith 2006, p. 25".
- The pp= parameter is an optional page range parameter; thus "{{Harvnb|Smith|2006| pp=25–26}}" yields "Smith 2006, pp. 25–26".
- If you specify Ref=none no hyperlink is created. (See the examples.)
- To include brackets surrounding the citation, use
{{Harvard citation}}or{{Harv}}. - To use the author name(s) in the text, use
{{Harvard citation text}}or{{Harvtxt}}. - For more complicated Harvard citations with multiple links use
{{Harvard citations}}or its abbreviation{{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, "{{Harvnb|Smith|2007a| p=25}}" yields "Smith 2007a, p. 25" and "{{Harvnb|Smith|2007b| p=37}}" yields "Smith 2007b, p. 37"
- 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 to add the target of the footnote link to each reference.
Examples
| Code | Result |
|---|---|
| {{Harvard citation no brackets|Smith|2006| loc=ch. 10}} | Smith 2006, ch. 10 |
| {{Harvnb|Smith|2006| p=25}} | Smith 2006, p. 25 |
| {{Harvnb|Smith|2006| pp=25–26}} | Smith 2006, pp. 25–26 |
| {{Harvnb|Smith|2006| pp=25–26 | Ref=none}} | Smith 2006, pp. 25–26 |
| {{Harvnb|Smith|2007a| p=25}} | Smith 2007a, p. 25 |
| {{Harvnb|Smith|2007b| p=37}} | Smith 2007b, p. 37 |
| {{Harvnb|Smith|Jones|Brown|2008 | p=25}} | Smith, Jones & Brown 2008, p. 25 |
| {{Harvnb|Smith|Jones|Brown|Black|2009 | p=25}} | Smith et al. 2009, p. 25 |
- Full references for examples
The following references are provided as targets for the {{Harvnb}} templates used in the examples above. If you click on a link in the Result column, the browser will highlight the proper entry below and scroll to the page to make it visible.
- Smith, John (2006). His First Book.CS1 maint: ref=harv (link)
- Smith, John (2007a). His Second Book.CS1 maint: ref=harv (link)
- Smith, John (2007b). His Third Book.CS1 maint: ref=harv (link)
- Smith, John; Jones, Ann; Brown, Shelby (2008). Multiple Authors Example Book One.CS1 maint: ref=harv (link)
- Smith, John; Jones, Ann; Brown, Shelby; Black, Joseph (2009). Multiple Authors Example Book Two.CS1 maint: ref=harv (link)
Purpose
When using parenthetical referencing there are some situations in which it is undesirable to surround the citation with brackets. Also, Harvnb is sometimes used with inline citations (<ref>…</ref>) to create short footnotes in a Notes section that link to full footnotes in a References section.
- Multiple citations
A useful example of the Harvard no brackets template is when creating multiple cites using different pages of the same book. For a worked example, see User:RexxS/Cite_multiple_pages.