Template:Ref/doc

Ref-family templates
The ref family of templates is used to place labeled references and notes and references into an article, with the labels normally being clickable links for navigating from a ref to a corresponding note and back from the note to the ref. The links and backlinks are identified internally by combining the specified parameters. The templates take a variable number of unnamed parameters identified by their position and, optionally, a named parameter named noid which, if used, should be set by specifying it as "noid=noid".

Very simple example
There are many ways to use Ref and Note. Among the simplest is: {| class=wikitable !Article !Wikitext Text that requires a footnote.

Simple examples
ref and note

Example:  Article text more text more text.
 * Bulleted text
 * Bulleted text.
 * intervening text
 * Text for note a.
 * Text for note b.
 * Text for note c.
 * Text for note b.
 * Text for note c.

This would produce: Article text more text more text.
 * Bulleted text
 * Bulleted text.
 * intervening text
 * Text for note a.
 * Text for note b.
 * Text for note c.
 * Text for note b.
 * Text for note c.

Notice that the navigation back from the note to the ref does not work for refs which specify "noid=noid". In practice, if "noid=noid" is specified, it is usually specified for all refs having identical unnamed parameters.

More complex examples
ref label, ref harv and ref harvard; these all pair withnote label. These three comples ref family templates display differently but work the same. The template will normally have identical parameters with the ref template with which it is paired, and is normally created by copying the ref, pasting it into the note location, and changing its name to "note label"; this avoids having parameters mismatched because of a typo. Navigation forward uses parameters 1 and 3, navigation backward uses parameters 1 and 2. The third parameter is optional, and note label has an optional fourth parameter.

Example:  Article text more text more text more text  more text  more text  more text  more text.
 * intervening text
 * Text of note for ref a.
 * Text of note for ref b.
 * Text of note for ref c.
 * Text of note for ref d.
 * Text of note for ref e.
 * Text of note for ref f.
 * Text of note for refs g and h.
 * Text of note for ref f.
 * Text of note for refs g and h.

This would produce: Article text more text more text more text  more text  more text  more text  more text.
 * intervening text
 * Text of note for ref a.
 * Text of note for ref b.
 * Text of note for ref c.
 * Text of note for ref d.
 * Text of note for ref e.
 * Text of note for ref f.
 * Text of note for refs g and h.
 * Text of note for ref f.
 * Text of note for refs g and h.
 * 1) Notice the different styles for the ref links. ref harvard produces a parenthesized link, ref harv produces a superscripted parenthesized link, ref label produces a superscripted link with square brackets.
 * 2) Notice also that the notes for refs f and g do not have a clickable backlink. This is because no third parameter was specified.
 * 3) Finally, notice that the note for ref e has a "^" character as its backlink; this is because parameter 3 was specified as "none".

Table footnotes
One common application for ref and notes templates is in placing footnotes below tables, as in the following example taken from the Kent article:


 * {| class="wikitable"

! Year || Regional GVA ||COLSPAN=2| Agriculture ||COLSPAN=2| Industry ||COLSPAN=2| Services
 * COLSPAN=8 | County of Kent (excluding Medway)
 * 1995 || 12,369 || 379 || 3.1% || 3,886 || 31.4% || 8,104 || 65.5%
 * 2000 || 15,259 || 259 || 1.7% || 4,601 || 30.2% || 10,399 || 68.1%
 * 2003 || 18,126 || 287 || 1.6% || 5,057 || 27.9% || 12,783 || 70.5%
 * COLSPAN=8 | Medway
 * 1995 || 1,823 || 21 || 3.1% || 560 || 31.4% || 1,243 || 68.2%
 * 2000 || 2,348 || 8 || 1.7% || 745 || 30.2% || 1,595 || 67.9%
 * 2003 || 2,671 || 10 || 1.6% || 802 || 27.9% || 1,859 || 69.6%
 * }
 * COLSPAN=8 | Medway
 * 1995 || 1,823 || 21 || 3.1% || 560 || 31.4% || 1,243 || 68.2%
 * 2000 || 2,348 || 8 || 1.7% || 745 || 30.2% || 1,595 || 67.9%
 * 2003 || 2,671 || 10 || 1.6% || 802 || 27.9% || 1,859 || 69.6%
 * }
 * 2003 || 2,671 || 10 || 1.6% || 802 || 27.9% || 1,859 || 69.6%
 * }
 * }


 * Components may not sum to totals due to rounding
 * includes energy and construction
 * includes financial intermediation services indirectly measured

Alternative referencing style
Using ref/note tags is not the only way to do footnotes. Some people prefer to use Cite.php. Cite.php has many advantages, but is not mandatory. You can use the Ref converter to replace ref/note tags with the newer Cite.php style. If you are interested in the discussion, please see the Footnotes talk page. For details of that system, please see Footnotes.

Combining Ref family templates with the alternative referencing style
An example combining the use of Ref-family templates with the alternative referencing style might be something like

 Yammer yammer yammer. Yammer yammer yammer. ...