Difference between revisions of "Template:Reflist"
sc4e>Freedo50 m (Protected "Template:Reflist": High use template [edit=sysop:move=sysop]) |
sc4e>Freedo50 |
||
Line 1: | Line 1: | ||
− | <div class="references-small" {{#if: {{{colwidth|}}}| style="-moz-column-width:{{{colwidth}}}; -webkit-column-width:{{{colwidth}}}; column-width:{{{colwidth}}};" | {{#if: {{{1|}}}| style="-moz-column-count:{{{1}}}; -webkit-column-count:{{{1}}}; column-count:{{{1}}};" }} }}> | + | <includeonly><div class="references-small" {{#if: {{{colwidth|}}}| style="-moz-column-width:{{{colwidth}}}; -webkit-column-width:{{{colwidth}}}; column-width:{{{colwidth}}};" | {{#if: {{{1|}}}| style="-moz-column-count:{{{1}}}; -webkit-column-count:{{{1}}}; column-count:{{{1}}};" }} }}> |
− | {{#tag:references||group={{{group|}}}}}</div> | + | {{#tag:references||group={{{group|}}}}}</div></includeonly><noinclude><!-- EDIT TEMPLATE DOCUMENTATION BELOW THIS LINE -->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 /></nowiki></code> instead. |
+ | |||
+ | == Usage == | ||
+ | |||
+ | If used with no parameters, it will produce a reference list with a single column. | ||
+ | |||
+ | === Multiple columns === | ||
+ | Using <code><nowiki>{{reflist|2}}</nowiki></code> will create a two-column reference list, and <tt><nowiki>{{reflist|3}}</nowiki></tt> will create a three-column list. Three-column lists are inaccessible to users with smaller/laptop monitors and should be avoided. | ||
+ | |||
+ | Using <code><nowiki>{{reflist|colwidth=30em}}</nowiki></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's appropriate for the average width of the references on the page. | ||
+ | |||
+ | Note: multiple columns currently render properly only in [[Wikipedia:Mozilla Firefox|Mozilla Firefox]] and other [[WIkipedia:Gecko (layout engine)|Gecko]]-based browsers<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> though the feature is included in [[Wikipedia:Cascading Style Sheets|CSS3]] so it should work for a larger number of browsers in the future.<ref>{{cite web|url=http://www.w3.org/TR/css3-multicol/|title=CSS3 module: Multi-column layout|publisher=[[Wikipedia:World Wide Web Consortium|W3C]]|date=2005-12-15|accessdate=2006-11-24}}</ref> | ||
+ | |||
+ | ===Three options for usage=== | ||
+ | ====Option 1 (only specific references) — 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) — 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) — 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 | ||
+ | <tt>"references-small"</tt> div style, as in this example: | ||
+ | |||
+ | <pre> | ||
+ | <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> | ||
+ | </pre> | ||
+ | |||
+ | 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:Wikipedia:Footnotes#Separating reference lists and explanatory notes|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:Wikipedia:Citing sources|Wikipedia:Citing sources]]; style guide for the citation of sources, and layout options | ||
+ | * [[Wikipedia:Wikipedia:Footnotes|Wikipedia:Footnotes]]; style guide for footnotes and inline citations | ||
+ | |||
+ | ==References== | ||
+ | {{reflist}} | ||
+ | |||
+ | <!-- ADD CATEGORIES BELOW THIS LINE --> | ||
+ | [[Category:Citation templates|{{PAGENAME}}]] |
Revision as of 06:58, 21 August 2008
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 <references />
instead.
Usage
If used with no parameters, it will produce a reference list with a single column.
Multiple columns
Using {{reflist|2}}
will create a two-column reference list, and {{reflist|3}} will create a three-column list. Three-column lists are inaccessible to users with smaller/laptop monitors and should be avoided.
Using {{reflist|colwidth=30em}}
will allow the browser to automatically choose the number of columns based on the width of the web browser. Choose a column width that's appropriate for the average width of the references on the page.
Note: multiple columns currently render properly only in Mozilla Firefox and other Gecko-based browsers[1] though the feature is included in CSS3 so it should work for a larger number of browsers in the future.[2]
Three options for usage
Option 1 (only specific references) — Example:
==Content== Lorem ipsum.<ref>Source name, access date, etc.</ref> Lorem ipsum dolor sit amet.<ref>Source name, access date, etc.</ref> ==References== {{reflist}}
Option 2 (only general references) — Example:
==Content== Lorem ipsum. Lorem ipsum dolor sit amet. ==References== {{refbegin}} * general reference 1 * general reference 2 {{refend}}
Option 3 (both specific and general references) — Example:
==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}}
Continuing the references
In order to add references manually, use the "#" sign and enclose the additional references in the "references-small" div style, as in this example:
<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>
The <li value="2">
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 <ref> 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:
<ref group=name>
And for the reflist:
{{reflist|group=name}})
- 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:
<ref group=note>
To create the formatted list:
==Name== {{reflist|group=note}})
While any number of groups can be created and listed, they should be kept to a minimum.
Caveats
This template (or <references/>
by any means, for that matter) should probably not be used multiple times in the same page with the same value for the group
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 {{reflist|dummy=1}}
instead of simply {{reflist}}
.
See also
- Wikipedia:Citing sources; style guide for the citation of sources, and layout options
- Wikipedia:Footnotes; style guide for footnotes and inline citations
References
- ↑ "CSS3 Multi-Column Thriller" (2005-12-30). Retrieved on 2006-11-24.
- ↑ "CSS3 module: Multi-column layout". W3C (2005-12-15). Retrieved on 2006-11-24.