Wikipedia:Citation templates

Citation templates are used to format citations in a consistent way, as an alternative to formatting the citations by hand. The use of citation templates is neither encouraged nor discouraged. Templates may be used or removed at the discretion of individual editors, subject to agreement with other editors on the article. Because templates can be contentious, editors should not add citation templates, or change an article with a consistent citation format to another, without gaining consensus; see WP:CITECONSENSUS and WP:CITEVAR. The various citation templates may be freely mixed, since they all produce a similar format. WP:DUPLINK and WP:OVERLINK do not apply to citations. It is expected that a reference citation includes wikilinks to the relevant article for the source, such as The New York Times, rather than The New York Times.

Use in footnotes
For a citation to appear in a footnote, it needs to be enclosed in "ref" tags. You can add these by typing ' at the front of the citation and ' at the end. Alternatively you may notice above the edit box there is a row of "markup" formatting buttons which include a button to the right—if you highlight your whole citation and then click this markup button, it will automatically enclose your citation in ref tags (i.e. citation).

Note, if this is a new page or if there are not already references previously cited, it is necessary to create a section usually named "Notes" or "References" near the end of the page; see WP:FNNR and MOS:APPENDIX for more information on section names:

==Notes== or {{pre| ==Notes== the first time, and just  elsewhere. When there are citations that differ only in page number, there are two alternatives: write all the citations out in full, including the page number, or use one citation without page numbers along with the {{tl|rp}} template to add an inline page number after the small bracketed footnote number.
 * 1) Footnotes with list-defined references. All inline citations take the form  . The reference list at the end of the article is a list of full citations, each of which takes the form , all of which are surrounded by.
 * 2) Shortened footnotes. Instead of the full citation appearing in the footnote, a short form appears (e.g. {{harvnb|Turner|1851}}), giving only the author and year (or in some styles, a shortened version of the article or book title), and page number if appropriate. The full citation appears later on, in a bibliography section. This usually follows directly after the footnotes, is titled "References" or "Bibliography", and contains all relevant citations, listed in (typically) alphabetical order. This style is especially appropriate when there are large numbers of references overall and frequent cases of multiple references to the same work, especially in the presence of differing page numbers.

When using shortened footnotes, there are three ways to link the short and full references:
 * 1) Insert manual links. These look like e.g.  . If a citation template is used for the full reference, the anchor (e.g.  ) is automatically attached to the full reference; if the full reference is typed by hand, surround the reference with {{tl|wikicite}} to attach the anchor to it.
 * 2) Insert links using a Harvard citation template, e.g.  . This will insert a footnote into the text and link it to the citation with the corresponding last name and year. Other variations of the Harvard citation templates format the short citation differently.
 * 3) Use the {{tlx|sfn}} template for the whole of the footnote. The {{tlx|sfn}} template creates its own named {{tag|ref}} tags: {{tlx|sfn|Pereira|2006|4=p=25}} is exactly equivalent to {{tag|ref|content= Pereira 2006, p. 25.|params=name=FOOTNOTEPereira200625}} which is itself equivalent to {{tag|ref|content={{tlx|Harvnb|Pereira|2006|4=p=25}}|params=name=FOOTNOTEPereira200625}}.

See also WP:Footnotes and WP:Citing sources for general information, and WP:CITEX for specific examples of exactly how to write the code for various combinations of the above styles.

Discussing citations on talk pages
When citations are brought to talk pages, noticeboards and other discussions, follow the group of citations, or the text you have added, with Reflist-talk.

This template places the citations in their own box under the bold header References at the position where the template was inserted; otherwise the citations (and any others in the talk page) will be listed at the end of the talk page, below all sections. The resulting reference box does not appear in the table of contents.