Open main menu

Wikipedia β

Template documentation[view] [edit] [history] [purge]

Intent

Provides a simple wrapper for up to nine consecutive <ref name="RefName" /> citation tags that minimizes visual impact on the text which, along with the simpler syntax, increases code readability and ease of editing.

Comparison to <ref>

Note how much shorter the coding is when using {{r}}.

Using <ref> For example, fact<ref name=RefName/><ref name=Bam/><ref name=Bar/> and fact.<ref name=Bas/><ref name=Bay/><ref name=Baz/>

Displays as: For example, fact[1][2][3] and fact.[4][5][6]

Using {{r}} For example, fact{{r|RefName|Bam|Bar}} and fact.{{r|Bas|Bay|Baz}}

Displays as: For example, fact[1][2][3] and fact.[4][5][6]

References using {{r}} and references using <ref> can coexist on the same page.

Usage

Usage Display Notes
{{r|RefName}} Text.[1] Equivalent to <ref name="RefName" />.
{{r|RefName|p=100}}

{{r|RefName|pp=100}}

{{r|RefName|page=100}}

{{r|RefName|pages=100}}

Text.[1]:100 Adds a page number (or other location identifier) within the source.

The |p=, |pp=, |page=, and |pages= parameters are equivalent.

If the article cites only one location in a given source, reduce clutter by coding simply {{r|RefName}} and integrating the location into the main RefName citation.

{{r|RefName|p=10–14}}

{{r|RefName|pp=3, 6}}

{{r|RefName|page=§C}}

{{r|RefName|pages=Dust jacket}}

{{r|RefName|pages=para. 7}}

Text.[1]:10–14

Text.[1]:3, 6

Text.[1]:§C

Text.[1]:Dust jacket

Text.[1]:para. 7

{{r|RefName|Bam|Bar}} Text.[1][2][3] Equivalent to {{r|RefName}}{{r|Bam}}{{r|Bar}} or <ref name=RefName/><ref name=Bam/><ref name=Bar/>.

Up to nine references may be "bundled" this way.

{{r|1=RefName|2=Bam|3=Bar|4=Bas|p1=100|p2=10–14|p4=§C}}

{{r|1=RefName|p1=100|2=Bam|p2=10–14|3=Bar|4=Bas|p4=§C}}

Text.[1]:100[2]:10–14[3][4]:§C Equivalent to {{r|RefName|p=100}}{{r|Bam}}{{r|Bar|p=10–14}}{{r|Bas|p=§C}}.

In the example, not all references have quotes; make sure that e.g. |1= matches |p1=

{{r|group=Notes|NtName}}

{{r|grp=Notes|NtName|NtCam}}

{{r|g=Notes|NtName|p=13}}

Text.[Notes 1]

Text.[Notes 1][Notes 2]

Text.[Notes 1]:13

The |group=, |grp=, and |g= parameters are equivalent and echo <ref group=Notes name=NtName/>.

If present, the parameter applies to all references in the template.

{{r|RefName|p=100|q=quote from the text}}

{{r|RefName|p=100|quote=quote from the text}}

Text.[1]:100 Makes sense only if |p= (or one of its synonyms) is present. |quote= (or |q=) underlines the superscript page number/​location identifier, signaling availability of a quote from the source, which pops up when the mouse is hovered over the underlined bit.
{{r|1=RefName|2=Bam|3=Bar|4=Bas|p1=100|p2=10–14|p4=§C|q1=Quote from 100|q4=Quote from §C}} Text.[1]:100[2]:10–14[3][4]:§C In the example, not all references have quotes; make sure that e.g. |1= matches |p1= matches |q1=.

The ref names must be defined; this is normally done in a References section (as demonstrated below). The separate Notes section is also illustrated.

===References===
{{reflist|refs=
<ref name=RefName>Reference text.</ref>
<ref name=Bam>Bam reference text.</ref>
<ref name=Bar>Bar reference text.</ref>
<ref name=Bas>Bas reference text.</ref>
<ref name=Bay>Bay reference text.</ref>
<ref name=Baz>Baz reference text.</ref>
}}

===Notes===
{{reflist|group=Notes|refs=
<ref name=NtName>Note text.</ref>
<ref name=NtCam>Cam note text.</ref>
}}

Resulting in:

References
  1. ^ a b c d e f g h i j k l m Reference text.
  2. ^ a b c d e Bam reference text.
  3. ^ a b c d e Bar reference text.
  4. ^ a b c d Bas reference text.
  5. ^ a b Bay reference text.
  6. ^ a b Baz reference text.
Notes
  1. ^ a b c Note text.
  2. ^ Cam note text.

TemplateData

This is the TemplateData documentation for this template used by VisualEditor and other tools; see the monthly error report for this template.

TemplateData for R

Provides a simple wrapper for up to nine consecutive <ref name=RefName/> citation tags that minimizes visual impact on the text which, along with the simpler syntax, increases code readability and ease of editing.

Template parameters

Parameter Description Type Status
Reference group groupggrp

The reference group of all the references displayed; see WP:REFGROUP for help.

Default
Defaults to not being in a group.
Example
empty
Auto value
empty
String suggested
Reference name 1 1

If this is "RefName", the template displays <ref name="RefName"/>.

Default
empty
Example
empty
Auto value
empty
String required
Pages number(s): reference 1 page1ppagepagesppp1pages1pp1

Adds a page number (or other location identifier) within the source. Note that you can also put this information in the original reference instead so it need only be stated once.

Default
empty
Example
"2", "34–38", "inside cover"
Auto value
empty
Content suggested
Quote: reference 1 q1quoteqquote1

A quote from the source. Appears when hovering over the page number, so the page number must be specified.

Default
empty
Example
empty
Auto value
empty
String suggested
Reference name 2 2

If this is "RefName", the template displays <ref name="RefName"/>.

Default
empty
Example
empty
Auto value
empty
String suggested
Pages number(s): reference 2 page2p2pages2pp2

Adds a page number (or other location identifier) within the source. Note that you can also put this information in the original reference instead so it need only be stated once.

Default
empty
Example
"2", "34–38", "inside cover"
Auto value
empty
Content optional
Quote: reference 2 q2quote2

A quote from the source. Appears when hovering over the page number, so the page number must be specified.

Default
empty
Example
empty
Auto value
empty
String optional
Reference name 3 3

If this is "RefName", the template displays <ref name="RefName"/>.

Default
empty
Example
empty
Auto value
empty
String suggested
Pages number(s): reference 3 page3p3pages3pp3

Adds a page number (or other location identifier) within the source. Note that you can also put this information in the original reference instead so it need only be stated once.

Default
empty
Example
"2", "34–38", "inside cover"
Auto value
empty
Content optional
Quote: reference 3 q3quote3

A quote from the source. Appears when hovering over the page number, so the page number must be specified.

Default
empty
Example
empty
Auto value
empty
String optional
Reference name 4 4

If this is "RefName", the template displays <ref name="RefName"/>.

Default
empty
Example
empty
Auto value
empty
String optional
Pages number(s): reference 4 page4p4pages4pp4

Adds a page number (or other location identifier) within the source. Note that you can also put this information in the original reference instead so it need only be stated once.

Default
empty
Example
"2", "34–38", "inside cover"
Auto value
empty
Content optional
Quote: reference 4 q4quote4

A quote from the source. Appears when hovering over the page number, so the page number must be specified.

Default
empty
Example
empty
Auto value
empty
String optional
Reference name 5 5

If this is "RefName", the template displays <ref name="RefName"/>.

Default
empty
Example
empty
Auto value
empty
String optional
Pages number(s): reference 5 page5p5pages5pp5

Adds a page number (or other location identifier) within the source. Note that you can also put this information in the original reference instead so it need only be stated once.

Default
empty
Example
"2", "34–38", "inside cover"
Auto value
empty
Content optional
Quote: reference 5 q5quote5

A quote from the source. Appears when hovering over the page number, so the page number must be specified.

Default
empty
Example
empty
Auto value
empty
String optional
Reference name 6 6

If this is "RefName", the template displays <ref name="RefName"/>.

Default
empty
Example
empty
Auto value
empty
String optional
Pages number(s): reference 6 page6p6pages6pp6

Adds a page number (or other location identifier) within the source. Note that you can also put this information in the original reference instead so it need only be stated once.

Default
empty
Example
"2", "34–38", "inside cover"
Auto value
empty
Content optional
Quote: reference 6 q6quote6

A quote from the source. Appears when hovering over the page number, so the page number must be specified.

Default
empty
Example
empty
Auto value
empty
String optional
Reference name 7 7

If this is "RefName", the template displays <ref name="RefName"/>.

Default
empty
Example
empty
Auto value
empty
String optional
Pages number(s): reference 7 page7p7pages7pp7

Adds a page number (or other location identifier) within the source. Note that you can also put this information in the original reference instead so it need only be stated once.

Default
empty
Example
"2", "34–38", "inside cover"
Auto value
empty
Content optional
Quote: reference 7 q7quote7

A quote from the source. Appears when hovering over the page number, so the page number must be specified.

Default
empty
Example
empty
Auto value
empty
String optional
Reference name 8 8

If this is "RefName", the template displays <ref name="RefName"/>.

Default
empty
Example
empty
Auto value
empty
String optional
Pages number(s): reference 8 page8p8pages8pp8

Adds a page number (or other location identifier) within the source. Note that you can also put this information in the original reference instead so it need only be stated once.

Default
empty
Example
"2", "34–38", "inside cover"
Auto value
empty
Content optional
Quote: reference 8 q8quote8

A quote from the source. Appears when hovering over the page number, so the page number must be specified.

Default
empty
Example
empty
Auto value
empty
String optional
Reference name 9 9

If this is "RefName", the template displays <ref name="RefName"/>.

Default
empty
Example
empty
Auto value
empty
String optional
Pages number(s): reference 9 page9p9pages9pp9

Adds a page number (or other location identifier) within the source. Note that you can also put this information in the original reference instead so it need only be stated once.

Default
empty
Example
"2", "34–38", "inside cover"
Auto value
empty
Content optional
Quote: reference 9 q9quote9

A quote from the source. Appears when hovering over the page number, so the page number must be specified.

Default
empty
Example
empty
Auto value
empty
String optional

See also