Khác biệt giữa bản sửa đổi của “Trợ giúp:Cước chú”

Nội dung được xóa Nội dung được thêm vào
Dòng 92:
 
Trong một số trường hợp bạn có thể chuyển ghi chú cuối chương thành ghi chú cuối trang bằng cách dùng các chức năng nâng cao như mô tả ở dưới tại [[#Cước chú trải dài qua nhiều trang]].
 
== Nâng cao ==
 
=== Cước chú trải dài qua nhiều trang ===
{{xem thêm|Trợ giúp:Ngắt trang#Cước chú trải dài qua nhiều trang|l1=Trợ giúp:Ngắt trang}}
 
Trong một số tác phẩm, cước chú có thể viết trải ra hai trang và, trong một số trường hợp, nhiều hơn cả hai trang. Khi hiệu đính từng trang trong không gian Trang, rất khó xử lý trường hợp này bằng cách cơ bản như mô tả ở trên.
 
Khi dùng thẻ <nowiki><ref></nowiki> cho phần đầu của cước chú, thêm tham số "name" (tên). Người hiệu đính có thể chọn tên tùy ý, nhưng tốt nhất là dùng số trang.
 
Các phần còn lại của cước chú nên dùng tham số "follow" (tiếp theo) với cùng tên được đặt. Vị trí của văn bản này không quan trọng nhưng đặt vào cuối trang, nơi thường xuất hiện cước chú, là vị trí hiển nhiên nhất. Nhớ đảm bảo nó nằm trong trang sẽ được nhúng chéo vào cùng với phần còn lại của cước chú: tức là không phải là phần đầu trang hoặc chân trang của Trang, không đặt trong thẻ <nowiki><noinclude></nowiki>, và, nếu nhúng chéo theo mục, thì phải cùng mục với phần còn lại của cước chú (để cho tất cả các phần được nhúng chéo đầy đủ vào cùng một trang trong không gian chính).
 
Ví dụ, nếu cước chú "<code>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa.</code>" bị tách thành "<code>Lorem ipsum dolor sit amet, consectetuer</code>" tại trang 51 và "<code>adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa.</code>" tại trang 52:
 
Phần đầu sẽ được viết như sau:
 
 
{| class="wikitable" style="width:75%; margin:0 auto 0 auto;"
|<nowiki><ref name="p51">Lorem ipsum dolor sit amet, consectetuer</ref></nowiki>
|}
 
 
Phần thứ hai sẽ được viết như sau:
 
 
{| class="wikitable" style="width:75%; margin:0 auto 0 auto;"
|<nowiki><ref follow="p51">adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa.</ref></nowiki>
|}
 
 
Các phần riêng lẻ sẽ được gắn lại với nhau bằng thẻ <nowiki><references/></nowiki>, hoặc một bản mẫu tương đương, trong không gian chính.
 
Quy trình tương tự cũng áp dụng cho '''cước chú kéo dài qua ba trang'''.
 
Quy trình này có thể dùng để '''chuyển chú thích tại mục riêng thành cước chú'''. Ví dụ, chú thích [1] tại [[Page:Medivalhymnsand00nealgoog.djvu/25]] (page 1) chỉ đến chú thích tại [[Page:Medivalhymnsand00nealgoog.djvu/28]] (page 4). Khi được nhúng, chú thích này được gắn lại vào chú thích rỗng, như xem tại [[Mediaeval Hymns and Sequences/Pange lingua gloriosi (Fortunatus)]].
 
=== Cước chú được gom thành nhóm ===
 
Đôi khi việc tách các cước chú ra các mục khác nhau là cần thiết. Các cước chú khác nhau có thể được liệt kê tại nhiều hơn một vị trí hoặc sẽ có các loại cước chú khác nhau, mỗi loại sẽ nằm trong danh sách riêng ở cuối trang. Trong các trường hợp này, các cước chú khác nhau cần được gom thành nhóm.
 
Khi dùng thẻ <nowiki><ref></nowiki> them tham số "group" (nhóm). Tên nhóm do người hiệu đính lựa chọn nhưng nên nhớ là nó sẽ hiển thị trong trang thành một bộ phận của số thứ tự của cước chú. Tất cả các thẻ trong một nhóm nhất định phải có cùng tham số "group".
 
Mỗi thẻ <nowiki><references/></nowiki> cũng phải có cùng tham số "group". Mỗi thẻ sẽ chỉ liệt kê những cước chú có cùng tên nhóm mà thôi.
 
Ví dụ:
 
 
{| class="wikitable" style="width:75%; margin:0 auto 0 auto;"
| Lorem<nowiki><ref group="A">Foo</ref></nowiki><br />
Ispum<nowiki><ref group="B">Bar</ref></nowiki><br />
Dolar<nowiki><ref group="A">Baz</ref></nowiki>
 
 
Nhóm "A":
<nowiki><references group="A" /></nowiki>
 
Nhóm "B":
<nowiki><references group="B" /></nowiki>
|}
 
 
Hiện ra thành:
 
 
{| class="wikitable" style="width:75%; margin:0 auto 0 auto;"
| Lorem<ref group="A">Foo</ref><br />
Ipsum<ref group="B">Bar</ref><br />
Dolar<ref group="A">Baz</ref>
 
 
Nhóm "A":
<references group="A" />
 
Nhóm "B":
<references group="B" />
|}
 
===Cước chú lồng nhau===
There is a known limitation in mediawiki that certain tags such as [[mw:extension:Cite|&lt;ref&gt;]] are parsed in a linear rather than hierarchic fashion, resulting in constructions such as:
<syntaxhighlight lang="HTML5">This is a basic<ref>Not<ref>Here is an opportunity for a really bad pun.</ref> the computer language!</ref> statement.<references/></syntaxhighlight>
unexpectedly resulting in: {{box|This is a basic<ref>Not<ref>Here is an opportunity for a really bad pun.</ref> the computer language!</ref> statement.<references/>}}—due to the parser attempting to match the first occurrence of <code>&lt;/ref&gt;</code> back to the first occurrence of <code>&lt;ref&gt;</code> instead of to the ''innermost'' occurrence and generally thereafter becoming confused.
 
However resort may be made in these instances to a much older syntax which is somewhat resistant to this behaviour. This same sequence may be re-expressed as:
<syntaxhighlight lang="HTML5">This is a basic{{#tag:ref|Not<ref>Here is an opportunity for a really bad pun.</ref> the computer language!}} statement.<references/></syntaxhighlight>
which produces something closer to the expected result:{{box|This is a basic{{#tag:ref|Not<ref>Here is an opportunity for a really bad pun.</ref> the computer language!}} statement.<references/>}}—but sadly, the footnotes are still "out-of-order" with regards to normal expectation. So additionally applying lessons from the [[#Grouped footnotes|former section]]: <syntaxhighlight lang="HTML5">This is a basic{{#tag:ref|Not<ref group="I">Here is an opportunity for a really bad pun.</ref> the computer language!|group="O"}} statement.<references group="O"/><references group="I"/></syntaxhighlight>N.B. group names "I" and "O" are entirely arbitrary and here are simply chosen to represent '''I'''nner and '''O'''uter nesting levels.
 
This new coding results in: {{box|This is a basic{{#tag:ref|Not<ref group="I">Here is an opportunity for a really bad pun.</ref> the computer language!|group="O"}} statement.<references group="O"/><references group="I"/>}}
 
===Multiple references that point to the same footnote===
Sometimes two or more references may point to the same footnote, for example.
 
 
{| class="wikitable" style="width:75%; margin:0 auto 0 auto;"
! Text
| Here is one reference<ref name=ref>This is the footnote that can be reached by the three different reference tags</ref> and here is another<ref name=ref /> pointing to the same footnote. Here is one more<ref name=ref />
|-
! Footnote
| <references />
|}
 
 
This is accomplished by using the "name" parameter. Give the first reference a unique name, in our example it is '''ref''' and each subsequent reference that points to the same footnote is tagged <nowiki><ref name= /></nowiki> where you want the references to appear. In our example it is <nowiki><ref name=</nowiki>'''ref''' />
 
<syntaxhighlight lang="HTML5">Here is one reference<ref name=ref>This is the footnote that can be reached by the three different reference tags</ref> and here is another<ref name=ref /> pointing to the same footnote. Here is one more<ref name=ref /></syntaxhighlight>
 
There are additional complications when the same footnote is called from more than than one page in the text. A possible workaround in these situations is [[Page:Vocabulary of Menander (1913).djvu/24|demonstrated here]].
 
=== Multiple pages that reference the same footnote ===
{{hatnote|This solution only works on pages that are transcluded together in the Main namespace.}}
 
Sometimes, a page references a footnote located on another page earlier in the work. Here is one solution to make both pages and the whole transcluded document look right:
 
;Page containing the footnote
The page containing the footnote should name the reference. Example:
 
<syntaxhighlight lang="HTML5">This page references the footnote for the first time.<ref name="name-of-the-ref">This is the footnote that is referenced by multiple pages.</ref></syntaxhighlight>
 
;Other page referencing the footnote
In the '''body''' of the page, the reference should be given the name only. Example:
 
<syntaxhighlight lang="HTML5">The other page referencing the footnote should only include its name in the body of the text.<ref name="name-of-the-ref" /></syntaxhighlight>
 
In the '''footer''' of the page, one of the following options must appear, depending on which reference format is being used elsewhere in the work:
{|
| With <code><nowiki><references /></nowiki></code>:
<syntaxhighlight lang="HTML5"><references>
<ref name="name-of-the-ref">This is the footnote that is referenced by multiple pages.</ref>
</references></syntaxhighlight>
| With <code>{{tl|smallrefs}}</code>:
<syntaxhighlight lang="HTML5">{{smallrefs|refx=
<ref name="name-of-the-ref">This is the footnote that is referenced by multiple pages.</ref>
}}</syntaxhighlight>
| With <code>{{tl|reflist}}</code>:
<syntaxhighlight lang="HTML5">{{reflist|refs=
<ref name="name-of-the-ref">This is the footnote that is referenced by multiple pages.</ref>
}}</syntaxhighlight>
|}
See [[Page:Oregon Historical Quarterly vol. 4.djvu/35]] and [[Page:Oregon Historical Quarterly vol. 4.djvu/38]] for a demonstration.