變更
{{NoteTADocumentation subpage}}<includeonly>{{High-risk|G1 = IT4400000+ }}</includeonly>{{notice|G2 = MediaWiki<nowiki />* This page gives technical details for the {{tl|reflist}} template. For a full overview of this template in use, see [[Help:Footnotes]].
}}
{{Documentation subpageTranswiki guide |small=yes |text=See [[Template:Reflist/Transwiki guide|'''this information''']] on copying this template and modifying it for use on another wiki.}}This [[Wikipedia:Citation templates|citation template]] provides formatting and organizational features for [[Help:Footnotes|footnotes]]. It encapsulates the {{tag|references|s}} tag used by the {{Highcite.php}} MediaWiki extension to show the list of references as defined by {{tag|ref|o}} tags. It adds support for sizing the column width, groups and {{ldr}}. ==Parameters==There are no ''required'' parameters; if none are supplied, a single-riskcolumn list will be generated if there are fewer than 10 references in the list. If you have more than 10 references, it will use columns of 30em wide if your device allows this. Optional parameters are:* Unnamed parameter (must be the first one if used): the minimum width for each column of references, typically in [[em (typography)#CSS|540em]]s. Syntax (for example) {{para||30em}} with no space (i.e. not {{para||30 em}}). Note that this replaces '''colwidth'''—see [[#Obsolete parameters|§ Obsolete parameters]].* '''refs''': used with {{ldr}}.* '''group''': identifies by name the subset of references to be rendered; the value should correspond to that used inline, e.g.,000+{{tlx|Reflist|2=group=groupname}}renders all references with groupname as the group name ({{tag|ref|o|params=group=groupname}}). There are five pre-defined group names that style the list differently. See [[#Grouped references|§ Grouped references]] below.* '''liststyle''': specifies the style used when the reference list is rendered. The default is a numbered list. When set, it will override the style set by the {{Esotericpara|group}}parameter, without affecting group functionality. See [[#List styles|§ List styles]] below.{{anchor|Multiple uses}} ==Usage=={{markup|title=Using only footnote-style references|<nowiki>Lorem ipsum.<ref>Source name, access date, etc.</ref> Lorem ipsum dolor sit amet.<ref>Source name, access date, etc.</ref>
{{fake heading|sub==参数解说 ==3|References}}{{Reflist}}}}
{{tlcmarkup|1title=ReflistUsing only bibliographical style references (no direct references from the text)|2=欄位數/欄位寬度|3=group=组别|4=refs=列表內容|5=liststyle=|6=list=}}<nowiki>Lorem ipsum. Lorem ipsum dolor sit amet.
{{markup|title=== 过时参数 ===Using both footnote-style and bibliography-style references; |<nowiki>Lorem ipsum.<coderef>colwidthSource name, access date, etc.</coderef>: 已合并到无名参数1
==References=={{markup|title=只使用内文注释|<nowiki>一條青龍一氣通<ref>參考1</ref>,二盤連莊二本場<ref>參考2</ref>。Reflist}}
{{fake heading| 參考資料sub=3|References}}
{{Reflist}}
{{Refbegin}}
* reference 1
* reference 2
{{Refend}}
}}
===Columns===
{{tlx|Reflist|30em}} (for example) instructs the browser to create as many columns as possible (of width at least 30 [[Em (typography)|em]], in this example) given the width of the display window. ([http://www.w3.org/TR/CSS21/syndata.html#length-units Units supported are em, ex, in, cm, mm, pt, pc, px], but em is almost always used.) There must not be a space between the number and the unit.
Choose a width appropriate to the typical width of the references:
* Automatic columns (default when no width is specified): Where there are only a few {{fnote}}; see, e.g., {{oldid|Silver State Arena|530211388#References|Silver State Arena (23:05, 28 December 2012)}}
* 30em: Where there are many footnotes plus a page-width Bibliography subsection: see, e.g., {{oldid|Ebola virus disease|819923970#References|Ebola virus disease (02:02, 12 January 2018)}}
* 20em: Where {{sfnote}} are used; see, e.g., {{oldid|NBR 224 and 420 Classes|442508215#Notes|NBR 224 and 420 Classes (13:32, 1 August 2011)}}.
====Example====
{{markup|title=15em wide columns (vary width of display window to see change in number of columns)
|<nowiki>Lorem ipsum.<ref>Source name, access date, etc.</ref>
Lorem ipsum dolor sit amet.<ref>Source name, access date, etc.</ref>
Lorem ipsum dolor sit amet.<ref>Source name, access date, etc.</ref>
Lorem ipsum dolor sit amet.<ref>Source name, access date, etc.</ref>
Lorem ipsum dolor sit amet.<ref>Source name, access date, etc.</ref>
==References==
{{Reflist|15em}}</nowiki>
|Lorem ipsum.<ref>Source name, access date, etc.</ref>
Lorem ipsum dolor sit amet.<ref>Source name, access date, etc.</ref>
Lorem ipsum dolor sit amet.<ref>Source name, access date, etc.</ref>
Lorem ipsum dolor sit amet.<ref>Source name, access date, etc.</ref>
Lorem ipsum dolor sit amet.<ref>Source name, access date, etc.</ref>
{{fake heading|sub=3|References}}
{{Reflist|15em}}<!-- note 15em used here for illustration purposes because larger value won't columnize in the "renders as" part on many screens -->
}}
* <strong>Note 1:</strong> The syntax {{tlx|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.* <strong>Note 2:</strong> Browser support: Internet Explorer 10+, Microsoft Edge, Firefox 2+, Chrome 4+, Safari 3.1+, Opera 11.1+ ===List-defined references==={{see|Help:List-defined references}} A list of references may be defined within {{tl|Reflist}} using the {{para|refs}} parameter, just like including named {{tag|ref|params=name="..."}} elements inside the {markup{tag|titlereferences}} container. ====Example==== 只使用一般注释{{markup|<nowiki> 一條青龍一氣通,二盤連莊二本場。This is reference 1.<ref name="refname1" />This is reference 2.<ref name="refname2" />
== 參考資料References=={{Reflist|listrefs=* 书目a<ref name="refname1">content1</ref>* 书目b<ref name="refname2">content2</ref>
}}</nowiki>
| 一條青龍一氣通,二盤連莊二本場。This is reference 1.<ref name="refname1" group=decimal/>This is reference 2.<ref name="refname2" group=decimal/>
{{fake heading| 參考資料sub=3|References}}{{Reflist|listgroup=decimal|refs=* 书目a<ref name="refname1">content1</ref>* 书目b<ref name="refname2">content2</ref>
}}
}}
===Grouped references==={{markupdetails|titleWP:REFGROUP}} References can be grouped into separate sections (for explanatory notes, table references, and the like) via <code>group=</code>::{{tag|ref|open|params=group=<var>groupname</var>}}where <var>groupname</var> is (for example) <code>notes</code> or <code>sources</code>. 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::{{tlx|Reflist|2=group=<var>groupname</var>}} ====Predefined groups==== 内文与一般注释混合使用{{details|H:PREGROUP}} There are predefined group names that automatically set the labels in the footnote markers and the reference list to other styles. Thus, setting <code><nowiki> 一條青龍一氣通{{Reflist|group=lower-alpha}}<ref/nowiki> 參考1</refcode> will set the group to <code> ,二盤連莊二本場lower-alpha</code> and will style the reference list with lower alpha characters. The matching footnote marker can be formed by {{tag|ref|params=group=lower-alpha}}. This is made easier by a series of templates to set the group/label styles for the footnote marker and the reference list:{{#section:Help:Footnotes|pregrouptable}} ===List styles==={{for|technical details|Help:Cite link labels}} As noted in [[#Predefined groups|§ Predefined groups]], there are predefined groups that automatically add list styling. Using the listed templates is more convenient than using {{para|liststyle}}. Reference lists are by default numbered lists. By using the {{para|liststyle}} parameter, you can control how the list is rendered. For example, using {{para|liststyle|upper-roman}} will result in references being labeled with [[Roman numerals]] instead of decimal numbers. The parameter accepts any valid CSS value defined for <code> 參考2list-style-type</refcode> 。as shown below.{{CSS list-style-type values}}
{{Reflistmarkup|list1=* 书目a* 书目b}}</nowiki>|一條青龍一氣通<ref>參考1</ref>,二盤連莊二本場<refgroup=note> 參考2Reference</ref> 。
{{fake headingReflist|group=note| 參考資料liststyle=lower-alpha}}{{Reflist}}</nowiki>|2=<ref group=note>Reference</ref>
{{Reflist|listgroup=* 书目a* 书目bnote|liststyle=lower-alpha}}
}}
===Interaction with images===
{{Reflist hide}}
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.
==Technical details==
===Font size===
The font size should reduce to 90% for most browsers, but may appear to show at 100% for Internet Explorer and possibly other browsers.<ref group=general name=fontsize /> As of December 21, 2010, the standard {{tag|references|single}} tag has the same font styling. The smaller font may be disabled through {{myprefs|Gadgets|Disable smaller font sizes of elements such as Infoboxes, Navboxes and References lists}}.
===Browser support for columns===
{{CSS3 multiple column layout}}
Multiple columns are generated by using [[Cascading Style Sheets|CSS3]], which is still in development; thus only browsers that properly support the multi-column property will show multiple columns with {{tl|Reflist}}.<ref group=general name="stuffandnonsense" /><ref group=general name="w3org1" />
These browsers '''support''' CSS3 columns:
* [[Gecko (layout engine)|Gecko]]-based browsers such as [[Mozilla Firefox]]
* [[WebKit]]-based browsers such as [[Safari (web browser)|Safari]] and [[Google Chrome]]
* [[Opera (web browser)|Opera]] from version 11.10 onward
* [[Internet Explorer]] from version 10 onward
These browsers do '''not support''' CSS3 columns:
* Microsoft [[Trident (layout engine)|Trident]]-based browsers including Internet Explorer up to version 9<ref group=general name="msdn" />
* [[Opera (web browser)|Opera]] through to version 11
===Widows and orphans===
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, such as a reference list formatted in columns where only a single reference is defined.
{{markup
|<nowiki>Lorem ipsum.<ref>Source name, access date, etc.</ref>
Lorem ipsum dolor sit amet.
==References==
{{Reflist|10em}}</nowiki>
|Lorem ipsum.<ref>Source name, access date, etc.</ref>
Lorem ipsum dolor sit amet.
{{fake heading|sub=3|References}}
{{Reflist|10em}}
}}
=== 分栏 Supporting CSS==={{tl|Reflist}} uses a CSS rule in [[MediaWiki:Common.css]] to set the font size:* <code>div.reflist { font-size: 90%; }</code>
===Customizing the view==={{markup|title=分为2栏see|<nowiki>一條青龍一氣通<ref>參考1</ref>,二盤連莊二本場<ref>參考2</ref>。Help:Reference display customization}}
<source lang==參考資料=="css">ol.references,div.reflist,div.refbegin {{Reflist|30em font-size: 90%;}}</nowiki>|一條青龍一氣通<ref>參考1</ref>,二盤連莊二本場<ref>參考2</refsource> 。
==Perennial suggestions= 参考==={{Reflist|group=参考}}</nowiki>|三元兼四喜,滿貫<ref group="注释">注释1</ref>遇全么<ref group="参考">参考1</ref>。'''Collapsing and scrolling'''
There have been suggestions to include section header markup such as <code>== 参考资料References=={{Reflist|refs=<ref name="refname1">内容1</refcode>. This is inadvisable because:<ref * There is no standard section name="refname2">内容2<{{crossref|(see {{section link|WP:Manual of Style/ref>Layout|Notes and references}})}}</nowiki>.|这是参考A<ref name="refname1" group=upper-alpha/>。* When transcluded, the article will have an edit link that will confusingly open the template for editing.
Articles using unsupported parameters are tracked in {{fake headingclc| 参考资料}}{{Reflist|group=upper-alpha|refs=<ref name="refname1">内容1</ref><ref name="refname2">内容2</ref>}}Pages using reflist with unknown parameters}}.
== 模板數據Template data=={{templatedataheaderTemplateDataHeader}}
<templatedata>
{
}
</templatedata>
== 参考文献See also==* {{RefFootphab|T53260}}- Cite: Support multi-column and alternative list-style for {{tag|references|s}} tag (like enwiki {{tl|reflist}})* [[Wikipedia:Citing sources]] – style guide for the citation of sources* [[Wikipedia:Citation templates]] – templates for use with references* {{tl|Refbegin}} and {{tl|Refend}} – format reference lists
'''Variants'''* {{tl|Template reference list}} – version of reflist for use in templates* {{tl|Reflist-talk}} – for use in talk page sections and other non-mainspace pages == 參見References==*{{tlxReflist|group=general|refs=<ref group=general name=fontsize>See [[User:Edokter/fonttest]] for a comparison of font sizes for various browsers; see [//en.wikipedia.org/w/index.php?title=Special%3ASearch&redirs=1&search=fonttest+prefix%3AMediaWiki+talk%3ACommon.css%2F&fulltext=Search&ns0=1 previous discussions] on changing the font size to resolve the IE issue.</ref><ref group=general name=stuffandnonsense>{{cite web |accessdate=November 24, 2006 |ReferencesWithExtradate=December 30, 2005 |title=CSS3 Multi-Column Thriller |url=http://www.stuffandnonsense.co.uk/archives/css3_multi-column_thriller.html}}</ref> *<ref group=general name=w3org1>{{tlxcite web |url=http://www.w3.org/TR/css3-multicol/ |Notelisttitle=CSS3 module: Multi-column layout |publisher=[[World Wide Web Consortium|W3C]] |date=December 15, 2005 |accessdate=November 24, 2006}}</ref>*<ref group=general name=msdn>{{tlxcite web |TRefListurl=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=March 16, 2011}}</ref>}}{{Wikipedia referencing}}*在討論頁顯示參考文獻請用{{tlx|Reflist-talkWikipedia template messages}}{{Wikipedia technical help}}<includeonly>{{#ifeq:{{SUBPAGENAME}}|sandbox| |*[[WikipediaCategory: 腳注Footnote templates]]*[[WikipediaCategory: 列明來源Reference list templates]]
}}</includeonly>