Template:Cite Q/doc

From MOASSpedia
Jump to navigation Jump to search

Background

You can read about the template in:

Lua error in Module:Cite_Q at line 13: attempt to index field 'wikibase' (a nil value).

Usage

A wrapper for {{Citation}}, which calls available values from Wikidata.

An example of an article using this template for all of its references is South Pole Telescope; an example using Harvard style citations is Suffix automaton.

By default, if there are more than eight author names, the template displays three, followed by "et al". This can be changed using |display-authors=; setting that parameter to all displays them all. The same applies to multiple editors – see the test-case pages.

Citations of papers which have been retracted ( (P5824)) will appear in Category:Cite Q - cites a retracted work.

Citations of papers which have been replaced ( (P1366)) will appear in Category:Cite Q - cites a replaced work.

You can also use {{Cite Q bulleted}} if you want to have a bullet returned before the citation (useful for automatic lists).

Parameters

  • |1= = Wikidata QID for the article

Additionally, any named parameter used in {{citation}} may be entered and will overwrite the value in Wikidata. Using such parameters, with a value of unset, will suppress display of data from Wikidata.

Blank

<ref name="">{{Cite Q| XXQIDXX }}</ref>

Reference naming

For ease of use, you may wish to name your references to reflect the cited work, for example:

<ref name="Williams-2010">{{Cite Q|Q15625490}}</ref>

Parameter / entity map

This section lists where each of the template's supported parameters gets its data.

Bibliographic parameters

Identifier parameters

Examples

{{Cite Q|Q15625490}}
Lua error in Module:Cite_Q at line 13: attempt to index field 'wikibase' (a nil value).
{{Cite Q|Q15625490|page=42}}
Lua error in Module:Cite_Q at line 13: attempt to index field 'wikibase' (a nil value).
{{Cite Q|Q15625490|access-date=18 May 2017}}
Lua error in Module:Cite_Q at line 13: attempt to index field 'wikibase' (a nil value).
{{Cite Q|Q15625490|quote=lorem ipsum}}
Lua error in Module:Cite_Q at line 13: attempt to index field 'wikibase' (a nil value).
{{Cite Q|Q25766745}}
Lua error in Module:Cite_Q at line 13: attempt to index field 'wikibase' (a nil value).
{{Cite Q|Q25766745 |chapter=The Final Cut}} (with chapter specified)
Lua error in Module:Cite_Q at line 13: attempt to index field 'wikibase' (a nil value).
{{Cite Q|Q25766745 |pages=48-52}} (with pages)
Lua error in Module:Cite_Q at line 13: attempt to index field 'wikibase' (a nil value).
{{Cite Q|Q15625490|access-date=18 May 2017}}
Lua error in Module:Cite_Q at line 13: attempt to index field 'wikibase' (a nil value).
{{Cite Q|Q25766745|mode=cs1}}
Lua error in Module:Cite_Q at line 13: attempt to index field 'wikibase' (a nil value).
{{Cite Q|Q25766745|mode=cs2}}
Lua error in Module:Cite_Q at line 13: attempt to index field 'wikibase' (a nil value).
{{Cite Q|Q25766745|author-mask=1}}
Lua error in Module:Cite_Q at line 13: attempt to index field 'wikibase' (a nil value).

For an example of a bibliography, updated periodically by Listeriabot, see User:Mike Peel/publications.

For additional examples, see testcases and testcases/many names.

Workflow

The template used with a single parameter, the Q-number of the article on Wikidata, will produce a citation using the default display parameters from Template:Citation and the styling of the author and editor names as they are stored on Wikidata. This is rarely the same as required by the citation formatting in any given article. The guidance at WP:CITEVAR requires that editors match the formatting of citations that they add to that of the article where it is added. At present, {{Cite Q}} does not know what style the formatting in an article requires (although it is possible that common styles could be marked or recognised automatically as is done for date formatting).

The result is that editors using {{Cite Q}} must take care to preview their edits and ensure that the formatting rendered matches that of the rest of the article. The commonest formatting issues are:

  1. Order of editor names:
    A typical output might be:
    • {{Cite Q |Q15625490}}
    • Lua error in Module:Cite_Q at line 13: attempt to index field 'wikibase' (a nil value).
    If that were used in an article that used "Last, First" format for author names, then the editor would have to supply those author names manually in the desired format. It's often worth previewing the citation in expanded form to show what is being passed to the actual citation template:
    • {{Cite Q |Q15625490 |expand=yes}}
    • Lua error in Module:Cite_Q at line 13: attempt to index field 'wikibase' (a nil value).
    That would make the author names (and author-links) easily available for copy and paste, followed by tweaking into the desired format:
    • {{Cite Q |Q15625490 |author6=Etnoyer, Peter |author4=Hoetjes, Paul |author7=Smith, Michael |author5=Toller, Wes |author3=van Tassell, James L |author-link2=Kent E. Carpenter |author1=Williams, Jeffrey T |author2=Carpenter, Kent E}}
    • Lua error in Module:Cite_Q at line 13: attempt to index field 'wikibase' (a nil value).
  2. Punctuation:
    The separators between elements in the above citation is a comma, which is the default for a CS2-style format produced by {{Citation}}. Careful examination in a particular article will often show the separator punctuation to be a full stop (period). That may be selected by setting |mode=cs1:
    • {{Cite Q |Q15625490 |author6=Etnoyer, Peter |author4=Hoetjes, Paul |author7=Smith, Michael |author5=Toller, Wes |author3=van Tassell, James L |author-link2=Kent E. Carpenter |author1=Williams, Jeffrey T |author2=Carpenter, Kent E |mode=cs1}}
    • Lua error in Module:Cite_Q at line 13: attempt to index field 'wikibase' (a nil value).
    • Sometimes, the article will have author names with initials, and those initials are terminated with a full stop (period). It may be necessary to manually add or remove the punctuation in the author names to match the style of the target article (note: this does not apply to author-links, which match the title of the author's article):
    • {{Cite Q |Q15625490 |author6=Etnoyer, Peter |author4=Hoetjes, Paul |author7=Smith, Michael |author5=Toller, Wes |author3=van Tassell, James L. |author-link2=Kent E. Carpenter |author1=Williams, Jeffrey T. |author2=Carpenter, Kent E. |mode=cs1}}
    • Lua error in Module:Cite_Q at line 13: attempt to index field 'wikibase' (a nil value).
  3. Italicisation in titles:
    Titles drawn from Wikidata cannot contain formatting, so editors using {{Cite Q}} may have to add appropriate formatting.
    {{Citation}} will automatically apply italicisation to titles of books, etc. so that does not need to be added:
    • {{Cite Q |Q25766745}}
    • Lua error in Module:Cite_Q at line 13: attempt to index field 'wikibase' (a nil value).
    However, some titles require partial italicisation, and that has to be done manually when the whole title is not italicised, although that is rare. Titles of chapters may also need to be checked:
    • For example (from ISBN 978-0-521-32115-0): |chapter= ''Porphyra'' as food: cultivation and economic

Module:Wd

Module:Wd can automatically cause this template to be invoked, e.g.,

{{Wikidata|references|raw|Q2978|P2046}}

currently causes the following to be invoked:

{{Cite Q|Q15707237|pages=242}}
Lua error in Module:Cite_Q at line 13: attempt to index field 'wikibase' (a nil value).

because an Lua error in Module:Wd at line 196: attempt to index field 'wikibase' (a nil value). (P2046) statement on Lua error in Module:Wd at line 196: attempt to index field 'wikibase' (a nil value). (Q2978) is referenced to be Lua error in Module:Wd at line 196: attempt to index field 'wikibase' (a nil value). (P248) Lua error in Module:Wd at line 196: attempt to index field 'wikibase' (a nil value). (Q15707237) with Lua error in Module:Wd at line 196: attempt to index field 'wikibase' (a nil value). (P304) = 242.

Issues

Future developments

  • Once robust the functionality should be merged into {{Citation}}
  • Eventually, each signed-in reader should be able to set, under their "Preferences", the style in which they wish to see citations rendered. No more CiteVar wars!
  • We should have a global template repository, so the code can be used by multiple wikis, without having to manually copy it after every update.

To do list

Deferred

Feel free to tackle these; the core team working on Cite Q sees them as low priority, or too complex.

  • Resolve special case of newspaper articles
    • Is the following topic of "hint parameters" related to this?
  • Author names (Western-style, at least) should display as "Last, First Middle" to match Wikipedia house style
    • How to deal with Tussenvoegsels etc.
      • In Romance languages, it should be, e.g., "Quental, Antero de" instead of "de Quental, Antero"
  • Handle volume in a serial
    • Clarification needed: What is meant by this? |part=, or output format differences journal vs. magazine?
  • Is there a Pxxxx code for book series editors to add them to the list of "normal" editors?
    • resolve at Wikidata first

Done

Won't fix

  • Improve date formatting options
  • Fix unnecessary piping of author/editor and journal links if link and label are the same, f.e. [[Author|Author]] -> [[Author]], [[Journal|Journal]] -> [[Journal]] for improved reusability, cleaniness of output, reduced size of resulting page code, and to avoid potential future extra text errors thrown by the underlying {citation} template
    • See talk
  • Fix invocation with |qid= instead of unnamed parameter. At present {{cite Q|qid=Q12345}} instead of {{cite Q|Q12345}} gives an error.
    • This is intended; please discuss on talk
    • Fix ready for test in template sandbox: {{cite Q/sandbox|qid=Q15625490}} gives Template:Cite Q/sandbox

Template data

Generate citations from Wikidata by passing the QID to this template

Template parameters

ParameterDescriptionTypeStatus
QID1

The Wikidata QID of the cited source

Stringrequired