வார்ப்புரு:Citeref/doc
{{Documentation subpage}}
 &lt;!-- Please add categories at the bottom of this page, and interwikis at Wikidata (see Wikipedia:Wikidata) --&gt;
 
 {{COinS safe}}
 
 == Description ==
 This template can be used to create wiki-links to existing citations defined in the same article through CS1/CS2 (and many other) citation templates. It uses a (partial) reimplementation of the anchor-creation done by {{tl|SfnRef}}, to make it easier to create footnote links in a consistent format. By default, links will be styled as small superscript labels (like &lt;sup&gt;[n]&lt;/sup&gt;) similar to those created by Mediawiki's &lt;code&gt;&lt;nowiki&gt;&lt;ref&gt;...&lt;/ref&gt;&lt;/nowiki&gt;&lt;/code&gt; tags, but plain text links are possible as well.
 
 A typical use is inside of {{para|quote}}, if the quotation refers to other works defined as citations in the same article, but the template can also be used in many other locations inside and outside of citation templates, including in other parameters.
 
 While it is possible to create direct piped links like &lt;code&gt;&lt;nowiki&gt;[[#CITEREF&lt;name-list&gt;&lt;year&gt;&lt;disambiguator&gt;|&lt;label&gt;]]&lt;/nowiki&gt;&lt;/code&gt;, usage of the template is preferred as it hides the internal CITEREF-anchor-composing details away from the user. Since the template can be centrally updated it is easier to maintain in the future than adjusting hardcoded links all over the place. Also, in the case of superscript labels, the template ensures a consistent appearance and safe coding usable inside of citations without the user having to remember HTML syntax etc. to achieve the effect.
 
 == Usage ==
 By default, the template supports 1 to 4 author name parameters (as per {{tl|SfnRef}}) followed by 1 date parameter (also as per {{tl|SfnRef}}) to compose the appendage to &lt;code&gt;CITEREF&lt;/code&gt; in order to match the internal anchor created by the citation template this link should point to. The last unnamed parameter is the label text that should be displayed as link text, e.g. &quot;a&quot;, &quot;b&quot;, &quot;c&quot;, etc.
 While this does not affect the functionality please make sure that these labels do not clash with other labels used for citations or notes in the same article in order to avoid confusion for users (that is, if small letters or Arabic numbers are already used, you could e.g. use capital letters or Roman numbers instead). Also, since the sequence of labels in an article may change when additional links are added or the arrangement of citations changes, it might be beneficial to use a citation-relative numbering scheme (e.g. (re-)start with &quot;A&quot; in each new citation) instead of having to frequently renumber an article-wide absolute name scheme (e.g. starting with &quot;A&quot; in the first citeref link in an article).
 
 If only one parameter is given, the label text will be the same.
 
 The optional named parameter {{para|style|plain}} can be used to switch the display style from the default superscript labels to plain text.
 
 Using the optional {{para|ref}} or {{para|id}} parameters the template can be used for other anchor name styles in order to support special cases.
 
 In order to avoid dangling links, please check the links by clicking on them after creation and when changing the author/editor names or dates in the corresponding citations. (A future version of the template might automatically detect dangling links and throw error messages, see [[Module talk:Footnotes/Archive 1#broken harv link reporting]] and [[Help talk:Citation Style 1/Archive 66#make ref=harv the default for CS1]]&lt;!-- |ignore-err= --&gt;.)
 
 == Examples ==
 Example reference definitions:&lt;ref name=&quot;Example_Ref_1&quot;/&gt;&lt;ref name=&quot;Example_Ref_2&quot;/&gt;
 
 Example 1:
 * &lt;code&gt;&lt;nowiki&gt;Example text{{citeref|Author2|2018|a}}&lt;/nowiki&gt;&lt;/code&gt;:
 : Example text{{citeref|Author2|2018|a}}
 
 Example 2:
 * &lt;code&gt;&lt;nowiki&gt;Example {{citeref|Author1|2017|text|style=plain}}&lt;/nowiki&gt;&lt;/code&gt;:
 : Example {{citeref|Author1|2017|text|style=plain}}
 
 Using the {{para|ref}} or {{para|id}} parameters, the template can also be used to create links following two other anchor-naming styles. If one of them is given, this will override the default Harvard anchor naming scheme by {{tl|SfnRef}} and the template will accept only one unnamed parameter (for the link label text). If both parameters are given, {{para|id}} will be ignored:&lt;ref name=&quot;Example_Ref_3&quot;/&gt;&lt;ref name=&quot;Example_Ref_4&quot;/&gt;
 
 * {{para|ref}} can be used to link to completely free-style anchors (e.g. to override the default harv scheme if this is found too complicated to follow in specific cases). The values &quot;harv&quot; and &quot;none&quot; are reserved and ''must not be used''.&lt;!-- In a future revision of the template, they might be special-cased in the code - at present they would cause problems if used (because they would be interpreted as valid arguments to the ref parameter). --&gt;
 
 * {{para|id}} works similarly, but automatically prefixes the anchor name by &quot;Reference-&quot;. (See {{tl|wikicite}} for details.)
 
 Example 3:
 * &lt;code&gt;&lt;nowiki&gt;Example text{{citeref|b|ref=Author-2020}}&lt;/nowiki&gt;&lt;/code&gt;:
 : Example text{{citeref|b|ref=Author-2020}}
 
 Example 4:
 * &lt;code&gt;&lt;nowiki&gt;Example {{citeref|text|ref=Author-2020|style=plain}}&lt;/nowiki&gt;&lt;/code&gt;:
 : Example {{citeref|text|ref=Author-2020|style=plain}}
 
 Example 5:
 * &lt;code&gt;&lt;nowiki&gt;Example text{{citeref|c|id=Example}}&lt;/nowiki&gt;&lt;/code&gt;:
 : Example text{{citeref|c|id=Example}}
 
 Example 6:
 * &lt;code&gt;&lt;nowiki&gt;Example {{citeref|text|id=Example|style=plain}}&lt;/nowiki&gt;&lt;/code&gt;:
 : Example {{citeref|text|id=Example|style=plain}}
 
 There isn't much point in combining {{para|ref}} or {{para|id}} with {{para|style|plain}} because the syntax is more complicated than a piped link like &lt;code&gt;&lt;nowiki&gt;[[#anchor-name|label]]&lt;/nowiki&gt;&lt;/code&gt;, however, this is supported for cases where it is desirable for maintenance reasons to use the same link style (that is, linking through citeref) in an article rather than to mix different methods and syntaxes.
 
 == See also ==
 * {{tl|SfnRef}}
 * {{tl|refn}} (a different method to create nested links working on &lt;nowiki&gt;&lt;ref&gt;&lt;/ref&gt;&lt;/nowiki&gt; markup level rather than on citation template anchor level)
 * {{tl|r}} (a different method to create nested links working on &lt;nowiki&gt;&lt;ref&gt;&lt;/ref&gt;&lt;/nowiki&gt; markup level rather than on citation template anchor level)
 * [[w:Wikipedia:Citation templates|Wikipedia:Citation templates]]
 * [[Wikipedia:Nesting footnotes]]
 
 == References ==
 : &lt;code&gt;&lt;nowiki&gt;{{reflist|refs=&lt;/nowiki&gt;&lt;/code&gt;
 * &lt;code&gt;&lt;nowiki&gt;&lt;ref name=&quot;Example_Ref_1&quot;&gt;{{cite book |title=Title1 |author=Author1 |date=2017 |quote=Quote1 referring to another citation via CITEREF.{{citeref|Author2|2018|A}}}}&lt;/ref&gt;&lt;/nowiki&gt;&lt;/code&gt;
 * &lt;code&gt;&lt;nowiki&gt;&lt;ref name=&quot;Example_Ref_2&quot;&gt;{{cite book |title=Title2 |author=Author2 |date=2018 |quote=Quote2 referring to {{citeref|Author1|2017|another citation|style=plain}} via CITEREF.}}&lt;/ref&gt;&lt;/nowiki&gt;&lt;/code&gt;
 * &lt;code&gt;&lt;nowiki&gt;&lt;ref name=&quot;Example_Ref_3&quot;&gt;{{anchor|Reference-Example}}{{cite book |title=Title3 |author=Author3 |date=2019 |quote=Quote3 referring to another citation via CITEREF.{{citeref|Author4|2020|B}}}}&lt;/ref&gt;&lt;/nowiki&gt;&lt;/code&gt;
 * &lt;code&gt;&lt;nowiki&gt;&lt;ref name=&quot;Example_Ref_4&quot;&gt;{{anchor|Author-2020}}{{cite book |title=Title4 |author=Author4 |date=2020 |quote=Quote4 referring to {{citeref|Author3|2019|another citation|style=plain}} via CITEREF.}}&lt;/ref&gt;&lt;/nowiki&gt;&lt;/code&gt;
 : &lt;code&gt;&lt;nowiki&gt;}}&lt;/nowiki&gt;&lt;/code&gt;
 {{Reflist|refs=
 &lt;ref name=&quot;Example_Ref_1&quot;&gt;{{cite book |title=Title1 |author=((Author1)) |date=2017 |quote=Quote1 referring to another citation via CITEREF.{{citeref|Author2|2018|A}}}}&lt;/ref&gt;
 &lt;ref name=&quot;Example_Ref_2&quot;&gt;{{cite book |title=Title2 |author=((Author2)) |date=2018 |quote=Quote2 referring to {{citeref|Author1|2017|another citation|style=plain}} via CITEREF.}}&lt;/ref&gt;
 &lt;ref name=&quot;Example_Ref_3&quot;&gt;{{anchor|Reference-Example}}{{cite book |title=Title3 |author=((Author3)) |date=2019 |quote=Quote3 referring to another citation via CITEREF.{{citeref|Author4|2020|B}}}}&lt;/ref&gt;
 &lt;ref name=&quot;Example_Ref_4&quot;&gt;{{anchor|Author-2020}}{{cite book |title=Title4 |author=((Author4)) |date=2020 |quote=Quote4 referring to {{citeref|Author3|2019|another citation|style=plain}} via CITEREF.}}&lt;/ref&gt;
 }}
 &lt;includeonly&gt;{{sandbox other||
 &lt;!-- Add categories below this line, and interwikis at Wikidata --&gt;
 [[Category:Author–date citation templates]]
 [[Category:Footnote templates]]