| This template is used on approximately 2,300 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. |
Lua error in Module:TNT at line 159: Missing JsonConfig extension; Cannot load https://commons.wikimedia.org/wiki/Data:I18n/Uses TemplateStyles.tab.
For some atypical citations, {{Wikicite}} can create an HTML anchor. When used in manually written, non-templated full citations, it allows shortened footnotes to link to the full citation on the same page. The link anchor can work with short-citation templates, such as {{sfn}}, {{harvnb}}, {{sfnp}}, {{harvp}}, and others.
This template is only needed for a handwritten citation or for a citation using non-standard citation templates, that is linked to by a shortened footnote. The anchor serves no purpose if nothing links to it, and full citations created with the common {{cite xxx}} templates will either automatically create the anchor or offer the <syntaxhighlight lang="wikitext" inline style="display: none;" />|ref= parameter for custom link anchors. In most cases, this template is expected to be used temporarily, in cases where an editor is not certain how to format the full citation data into a template, does not have time to do it, where there is a dispute on the talk page about which citation format should be used, or where a specific citation template does not yet support the <syntaxhighlight lang="wikitext" inline style="display: none;" />|ref= parameter. In a handful of cases, however, there remain some articles with local consensus to use entirely manually formatted citations, to exactly mirror some off-site citation style. This is rare but permitted by the WP:CITESTYLE guideline.
Usage
Copy and paste: <syntaxhighlight lang="wikitext" copy="1"></syntaxhighlight> or <syntaxhighlight lang="wikitext" copy="1"></syntaxhighlight>
- ref
- This creates the invisible HTML anchor. It can be used with the anchor template {{sfnref}} or its alias {{harvid}}. Both of those templates accept the same parameters as shortened footnote templates. The parameter can also be used with a freeform anchor and manually written anchor links. Compared to citation style 1 templates, such as {{cite web}} or {{cite book}}, the anchor is rather arbitrary, but it is best if the parameters match the citation data exactly (including precise author name spellings and order), since someone might template the manually formatted citation, which would auto-generate citation anchor data that could then be used with the same short-citation templates without them having to be updated.The anchor can be enclosed in quotation marks, but these are optional unless the anchor contains any character other than a number, letter, or hyphen. For example, with a space, a ref anchor of Von Autor-2006 must be specified as <syntaxhighlight lang="wikitext" inline style="display: none;" />
|ref="Von Autor-2006". - reference
- The actual reference text. It may be plain text, formatted text, or one of the citation templates.
Examples
In the following examples from the Bengal famine of 1943, an unpublished but publicly available manuscript by the Indian Government's Regional Food Commissioner is used as a primary source. As there are few acceptable places on Wikipedia to use an unpublished memoir as a source, no citation template directly matches the document:
| Markup | Renders as |
|---|---|
Government sources privately admitted the shortfall was 2 million tons.{{sfn|Braund|1944|p=50}}
==Notes==
{{reflist}}
==References==
* {{wikicite | ref = {{sfnref|Braund|1944}} | reference = Braund, H. B. L. (1944). ''Famine in Bengal'', typescript. British Library Doc D792.}} |
Government sources privately admitted the shortfall was 2 million tons.[1] Notes
References
|
You can also provide the <syntaxhighlight lang="wikitext" inline style="display: none;" />|ref= parameter with a free-form anchor. The anchor can contain letters, numbers, and hyphens. To link to a free-form anchor, use a wikitext anchor link. For example, link to {{wikicite |ref=Doe-1999 |reference=... }} with <ref>[[#Doe-1999|Doe 1999]], p. x.</ref>. Below, the previous example has been rewritten with a free-form anchor:
| Markup | Renders as |
|---|---|
Government sources privately admitted the shortfall was 2 million tons.<ref>[[#Braund-1944|Braund (1944)]], p. 50</ref>
==Notes==
{{reflist}}
==References==
* {{wikicite | ref = Braund-1944 | reference = Braund, H. B. L. (1944). ''Famine in Bengal'', typescript. British Library Doc D792.}} |
Government sources privately admitted the shortfall was 2 million tons.[1] Notes
References
|
Non-standard templates
Most citation templates have a <syntaxhighlight lang="wikitext" inline style="display: none;" />|ref= parameter that can accept any anchor, similar to the <syntaxhighlight lang="wikitext" inline style="display: none;" />|ref= parameter in this template. Templates that don't support this can be placed into this template's <syntaxhighlight lang="wikitext" inline style="display: none;" />|reference= parameter:
<syntaxhighlight lang="wikitext">
- "ARIA Charts – Accreditations – 2006" (PDF). Australian Recording Industry Association. Retrieved 1 July 2019.
</syntaxhighlight>
When the citation template is updated to generate its own anchor, the custom anchor can be moved from {{wikicite}} to the citation template:
<syntaxhighlight lang="wikitext">
- "ARIA Charts – Accreditations – 2006" (PDF). Australian Recording Industry Association. Retrieved 1 July 2019.
</syntaxhighlight>
Backward compatibility with id
The <syntaxhighlight lang="wikitext" inline style="display: none;" />|id= parameter can also be used to create an HTML anchor in a full citation. It has the same role as the <syntaxhighlight lang="wikitext" inline style="display: none;" />|ref= parameter but they work in slightly different ways. If both <syntaxhighlight lang="wikitext" inline style="display: none;" />|id= and <syntaxhighlight lang="wikitext" inline style="display: none;" />|ref= are provided, <syntaxhighlight lang="wikitext" inline style="display: none;" />|id= is ignored. There are two differences:
- <syntaxhighlight lang="wikitext" inline style="display: none;" />
|id=automatically prefixes the link anchor with "Reference-", whereas <syntaxhighlight lang="wikitext" inline style="display: none;" />|ref=does not. - <syntaxhighlight lang="wikitext" inline style="display: none;" />
|id=encloses the link anchor in double quotes, so these must not be provided by the editor.
Thus, these two forms produce identical results:
<syntaxhighlight lang="wikitext">Reference text</syntaxhighlight> <syntaxhighlight lang="wikitext">Reference text</syntaxhighlight>
The <syntaxhighlight lang="wikitext" inline style="display: none;" />|id= parameter can only be used with manual anchor links:
| Markup | Renders as |
|---|---|
According to Atwood, blah blah.<ref>[[#Reference-Atwood-2003|Atwood (2003)]], p. 29.</ref>
== Notes ==
{{reflist}}
== References ==
* {{wikicite | id = Atwood-2003 | reference = Atwood, Margaret (2003). ''Oryx and Crake'', Toronto: McClelland & Stewart. {{ISBN|978-0-7710-0868-9}}. }}
|
According to Atwood, blah blah.[1] Notes
References
|
SfnRef formatting
This template can be used with the same unnamed parameters as other short citation template like {{sfn}} and {{SfnRef}}. If no <syntaxhighlight lang="wikitext" inline style="display: none;" />|ref= or <syntaxhighlight lang="wikitext" inline style="display: none;" />|id= parameter is given, then the unnamed parameters are 1 to 4 author surnames (in the same order as found in the citation) and the year as the last parameter, each with its own |.
- Examples
{{SfnRef inline|Smith|2022}}{{SfnRef inline|Garcia|Chiang|1975}}{{SfnRef inline|Banh|van Doren|Lytton-St. John|O'Brien|2009}}
| Markup | Renders as |
|---|---|
Some article text.{{sfnp|Buchanan|2023|loc=para. 7}}
==Notes==
{{reflist}}
==References==
* {{wikicite|Buchanan|2023|reference=Buchanan, Abigail. (14 November 2023). "[https://en.wikipedia.org/wiki/Template:SfnRef_inline 'We are making bagpipes sexy again': Inside the late Queen's beloved Scottish music school]". ''[[The Daily Telegraph]]'') {{Webarchive |url= https://web.archive.org/web/20240102130411/https://www.telegraph.co.uk/christmas/2023/11/14/inside-the-late-queens-beloved-scottish-music-school/ |date=2 January 2024}} }} |
Some article text.[1] Notes
References
|
Template data
TemplateData for Wikicite
<templatedata> { "params": { "1": {}, "2": {}, "3": {}, "4": {}, "5": {}, "ref": { "label": "Anchor", "description": "HTML anchor id used by links (not visible to readers)", "suggestedvalues": [ "CITEREF..." ], "suggested": true }, "id": { "description": "alternative HTML anchor id used by links (ignored when the 'ref' parameter is also used)" }, "reference": { "label": "Visible reference text", "description": "The entire visible reference. Can include links and templates.", "suggested": true } }, "paramOrder": [ "reference", "ref", "1", "2", "3", "4", "5", "id" ] } </templatedata>
See also
- {{Citation}}
- {{Harvnb}}
- {{Sfn}}, an alternative method for creating shortened footnotes
- {{Citeref}}, alternative method to create links to citations
- Wikipedia:Citation templates
- Wikipedia:Citing sources
- Wikipedia:Citing sources/Further considerations#Using Wikicite
- T-34#References, example of usage