Anonymous
Not logged in
Talk
Contributions
Create account
Log in
Search
Editing
Template:Citation/doc
(section)
From MEpedia, a crowd-sourced encyclopedia of ME and CFS science and history
Namespaces
Template
Discussion
More
More
Page actions
Read
Edit source
History
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==Anchored citations== This template can generate a citation that can be combined with [[Help:shortened footnotes]] or [[MEpedia:Parenthetical referencing|parenthetical referencing]]. It does this by creating an HTML anchor containing an ID. The special parameter {{para|ref|harv}} generates an ID suitable for '''Harvard referencing''' templates such as {{tl|harv}} as specified in the next section; this is the default for the {{tl|citation}} template. To disable anchor generation, specify {{para|ref|none}} (in contrast, other Cite templates such as {{tl|cite book}} and {{tl|cite news}} do not create an anchor by default). You can also specify the ID directly, using the {{para|ref|<var>ID</var>}} parameter. For example, suppose an article's ''References'' section contains the markup: * <code><nowiki>{{Citation |author=Sigmund Freud |title=Civilization and Its Discontents |year=1930 |ref=CivDis}}</nowiki></code> which generates the citation: * {{Citation |author=Sigmund Freud |title=Civilization and Its Discontents |year=1930 |ref=CivDis}} Then, the markup "<code><nowiki>([[#CivDis|Freud 1930]])</nowiki></code>" generates a parenthetical reference "([[#CivDis|Freud 1930]])" containing a wikilink to the citation (try clicking on the wikilink). ===Anchors for Harvard referencing templates=== IDs compatible with Harvard referencing templates such as {{tl|harv}} are computed from the last names of the authors and the year of the cited source. For example, the markup "<code><nowiki>{{harv|Wright|Evans|1851|p=ix}}</nowiki></code>" generates the Harvard reference "{{harv|Wright|Evans|1851|p=ix}}", which wikilinks to the citation whose markup and appearance are shown below: * <code><nowiki>{{Citation |last1=Wright | first1 = Thomas |last2=Evans | first2 = R. H. |title=Historical and Descriptive Account of the Caricatures of James Gillray |location=London |publisher=Henry G. Bohn |year=1851 |oclc=59510372}}</nowiki></code> * {{Citation |last1=Wright | first1 = Thomas |last2=Evans | first2 = R. H. |title=Historical and Descriptive Account of the Caricatures of James Gillray |location=London |publisher=Henry G. Bohn |year=1851 |oclc=59510372}} In this example the {{tl|citation}} template defines, and the {{tl|harv}} template uses, the HTML ID "<code>CITEREFWrightEvans1851</code>", composed by concatenating the string "<code>CITEREF</code>" with the last names of the authors and the year. The {{tl|harvid}} template can be used to generate such IDs, for example, <code><nowiki>{{harvid|Wright|Evans|1851}}</nowiki></code> generates "<code>{{harvid|Wright|Evans|1851}}</code>". Related methods which leave only a number in the text are to use the {{tl|harvnb}} template enclosed in the <nowiki><ref></ref></nowiki> html code, or to use the {{tl|sfn}} template alone. The example above would be <code><nowiki><ref>{{harvnb|Wright|Evans|1851|p=ix}}</ref></nowiki></code> or <code><nowiki>{{sfn|Wright|Evans|1851|p=ix}}</nowiki></code> both of which generate a footnote, such as :17. {{harvnb|Wright|Evans|1851|p=ix}} 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 [[#Citing patents|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 {{para|last1}} (or {{para|last}}), {{para|last2}}, {{para|last3}}, and {{para|last4}}, and similarly for {{para|editor1-last}} etc. and for {{para|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 "<code><nowiki>{{Citation | author = Sigmund Freud | title = The Ego and the Id | year = 1923}}</nowiki></code>" no last name is given, so this citation cannot be combined with the Harvard reference "<code><nowiki>{{harv|Freud|1923}}</nowiki></code>". To make these {{tl|citation}} and {{tl|harv}} invocations compatible, either replace "{{para|author|Sigmund Freud}}" with "{{para|first|Sigmund}} {{para|last|Freud}}", or add "{{para|ref|<nowiki>{{harvid|Freud|1923}}</nowiki>}}" to the {{tl|citation}} invocation, or add the same ref parameter (say, "{{para|ref|EgoId}}") to both the {{tl|citation}} and the {{tl|harv}} invocations. Similarly, the year is used, as specified by {{para|year}}. If no year is given, this template attempts to derive the year from {{para|date}} (or, if no date is given, from {{para|publication-date}}) by applying the [[mw:Help:Extension:ParserFunctions##time|MediaWiki#time function]]. This heuristic works with many common date formats (American, International and [https://www.w3.org/TR/NOTE-datetime ISO 8601 standard format] YYYY-MM-DD as listed in [[MOS]]), but may not work as expected with other formats, so when in doubt it may be safer to use {{para|year}}. Note that if only a year, say 2005, is known you must use {{para|year|2005}} rather than {{para|date|2005}}. ===IDs must be unique=== 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 {{tl|harv}}-compatible IDs: * {{Citation |last1=Montes | first1 = G. |last2 = Halterman |first2=J.S. |year=2008a |journal=Pediatrics |volume=121 |issue=4 |pages=e821βe826 |title=Association of Childhood Autism Spectrum Disorders and Loss of Family Income |doi=10.1542/peds.2007-1594 |pmid=18381511 |url= http://pediatrics.aappublications.org/cgi/content/full/121/4/e821 }} * {{Citation |last1=Montes | first1 = G. |last2 = Halterman |first2=J.S. |year=2008b |journal=Pediatrics |volume=122 |issue=1 |pages=e202βe208 |title=Child Care Problems and Employment Among Families with Preschool-aged Children with Autism in the United States |doi=10.1542/peds.2007-3037 |pmid=18595965 |url= http://pediatrics.aappublications.org/cgi/content/full/122/1/e202 }} 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 "<code>CITEREFMontesHalterman2008</code>". To avoid this problem, distinguish the citations by appending suffixes to the years, e.g. "{{para|year|2008a}}" and "{{para|year|2008b}}", as was done above. Any Harvard references to these citations should use years with the same suffixes. It is good practice to verify that a page does not contain duplicate IDs by using the ''W3C Markup Validation Service''; see ''[[#External links|External links]]''.
Summary:
Please make sure your edits are consistent with
MEpedia's guidelines
.
By saving changes, you agree to the
Terms of use
, and you irrevocably agree to release your contribution under the
CC BY-SA 3.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)
This page is a member of 2 hidden categories:
Category:CS1 location test
Category:Templates generating COinS
Navigation
Navigation
Skip to content
Main page
Browse
Become an editor
Random page
Popular pages
Abbreviations
Glossary
About MEpedia
Links for editors
Contents
Guidelines
Recent changes
Pages in need
Search
Help
Wiki tools
Wiki tools
Special pages
Page tools
Page tools
User page tools
More
What links here
Related changes
Page information
Page logs