Template:Reflist

From Feed The Beast Wiki
Jump to: navigation, search
Template-info.png Documentation

This citation template provides formatting and organizational features for footnotes. 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 a reduced font size, columns, groups.

If you don't use any of the additional features, then it produces the same output as the simpler and slightly faster <references /> tag.

Parameters[edit source]

  • 1 or colwidth: Two modes supported. First mode: integer number of fixed columns into which the reference list is to be rendered. Second mode: typographic unit of measurement such as 'em', specifying the width for the reference list columns, e.g. '33em'; note that '33\u00a0em' will not be recognized".
  • lifestyle: Specifies the style used when the reference list is enumerated; accepts any valid CSS value defined for list-style-type. Defaults to "decimal".
  • close: When set to '1', forces the reference list to close and render all references defined to that point; useful if including more than one Reflist call.
  • group: Group is an identifier which restricts the references that are shown. Without this parameter, this template only shows references with no group identifier. With a group identifier specified, only references with a matching group identifier are handled. The rest are left alone.
  • refs: Provides a space to define named references for use in the article. References defined in this space are not shown unless used somewhere in the article.

Usage[edit source]

Using only footnote-style references
Markup Renders as
Lorem ipsum.<ref>Source name, access date, etc.</ref>
Lorem ipsum dolor sit amet.<ref>Source name, access date, etc.</ref>

==References==
{{Reflist}}
Lorem ipsum.[1]

Lorem ipsum dolor sit amet.[2]

References
  1. Source name, access date, etc.
  2. Source name, access date, etc.

Columns[edit source]

Browser support: Internet Explorer 10+, Firefox 2+, Chrome 4+, Safari 3.1+, Opera 11.1+

Using {{Reflist|2}} will create a two-column reference list, and {{Reflist|3}} will create a three-column list, and so on. Choose the number of columns that is appropriate for the average width of the references on the page.

Using {{Reflist|30em}} will create columns with a minimum width of 30em, allowing 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. A width measurement must conform to the format given in CSS 2.1 Syntax and basic data types: Lengths; in particular, there must not be a space between the number and the unit.

Widows and orphans[edit source]

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 avoid list items from breaking between columns. Widows may still show in extreme circumstances, such as a reference list formatted in columns where only a single reference is defined.

Markup Renders as
Lorem ipsum.<ref>Source name, access date, etc.</ref>
Lorem ipsum dolor sit amet.

==References==
{{Reflist|3}}
Lorem ipsum.[1]

Lorem ipsum dolor sit amet.

References
  1. Source name, access date, etc.

Practices[edit source]

The number of columns to use is up to the editor, but some major practices include:

  • 1 column (default): Where there are only a few footnotes.
  • 2 columns specified: Where there are a number of footnotes.
  • 30em: Where there are many footnotes plus a page-width Bibliography subsection.

Examples[edit source]

Two columns
Markup Renders as
Lorem ipsum.<ref>Source name, access date, etc.</ref>
Lorem ipsum dolor sit amet.<ref>Source name, access date, etc.</ref>

==References==
{{Reflist|2}}
Lorem ipsum.[1]

Lorem ipsum dolor sit amet.[2]

References
  1. Source name, access date, etc.
  2. Source name, access date, etc.
30em wide columns
Markup Renders as
Lorem ipsum.<ref>Source name, access date, etc.</ref>
Lorem ipsum dolor sit amet.<ref>Source name, access date, etc.</ref>

==References==
{{Reflist|30em}}
Lorem ipsum.[1]

Lorem ipsum dolor sit amet.[2]

References
  1. Source name, access date, etc.
  2. Source name, access date, etc.

List styles[edit source]

Reference lists are by default numbered lists. By using the liststyle parameter, you can control how the list is rendered. For example, using liststyle=upper-roman will result in items being prefixed with roman numerals instead of decimal numbers. The parameter accepts any valid CSS value defined for list-style-type.

The citations in the reference list will show the default decimal styling if:

  • The value for liststyle does not exactly match one of the predefined values
  • The value for liststyle is enclosed by quotes
  • {{Reflist}} is indented with the : markup

Multiple uses[edit source]

<section begin=multiref /> If {{Reflist}} is used multiple times without a parameter, each subsequent use will confusingly repeat the output of the first instance due to template caching. This may also result in an error message:

Cite error: <ref> tags exist, but no <references/> tag was found

Where a page included multiple uses of {{Reflist}}, or a variant such as {{Notelist}}, each subsequent use should include at least one named parameter, such as refs or group. If these parameters are not appropriate, then the practice is to use {{Reflist|close=1}}. Do not use close without the =1, as it will be parsed into the column-width. <section end=multiref />

List-defined references[edit source]

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. This has been available since September 2009. There are new error messages associated with this feature, documented at wikipedia:Help:Cite errors, including one for references defined in {{Reflist}} but not used within the body.

Example[edit source]

Markup Renders as
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>
}}
This is reference 1.[decimal 1]

This is reference 2.[decimal 2]

References
  1. content1
  2. content2

Grouped references[edit source]

As of June 2008, the footnotes system supports the separation of references into groups. This allows groups for explanatory notes, table references and the like.

The general format for the reference tag is:

<ref group="groupname">

And using group for the reflist:

{{Reflist|group="groupname"}}
Where groupname is a group identifier such as "notes", "nb" or "label".

There are three pre-defined group names that will automatically cause the link labels and this template to display other characters instead of numbers (see List styles above). These are: "lower-alpha" (a, b, c...), "lower-greek" (α, β, γ...) and "lower-roman" (i, ii, iii...) and must be written without quotes.

Image flow issues[edit source]

When an image is inserted to the left of the reference list, the list may flow under the image, clipping the reference numbers or hiding them behind the image frame.

Markup Renders as
Lorem ipsum dolor sit amet.<ref>Lorem ipsum dolor sit amet.</ref><ref>Lorem ipsum dolor sit amet.</ref>

==References==
[[File:Example.jpg|left|thumb|100px]]
{{Reflist}}
Lorem ipsum dolor sit amet.[1][2]
References
Example.jpg
  1. Lorem ipsum dolor sit amet.
  2. Lorem ipsum dolor sit amet.

To resolve this issue, use the columns feature. If columns are not desired, simply set it to one column using {{reflist|1}}. Note that if the list is longer then the image, it will cause the space below the image to remain empty. It is recommended that a comment be added so that follow-on editors will understand the use.

Markup Renders as
Lorem ipsum dolor sit amet.<ref>Lorem ipsum dolor sit amet.</ref><ref>Lorem ipsum dolor sit amet.</ref>

==References==
[[File:Example.jpg|left|thumb|100px]] 
{{Reflist|1}}<!--Set one column to resolve flow issues with left floated image.-->
Lorem ipsum dolor sit amet.[1][2]
References
Example.jpg
  1. Lorem ipsum dolor sit amet.
  2. Lorem ipsum dolor sit amet.

See also[edit source]

  • {{Notelist}} – for use with explanatory notes; sets group=lower-alpha