Difference between revisions of "Template:Ref"

From Chevy Wiki
Jump to navigation Jump to search
(uploaded "Image:Template-info.svg": Importing image file)
m (1 revision)
 
Line 1: Line 1:
{{documentation subpage}}
<span class="reference plainlinksneverexpand" {{#ifeq:{{{noid}}}|noid||id="ref_{{{1}}}"}}><sup>{{#if:{{{2|}}}|[[#endnote_{{{1}}}|{{{2}}}]]|[{{fullurl:{{FULLPAGENAME}}}}#endnote_{{{1|}}}]}}</sup></span><noinclude>
<!-- EDIT TEMPLATE DOCUMENTATION BELOW THIS LINE -->
{{pp-template}}{{documentation}}
 
<!-- Add categories and interwikis to the /doc subpage, not here! -->
==Usage==
</noinclude>
Use this template to create a reference list in small font for an article.  Note that there is no consensus that small font size should always be used for all references; when normal-sized font is more appropriate on an article, use <code><nowiki><references&nbsp;/></nowiki></code> instead.
 
If used with no parameters, it will produce a reference list with a single column.
 
===Font size===
The font size should reduce to 90% for most browsers, but may show at 100% for Internet Explorer and possibly other browsers. Reflist uses one CSS entry in [[MediaWiki:Common.css]] to set the font size:
 
* <code>.references-small { font-size: 90%;}</code>
 
There is another CSS entry:
 
* <code>ol.references { font-size: 100%;}</code>
 
Although Reflist does not use this CSS, some browsers may honor it over the references-small CSS, especially Internet Explorer, thus showing the font size at 100%.
 
Editors may over-ride these settings by placing entries in their personal CSS.
 
===Multiple columns===
Using <code>{{tlx|reflist|2}}</code> will create a two-column reference list, and <code>{{tlx|reflist|3}}</code> will create a three-column list.  Three-column lists are inaccessible to users with smaller/laptop monitors and should be avoided.
 
Using <code>{{tlx|reflist|colwidth{{=}}30em}}</code> will allow the browser to automatically choose the number of columns based on the width of the web browser.  Choose a column width that is appropriate for the average width of the references on the page.
 
====Browser support====
Multiple columns are generated by using [[Cascading Style Sheets|CSS3]], which is still in development; thus only browsers that properly support the multi-column selector will show multiple columns.<ref>{{cite web|accessdate=2006-11-24|date=[[2005-12-30]]|title=CSS3 Multi-Column Thriller|url=http://www.stuffandnonsense.co.uk/archives/css3_multi-column_thriller.html}}</ref><ref>{{cite web|url=http://www.w3.org/TR/css3-multicol/|title=CSS3 module: Multi-column layout|publisher=[[World Wide Web Consortium|W3C]]|date=[[2005-12-15]]|accessdate=2006-11-24}}</ref>
 
* [[Mozilla Firefox]] and other [[Gecko (layout engine)|Gecko]]-based browsers support multiple columns with two caveats:
**may create [[Widows and orphans|widows]]
**may mangle long URLs in the printable version; see [[:Image:Wikipediareflistoverlap.gif]] for an example
* [[Internet Explorer]] does not currently support the column selector; version 8 is not scheduled to support it.<ref>{{cite web |url=http://msdn.microsoft.com/en-us/library/cc351024(VS.85).aspx#multicolumn |title=CSS Compatibility and Internet Explorer: Multi-column Layout |work=Microsoft Developer Network |publisher=Microsoft |accessdate=2008-09-15}}</ref>
* [[Safari (web browser)|Safari]] 3.1.2, [[Google Chrome]] and possibly other [[WebKit]] based browsers have a bug that breaks links in multiple columns; the column feature has been removed for these browsers until the bug is resolved; see [[Template:Reflist/Safari testcase]] for details.
* [[Opera (web browser)|Opera]] does not support multiple columns.
 
==== Disabling multiple columns for your account ====
If you cannot abide multiple columns, you may add the following to your personal CSS file (after [[Special:UserLogin/signup|creating an account]] if you have not already done so) to force single-column display while logged in to your account:
<source lang="css">
.references-column-count, .references-column-width {
    column-count:1 !important;
    column-width:auto !important;
    -moz-column-count:1 !important;
    -moz-column-width:auto !important;
    -webkit-column-count:1 !important;
    -webkit-column-width:auto !important;
}
</source>
This will normally have to be added to your [[Special:MyPage/monobook.css|monobook.css]]; if you are using a different skin, look in the "Personal CSS" column of the table [[Help:Skin#Customisation (advanced users)|here]] to find the right file.
 
===Three options for usage===
====Option 1 (only specific references)&nbsp;— Example:====
<pre>
==Content==
Lorem ipsum.<ref>Source name, access date, etc.</ref>
 
Lorem ipsum dolor sit amet.<ref>Source name, access date, etc.</ref>
 
==References==
{{reflist}}
</pre>
 
====Option 2 (only general references)&nbsp;— Example:====
<pre>
==Content==
Lorem ipsum.
 
Lorem ipsum dolor sit amet.
 
==References==
{{refbegin}}
* general reference 1
* general reference 2
{{refend}}
</pre>
 
====Option 3 (both specific and general references)&nbsp;— Example:====
<pre>
==Content==
Lorem ipsum.<ref>Source name, access date, etc.</ref>
 
Lorem ipsum dolor sit amet.<ref>Source name, access date, etc.</ref>
 
Lorem ipsum.
 
Lorem ipsum dolor sit amet.
 
==References==
{{reflist}}
 
{{refbegin}}
* general reference 1
* general reference 2
{{refend}}
</pre>
 
====Continuing the references====
In order to add references manually, use the "#" sign and enclose the additional references in the <code>"references-small"</code> div style, as in this example:
 
{{Pre2|scroll|<nowiki>
<div class="references-small">
#<li value="2"> [http://saturn.jpl.nasa.gov/news/features/feature20070719.cfm ''Cassini-Huygens: NEWS - Features - Saturn Turns 60'']
# [http://www.scitech.ac.uk/PMC/PRel/STFC/frank.aspx ''A new moon for Saturn a family affair'']
# [http://ciclops.org/view.php?id=3353 ''From Dark Obscurity... A Tiny New Saturnian Moon Comes To Light'']
</div>
</nowiki>}}
 
The <code><nowiki><li value="2"></nowiki></code> tag is used to ensure the new references start at the correct number. In the example, there was just one reference. Had there been 10, we would have started the additional references at "11".
 
==Groups extension==
The <nowiki><ref></nowiki> tag now supports named groups so that separate lists may be created— see [[Wikipedia:Footnotes#Separating reference lists and explanatory notes]].
 
The general format for the reference tag would be:
 
<pre><ref group=name></pre>
 
And for the reflist:
<pre>{{reflist|group=name}})</pre>
 
:Where ''name'' would be a group identifier such as "note", "nb" or "label".
 
For example, to create a separate format notes list, the references would be formatted as:
 
<pre><ref group=note></pre>
 
To create the formatted list:
 
<pre>
==Name==
{{reflist|group=note}})</pre>
 
While any number of groups can be created and listed, they should be kept to a minimum.
 
==Caveats==
 
This template (or <code><nowiki><references/></nowiki></code> by any means, for that matter) should probably not be used multiple times in the same page with the same value for the <code><nowiki>group</nowiki></code> parameter. But if this is for some reason required, at least one parameter must be passed to every invocation of the template for correct output. For example, use <code><nowiki>{{reflist|dummy=1}}</nowiki></code> instead of simply <code><nowiki>{{reflist}}</nowiki></code>.
 
==See also==
* [[Wikipedia:Citing sources]]; style guide for the citation of sources, and layout options
* [[Wikipedia:Footnotes]]; style guide for footnotes and inline citations
* Template for adding an HTML comment that explains references
** {{tl|Footnotes}}
; Templates for formatting individual reference citations
* [[Wikipedia:Citation templates]]
; Templates for formatting lists of references and bibliographies
* {{tl|Refbegin}}&nbsp;— {{tl|Refend}}; open and close tags to apply 'references-small' font-size style to a listing
** {{tl|Ref indent}}&nbsp;— {{tl|Ref indent-end}}; open and close tags to apply a [[indentation|hanging indent]] style to a listing
** {{tl|Colbegin}} Template creates 2 columns.
*{{tl|Reflist-talk}}; reflist for Talk pages.
 
==References==
{{reflist}}
 
<includeonly>
<!-- ADD CATEGORIES BELOW THIS LINE -->
[[Category:Citation templates|{{PAGENAME}}]]
 
<!-- ADD INTERWIKIS BELOW THIS LINE -->
[[ar:قالب:ثبت المراجع]]
[[be-x-old:Шаблён:Зноскі]]
[[ca:Plantilla:Referències]]
[[eo:Ŝablono:Referencoj]]
[[es:Plantilla:Listaref]]
[[fr:Modèle:Références]]
[[hi:Template:टिप्पणीसूची]]
[[hsb:Předłoha:Referency]]
[[hu:Reflist]]
[[ia:Patrono:Reflist]]
[[ja:Template:Reflist]]
[[ka:თარგი:სქოლიოს სია]]
[[ko:틀:주석]]
[[lv:Veidne:Reflist]]
[[ml:ഫലകം:Reflist]]
[[ms:Templat:Reflist]]
[[no:Mal:Reflist]]
[[pl:Szablon:Przypisy]]
[[pt:Predefinição:Reflist]]
[[ro:Format:Listănote]]
[[ru:Шаблон:Примечания]]
[[sr:Шаблон:Напомене]]
[[fi:Malline:Viitteet]]
[[zh:Template:Reflist]]
</includeonly>

Latest revision as of 15:12, 3 February 2009

[1]

[edit] Template-info.svg Template documentation

Using ref/note tags is not the only way to do footnotes. Some people prefer to use Cite.php. Cite.php has many advantages, but is not mandatory. You can use the Ref converter to replace ref/note tags with the newer Cite.php style. If you are interested in the discussion, please see the Footnotes talk page.

Simple example

There are many ways to use {{Ref}} and {{Note}}. Among the simplest is:

Article Wikitext

Text that requires a footnote.[2]

Notes


1.^ Body of the footnote.
Text that requires a footnote.{{Ref|1}}

==Notes==

:1.{{Note|1}}Body of the footnote.

Alternative referencing style

The Cite.php <ref> and <references/> system is an alternative style of referencing to the templates discussed on this page. For details on this system, please see Wikipedia:Footnotes and Wikipedia:Cite sources.

A third-party tool to translate articles using the templates described on this page into the Cite.php system is available, see Ref converter.

Usage

For multiple links to one citation in the Reference section, use different id values ("a", "b", etc.), beginning with the first citation. The "id" is used to make multiple backlinks from the note.

Ref-family templates and Links

The {{ref}} family of templates is used to place links into an article. Each link is identified with a reference_name parameter which is used to generate an invisible name to link it with a matching {{note}} template sharing that invisible name. {{note}} templates are usually located just prior to a footnote or other referenced item. It is sometimes useful to use {{ref}} templates more than once with the same reference_name. Whenever that is done, an optional parameter noid=noid should be specified, in exactly that form. The backlink supplied by the matching {{note}} template will be paired with the {{ref}} template instance with the matching reference-name parameter and in which the optional noid=noid parameter was not supplied.

Simple

fuu{{ref|reference_name_A}}
fuu{{ref|reference_name_B}}
fuu{{ref|reference_name_B|noid=noid}}
fuu{{ref|reference_name_C|label}}
fuu{{ref|reference_name_C|label|noid=noid}}

This creates simple links to three separate footnotes, with "reference_name_A", etc. being unique invisible names which are used to create a clickable link to a matching {{note}} template placed at the footnote locations. The backlink from the {{Note}} template at the footnote location would pair with the {{ref}} template for which the noid=noid parameter was not supplied. A superscripted clickable link surrounded by square brackets is generated. If supplied, the optional second parameter is used to label the clickable link.

fuu[3]
fuu[4]
fuu[5]
fuulabel
fuulabel

Complex

There are three complex Ref-family templates: {{ref label}}, {{ref harvard}} and {{ref harv}}. These all pair up with a matching {{note label}} template. All of these, and the matching {{note label}} template have three required parameters: reference_name, label, and id. The invisible name used to link these templates to the matching {{note label}} template is formed by concatenating the first and third parameters (i.e., "referencenameid"). If a particular reference_name and id parameter pair is used more than once, the optional noid=noid parameter should be supplied in all but one instance.

Ref label

{{ref label}} displays the clickable link using the label parameter, surrounded by square-brackets and superscripted.

fuu{{ref label|reference_name_D|label|id}}
fuu[label]

Harvard

{{ref harvard}} displays the clickable link using the label parameter, surrounded by parentheses but not superscripted. {{ref harv}} displays the clickable link using the 'label parameter, surrounded by parentheses and superscripted.

fuu{{ref harvard|reference_name_E|Harvard reference|id_1}}
fuu{{ref harv|reference_name_E|Harvard reference|id_2}}
fuu{{ref harv|reference_name_E|Harvard reference|id_2|noid=noid}}
fuu(Harvard reference)
fuu(Harvard reference)
fuu(Harvard reference)

Note templates and backlinks

There are two Note-family templates: {{note}} and {{note label}}. These templates are usually placed just prior to the location of a footnote or other item referenced in the text by matching {{ref}} family templates. The parameters in these templates match the parameters in the {{ref}}, and it is often convenient to copy a particular {{ref}} template instance to the {{note}} location, and change the name of the copied template from ref to note or from ref (whatever) to note label . Any parameters which are not required by {{note}} templates are ignored if supplied.

Simple

*{{note|reference_name_A}}bar
*{{note|reference_name_C|label}}bar


Creates a simple footnote for the reference with the invisible unique id reference_name and generates a clickable backlink to the {{ref}} template with the matching reference_name and in which the noid=noid is not specified.

Complex

*{{note label|reference_name|number|id}}bar

Creates a clickable link labeled with the id parameter, and paired with the {{ref label}} instance which has matching reference_name and id parameters. The label parameter is not used and is ignored.

A footnote which is cited from multiple locations in the text might have multiple {{note label}} instances associated with it.

*{{note label|Smith2000|Smith 2000:12|a}}{{note label|Smith2000|Smith 2000:45:|b}} Smith (2000), "A book about yammering".

which could produce something like

  • a b  Smith (2000), "A book about yammering".

Examples

Combining Ref and Note family templates with the alternative referencing style

An example combining the use of Ref-family templates with the alternative referencing style might be something like

Yammer yammer yammer.<ref name=smith2000>Smith wrote the definitive book on yammering.{{ref|Smith2000|Smith 2000}}
</ref>Yammer yammer yammer.<ref name=smith2000/>
...
==References==
<References/>
...
==Bibliography==
*{{note|Smith2000}}, Smith 2000, "A book about yammering".

which could produce something like:

Yammer yammer yammer.[1]Yammer yammer yammer.[1]
...
==References==
  1. 1.0 1.1 Smith wrote the definitive book on yammering.Smith 2000
  2. ...
    ==Bibliography==
    • ^ , Smith 2000, "A book about yammering".

    Also see examples and explanation in Wikipedia:Footnote3.

    Table footnotes

    One common application for {{ref}} and {{notes}} templates is in placing footnotes below tables, as in the following example taken from Kent#Economy:

    Year Regional GVA[A] Agriculture Industry[B] Services[C]
    County of Kent (excluding Medway)
    1995 12,369 379 3.1% 3,886 31.4% 8,104 65.5%
    2000 15,259 259 1.7% 4,601 30.2% 10,399 68.1%
    2003 18,126 287 1.6% 5,057 27.9% 12,783 70.5%
    Medway
    1995 1,823 21 3.1% 560 31.4% 1,243 68.2%
    2000 2,348 8 1.7% 745 30.2% 1,595 67.9%
    2003 2,671 10 1.6% 802 27.9% 1,859 69.6%
    A  Components may not sum to totals due to rounding
    B  includes energy and construction
    C  includes financial intermediation services indirectly measured

    Further examples


    The following examples from {{Ref/examples}} are rendered as a template in the following table:

    What to type What it makes

    Linking and footnote templates

    Tags attached to links in text area:

    • "{{ref}} example{{ref|reference1}}" — Links to a citation in the Reference section labeled "reference1".
    • "Deprecated {{ref num}} example{{ref num|reference1|1}}" — Links to a citation in the Reference section labeled "reference1", but marked in the text with the number "1" instead of an automatically generated number. NOTE: {{ref num}} is deprecated. {{ref label}} should be used instead.
    • "{{ref label}} example{{ref label|example.com|2|none}}" — Links to a citation in the Reference section labeled "example.com". Text is marked with the number "2".

    For two links to the same footnote labeled "example.com", you would:

    • "{{ref label}} example{{ref label|example.com|3|a}}"
    • "{{ref label}} example{{ref label|example.com|3|b}}"
    • "{{ref label}} example{{ref label|nextexample.com|4|4}}"
    • "{{ref harvard}} example {{ref harvard|lastexample.com|Jones 1999|none}}" — Links to a citation in the Reference section labeled "lastexample.comnone", and marked in the text with (Jones 1999).
    • "{{ref harv}} example {{ref harv|lastexample.com|Jones 1999|none}}" — Links to a citation in the Reference section labeled "lastexample.comnone", and marked in the text with (Jones 1999).
    • "{{ref harvard}} example {{ref harvard|finalexample.com|Smith 2000|a}}(a)"
    • "{{ref harv}} example {{ref harv|finalexample.com|Smith 2000|a}}(a)"
    • "{{ref harvard}} example {{ref harvard|finalexample.com|Smith 2000|b}}(b)"
    • "{{ref harv}} example {{ref harv|finalexample.com|Smith 2000|b}}(b)"

    Tags attached to links in References or Footnote section:

    "#{{note|reference1}} example of {{note}}" — In References section, citation labeled "reference1".

    "#{{note label|example.com|2|none}}"— In References section, citation labeled "example.comnone". Creates backlink to matching {{ref label}} entry in the text labeled "example.comnone".

    Now, if you have two links to the same footnote labeled "example.com", you would do:

    "#{{note label|example.com|3|a}}{{note label|example.com|3|b}} example of {{note label}}"

    "{{note label|nextexample.com|4|4}} example of {{note label}}"

    • "{{note label|lastexample.com|Jones 1999|none}}Jones (1999) {{note label}}" -- Note that when the 3rd unnamed parameter is specified as "none", the ^ symbol is rendered for the backlink.
    • "{{note label|finalexample.com|Smith 2000|a}}{{note label|finalexample.com|Smith 2000|b}}Smith (2000)"


    In text area:


    In References or Footnote section:

    1. ^  example of {{note}}
    2. ^  example of {{note label}}
    3. a b  example of {{note label}}

    4  example of {{note label}}


    Also see examples and explanation in Wikipedia:Footnote3.


    Instructions

    In an article, a reference link to supporting material can be made with the {{ref}} template, such as this[7]. (Note the link to the reference's footnote; at present it appears as a small number.)

    A significant advantage of using this method is that the reference contains a named link which allows recovery from various edit problems. Otherwise, connections to references can be lost if only numbers are used and editors alter footnote numbers.

    • For multiple references to the same work it is suggested that the page number be used to make each reference unique, i.e. {{ref|Jones1954a-25}}.
    • For journal articles it is suggested a reference similar to AuthorYear be used, i.e. {{ref|Jones1954a}}.
    • Instructions for adding a citations using these templates:
    Footnotes use names, not numbers. Please see Wikipedia:Footnote3 for details.
    1) Assign your footnote a unique name, for example "TheSun_Dec9".
    2) Add the template {{ref|TheSun_Dec9}} to the body of the article where you want the new footnote.
    3) Take note of the name of the footnote that immediately proceeds yours in the article body.
    4) Add #{{Note|TheSun_Dec9}} to the reference list, immediately below the footnote you noted in step 3.
    5) Multiple sources in the text pointing to the same reference will not work: each source must have uniquely-named notes in the References section.
    It is important to add the citations in the right order in the Reference (or Notes) list.

    References (example for Notes)

    1. (used earlier)
    2. ^  This is a footnote with supporting material to the above reference. This footnote is created with the template syntax: {{note|ref_example}}. The {{note}} template presently creates a small symbol ("^") that contains a link back up to the source in the text. Readers thus have links back and forth within the text. The number at the beginning of this line was created with the Wiki notation # placed at the beginning of the line, which only displays a numbered list. The matching number is not necessary, and Wikipedia:Cite sources suggests using the bulleted list notation: *

    See also

    is:Snið:Ref no:Mal:Ref sl:Predloga:Ref sv:Mall:ref de:Vorlage:Ref ar:قالب:Ref bg:Шаблон:Справка bs:Šablon:Ref ca:Plantilla:Ref cs:Šablona:Ref da:Skabelon:Ref el:Πρότυπο:Ref es:Plantilla:Ref fa:الگو:Ref fr:Modèle:Ref label hr:Predložak:Ref hu:Sablon:Hiv id:Templat:Ref it:Template:Ref ja:Template:Ref ko:틀:Ref nl:Sjabloon:Ref no:Mal:Ref pl:Szablon:Ref pt:Predefinição:Ref ro:Format:Ref ru:Шаблон:Ref simple:Template:Ref sk:Šablóna:Ref sl:Predloga:Ref sr:Шаблон:Ref tr:Şablon:Ref uk:Шаблон:Ref zh:Template:Ref