Template:Csdoc
The Citation template generates a citation for a book, periodical, contribution in a collective work, patent, or a web page. It determines the citation type by examining which parameters are used. As with other citation templates, this template can be used either in a footnote (between <ref>...</ref> tags) or in a section that lists sources. This template uses the same Lua code as citation style 1 (CS1) templates with parameters to change the displayed format to citation style 2 (CS2).

If the correct parameters are used, this template produces output identical to that of the Cite templates, such as {{Cite book}} and {{Cite web}}, with one important exception: By default, this Citation template uses commas in places where the Cite templates use periods (full stops) by default; either type of template can use periods (full stops) or commas by using an optional parameter. Also, this template by default generates anchors for Harvard references whereas the Cite templates by default do not (although they can be made to do so).

Regardless of which citation templates are used or even if none are used at all, all citations should have the same format throughout an article in the saved, rendered text.

This section covers the most commonly used parameters. You can copy the horizontal form or vertical form below and then add in extra parameters from the full list. Spacing and ordering of the parameters within the template is irrelevant and does not affect the final, rendered text.

last: The author's surname or last name. Don't use with the author parameter.

first: The author's first or given name(s).

year: Year of authorship or publication. Mandatory for use with links from Template:Harvard citation, unless |date= specifies both month and year.

title: Title of the work. Mandatory for web references.

publisher: The name of the publisher. Omit terms such as Publishers, Co., Inc., Ltd., etc., but retain the words Books or Press. Not normally included where the publication is a periodical which has its own Wikipedia article (e.g. Newsweek, Billboard).

publication-place (or place or location): The city of publication. If more than one town/city is listed on the title page, give the first one or the location of the publisher's head office. Omit when the publication is a periodical whose name specifies the location (e.g. The New York Times, The Times of India)

page: For use when one page is cited. Adds "p." before the page number. Do not use with pages.

url: A url of an online location where the item can be found. If the url includes double quotes, these must be encoded as "%22".

These can be used for all types of publication except patents. All are optional and indentation is used simply to group related items — these may be mutually exclusive where indicated. Some hyphenated names can also be placed without hyphens.

{{Citation
| last = Habicht
| first = Christian
| contribution = Hellenistic Athens and her Philosophers
| year = 1988
| title = David Magie Lecture, Princeton University Program in the History, Archaeology, and Religions of the Ancient World
| publisher = Princeton University
| page=14
}}

Habicht, Christian (1988), "Hellenistic Athens and her Philosophers", David Magie Lecture, Princeton University Program in the History, Archaeology, and Religions of the Ancient World, Princeton University, p. 14

To disable anchor generation, specify |ref=none (in contrast, other Cite templates such as {{cite book}} and {{cite news}} do not create an anchor by default). You can also specify the ID directly, using the |ref=ID parameter. For example, suppose an article's References section contains the markup:

IDs compatible with Harvard referencing templates such as {{harv}} are computed from the last names of the authors (or editors, if no authors are given) and the year of the cited source. For example, the markup "{{harv|Wright|Evans|1851|p=ix}}" generates the Harvard reference "(Wright & Evans 1851, p. ix)", which wikilinks to the citation whose markup and appearance are shown below:

In this example the {{citation}} template defines, and the {{harv}} template uses, the HTML ID "CITEREFWrightEvans1851", composed by concatenating the string "CITEREF" with the last names of the authors and the year. The {{harvid}} template can be used to generate such IDs, for example, {{harvid|Wright|Evans|1851}} generates "CITEREFWrightEvans1851".

Related methods which leave only a number in the text are to use the {{harvnb}} template enclosed in the <ref></ref> html code, or to use the {{sfn}} template alone. The example above would be <ref>{{harvnb|Wright|Evans|1851|p=ix}}</ref> or {{sfn|Wright|Evans|1851|p=ix}} both of which generate a footnote, such as

The names of only the first four authors are used; other author names are not concatenated to the ID. If no author names are given, editor names are used instead. For patents, inventor names are used instead of authors or editors. If these names are not given, this template does not generate an anchor.

Last names are used, as specified by the parameters |last1= (or |last=), |last2=, |last3=, and |last4=, and similarly for |editor1-last= etc. and for |inventor1-last= etc. If a full name is given but no last name is specified, this template falls back on the full name, but this usage is not recommended. For example, in "{{Citation | author = Sigmund Freud | title = The Ego and the Id | year = 1923}}" no last name is given, so this citation cannot be combined with the Harvard reference "{{harv|Freud|1923}}". To make these {{citation}} and {{harv}} invocations compatible, either replace "|author=Sigmund Freud" with "|first=Sigmund|last=Freud", or add "|ref={{harvid|Freud|1923}}" to the {{citation}} invocation, or add the same ref parameter (say, "|ref=EgoId") to both the {{citation}} and the {{harv}} invocations.

Similarly, the year is used, as specified by |year=. If no year is given, this template attempts to derive the year from |date= (or, if no date is given, from |publication-date=) by applying the MediaWiki § Time function. This heuristic works with many common date formats (American, International and ISO 8601 standard format YYYY-MM-DD as listed in WP:MOS), but may not work as expected with other formats, so when in doubt it may be safer to use |year=. Note that if only a year, say 2005, is known you must use |year=2005 rather than |date=2005.

Names, years, and hand-specified IDs must be chosen so that the IDs are unique within a page; otherwise the HTML will not conform to the W3C standards, and any references to the citations will not work reliably. For example, suppose a page contains the following two citations with {{harv}}-compatible IDs:

If these citations were altered to say "2008" rather than "2008a" and "2008b", the resulting page would not work, because the two different citations would both attempt to use the ID "CITEREFMontesHalterman2008". To avoid this problem, distinguish the citations by appending suffixes to the years, e.g. "|year=2008a" and "|year=2008b", as was done above. Any Harvard references to these citations should use years with the same suffixes.

This template data section needs to be edited. It includes deprecated parameters and does not include parameters that were added in the Lua updates. It also includes a mix of patent and non-patent parameters.

The Citation template generates a citation for a book, periodical, contribution in a collective work, patent, or a web page. It determines the citation type by examining which parameters are used.

Template parameters

Parameter

Description

Type

Status

Last name

lastauthorauthor1authorslast1

The surname of the author; don't wikilink, use 'authorlink'; can suffix with a numeral to add additional authors

Default

empty

Example

empty

Auto value

empty

Line

suggested

First name

firstfirst1

Given or first name, middle names, or initials of the author; don't wikilink, use 'authorlink'; can suffix with a numeral to add additional authors

Default

empty

Example

empty

Auto value

empty

Line

suggested

title of source

title

Title of source; displays in italics.

Default

empty

Example

empty

Auto value

empty

String

required

date of source

date

Full date of source being referenced in the same format as other publication dates in the citations.[1] Do not wikilink. Displays after the authors and enclosed in parentheses. If there is no author, then displays after publisher.

Default

empty

Example

empty

Auto value

empty

String

optional

url of source

url

URL of an online location where the text of the publication can be found.

Pages in the source that support the content (not an indication of the number of pages in the source; displays after 'pp.'

Default

empty

Example

empty

Auto value

empty

Line

suggested

Patent Number

patent-number

no description

Default

empty

Example

empty

Auto value

empty

String

optional

Description

description

Type of patent; shown between country code and number.

Default

empty

Example

empty

Auto value

empty

String

optional

Publication Date

publication-datepubdate

Date of publication when different from the date the work was written. Displays only if year or date are defined and only if different, else publication-date is used and displayed as date. Use the same format as other dates in the article; do not wikilink. Follows publisher; if work is not defined, then publication-date is preceded by "published" and enclosed in parenthesis.

Default

empty

Example

empty

Auto value

empty

String

optional

Issue Date

issue-date

Date patent was issued by patent agency.

Default

empty

Example

empty

Auto value

empty

String

optional

Date format

df

Sets rendered dates to the specified format

Default

empty

Example

empty

Auto value

empty

String

optional

Year of publication

year

Year of the source being referenced; recommended only when date parameter format is YYYY-MM-DD and a CITEREF disambiguator is needed

Default

empty

Example

empty

Auto value

empty

Number

optional

Postscript

postscript

Controls the closing punctuation for a citation; defaults to a period (.); for no terminating punctuation, specify |postscript=none – leaving |postscript= empty is the same as omitting it, but is ambiguous. Ignored if quote is defined.

The surname of the editor; don't wikilink, use 'editor-link'; can suffix with a numeral to add additional editors

Default

empty

Example

empty

Auto value

empty

Unknown

optional

Editor first name

editor-firsteditor-first1editor-given1editor1-firsteditor1-given

The surname of the editor; don't wikilink, use 'editor-link'; can suffix with a numeral to add additional editors

Default

empty

Example

empty

Auto value

empty

Unknown

optional

Author Mask

author-maskauthormask

Replaces the name of the first author with em dashes or text. Set author-mask to a numeric value n to set the dash n em spaces wide; set author-mask to a text value to display the text without a trailing author separator; for example, "with". You must still include the values for all authors for metadata purposes. Primarily intended for use with bibliographies or bibliography styles where multiple works by a single author are listed sequentially such as shortened footnotes. Do not use in a list generated by {{reflist}}, <references /> or similar as there is no control of the order in which references are displayed. You can also use editor-mask and translator-mask in the same way.

Default

empty

Example

empty

Auto value

empty

String

optional

Original year

orig-yearorigyear

Original year of publication; provide specifics

Default

empty

Example

empty

Auto value

empty

Number

optional

Translated title

trans-titletrans_title

An English language title, if the source cited is in a foreign language; 'language' is recommended

Default

empty

Example

empty

Auto value

empty

Content

optional

Translated chapter title

trans-chaptertrans_chapter

An English language chapter title, if the source cited is in a foreign language; 'language' is recommended

Default

empty

Example

empty

Auto value

empty

Content

optional

Type

type

Additional information about the media type of the source; format in sentence case

Default

empty

Example

empty

Auto value

empty

Content

optional

Archive URL

archive-urlarchiveurl

The URL of an archived copy of a web page, if or in case the URL becomes unavailable; requires 'archivedate'

Default

empty

Example

empty

Auto value

empty

Line

optional

Dead URL

dead-urldeadurl

If set to 'no', the title display is adjusted; useful for when the URL is archived preemptively but still live

Default

empty

Example

empty

Auto value

empty

Line

optional

Series

seriesversion

Series identifier when the source is part of a series, such as a book series or a journal; alias of 'version'

Default

empty

Example

empty

Auto value

empty

Content

optional

periodical

periodical

no description

Default

empty

Example

empty

Auto value

empty

String

optional

At

at

May be used instead of 'page' or 'pages' where a page number is inappropriate or insufficient

Default

empty

Example

empty

Auto value

empty

Line

optional

No pp

nopp

Set to 'y' to suppress the 'p.' or 'pp.' display with 'page' or 'pages' when inappropriate (such as 'Front cover')

Default

empty

Example

empty

Auto value

empty

Line

optional

Chapter

chapter

The chapter heading of the source

Default

empty

Example

empty

Auto value

empty

String

optional

contribution

contribution

no description

Default

empty

Example

empty

Auto value

empty

String

optional

chapter-url

chapter-urlchapterurl

no description

Default

empty

Example

empty

Auto value

empty

String

optional

contribution-url

contribution-url

no description

Default

empty

Example

empty

Auto value

empty

String

optional

chapter-format

chapter-format

no description

Default

empty

Example

empty

Auto value

empty

String

optional

others

others

no description

Default

empty

Example

empty

Auto value

empty

String

optional

Edition

edition

When the publication has more than one edition; for example: '2nd', 'Revised' etc.; suffixed with ' ed.'

Default

empty

Example

empty

Auto value

empty

Line

optional

Location of publication

placelocation

Geographical place of publication; usually not wikilinked

Default

empty

Example

empty

Auto value

empty

String

optional

Place of publication

publication-place

Publication place shows after title; if 'place' or 'location' are also given, they are displayed before the title prefixed with 'written at'

Default

empty

Example

empty

Auto value

empty

Content

optional

Publisher

publisher

Name of the publisher; displays after title

Default

empty

Example

empty

Auto value

empty

Content

optional

in

in

no description

Default

empty

Example

empty

Auto value

empty

String

optional

Language

language

The language in which the source is written, if not English; use the full language name; do not use icons or templates

Default

empty

Example

empty

Auto value

empty

Content

optional

Format

format

Format of the work referred to by 'url' ('url' is required when using 'format'); examples: PDF, DOC, XLS; do not specify HTML

Default

empty

Example

empty

Auto value

empty

Content

optional

arXiv identifier

arxiv

An identifier for arXive electronic preprints of scientific papers

Default

empty

Example

empty

Auto value

empty

Line

optional

ASIN

asinASIN

Amazon Standard Identification Number; 10 characters

Default

empty

Example

empty

Auto value

empty

Line

optional

ASIN TLD

asin-tld

ASIN top-level domain for Amazon sites other than the US

Default

empty

Example

empty

Auto value

empty

Line

optional

Bibcode

bibcode

Bibliographic Reference Code (REFCODE); 19 characters

Default

empty

Example

empty

Auto value

empty

Line

optional

biorXiv

biorxiv

biorXiv identifier; 6 digits

Default

empty

Example

empty

Auto value

empty

Line

optional

CiteSeerX

citeseerx

CiteSeerX identifier; found after the 'doi=' query parameter

Default

empty

Example

empty

Auto value

empty

Line

optional

DOI

doiDOI

Digital Object Identifier; begins with '10.'

Default

empty

Example

empty

Auto value

empty

String

optional

doi_inactivedate

doi_inactivedate

no description

Default

empty

Example

empty

Auto value

empty

String

optional

DOI broken date

doi-broken-date

The date that the DOI was determined to be broken

Default

empty

Example

empty

Auto value

empty

Date

optional

ISBN

isbn

International Standard Book Number; use the 13-digit ISBN where possible

Default

empty

Example

empty

Auto value

empty

Line

optional

ISSN

issn

International Standard Serial Number (print); 8 characters; usually split into two groups of four using a hyphen

Default

empty

Example

empty

Auto value

empty

Line

optional

eISSN

eissn

International Standard Serial Number (online); 8 characters; usually split into two groups of four using a hyphen

Default

empty

Example

empty

Auto value

empty

Line

optional

jfm code

jfm

Jahrbuch über die Fortschritte der Mathematik classification code

Default

empty

Example

empty

Auto value

empty

Line

optional

JSTOR

jstor

JSTOR identifier

Default

empty

Example

empty

Auto value

empty

Line

optional

LCCN

lccn

Library of Congress Control Number

Default

empty

Example

empty

Auto value

empty

Line

optional

MR

mr

Mathematical Reviews identifier

Default

empty

Example

empty

Auto value

empty

Line

optional

OCLC

oclc

Online Computer Library Center number

Default

empty

Example

empty

Auto value

empty

Number

optional

OL

ol

Open Library identifier

Default

empty

Example

empty

Auto value

empty

Line

optional

OSTI

osti

Office of Scientific and Technical Information identifier

Default

empty

Example

empty

Auto value

empty

Line

optional

PMC

pmc

PubMed Center article number

Default

empty

Example

empty

Auto value

empty

Number

optional

PMID

pmid

PubMed Unique Identifier

Default

empty

Example

empty

Auto value

empty

Line

optional

RFC

rfc

Request for Comments number

Default

empty

Example

empty

Auto value

empty

Number

optional

SSRN

ssrn

Social Science Research Network

Default

empty

Example

empty

Auto value

empty

Line

optional

Zbl

zbl

Zentralblatt MATH journal identifier

Default

empty

Example

empty

Auto value

empty

Line

optional

id

id

A unique identifier used where none of the specialized ones are applicable

Default

empty

Example

empty

Auto value

empty

Line

optional

Quote

quote

Relevant text quoted from the source; displays last, enclosed in quotes; needs to include terminating punctuation

Default

empty

Example

empty

Auto value

empty

Content

optional

Ref

ref

An anchor identifier; can be made the target of wikilinks to full references; special value 'harv' generates an anchor suitable for the harv and sfn templates

Default

empty

Example

empty

Auto value

empty

Line

optional

URL access date

access-dateaccessdate

The full date when the original URL was accessed; do not wikilink

Default

empty

Example

empty

Auto value

empty

Date

optional

Lay URL

laysummarylayurllay-url

URL link to a non-technical summary or review of the source

Default

empty

Example

empty

Auto value

empty

Line

optional

Lay source

lay-sourcelaysource

Name of the source of the laysummary; displays in italics, preceded by an en dash

Default

empty

Example

empty

Auto value

empty

String

optional

Lay date

lay-datelaydate

Date of the summary; displays in parentheses

Default

empty

Example

empty

Auto value

empty

Date

optional

Author name separator

author-name-separator

Changes the separator between last and first names; defaults to a comma and space; a space must be encoded as &#32;

Default

,

Example

empty

Auto value

empty

Line

optional

Last author ampersand

last-author-amplastauthoramp

When set to any value, changes the separator between the last two names of the author list to 'space ampersand space'