Changes

Jump to navigation Jump to search
5,421 bytes added ,  12:20, 12 March 2022
Import from wikipedia
{{Documentation subpage}}
{{Template shortcut|harvid}}
<!-- PLEASE ADD CATEGORIES AND INTERWIKIS AT THE BOTTOM OF THIS PAGE -->

Generate an identifier suitable as an [[Template:Citation/doc #Anchors for Harvard referencing templates|anchor for a Harvard citation]]. This template, which can be used with either the name {{tlc|SfnRef}} or the name {{tlc|harvid}}, is intended to be paired with Harvard citation templates such as {{tl|Sfn}}, {{tl|harv}}, and {{tl|harvnb}}. This template uses the same arguments as the other citation templates. As explained below, this template is needed only in some cases when the Harvard citation templates are used.

== Usage ==

: <code><nowiki>{{</nowiki>SfnRef|''Last name of author(s)''|''Year''<nowiki>}}</nowiki></code>
or
: <code><nowiki>{{</nowiki>harvid|''Last name of author(s)''|''Year''<nowiki>}}</nowiki></code>

The first parameter is the first author's last name. Up to four authors can be given as parameters; if there are more than four authors, list only the first four. The last parameter is the year of publication, possibly with a letter suffixed to avoid ambiguity if there are multiple citations by the same set of authors in the same year.

All named parameters such as {{para|p}} are ignored.

==Purpose==

This template creates the proper value for the {{para|ref}} parameter for use with {{tl|cite journal}}, {{tl|cite book}}, {{tl|citation}}, and the other [[Help:Citation Style 1|Citation Style 1 and 2]] templates, and for use by {{tl|vcite journal}}, {{tl|vcite book}} and other templates that generate [[Vancouver system]] references. It is intended to be paired with {{tl|Sfn}} and uses the same arguments. As explained below, {{tlc|SfnRef}}/{{tlc|harvid}} is only necessary in a subset of the cases where {{tlc|Sfn}} is used.

{{tlc|Sfn}} creates a short footnote that is linked to a full footnote. {{tlc|Sfn}} creates the link automatically, but the full footnote must be assigned the proper ID value to be a valid target for that link.

When using the Citation Style 1 and 2 family of citation templates, a default ID is generated from the last names of the first four authors or editors. A custom ID can be created via the {{para|ref}} parameter. However, if none of {{para|last1}}, {{para|editor-last}}, or their equivalents are used, use {{tlc|SfnRef}} to create the proper value without having to know the rules for how {{tlc|Sfn}} creates the ID.

The {{tl|vcite journal}} etc. templates (with "<code>vcite</code>", not "<code>cite</code>") require the use of {{tlc|SfnRef}}/{{tlc|harvid}} to work with Harvard citations.

==Examples==

; With the shortened footnote template

When citing an article published in the December 2004 edition of ''Rolling Stone'' where the author is unknown, you might create a short footnote as follows:

: <code><nowiki>{{Sfn|Rolling Stone|2004}}</nowiki></code>

{{para|ref|harv}} will not work in this case because "Rolling Stone" is not the name of the author. You may code the value for the {{para|ref}} parameter manually, or you can use {{tlc|SfnRef}} and specify the same parameters as used with {{tlc|Sfn}}:

: <code><nowiki>{{SfnRef|Rolling Stone|2004}}</nowiki></code>

The full footnote:

: <code><nowiki>{{cite news |work=[[Rolling Stone]] |title=The RS 500 Greatest Songs of All Time |ref={{SfnRef|Rolling Stone|2004}} |date=December 2004}}</nowiki></code>

You can copy and paste the {{tlc|Sfn}} template code and change the name of the template from "Sfn" to "SfnRef". If your short footnote includes page numbers such as {{tlc|Sfn|Rolling&nbsp;Stone|2004|p{{=}}48}}, you can copy and paste it to create {{tlc|SfnRef|Rolling&nbsp;Stone|2004|p{{=}}48}}; the {{para|p|48}} parameter is not necessary but will do no harm.

; With other Harvard templates

For example, a ''References'' section might contain the following markup:
: <code><nowiki>{{</nowiki>[[Template:vcite journal|vcite journal]]<nowiki> |author=Peh WC, Ng KH |title=Preparing the references |journal=Singapore Med J |volume=50 |issue=7 |pages=659–661 |date=2009 |pmid=19644619 |url=http://smj.sma.org.sg/5007/5007emw1.pdf |format=PDF |ref={{harvid|Peh|Ng|2009}} }}</nowiki></code>
This markup uses <code><nowiki>{{harvid|Peh|Ng|2009}}</nowiki></code> to generate the anchor identifier "{{harvid|Peh|Ng|2009}}", used internally to link Harvard references to citations. (This identifier is not visible to the article's reader.) The generated citation looks like this:
: {{vcite journal |author=Peh WC, Ng KH |title=Preparing the references |journal=Singapore Med J |volume=50 |issue=7 |pages=659–661 |date=2009 |pmid=19644619 |url=http://smj.sma.org.sg/5007/5007emw1.pdf |format=PDF |ref={{harvid|Peh|Ng|2009}} }}
Article prose can link to this citation with markup like the following:
: {{tlx|harv|Peh|Ng|2009}}
which generates the following:
: {{harv|Peh|Ng|2009}}
To see how it works, click on the "{{harv|Peh|Ng|2009}}".

== See also ==
* {{tl|citeref}} (a wrapper for <code><nowiki>harvid</nowiki></code> to create #internal wikilinks with either superscript <sup>[n]</sup> or plain-text labels to other citations from inside a citation)

{{Wikipedia referencing}}

<includeonly>{{Sandbox other||
[[Category:Author–date citation templates]]
[[Category:Footnote templates]]

[[bn:টেমপ্লেট:SfnRef]]
[[ja:Template:SfnRef]]
[[sl:Template:SfnRef]]
[[simple:Template:SfnRef]]
}}</includeonly>
{{SourceWikipedia}}
Cookies help us deliver our services. By using our services, you agree to our use of cookies.

Navigation menu