Template:Reflist/doc

From OxDNA

{{#ifeq: doc | doc

 | 

{{

   #ifeq: show | show
   | Template:Mbox
   }}{{
   #if: 
   | 
   | {{#ifexist:Template:Reflist|[[Category:{{
     #switch: Template
     | Template  = Template
     | User      = User
     | #default  = Wikipedia
   }} documentation pages]]|}}
 }}

| }}


This citation template provides formatting and organizational features for footnotes. It encapsulates the {{#switch:s

|c|close  = 
|s|single
|o|open
|p|pair   = <references{{#if:| {{{params}}}}}

}}{{#switch:s

|c|close  = 
|s|single =  />
|o|open   = >
|p|pair   = >...

}}{{#switch:s

|s|single
|o|open   = 
|c|close
|p|pair   = </references>

}} tag used by the Cite.php MediaWiki extension to show the list of references as defined by {{#switch:o

|c|close  = 
|s|single
|o|open
|p|pair   = <ref{{#if:| {{{params}}}}}

}}{{#switch:o

|c|close  = 
|s|single =  />
|o|open   = >
|p|pair   = >...

}}{{#switch:o

|s|single
|o|open   = 
|c|close
|p|pair   = </ref>

}} tags. It adds support for a reduced font size, columns, groups and List-defined references.

Parameters

  • column-count: specifies a fixed number as to how many columns into which the reference list is to be rendered
  • column-width: establishes column width for the reference list based on a typographic unit of measurement
If a single unnamed parameter is supplied, it is treated as a column-count if it is a natural number or as a column-width if it is a typographic unit of measurement such as em.
  • refs: used with named references (e.g. {{#switch:s
|c|close  = 
|s|single
|o|open
|p|pair   = <ref{{#if:name=name| name=name}}

}}{{#switch:s

|c|close  = 
|s|single =  />
|o|open   = >
|p|pair   = >...

}}{{#switch:s

|s|single
|o|open   = 
|c|close
|p|pair   = </ref>

}}); it specifies a list of some or all named references used in the article

  • group: identifies by name the subset of references to be rendered; the value should correspond to that used inline, e.g. {{{{#if:|subst:}}Reflist{{#if:group=groupname|

|group=groupname }}{{#if:| |{{{3}}} }}{{#if:| |{{{4}}} }}{{#if:| |{{{5}}} }}{{#if:| |{{{6}}} }}{{#if:| |{{{7}}} }}{{#if:| |{{{8}}} }}{{#if:| |{{{9}}} }}{{#if:| |{{{10}}} }}{{#if:| |{{{11}}} }}{{#if:| |... }}}} renders all references with groupname as the group name ({{#switch:o

|c|close  = 
|s|single
|o|open
|p|pair   = <ref{{#if:| {{{params}}}}}

}}{{#switch:o

|c|close  = 
|s|single =  />
|o|open   = >
|p|pair   = >...

}}{{#switch:o

|s|single
|o|open   = 
|c|close
|p|pair   = </ref>

}})

  • liststyle: specifies the style used when the reference list is enumerated; if none is specified, the default is to render a numbered list
  • close: forces the reference list to close and render all references defined to that point; see the section on multiple uses for the details.

Usage

{{#if: Using only footnote-style references | |+ Using only footnote-style references}} {{#if: || ! width="50%" scope="col" | Markup}} {{#if: || ! width="50%" scope="col" | Renders as}}{{#if: 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.<ref>Source name, access date, etc.</ref>
Lorem ipsum dolor sit amet.<ref>Source name, access date, etc.</ref>

==References==
{{Reflist}}
Lorem ipsum.<ref>Source name, access date, etc.</ref>

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

References
1 }}
references-column-width references-column-count references-column-count-close }} {{#if: references-column-width }} }}" style="{{#if: close {{#iferror: {{#ifexpr: close > 1 }} -moz-column-width: close; -webkit-column-width: close; column-width: close; Template:Column-count }} {{#if: -moz-column-width: {{{colwidth}}}; -webkit-column-width: {{{colwidth}}}; column-width: {{{colwidth}}}; }} }} list-style-type: {{#switch: upper-alpha upper-roman lower-alpha lower-greek lower-roman = {{{group}}} #default = decimal}};"> <references group=""></references>

}}{{#if: |


}}{{#if: |


}}{{#if: |


}}{{#if: |


}}{{#if: |


}}{{#if: |


}}{{#if: |


}}{{#if: |


}}{{#if: |


}}{{#if: |


}}{{#if: |


}}{{#if: |


}}{{#if: |


}}{{#if: |


}}{{#if: |


}}{{#if: |


}}{{#if: |


}}{{#if: |


}}{{#if: |


}}

{{#if: Using only bibliographical style references (no direct references from the text) | |+ Using only bibliographical style references (no direct references from the text)}} {{#if: || ! width="50%" scope="col" | Markup}} {{#if: || ! width="50%" scope="col" | Renders as}}{{#if: Lorem ipsum. Lorem ipsum dolor sit amet. ==References== {{Refbegin}} * reference 1 * reference 2 {{Refend}}

Lorem ipsum. Lorem ipsum dolor sit amet.

==References==
{{Refbegin}}
* reference 1
* reference 2
{{Refend}}
Lorem ipsum. Lorem ipsum dolor sit amet.
References
1 }}
references-column-width references-column-count references-column-count-{{{1}}} }} {{#if: references-column-width }} }}" style="{{#if: {{#iferror: {{#ifexpr: 1 > 1 }} -moz-column-width: {{{1}}}; -webkit-column-width: {{{1}}}; column-width: {{{1}}}; Template:Column-count }} {{#if: -moz-column-width: {{{colwidth}}}; -webkit-column-width: {{{colwidth}}}; column-width: {{{colwidth}}}; }} }}">{{#if:
}}
  • reference 1
  • reference 2

}}{{#if: |


}}{{#if: |


}}{{#if: |


}}{{#if: |


}}{{#if: |


}}{{#if: |


}}{{#if: |


}}{{#if: |


}}{{#if: |


}}{{#if: |


}}{{#if: |


}}{{#if: |


}}{{#if: |


}}{{#if: |


}}{{#if: |


}}{{#if: |


}}{{#if: |


}}{{#if: |


}}{{#if: |


}}

{{#if: Using both footnote-style and bibliography-style references | |+ Using both footnote-style and bibliography-style references}} {{#if: || ! width="50%" scope="col" | Markup}} {{#if: || ! width="50%" scope="col" | Renders as}}{{#if: Lorem ipsum.<ref>Source name, access date, etc.</ref> Lorem ipsum dolor sit amet.<ref>Source name, access date, etc.</ref> ==References== {{Reflist|close}} {{Refbegin}} * reference 1 * reference 2 {{Refend}}

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

==References==
{{Reflist|close}}

{{Refbegin}}
* reference 1
* reference 2
{{Refend}}
Lorem ipsum.<ref>Source name, access date, etc.</ref>

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

References
1 }}
references-column-width references-column-count references-column-count-close }} {{#if: references-column-width }} }}" style="{{#if: close {{#iferror: {{#ifexpr: close > 1 }} -moz-column-width: close; -webkit-column-width: close; column-width: close; Template:Column-count }} {{#if: -moz-column-width: {{{colwidth}}}; -webkit-column-width: {{{colwidth}}}; column-width: {{{colwidth}}}; }} }} list-style-type: {{#switch: upper-alpha upper-roman lower-alpha lower-greek lower-roman = {{{group}}} #default = decimal}};"> <references group=""></references>
1 }}
references-column-width references-column-count references-column-count-{{{1}}} }} {{#if: references-column-width }} }}" style="{{#if: {{#iferror: {{#ifexpr: 1 > 1 }} -moz-column-width: {{{1}}}; -webkit-column-width: {{{1}}}; column-width: {{{1}}}; Template:Column-count }} {{#if: -moz-column-width: {{{colwidth}}}; -webkit-column-width: {{{colwidth}}}; column-width: {{{colwidth}}}; }} }}">{{#if:
}}
  • reference 1
  • reference 2

}}{{#if: |


}}{{#if: |


}}{{#if: |


}}{{#if: |


}}{{#if: |


}}{{#if: |


}}{{#if: |


}}{{#if: |


}}{{#if: |


}}{{#if: |


}}{{#if: |


}}{{#if: |


}}{{#if: |


}}{{#if: |


}}{{#if: |


}}{{#if: |


}}{{#if: |


}}{{#if: |


}}{{#if: |


}}

Columns

Using {{{{#if:|subst:}}Reflist{{#if:2| |2 }}{{#if:| |{{{3}}} }}{{#if:| |{{{4}}} }}{{#if:| |{{{5}}} }}{{#if:| |{{{6}}} }}{{#if:| |{{{7}}} }}{{#if:| |{{{8}}} }}{{#if:| |{{{9}}} }}{{#if:| |{{{10}}} }}{{#if:| |{{{11}}} }}{{#if:| |... }}}} will create a two-column reference list, and {{{{#if:|subst:}}Reflist{{#if:3| |3 }}{{#if:| |{{{3}}} }}{{#if:| |{{{4}}} }}{{#if:| |{{{5}}} }}{{#if:| |{{{6}}} }}{{#if:| |{{{7}}} }}{{#if:| |{{{8}}} }}{{#if:| |{{{9}}} }}{{#if:| |{{{10}}} }}{{#if:| |{{{11}}} }}{{#if:| |... }}}} 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 {{{{#if:|subst:}}Reflist{{#if:30em| |30em }}{{#if:| |{{{3}}} }}{{#if:| |{{{4}}} }}{{#if:| |{{{5}}} }}{{#if:| |{{{6}}} }}{{#if:| |{{{7}}} }}{{#if:| |{{{8}}} }}{{#if:| |{{{9}}} }}{{#if:| |{{{10}}} }}{{#if:| |{{{11}}} }}{{#if:| |... }}}} will create columns with a minimum width of 30 em, 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.

Columns are currently supported only by Gecko-based browsers (such as Mozilla Firefox) and WebKit-based browsers (such as Google Chrome and Safari). See below for more information.

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. There are CSS3 selectors that could resolve this, but they are not yet supported by any major browsers.

See also bug combining grouped references and columns.

List styles

{{#ifeq:Template|Category|The main {{#ifeq:Help||article|page}}{{#if:|s}} for this category {{#if:|are|is}}|Main {{#ifeq:Help||article|page}}{{#if:|s}}:}} Help:Cite link labels{{#if:
|{{#if:|, | and }}[[{{{2}}}|{{{2}}}]]}}{{#if:
|{{#if:|, |, and }}[[{{{3}}}|{{{3}}}]]}}{{#if:
|{{#if:|, |, and }}[[{{{4}}}|{{{4}}}]]}}{{#if:
|{{#if:|, |, and }}[[{{{5}}}|{{{5}}}]]}}{{#if:
|{{#if:|, |, and }}[[{{{6}}}|{{{6}}}]]}}{{#if:
|{{#if:|, |, and }}[[{{{7}}}|{{{7}}}]]}}{{#if:
|{{#if:|, |, and }}[[{{{8}}}|{{{8}}}]]}}{{#if:
|{{#if:|, |, and }}[[{{{9}}}|{{{9}}}]]}}{{#if:
|, and [[{{{10}}}|{{{10}}}]]}}{{#if: | (too many parameters in {{main}})}}

Reference lists are by default numbered lists. By using the |{{#if:liststyle|liststyle=|}} parameter, you can control how the list is rendered. For example, using |{{#if:liststyle|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 as shown below.

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

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

{{#if:CSS list-style-type values|}}{{#if:|}}{{#if:|}}{{#if:|}}{{#if:|}}{{#if:|}}{{#if:|}}{{#if:|}}{{#if:|}}{{#if:|}}{{#if:|Template:Anchor (or Anchors): too many anchors, maximum is 10.}} {{#ifeq:right|left

|