Predefinição:Reflist/doc
This is a documentation subpage for Predefinição:Reflist. It contains usage information, categories and other content that is not part of the original predefinição page. |
{{Reflist}} is a citation template that provides formatting and organizational features for footnotes at the bottom of a page. It encapsulates the <references />
tag used by the cite MediaWiki extension to show the list of references as defined by <ref>
tags. It adds support for sizing the column width, groups and list-defined references. This was originally from Wikipedia.
Specifically, {{Reflist}} is used to list citations, where it helps to verify that the information given is supported by reliable sources.
Usage[editar código-fonte]
{{Reflist}} usually needs to be placed at the bottom of a page, with a h2 header above it named "References". The usage for this is mostly for citations. Note that this template is not used to list notes: that is taken care of with {{Notelist}}
.
Note that it is preferable to use {{Ref}} as the footnote marker rather than a typical <ref>
tag. This allows your citation to appear within the Reflist template in an efficient way.
The following text shows how it would be typically written:
Lorem ipsum.{{ref|Citation stuff}} Lorem ipsum dolor sit amet.<ref>Citation stuff</ref> ==References== {{Reflist}} |
And as such, it would be rendered as:
|
Parameters[editar código-fonte]
You can add parameters, but they are optional; if none are supplied, a single-column list will be generated if there are fewer than 10 references in the list. If more than 10 references appear, it will use columns of 30em wide depending on the device.
Optional parameters are:
- Unnamed parameter (must be the first one if used): the minimum width for each column of references, typically in ems. Syntax (for example)
|30em
with no space (i.e. not|30 em
). See § Columns below. |refs=
: used with list-defined references. See § List-defined references below.|group=
: identifies by name the subset of references to be rendered; the value should correspond to that used inline, e.g., {{Reflist|group=groupname}} renders all references with groupname as the group name (<ref group=groupname>
). Wikipedia has five pre-defined group names that style the list differently, but the Len'en Wiki would only need three at most. See § Grouped references below.|liststyle=
: specifies the style used when the reference list is rendered. The default is a numerical list. When set, it will override the style set by the|group=
parameter, without affecting group functionality. See § Predefined groups and list styles below.
Columns[editar código-fonte]
{{Reflist|30em}} (for example) instructs the browser to create as many columns as possible (of width at least 30 em, in this example) given the width of the display window. There must not be a space between the number and the unit.
Usually, it is not required to indicate the column width as it is done automatically. However, assuming you have decided to use {{Reflist|20em}}, then the template would be rendered as:
Lorem ipsum.[1] Lorem ipsum.[2] Lorem ipsum.[3] Lorem ipsum.[4] Lorem ipsum.[5] Lorem ipsum.[6] Lorem ipsum.[7] Lorem ipsum.[8] Lorem ipsum.[9] Lorem ipsum.[10] Lorem ipsum.[11]
References[editar código-fonte]
- The syntax {{Reflist|2}} (for example), which specifies two columns of equal width regardless of the available display width, is deprecated (and is disabled for mobile view). When you use 1, the template gives you a single column while 2 will pretend you specified 30em. When using higher column counts, it will pretend you specified 25em.
- Browser support: Internet Explorer 10+, Microsoft Edge, Firefox 2+, Chrome 4+, Safari 3.1+, Opera 11.1+.
List-defined references[editar código-fonte]
Note: Not usually needed.
A list of references may be defined within {{Reflist}}
using the |refs=
parameter, just like including named <ref name="...">...</ref>
elements inside the <references>...</references>
container.
Example[editar código-fonte]
Markup:
This is reference 1.<ref name="refname1" /> This is reference 2.<ref name="refname2" /> ==References== {{Reflist|refs= <ref name="refname1">content1</ref> <ref name="refname2">content2</ref> }} |
Rendered as:
|
Grouped references[editar código-fonte]
References can be grouped into separate sections (for explanatory notes, table references, etc.) via group=
:
<ref group=groupname>
where groupname is (for example) games
or sources
. The group name need not be enclosed in quotes; this differs from the footnote marker where quotes are required if the group name includes a space.
Each group used in the article must have a matching reference list:
- {{Reflist|group=groupname}}
Predefined groups and list styles[editar código-fonte]
This should be use subtly and with good reason. There are three predefined group names that automatically set the labels in the footnote markers and the reference list to other styles (e.g. [1]). Reference lists are by default numbered lists. By using the |liststyle=
parameter, you can control how the list is rendered. For example, using |liststyle=lower-roman
will result in references being labelled with roman numerals instead of decimal numbers. The parameter accepts any valid CSS value defined for list-style-type
.
You could instead use the |group=
parameter to state a preferred list style. Thus, setting {{Reflist|group=lower-roman}}
will set the group to lower-roman
and also style the reference list with roman numbers. The matching footnote marker can be formed by <ref group=roman>...</ref>
. If you use both parameters, then |liststyle=
will override the list style stated in |group=
.
This is made easier by a series of templates to set the group/label styles for the footnote marker and the reference list:
Group type | Sample labels |
---|---|
none | 1 2 3 4 5 6 7 8 9 10 |
lower-alpha | a b c d e f g h i j |
lower-roman | i ii iii iv v vi vii viii ix x |
Wikipedia has up to five of these, plus it's a bit more complicated, but for the Len'en Wiki, three simple groups listed above are more than enough.
Take note that it is possible to use |liststyle=
so that the labels for the footnote marker and the reference list marker differ. This should be used with care as it can be confusing to readers. For example:
Markup:
<ref group=note>Reference</ref> {{Reflist|group=note|liststyle=lower-alpha}} |
Renders as:
|
Technical details[editar código-fonte]
Font size[editar código-fonte]
The font size should reduce to 83% for most browsers, but may appear to show at 100% for Internet Explorer and possibly other browsers.
Interaction with images[editar código-fonte]
In the unusual case of an image being placed to the left of a reference list, layout problems may occur on some browsers. This can be prevented by using the columns feature.
Browser support for columns[editar código-fonte]
Multiple columns are generated by using CSS3, which is still in development; thus only browsers that properly support the multi-column property will show multiple columns with {{Reflist}}
, such as Firefox, Chrome and Internet Explorer.
Widows and orphans[editar código-fonte]
The use of columns can result in widows and orphans, where a citation at the bottom of a column may be split to the top of the next column. MediaWiki:Common.css includes CSS rules to prevent list items from breaking between columns. Widows may still show in extreme circumstances.
Supporting CSS[editar código-fonte]
{{Reflist}}
uses a CSS rule in MediaWiki:Common.css to set the font size:
div.reflist { font-size: 83%; }
The following class is assigned by the template when column width is set:
.references-column-width
The following CSS properties are utilized using the {{Column-width}}
templates:
column-width
CSS3 standard-moz-column-width
Mozilla CSS extension-webkit-column-width
Webkit CSS extension
Customizing the view[editar código-fonte]
By editing your CSS, the personal appearance of the reference list can be customized. From Preferences, select the Appearance tab, then on the selected skin select Custom CSS. After editing and saving, follow the instructions at the top of the page to purge. See Wikipedia:Skin#Customisation (advanced users) for more help.
Font size
Reference lists defaults to 90% standard font size. To change it, add: ol.references,
div.reflist,
div.refbegin {
font-size: 83%;
}
Change 83% to the desired size. |
Columns
To disable columns, add: .references-column-width {
-moz-column-width: auto !important;
-webkit-column-width: auto !important;
column-width: auto !important;
}
|
Column dividers
To add dividers (rules) between columns, add: .references-column-width {
-moz-column-rule: 1px solid #aaa;
-webkit-column-rule: 1px solid #aaa;
column-rule: 1px solid #aaa;
}
You can alter the appearance of the dividers by changing the values. |
See also[editar código-fonte]
{{Notelist}}
: version of reflist used to make notes of stuff rather than citing- Wikipedia:Citing sources: style guide for the citation of sources
- Wikipedia:Citation templates: templates for use with references