Help:Cite

From Memipedia

<languages/> <translate> Cite makes it possible to add footnotes to a page.

See <tvar|1>Extension:Cite </> for technical details.

Usage[edit]

The basic concept of the <tvar|1><ref></> tag is that it inserts the text enclosed by the ref tags as a footnote in a designated section, which you indicate with the placeholder tag <tvar|2><references /></>. This format cannot be used interchangeably with the older format—you must pick one or the other.

Additional placeholder tags <tvar|1><references /></> can be inserted in the text, and all <tvar|2><ref></> tags up to that point, in that group, will be inserted there.

If you forget to include <tvar|1><references /></> in the article, the footnotes will not disappear, but the references will be displayed at the end of the page. </translate>

<translate> This page itself uses footnotes, such as the one at the end of this sentence.</translate>[note 1] <translate> If you [<tvar|url>https://memes.miraheze.org/w/index.php?title=Help:Cite&action=edit</> view the source] of this page by clicking "Edit this page", you can see a working example of footnotes.</translate>

<translate> Wikitext</translate> <translate> Rendering</translate>
<translate nowrap><!--T:104--> The Sun is pretty big.</translate><ref><translate nowrap><!--T:219--> E. Miller, ''The Sun'', (New York: Academic Press, 2005), 23–25.</translate></ref> <translate nowrap><!--T:220--> The Moon, however, is not so big.</translate><ref><translate nowrap><!--T:221--> R. Smith, "Size of the Moon", ''Scientific American'', 46 (April 1978): 44–46.</translate></ref>

<translate nowrap>
==Notes== <!--T:105-->
</translate>
<references />

<translate> The Sun is pretty big.</translate>[1] <translate> The Moon, however, is not so big.</translate>[2]

<translate> Notes</translate>
  1. <translate> E. Miller, The Sun, (New York: Academic Press, 2005), 23–25.</translate>
  2. <translate> R. Smith, "Size of the Moon", Scientific American, 46 (April 1978): 44–46.</translate>

<translate>

Multiple uses of the same footnote[edit]

</translate> <translate> To give a footnote a unique identifier, use <tvar|1><ref name="name"></>.</translate> <translate> You can then refer to the same footnote again by using a ref tag with the same name.</translate> <translate> The text inside the second tag doesn't matter, because the text already exists in the first reference.</translate> <translate> You can either copy the whole footnote, or you can use a terminated empty ref tag that looks like this: <tvar|1><ref name="name" /></>.</translate>

<translate> In the following example, the same source is cited three times. </translate>

<translate> Wikitext</translate> <translate> Result</translate>
<translate nowrap><!--T:109--> This is an example of multiple references to the same footnote.</translate><ref name="multiple"><translate nowrap><!--T:226--> Remember that when you refer to the same footnote multiple times, the text from the first reference is used.</translate></ref>

<translate nowrap><!--T:110--> Such references are particularly useful when citing sources, if different statements come from the same source.</translate><ref name="multiple" /> <translate nowrap><!--T:227--> Any reused tag should not contain extra content, that will spawn an error.</translate> <translate nowrap><!--T:228--> Only use empty tags in this role.</translate>

<translate nowrap><!--T:111--> A concise way to make multiple references is to use empty ref tags, which have a slash at the end.</translate>
<translate nowrap><!--T:229--> Although this may reduce redundant work, please be aware that if a future editor removes the first reference, this will result in the loss of all references using the empty ref tags.</translate><ref name="multiple" />

<translate nowrap>
==Notes== <!--T:112-->
</translate>
<references />

<translate> This is an example of multiple references to the same footnote.</translate>[1]

<translate> Such references are particularly useful when citing sources, if different statements come from the same source</translate>[1] <translate> Any reused tag should not contain extra content, that will spawn an error.</translate> <translate> Only use empty tags in this role.</translate>

<translate> A concise way to make multiple references is to use empty ref tags, which have a slash at the end.</translate> <translate> Although this may reduce redundant work, please be aware that if a future editor removes the first reference, this will result in the loss of all references using the empty ref tags.</translate>[1]

<translate> Notes</translate>
  1. 1.0 1.1 1.2 <translate> Remember that when you refer to the same footnote multiple times, the text from the first reference is used.</translate>
1>name</> attribute require alphabetic characters; solely relying on numerals will generate an error message.</translate> <translate> The quotes are optional unless the name includes a space, punctuation or other mark.</translate> <translate> It is recommended that names be kept simple and restricted to the ASCII character set.</translate>

<translate>

The <tvar|1><references /></> tag[edit]

</translate> <translate> The <tvar|1><references /></> tag inserts the text of all the citations which have defined in <tvar|2><ref></> tags up to that point in the page.</translate> <translate> For example, based on the citations above, there should be reference for the <tvar|1>note</> group.</translate>

<translate> Wikitext</translate> <translate> Result</translate>
<references group="note"/>
  1. <translate> This footnote is used as an example in the "How to use" section.</translate>

<translate> The reference list [[<tvar|1>Special:MyLanguage/Contributors/Projects/Columns for references</>|can have a responsive width]] (displaying in some cases the references in several columns).</translate> <translate> In that case, the <tvar|1>responsive</> attribute is used to configure that behavior.</translate> <translate> On wikis with the default configuration, this will happen on every page; on others, you need to activate it.</translate>

<translate> In some language editions of Wikipedia, long reference lists may be placed using the template {{Reflist}}, which incorporates <tvar|1><references /></>.</translate> <translate> It provides an optional parameter to display the reference list in multiple columns.</translate> <translate> For instance, the Hindi and Interlingua Wikipedias use the CSS selector <tvar|1>references-small</> to make the reference text smaller than normal text.</translate>

<translate> Using templates in this way is strongly discouraged, for compatibility, performance, and functionality reasons. </translate>

<translate> If a page includes more than one <tvar|1><references /></> list, each list includes the <tvar|2><ref></> tags defined after the previous references list.</translate> <translate> If these references lists are produced by templates, each one lists the ref tags defined before the first references list, and there is an error message saying that there is a ref tag but not a references list.</translate>

<translate>

Grouped references[edit]

This may be disabled by <tvar|1>$wgAllowCiteGroups = false;</> if desired.

The following example generates separate reference lists for citations and miscellaneous footnotes: </translate>

<translate> Wikitext</translate> <translate> Result</translate>
<translate nowrap><!--T:130--> According to scientists, the Sun is pretty big.</translate><ref><translate nowrap><!--T:240--> E. Miller, ''The Sun'', (New York: Academic Press, 2005), 23–25.</translate></ref> <translate nowrap><!--T:241--> In fact, it is very big.</translate><ref group="footnotes"> <translate nowrap><!--T:242--> Take their word for it.</translate> <translate nowrap><!--T:243--> Don't look directly at the sun!</translate></ref>

<translate nowrap>
==Notes== <!--T:131-->
</translate>
<references group="footnotes" />

<translate nowrap>
==References== <!--T:132-->
</translate>
<references />
<translate> According to scientists, the Sun is pretty big.</translate>[1] <translate> In fact, it is very big.</translate>[footnotes 1]
<translate> Notes</translate>
  1. <translate> Take their word for it.</translate> <translate> Don't look directly at the sun!</translate>
<translate> References</translate>
  1. <translate> E. Miller, The Sun, (New York: Academic Press, 2005), 23–25.</translate>

<translate> The anonymous group works as before, while references destined for the named group will only show up in the designated <tvar|1><references /></> element. </translate>

1>group</> attribute require alphabetic characters; solely relying on numerals will generate an error message.</translate> <translate> The quotes are optional unless the name includes a space, punctuation or other mark.</translate> <translate> It is recommended that names be kept simple and restricted to the ASCII character set.</translate>

<translate>

Citing different parts of the same source[edit]

</translate> <translate> When several parts from the same work are used as references in an article, you can cluster them in the reference section.</translate> <translate> This gives readers a way to identify which references originate from the same source.</translate> <translate> It also allows you to cite different parts of the same source without repeating the entire source every time.</translate>

<translate> Wikitext</translate> <translate> Result</translate>
<translate nowrap><!--T:141--> According to scientists, the Sun is pretty big.</translate><ref name="Miller"><translate nowrap><!--T:253--> E. Miller, ''The Sun'', (New York: Academic Press, 2005).</translate></ref> <translate nowrap><!--T:254--> In fact, it is very big.</translate><ref extends="Miller">p. 123</ref> <translate nowrap><!--T:255--> Take their word for it.</translate> <translate nowrap><!--T:256--> Don't look directly at the sun!</translate><ref extends="Miller">p. 42</ref>

<translate nowrap>
==References== <!--T:142-->
</translate>
<references />
<translate> According to scientists, the Sun is pretty big.</translate>[1] <translate> In fact, it is very big.</translate>[1.1] <translate> Take their word for it.</translate> <translate> Don't look directly at the sun!</translate>[1.2]
<translate> References</translate>

<translate> 1. E. Miller, The Sun, (New York: Academic Press, 2005)</translate>
   1.1 ↑ p. 123
   1.2 ↑ p. 42

<translate> Note that this feature doesn't yet work on wikis outside the beta cluster, which is why the above example is a mock.</translate> <translate> You can follow the project update at [[<tvar|1>m:Special:MyLanguage/WMDE Technical Wishes/Book referencing</>|m:WMDE Technical Wishes/Book referencing]].</translate>

<translate>

Separating references from text[edit]

</translate> <translate> In-text references make it easy to copy the text to another page; on the other hand, they make it hard to read.</translate> <translate> References containing a lot of data, quotes or elaborate citation templates can make up a significantly larger fraction of the source than the text that will actually be visible.</translate> <translate> To avoid this, recent versions of the extension allow moving some or all of the references into the <tvar|1><references /></> section, to the place where they will actually appear to the reader.</translate>

<translate> Wikitext</translate> <translate> Result</translate>
<translate nowrap><!--T:152--> According to scientists, the Sun is pretty big.</translate><ref name="miller" /> <translate nowrap><!--T:262--> The Moon, however, is not so big.</translate><ref name="smith" />

<translate>
==Notes== <!--T:153-->
</translate>
<references>
<ref name="miller"><translate nowrap><!--T:263--> E. Miller, ''The Sun'', (New York: Academic Press, 2005), 23–25.</translate></ref>
<ref name="smith"><translate nowrap><!--T:264--> R. Smith, "Size of the Moon", ''Scientific American'', 46 (April 1978): 44–46.</translate></ref>
</references>

<translate> According to scientists, the Sun is pretty big.</translate>[1] <translate> The Moon, however, is not so big.</translate>[2]

<translate> Notes</translate>
  1. <translate> E. Miller, The Sun, (New York: Academic Press, 2005), 23–25.</translate>
  2. <translate> R. Smith, "Size of the Moon", Scientific American, 46 (April 1978): 44–46.</translate>

<translate> Thus, the code above will have the same output as the [[<tvar|1>#Example</>|first example]] above, although the numbering and order of the references will not in general be the same.

Substitution and embedded parser functions[edit]

</translate> <translate> Since Cite's <tvar|1><ref></> tag is parsed before MediaWiki's parser functions (e.g. <tvar|2>{{#ifexpr:…}}</>) or variables (e.g. <tvar|3>{{PAGENAME}}</>) or before <tvar|4>subst:</>, these will not work inside of citation references.</translate> <translate> Instead, you have to use the [[<tvar|1>Special:MyLanguage/Help:Magic words#Miscellaneous</>|magic word <tvar|2>{{#tag:…}}</>]].</translate>

<translate> Wikitext</translate> <translate> Result</translate>
Foo<ref><translate nowrap><!--T:159--> This is not working, see {{<tvar|1>cite journal|url=https://www.google.com |author= |date= |accessdate={{subst:#time:Y-m-d|now}}</>|title=Search}}</translate></ref> bar baz…
Foo{{#tag:ref|<translate nowrap><!--T:270--> Whereas this does, see {{<tvar|1>cite journal|url=https://www.google.com |author= |date= |accessdate={{subst:#time:Y-m-d|now}}</>|title=Search}}</translate>}} bar baz…
<references />

Foo[1] bar baz… Foo[2] bar baz…

  1. <translate> This is not working, see {{<tvar|1>cite journal|url=https://www.google.com |author= |date= |accessdate={{subst:#time:Y-m-d|now}}</>|title=Search}}</translate>
  2. <translate> Whereas this does, see {{<tvar|1>cite journal|url=https://www.google.com |author= |date= |accessdate=2021-03-11</>|title=Search}}</translate>

<translate>

Adding an automatic heading before the references list[edit]

</translate> <translate> Up to MediaWiki 1.28, one could use the system message <tvar|1>MediaWiki:Cite references prefix</> to define a wiki-wide heading which would be automatically inserted before each references list.</translate> <translate> In MediaWiki 1.29, this system message was removed.</translate> <translate> A hacky way to enter a headline now is to add the following code to <tvar|1>MediaWiki:Common.js</>:</translate>

$(document).ready(function(){
    $('.mw-references-wrap').before('<h2><translate nowrap><!--T:275--> References</translate></h2>');
});

<translate> If you only need a text heading (no link or other active elements) you could add the following to <tvar|1>MediaWiki:Common.css</> (Chrome 4, IE9, FF 3.5, Safari 3.1, Opera 7): </translate>

.mw-references-wrap::before {
  content: "Blue references";
  color: #0645ad;
  text-decoration: none;
  background: none;
  font-style: italic;
  font-size: 100%;
  font-weight: bold;
  line-height: 1.6;
  direction: ltr;
  font-family: sans-serif;
}

<translate>

Merging two texts into a single reference[edit]

</translate> <translate> A typical Wikisource issue are references that span multiple pages in the source material.</translate> <translate> These can be merged using a <tvar|1><ref name="name"></> tag for the first part of the reference, and tagging the following parts with a tag <tvar|2><ref follow="name"></> using the same name.</translate>

<translate> Example: </translate>

<translate> Wikitext</translate> <translate> Result</translate>
<translate nowrap><!--T:168--> This is an example of merging multiple texts into the same footnote.</translate><ref name="main"><translate nowrap><!--T:276--> Remember that all the texts will be included into the reference containing the <tvar|1>name="…"</> attribute.</translate></ref>

<ref follow="main"><translate nowrap><!--T:169--> Simply include the additional text in a tag with the <tvar|1>&lt;ref follow="…"></> attribute, matching the first ref's name.</translate></ref>

<translate>
==References== <!--T:170-->
</translate>
<references/>

<translate> This is an example of merging multiple texts into the same footnote.</translate>[1]


<translate> References</translate>

  1. <translate> Remember that all the texts will be included in the reference containing the <tvar|1>name="…"</> attribute.</translate> <translate> Simply include the additional text in a tag with the <tvar|1><ref follow="…"></> attribute, matching the first ref's name.</translate>

<translate> When using this syntax, take care that the "<tvar|1>follow</>" part of the footnote is included on the same page as the first part of the reference.</translate> <translate> Note that reference names cannot be start with a number, so always include some text like, <tvar|2><ref name="p32"></> and <tvar|3><ref follow="p32"></>.</translate>

<translate>

Customization[edit]

The format of the output of <tvar|1><ref></> and <tvar|2><references></> is almost completely customizable through MediaWiki [[<tvar|3>Special:MyLanguage/Help:System message</>|messages]], that can be modified, for example, through the MediaWiki namespace depending on the configuration of the wiki.

For a list of messages that control the output of <tvar|ref><ref></> and <tvar|references><references></> and the values, if any, that are passed to them ($1, $2, $3 ...), see [<tvar|url>https://www.mediawiki.org/w/index.php?title=Special%3AAllMessages&prefix=Cite_ref&filter=all&lang=en&limit=300</> an up-to-date listing of the default values] that can be obtained directly from MediaWiki. </translate>

<translate> Incomplete list</translate>
  • cite_reference_link_key_with_num
    1. key
    2. num
  • cite_reference_link_prefix
  • cite_reference_link_suffix
  • cite_references_link_prefix
  • cite_references_link_suffix
  • cite_reference_link
    1. <translate> ref ID</translate>
    2. <translate> backlink ID</translate>
    3. <translate> count to display</translate>
  • cite_references_link_one
    • <translate> Used to format the source list that <tvar|1><references /></> outputs, it configures 3 things: the backlink ID, the ref ID, and text of note.</translate>
    1. <translate> backlink ID</translate> — <translate> Used for creating the number order of the source list.</translate>
    2. <translate> ref ID</translate> — <translate> Used to link back to the actual reference in the text, this is where you can configure the <tvar|1>^'’'</> symbol.</translate>
    3. <translate> text of note</translate> — <translate> text used above describing the source info</translate>
  • cite_references_link_many
    1. <translate> backlink ID</translate>
    2. <translate> list of links</translate>
    3. <translate> text of note</translate>
  • cite_references_link_many_format
    1. <translate> ref ID</translate>
    2. <translate> numeric value to use as a backlink</translate>
    3. <translate> custom value (as defined in <tvar|1>cite_references_link_many_format_backlink_labels</> to use as a backlink)</translate>
  • cite_references_link_many_format_backlink_labels
  • cite_references_link_many_sep
  • cite_references_link_many_and
  • cite_references_suffix

<translate>

Set references to use <tvar|1>^</> and letters[edit]

</translate> <translate> To replace the default uparrow (<tvar|1>↑</>) with caret (<tvar|2>^</>), modify the following [[<tvar|3>Special:MyLanguage/Help:System message</>|system messages]].</translate> <translate> All of these pages can be found on <tvar|1>Special:AllMessages</>.</translate>

MediaWiki:Cite references link one
<translate> From</translate> <translate> To</translate>
<li id="$1"$4><span class="mw-cite-backlink">[[#$2|↑]]</span> $3</li>
<li id="$1"$4><span class="mw-cite-backlink">[[#$2|^]]</span> $3</li>
MediaWiki:Cite references link many
<translate> From</translate> <translate> To</translate>
<li id="$1"$4><span class="mw-cite-backlink">↑ $2</span> $3</li>
<li id="$1"$4><span class="mw-cite-backlink">^ $2</span> $3</li>
MediaWiki:Cite references link many format

<translate> Replacing $2 with $3 changes the links from 1.0, 1.1, 1.2 to a, b, c etc… </translate>

<translate> From</translate> <translate> To</translate>
<sup>[[#$1|$2]]</sup>
<sup>[[#$1|$3]]</sup>

<translate> Searching for these pages for the first time will result in no matches.</translate> <translate> Simply click "Create this page" to edit the code.</translate> <translate> The changes will not show up until a page with references is rebuilt.</translate>

<translate>

Set reference and reference number highlighting[edit]

</translate>

Cite/modules/ext.cite.css</>.</translate> <translate> Thus the CSS code below no longer needs to be added manually.</translate> ">1>MediaWiki 1.26 </> the selectors for highlighting are now incorporated into <tvar

<translate> Add the following code to the <tvar|1>MediaWiki:Common.css</> page. </translate>

/* <translate nowrap><!--T:300--> make the Cite extension list of references look smaller and highlight clicked reference in blue</translate> */
ol.references { font-size: 90%; }
ol.references li:target { background-color: #ddeeff; }
sup.reference:target { background-color: #ddeeff; }

<translate>

Broken references[edit]

</translate>

<translate> If the <tvar|ref><ref></> or <tvar|references><references /></> tags are used incorrectly, the Cite extension will add an error message to the page, and will add the "<tvar|category>Pages with reference errors</>" category.</translate> <translate> These error messages will appear in the user interface language, either in the article content or in the References section.</translate> <translate> For example:</translate>

<translate> Wikitext</translate> <translate> Result</translate>
<translate nowrap><!--T:191--> This is an example of a references error message.</translate><ref broken><translate nowrap><!--T:192--> Intended text.</translate></ref>

<translate nowrap>
==Notes== <!--T:193-->
</translate>
<references />

<translate> This is an example of a references error message.</translate>Cite error: Invalid <ref> tag; invalid names, e.g. too many

<translate> Notes</translate>

<translate> See the [[<tvar|1>Specs/HTML/Extensions/Cite#Error representation</>|spec for Parsoid's Cite error representation]].

See also[edit]

</translate>

[[Category:Extension help{{#translation:}}|Cite]]