Difference between revisions of "Template:Citation/core"

From LIMSWiki
Jump to navigationJump to search
m (Protected "Template:Citation/core" ([edit=sysop] (indefinite) [move=sysop] (indefinite)))
m (Italics for et al.)
 
(One intermediate revision by the same user not shown)
Line 34: Line 34:
     #if: {{{Surname2|}}}
     #if: {{{Surname2|}}}
     |{{#ifexpr:{{{Trunc|8}}}<2
     |{{#ifexpr:{{{Trunc|8}}}<2
       |&#32;et al{{#ifeq:{{{Sep|}}}|.||.}}
       |&#32;''et al.''{{#ifeq:{{{Sep|}}}|.||.}}
       |{{
       |{{
           #iferror: {{ #expr: 1*0.0{{{AuthorMask|}}} }}
           #iferror: {{ #expr: 1*0.0{{{AuthorMask|}}} }}
Line 56: Line 56:
           #if: {{{Surname3|}}}
           #if: {{{Surname3|}}}
           |{{#ifexpr:{{{Trunc|8}}}<3
           |{{#ifexpr:{{{Trunc|8}}}<3
             |&#32;et al{{#ifeq:{{{Sep|}}}|.||.}}
             |&#32;''et al.''{{#ifeq:{{{Sep|}}}|.||.}}
             |{{
             |{{
               #if: {{{Surname4|}}}
               #if: {{{Surname4|}}}
Line 74: Line 74:
               #if:{{{Surname4|}}}
               #if:{{{Surname4|}}}
               |{{#ifexpr:{{{Trunc|8}}}<4
               |{{#ifexpr:{{{Trunc|8}}}<4
                 |&#32;et al{{#ifeq:{{{Sep|}}}|.||.}}
                 |&#32;''et al.''{{#ifeq:{{{Sep|}}}|.||.}}
                 |{{
                 |{{
                     #if: {{{Surname5|}}}
                     #if: {{{Surname5|}}}
Line 92: Line 92:
                   #if:{{{Surname5|}}}
                   #if:{{{Surname5|}}}
                   |{{#ifexpr:{{{Trunc|8}}}<5
                   |{{#ifexpr:{{{Trunc|8}}}<5
                     |&#32;et al{{#ifeq:{{{Sep|}}}|.||.}}
                     |&#32;''et al.''{{#ifeq:{{{Sep|}}}|.||.}}
                     |{{
                     |{{
                     #if: {{{Surname6|}}}
                     #if: {{{Surname6|}}}
Line 110: Line 110:
                     #if:{{{Surname6|}}}
                     #if:{{{Surname6|}}}
                     |{{#ifexpr:{{{Trunc|8}}}<6
                     |{{#ifexpr:{{{Trunc|8}}}<6
                     |&#32;et al{{#ifeq:{{{Sep|}}}|.||.}}
                     |&#32;''et al.''{{#ifeq:{{{Sep|}}}|.||.}}
                       |{{
                       |{{
                         #if: {{{Surname7|}}}
                         #if: {{{Surname7|}}}
Line 128: Line 128:
                         #if:{{{Surname7|}}}
                         #if:{{{Surname7|}}}
                         |{{#ifexpr:{{{Trunc|8}}}<7
                         |{{#ifexpr:{{{Trunc|8}}}<7
                           |&#32;et al{{#ifeq:{{{Sep|}}}|.||.}}
                           |&#32;''et al.''{{#ifeq:{{{Sep|}}}|.||.}}
                         |{{
                         |{{
                           #if: {{{Surname8|}}}
                           #if: {{{Surname8|}}}
Line 146: Line 146:
                                       #if:{{{Surname8|}}}
                                       #if:{{{Surname8|}}}
                                       |{{#ifexpr:{{{Trunc|8}}}<8
                                       |{{#ifexpr:{{{Trunc|8}}}<8
                                           |&#32;et al{{#ifeq:{{{Sep|}}}|.||.}}
                                           |&#32;''et al.''{{#ifeq:{{{Sep|}}}|.||.}}
                                           |{{
                                           |{{
                                               #if: {{{Surname9|}}}
                                               #if: {{{Surname9|}}}
Line 163: Line 163:
                                             }}{{
                                             }}{{
                                               #if:{{{Surname9|}}}
                                               #if:{{{Surname9|}}}
                                               |&#32;et al{{#ifeq:{{{Sep|}}}|.||.}}
                                               |&#32;''et al.''{{#ifeq:{{{Sep|}}}|.||.}}
                                             }}
                                             }}
                                         }}
                                         }}
Line 235: Line 235:
             }}{{
             }}{{
               #if:{{{EditorSurname4|}}}
               #if:{{{EditorSurname4|}}}
               |&#32;et al{{#ifeq:{{{Sep|}}}|.||.}}
               |&#32;''et al.''{{#ifeq:{{{Sep|}}}|.||.}}
             }}
             }}
         }}
         }}
Line 335: Line 335:
             }}{{
             }}{{
               #if:{{{EditorSurname4|}}}
               #if:{{{EditorSurname4|}}}
               |&#32;et al{{#ifeq:{{{Sep|}}}|.||.}}
               |&#32;''et al.''{{#ifeq:{{{Sep|}}}|.||.}}
             }}
             }}
         }}
         }}

Latest revision as of 21:53, 9 August 2021

 

[edit] [purge] Template documentation

About this template

Template:Citation/core can be thought of as an engine producing consistent output for Wikipedia's citations. Templates such as {{Citation}} provide this core template with a list of parameters, which it uses to produce a formatted text (HTML) output, which contains embedded COinS metadata. This metadata allows many readers to find cited references more easily, or to extract their details to a reference manager.

The presence of a central template makes individual citation templates simpler to code and amend, and produces a consistent look throughout the encyclopaedia.

Templates using this 'engine'

Changes to this central template can affect the output of several 'upstream' templates. A list of templates using citation/core is provided below for testing purposes.

Parameter details

Note that the examples below are common uses of each parameter, intended to help editors understand the functioning of this template. In the most part, there is nothing wrong with passing different data to any of the parameters below if it produces the output that is desired. The exception is in parameters which are associated with a COinS field.

  • |AccessDate= date when the |URL= was accessed. Should not be wikilinked.
  • archive parameters (if used, must be used both of them together)
    • |ArchiveURL= the URL of an archived copy of a web page, if (or in case) the url becomes unavailable. Typically used to refer to services like WebCite and Archive.org.
    • |ArchiveDate= date when the item was archived. Should not be wikilinked.
  • |OriginalURL= If an archived URL is provided elsewhere, the original URL should be specified here.
  • |At= page reference within the source.
  • |AuthorBlock= replaces the first author with a score of length AuthorBlock em. Metadata is still produced from |Surname= and |Forename=.
  • |Authorlink1= title of an existing Wikipedia article about the first author.
  • |Authorlink2=, |Authorlink3=, ..., |Authorlink8= title of an existing Wikipedia article about up to seven additional authors.
  • |Bibcode= A Bibcode id
  • |DOI= Digital object identifier.
  • |Date= date of the authorship, if different from date of publication.
  • |DoiBroken= Date the DOI is broken
  • |Edition= number or name of the edition, if not the first; for example: |Edition=2nd.
  • |EditorGiven1= first editor's first or given name(s).
  • |EditorGiven2=, |EditorGiven3= second and third editors’ first or given name(s).
  • |EditorSurname1= first editor's surname or last name.
  • |EditorSurname2=, |EditorSurname3=, |EditorSurname4= second, third, and fourth editors’ surname or last name. The fourth is not actually used, but causes et al. to be generated.
  • |Editorlink1= title of an existing Wikipedia article about the first editor.
  • |Editorlink2=, |Editorlink3= title of existing Wikipedia articles about the second and third editors.
  • |format= file format of the source, if not the common format. Or; "Free full text", "abstract", or similar descriptor
  • |Given1= first author's first or given name(s).
  • |Given2=, |Given3=, ..., |Given8= up to seven additional authors' first or given name(s).
  • |ID= miscellaneous identifier, other than |DOI=, |ISBN=, |ISSN=, |OCLC=, |PMID=, or |PMC=.
  • |ISBN= International Standard Book Number.
  • |ISSN= International Standard Serial Number identifying the periodical.
  • |IncludedWorkTitle= Specific title, to be displayed in quotation marks. Contrast with |Title=, which is displayed in italics. In some cases (e.g. Template:Cite web) it may be desirable to use IncludedWorkTitle for the title, and not use the Title parameter at all.
  • |IncludedWorkURL= URL of the contribution or chapter, or other included work.
  • |Issue= issue number of the periodical.
  • |language= specifies the language in which the source is written, if not English.
  • |laydate= Date of a lay summary
  • |laysummary= Summary of the source in a layman-friendly journal - for instance a BBC news article about a paper in Nature.
  • |OCLC=Online Computer Library Center ID number.
  • |Other= Other details to be inserted in a particular place
  • |PMC= PubMed Central article number for full-text free repository of an article.
  • |PMID= PubMed Unique Identifier.
  • |Periodical= name of the periodical, journal, or magazine. This parameter controls whether or not the template will generate a citation in the style appropriate to a periodical, journal, magazine, or other serial publication.
  • |Place= place where the item was created (outputs "written at location"; this parameter should not be used for location of publication; see |PublicationPlace=, below.
  • |PublicationDate= date of publication.
  • |PublicationPlace= city of publication.
  • |Publisher= name of the publisher.
  • |quote= text to be quoted from the source. If supplied, this is enclosed in double-quotes.
  • |PS= postscript terminating the citation. This is empty by default.
  • |Ref= A reference name - if the citation is referred to using the Harvard referencing suite of templates.
  • |Sep= specifies the punctuation mark used to separate fields. This usually defaults to a period, but may occasionally be a comma. For technical reasons, the template will malfunction if a semicolon is passed as a separator. To circumvent this, the calling template should encode semicolons:
    |Sep = {{#ifeq:{{{separator}}}|;|&#059;|{{{separator|!}}}}}
    Replace the exclamation mark with a default separator, if one different to a period is desired.
  • |Series= series of which this periodical is a part.
  • |Surname1= first author's surname or last name.
  • |Surname2=, |Surname3=, ..., |Surname9= up to eight additional authors’ surnames or last names. The ninth is not actually used, but causes et al. to be generated.
  • |Title= Title, to be displayed in italics after |IncludedWorkTitle=. Used, for example, when citing the title of a book; the chapter title would be passed to IncludedWorkTitle
  • |TitleType= specific type of item cited. Example: PhD thesis. Appears in parentheses immediately after Title (or TransTitle).
  • |TransItalic= Translated italicized title, in case the original title is in a foreign language. Can be used in conjunction with TransTitle, e.g. for book and chapter title, respectively. This translated string will appear in square brackets, following the italicized book title, with the same URL link.
  • |TransTitle= Translated title, in case the original title is in a foreign language. The translated title will appear inside square brackets, enclosed within the quotation marks of the IncludedWorkTitle.
  • |URL= Uniform Resource Locator of an online location where the article can be found.
  • |Volume= volume number of a multi-volume book or compilation.
  • |YearNote= Note to accompany the year. Example: First published 1886
  • |Year= year of authorship or publication.