Teamplaid:Harvc
Uses Lua: |
This template uses TemplateStyles: |
This template is a citation hybrid that has characteristics of the long-form CS1 and CS2 and characteristics of short-form {{Sfn}} and the {{Harvard citation}} families of templates. Its purpose is to provide a method that allows editors to refer to a contribution or chapter in a larger work when more than a few such referrals are required. {{Harvc}}
is not a substitute for a properly constructed citation.
Short-form templates {{Sfn}}
and {{Harvard citation}}
are often used to link from an article's references section to a long-form CS1|2 template in a bibliography section:
{{Sfn}}
→ {{Cite book}}
It is not uncommon for a source have multiple contributors. When it is necessary to refer to multiple contributions in the same source, repeating all of the bibliographic details in multiple long-form citation templates adds to references-section clutter. {{Harvc}}
is designed to hold only the detail necessary to identify a contribution and link to the enclosing work's long-form citation where all of the bibliographic detail can be found:
{{Sfn}}
→{{Harvc}}
→{{Cite book}}
Ùsaid - Usage
deasaichThe minimal form is:
{{Harvc |last=contributor name |year=publication year |c=contribution title |in=source editor/author name}}
Parameters
deasaich{{Harvc}}
creates a CITEREF
anchor from one to four contribution or chapter author surnames (|lastn=
) and the value in |year=
. This allows {{Harvc}}
to be the target of a link created by {{Sfn}} or {{Harvard citation}}
family templates. From |inn=
and |year=
, {{Harvc}}
creates a CITEREF link similar to those created by {{Harvnb}} and {{Sfn}}
- |anchor-year= – optional, for use for author(s) with more than one contribution to the work; requires CITEREF disambiguator; see Examples
- |author-link= – optional, title of existing Wikipedia article about the first contributor—not the contributor's website; do not wikilink; alias: |author-link1=
- |author-linkn= – optional, title of existing Wikipedia article about contributorn; choose n to match n in |lastn=
- |author-mask=m – optional, replaces name of the first contributor with m (commonly 2) em dashes; alias: |author-mask1=
- |author-maskn=m – optional, replaces name of contributorn with m em dashes; choose n to match n in |lastn=
- |author-maskn=<text> – optional, replaces name of contributorn with <text>
- |c= – required, the title of chapter or contribution; rendered quoted in upright font; aliases: |chapter=, |contribution=
- |display-authors= – optional, defines how
{{Harvc}}
displays the contributor list; ignored when |name-list-format=harv:|display-authors=
– when empty or omitted, displays all contributor names in last/first format|display-authors=n
– displays n contributor names in last/first format; appends et al. when n is less than the number of contributors included in the template|display-authors=etal
– displays all contributor names in last/first format and appends et al.
- |first= – optional, first contributor's given or first name; alias: |first1=
- |firstn= – optional, contributorn given or first name; n begins at 2 and increases by 1 for each additional |firstn=
- |id= – required when
|last1=
-|last4=
are the same as|in1=
-|in4=
; otherwise optional. See Examples - |in= – required, surname or last name of first editor or author of the work that includes the contribution; aliases: |in1=
- |in2= – optional, surname or last name of second editor or author
- |in3= – optional, surname or last name of third editor or author
- |in4= – optional, surname or last name of fourth editor or author
- |last= – required, surname or last name of first author; aliases: |last1=
- |lastn= – optional, contributorn surname or last name; n begins at 2 and increases by 1 for each additional |lastn=;
- |last-author-amp=: – optional, when set to yes, inserts an ampersand between the last two contributor names
- |loc= – optional, other location identifier, displays after
|p=
or|pp=
- |mode= – controls rendered display to match that of adjacent CS1 or CS2 citations; defaults to CS1 style
- |mode=CS2 – mimic {{Citation}} style (comma separators, no terminal punctuation, static text not capitalized)
- |name-list-format= – optional, controls contributor name list display style
- |name-list-format=harv – mimic
{{Sfn}}
or{{Harvard citation}}
format (one to four last names); overrides |display-authors=
- |name-list-format=harv – mimic
- |nb= – optional, when set to
yes
, instructs{{Harvc}}
to render source link with out parentheses around the year; same format as that produced by {{Harvnb}} - |p= – optional, single page number where cited material can be found
- |pp= – optional, multiple page numbers, page ranges, etc where cited material can be found
- |ps= – optional, sets terminal punctuation; default is full stop; overrides |mode=CS2; aliases: |postscript=
- |ps=none – renders output without terminal punctuation
- |url= – optional, URL of an online location where the text of the contribution can be found; aliases: |chapter-url, |contribution-url
- |url-access= – optional, use when URL links to a source behind a registration barrier or paywall; inserts CS1|2 access icon; accepted values are:
limited
,registration
,subscription
- |year= – required, publication year of the work that includes the contribution
Examples
deasaichWhen a Wikipedia article makes reference to a work that contains multiple chapters by different authors, bibliographies and reference sections can look rather cluttered:
- George, Ernest J.; Read, Ralph A.; Johnson, R. W.; Ferber, A. E. (1957). "Shelterbelts and Windbreaks". In Stefferud, Alfred (ed.). Soil: The Yearbook of Agriculture 1957. United States Department of Agriculture. OCLC 704186906.
- Harper, V. L.; Frank, Bernard; McQuilkin, W. E. (1957). "Forest Practices and Productivity". In Stefferud, Alfred (ed.). Soil: The Yearbook of Agriculture 1957. United States Department of Agriculture. OCLC 704186906.
- Stout, P. R.; Johnson, C. M. (1957). "Trace Elements". In Stefferud, Alfred (ed.). Soil: The Yearbook of Agriculture 1957. United States Department of Agriculture. OCLC 704186906.
- Wadleigh, C. H. (1957). "Growth of Plants". In Stefferud, Alfred (ed.). Soil: The Yearbook of Agriculture 1957. United States Department of Agriculture. OCLC 704186906.
As the list grows longer, the look becomes more cluttered with the unnecessarily repeated detail of full-length citations. With {{Harvc}}
editors can link to shorter, less detailed contribution citations using standard implementations of {{Sfn}} templates[1] and {{Harvard citation}} templates (like this: (Harper, Frank & McQuilkin 1957) and also wrapped in <ref>...</ref>
tags[2]). {{Harvc}}
may also be wrapped in <ref>...</ref>
tags so that it becomes part of the article's References section.[3][4]
Avoiding circular reference
deasaichIt may sometimes be necessary to cite a contribution of a source's editor or author such that |last1=
through |last4=
are the same as |in1=
through |in4=
, an editor's preface for example. Such citations can, depending on placement, cause {{Sfn}}
or {{Harvard citation}}
-family references to link directly to the citation instead of to the {{Harvc}}
template, or cause circular links ({{Harvc}}
linking to itself because its CITEREF
anchor identifier is the same as the citation's CITEREF
anchor identifier). If |id=
is set, {{Harvc}}
will use it as an anchor identifier; if |id=
is not set, {{Harvc}}
will emit an error message when |last1=
through |last4=
are the same as |in1=
through |in4=
.
For example, to reference an editor's preface from article text, create a wikilink inside <ref>...</ref>
tags:[5]
<ref>[[#Stefferud preface|Stefferud 1957]]</ref>
Write a {{Harvc}}
template with |id=Stefferud preface
{{Harvc |last=Stefferud |first=A.|year=1957 |id=Stefferud preface |c=Preface |url=//archive.org/stream/yoa1957#page/n7/mode/1up |in=Stefferud}}
Example references section
deasaich- ↑ George et al. 1957.
- ↑ Stout & Johnson 1957
- ↑ Benson, Ezra Taft. "Foreword". In Stefferud (1957), p. vi, §2. harvc error: no target: CITEREFStefferud1957 (help)
- ↑ Wadleigh 1957.
- ↑ Stefferud 1957
Example bibliography section
deasaich- Stefferud, Alfred, ed. (1957). Soil: The Yearbook of Agriculture 1957. United States Department of Agriculture. OCLC 704186906.
- George, Ernest J.; Read; Johnson; Ferber. "Shelterbelts and Windbreaks". In Stefferud (1957). harvc error: no target: CITEREFStefferud1957 (help)
- Harper, V. L.; Frank; McQuilkin. "Forest Practices and Productivity". In Stefferud (1957). harvc error: no target: CITEREFStefferud1957 (help)
- Stefferud, A. "Preface". In Stefferud (1957). harvc error: no target: CITEREFStefferud1957 (help)
- Stout, P. R.; Johnson. "Trace Elements". In Stefferud (1957). harvc error: no target: CITEREFStefferud1957 (help)
- Wadleigh, C. H. "Growth of Plants". In Stefferud (1957). harvc error: no target: CITEREFStefferud1957 (help)
More than one contribution
deasaichThere are times when an author or authors will have contributed more than once to a work. When this occurs, it is necessary to disambiguate the CITEREF links from the {{Harvard citation}}
or {{Sfn}}
templates to the CITEREF id of the appropriate {{Harvc}}
template.
{{Harvard citation|Author|YYYYa}}
→{{Harvc|Author|Contribution 1|YYYYa}}
→{{Citation|...}}
}{{Harvard citation|Author|YYYYb}}
→{{Harvc|Author|Contribution 2|YYYYb}}
↑
In this example, author David Hunt contributed two appendices to Christmas Cacti: The Genus Schlumbergera and Its Hybrids.
There are two {{Harvnb}} templates that are disambiguated:
{{Harvnb |Hunt |1995a}}
→ Hunt 1995a{{Harvnb |Hunt |1995b}}
→ Hunt 1995b
These link to two {{Harvc}}
templates which use |anchor-year=
for their CITEREF id and for the date in the {{Harvc}}
rendering as a visual aid for readers:
{{Harvc |in=McMillan |in2=Horobin |last=Hunt |first=David |c=Appendix I Names and synonyms of the species, subspecies and interspecific hybrids |year=1995 |anchor-year=1995a |mode=CS2 |nb=yes}}
- Hunt, David (1995a). "Appendix I Names and synonyms of the species, subspecies and interspecific hybrids". In McMillan & Horobin 1995. harvc error: no target: CITEREFMcMillanHorobin1995 (help)
{{Harvc |in=McMillan |in2=Horobin |last=Hunt |first=David |c=Appendix III Excerpts from a Brazilian diary |year=1995 |anchor-year=1995b |mode=CS2 |nb=yes}}
- Hunt, David (1995b). "Appendix III Excerpts from a Brazilian diary". In McMillan & Horobin 1995. harvc error: no target: CITEREFMcMillanHorobin1995 (help)
and the single {{Citation}}
template:
{{Citation |last=McMillan |first=A. J. S. |last2=Horobin |first2=J. F. |year=1995 |title=Christmas Cacti: The Genus ''Schlumbergera'' and Its Hybrids |edition=p/b |publication-place=Sherbourne, Dorset, UK |publisher=David Hunt |isbn=978-0-9517234-6-3}}
- McMillan, A. J. S.; Horobin, J. F. (1995), Christmas Cacti: The Genus Schlumbergera and Its Hybrids (p/b ed.), Sherbourne, Dorset, UK: David Hunt, ISBN 978-0-9517234-6-3
Error messages
deasaich{{Harvc}}
emits these error messages:
- Harvc: author missing from source list.
- the source list parameters
|in1=
,|in2=
,|in3=
, and|in4=
form the template'sCITEREF
link to the full citation. All are not required but must be used in order without numerical gaps.
- the source list parameters
- Harvc: invalid
|anchor-year=
.- when used,
|anchor-year=
must be a three- or four-digit number and must have a lowercaseCITEREF
disambiguator. When the source does not have an identifiable year, use|anchor-year=n.d.l
or|anchor-year=ndl
with lowercaseCITEREF
disambiguator.
- when used,
- Harvc: invalid
|display-authors=
.- the value assigned to
|display-authors=
must be a number greater than 0 or the keywordetal
- the value assigned to
- Harvc: invalid
|year=
.|year=
is an integral part of the template'sCITEREF
anchor and link. The value of|year=
must be a three- or four-digit number with an optional lowercaseCITEREF
disambiguator. When the source does not have an identifiable year, use|year=n.d.
or|year=nd
.
- Harvc: missing
|year=
.|year=
is missing; the parameter is required.
- Harvc: no authors in contributor list.
- this error message indicates that
{{Harvc}}
can't find any of|last=
,|last1=
,|author=
or|author1=
with an assigned value and so cannot make a usableCITEREF
anchor. Add at least one of the listed parameters.
- this error message indicates that
- Harvc: required contribution is missing.
- this error message indicates that
{{Harvc}}
can't find any of|c=
,|chapter=
, or|contribution=
with an assigned value
- this error message indicates that
- Harvc: required
|id=
parameter missing.- this error message is emitted when the
{{Harvc}}
template'sCITEREF
anchor identifier would conflict with the long-form citation'sCITEREF
anchor identifier. See Examples
- this error message is emitted when the
- Harvc:
|year=
/|anchor-year=
mismatch.- the year portion of
|anchor-year=YYYYl
must match the year given in|year=YYYY
- the year portion of
The above documentation is transcluded from Teamplaid:Harvc/documentation. (edit | history) Editors can experiment in this template's sandbox (create | mirror) and testcases (create) pages. Please add categories to the /documentation subpage. Subpages of this template. |