Help:引用

From mediawiki.org
This page is a translated version of the page Help:Cite and the translation is 78% complete.
PD 注意: このページを編集すると、編集内容が CC0 のもとで公開されることに同意したと見なされます。詳細はパブリック・ドメインのヘルプ ページを参照してください。
このページの古い版の一部は、CC BY-SA ライセンスのもとで取り込まれました。 新しい編集のみがパブリックドメインと見なされます。
PD

Cite (引用) は、脚注をページに追加できるようにします。

技術的な詳細は Cite extension のページを参照してください。

使用法

‎<ref>タグを記して脚注を表示するよう指定された節に‎<references />タグで囲まれた文書を挿入するのが基本的な考えです。この書式は古い書式とは互換性がありません。どちらか一方を選ぶ必要があります。

文書に複数の‎<references />を記述することもできます。その場合、そのタグを記した箇所よりも上にあり、同グループの‎<ref>タグはすべて挿入されます。

記事の中に ‎<references /> を記述し忘れた場合は、脚注がなくなることはなくページの最後に脚注が表示されます。

このページ自体でもこの文の末尾にあるような脚注を使っています。[note 1] (英語ページで)「編集」をクリックしてソースを見ると、脚注がどのように動作しているのかをみることができます。

ウィキテキスト レンダリング
太陽はかなり大きい。<ref>E. Miller, ''The Sun'', (New York: Academic Press, 2005), 23-5.</ref> しかし、月はそれほど大きくはない。<ref>R. Smith, "Size of the Moon", ''Scientific American'', 46 (April 1978): 44-6.</ref>

==注記==
<references />

太陽はかなり大きい。[1] しかし、月はそれほど大きくはない。[2]

注記
  1. E. Miller, The Sun, (New York: Academic Press, 2005), 23-5.
  2. R. Smith, "Size of the Moon", Scientific American, 46 (April 1978): 44-6.

同じ脚注の複数回の使用

脚注に固有の識別子を指定するには、‎<ref name="名前"> を使用します。 すると同名の脚注タグを使って、同じ脚注を複数箇所に使うことができます。 最初の脚注に文が記してあることから、2回目のタグ内に記す文字は反映されません。 脚注全体を転記してもいいですし、以下のような自己完結の空の ref タグを使用することもできます: ‎<ref name="名前" />

以下の例では同じ情報源を3回引用しています。

ウィキテキスト 結果
これは同じ脚注を複数回、参照した例です。<ref name="multiple">同一の脚注の引用が複数回ある場合、必ず最初の脚注が使われる点にご注意ください。</ref>

同一の情報源から別箇所を引用するとき、こういう脚注の使い方は便利です。<ref name="multiple" /> 再利用したタグには内容を書かないことが、エラーを予防するコツです。 こういう場合は空の脚注タグのみ書きます。

同一の脚注を複数箇所で適切に使うには、空の脚注つまり末尾が半角スラッシュ「/」のタグを記します。
これなら確かに手間は省けるのですが、もし、最初の脚注タグを今後の編集で誰かが除去すると、空の脚注タグを記した箇所すべてから脚注が失われる点を覚えておいてください。<ref name="multiple" />

==注記==
<references />

これは同じ脚注を複数回、参照した例です。[1]

同一の情報源から別箇所を引用するとき、こういう脚注の使い方は便利です。[1] 再利用したタグには内容を書かないことが、エラーを予防するコツです。 こういう場合は空の脚注タグのみ書きます。

同一の脚注を複数箇所で適切に使うには、空の脚注つまり末尾が半角スラッシュ「/」のタグを記します。 これなら確かに手間は省けるのですが、もし、最初の脚注タグを今後の編集で誰かが除去すると、空の脚注タグを記した箇所すべてから脚注が失われる点を覚えておいてください。[1]

注記
  1. 1.0 1.1 1.2 同一の脚注の引用が複数回ある場合、必ず最初の脚注が使われる点にご注意ください。
脚注タグのname属性に記す識別子には欧文文字を必ず含めてください。もし数字だけで記すと、エラーメッセージが表示されます。 Quotation marks are always preferred for names, and are mandatory when the name includes a space, punctuation or other mark. nameはなるべく短くすることと、ASCII 文字盤にある文字に限定することが推奨されます。


<span id="The_‎<references />_tag">

‎<references />タグ

‎<references /> タグは、ページ内でそれ以前に置いた‎<ref>タグに指定した、すべての引用の文を挿入します。 たとえば上記の引用をもとづくと、グループnoteに属する脚注があるはずです。

ウィキテキスト 結果
<references group="note"/>
  1. この脚注は「使用法」の節で使われています。

脚注リストには相対幅の指定ができます (指定の内容により脚注を2段以上に割って表示すること)。 その場合の挙動はresponsive属性によって設定します。 既定の設定があるウィキの場合、すべてのページの脚注を段組み表示します。それ以外の場合は、手入力で段組みの指定をします。

特定のページ内に複数の‎<references /> リストを設けるには、1番目の脚注一覧の後に来るリスト用に、どのリストにも‎<ref> タグを記述します。 これらの脚注一覧の生成にテンプレートを使う場合は、1番目の脚注一覧より前に指定したそれぞれの脚注タグをまとめて表示するものの、エラーメッセージが出て、脚注タグはあるのに対応する脚注一覧の指定がないと告げます。


脚注をグループ化する

これを無効にしたい場合は $wgAllowCiteGroups = false; を指定します。

次の例の場合、引用とそれ以外の脚注を別々の一覧に表示します。

ウィキテキスト 結果
科学者によると、太陽はかなり大きいです。<ref>E. Miller, ''The Sun'', (New York: Academic Press, 2005), 23–25.</ref> 実際は、とても大きいです。<ref group="footnotes"> 彼らの言葉を信じる。 太陽を裸眼で見るな!</ref>

==注記==
<references group="footnotes" />

==脚注==
<references />
科学者によると、太陽はかなり大きいです。[1] 実際は、とても大きいです。[footnotes 1]
注記
  1. 彼らの言葉を信じる。 太陽を裸眼で見るな!
脚注
  1. E. Miller, The Sun, (New York: Academic Press, 2005), 23–25.

グループの名前のついていない脚注は以前の例と同じように機能しますが、名前の付いたグループがついている場合はグループ名を指定された‎<references />要素でしか表示できません。

脚注タグのgroup属性に記す識別子には欧文文字を必ず含めてください。もし数字だけで記すと、エラーメッセージが表示されます。 Quotation marks are always preferred for names, and are mandatory when the name includes a space, punctuation or other mark. nameはなるべく短くすることと、ASCII 文字盤にある文字に限定することが推奨されます。

The rendering of a given group can be customized across the wiki by creating MediaWiki:Cite_link_label_group-<name> and listing the used signs in the order they appear, separated by spaces or newlines.

For example, if MediaWiki:Cite_link_label_group-lower-alpha is created with the content
a b c d e f g h i j k l m n o p q r s t u v w x y z
then the first <ref group="lower-alpha">...</ref> renders [a], the second one renders [b], and so on, the 26th renders [z].

It is an error to use more footnotes in a custom-rendered group than the number of signs defined, so the 27th footnote in this group causes an error.

The following group names are often defined as custom groups by the following messages respectively:

グループ名 メッセージ
upper-alpha MediaWiki:Cite link label group-upper-alpha
lower-alpha MediaWiki:Cite link label group-lower-alpha
upper-roman MediaWiki:Cite link label group-upper-roman
lower-roman MediaWiki:Cite link label group-lower-roman
lower-greek MediaWiki:Cite link label group-lower-greek
The Cite link label group pages are not created by default. If a wiki does not configure them, markup such as <ref group="lower-alpha">...</ref> will render as lower-alpha 1.

同一ソースの異なる部の引用

記事の中で同じ出典の異なる部分が参考文献として使われている際には、参考文献欄にまとめて記載が可能です。 これにより、読者はどの脚注が同じソースのものか確認できます。 また、同一ソースの異なる部分を引用する際、同じソースを毎回書かなくても引用できます。

ウィキテキスト 結果
科学者によると、太陽はかなり大きいです。<ref name="Miller">E. Miller, ''The Sun'', (New York: Academic Press, 2005).</ref> 実際は、とても大きいです。<ref extends="Miller">p. 123</ref> 彼らの言葉を信じる。 太陽を裸眼で見るな!<ref extends="Miller">p. 42</ref>

==脚注==
<references />
科学者によると、太陽はかなり大きいです。[1] 実際は、とても大きいです。[1.1] 彼らの言葉を信じる。 太陽を裸眼で見るな![1.2]
脚注

1. E. Miller, The Sun, (New York: Academic Press, 2005)
   1.1 ↑ p. 123
   1.2 ↑ p. 42

なお、まだこの機能はベータクラスター以外のWikiに対応していない為、上記の例はモックです。 更新情報はm:WMDE Technical Wishes/Book referencingで確認可能です。

文書から参照情報を分離する

テキストのコピーが便利なインテキスト脚注を使用しています。 References containing a lot of data, quotes or elaborate citation templates can make up a significantly larger fraction of the source than the text that will actually be visible. To avoid this, recent versions of the extension allow moving some or all of the references into the ‎<references /> section, to the place where they will actually appear to the reader.

ウィキテキスト 結果
科学者によると、太陽はかなり大きいです。<ref name="miller" /> しかし、月はそれほど大きくはない。<ref name="smith" />

<span id="Notes"></span>
==注記==
<references>
<ref name="miller">E. Miller, ''The Sun'', (New York: Academic Press, 2005), 23–25.</ref>
<ref name="smith">R. Smith, "Size of the Moon", ''Scientific American'', 46 (April 1978): 44–46.</ref>
</references>

科学者によると、太陽はかなり大きいです。[1] しかし、月はそれほど大きくはない。[2]

注記
  1. E. Miller, The Sun, (New York: Academic Press, 2005), 23-5.
  2. R. Smith, "Size of the Moon", Scientific American, 46 (April 1978): 44-6.

Thus, the code above will have the same output as the first example above, although the numbering and order of the references will not in general be the same.

Substitution and embedded parser functions

Since Cite's ‎<ref> tag is parsed before MediaWiki's parser functions (e.g. {{#ifexpr:…}}) or variables (e.g. {{PAGENAME}}) or before subst:, these will not work inside of citation references. 代わりにマジックワード {{#tag:…}}を使う必要性があります。

ウィキテキスト 結果
Foo<ref>これは正常に動作しません、参照 {{cite journal|url=https://www.google.com |author= |date= |accessdate={{subst:#time:Y-m-d|now}}|title=Google検索}}</ref> bar baz…
Foo{{#tag:ref|対して、参照 {{cite journal|url=https://www.google.com |author= |date= |accessdate={{subst:#time:Y-m-d|now}}|title=Google検索}}}} bar baz…
<references />

Foo[1] bar baz… Foo[2] bar baz…

  1. これは正常に動作しません、参照 "Google検索" . Retrieved on [[{{subst:#time:Y-m-d|now}}]]. 
  2. 対して、参照 "Google検索" . Retrieved on 2021-03-11. 

脚注リストに自動で見出しを付ける

Up to MediaWiki 1.28, one could use the system message MediaWiki:Cite references prefix to define a wiki-wide heading which would be automatically inserted before each references list. In MediaWiki 1.29, this system message was removed. 見出しをつけるためには以下のコードをMediaWiki:Common.jsに記述してください :

$(document).ready(function(){
    $('.mw-references-wrap').before('<h2>脚注</h2>');
});

Note that this adds the header unconditionally, i.e. if you already have the header it gets added again thus creating duplicated headers.

単純にテキストで見出しを作る場合は(要素を付けない場合は)MediaWiki:Common.cssに以下のスタイルシートを追加してください(Chrome 4, IE9, FF 3.5, Safari 3.1, Opera 7) :

.mw-references-wrap::before {
  content: "Blue references";
  color: #0645ad;
  text-decoration: none;
  background: none;
  font-style: italic;
  font-size: 100%;
  font-weight: bold;
  line-height: 1.6;
  direction: ltr;
  font-family: sans-serif;
}

2つの参照文書を1つの参照に統合する

Wikiの脚注の問題点は、同じ脚注を複数使用する際に同じタグを何度も書かなくてはならない点です。 これらは、最初の脚注に ‎<ref name="名前"> タグを使用し、以降の脚注に同じ名前の ‎<ref follow="名前"> タグを使用することでマージできます。

例:

ウィキテキスト 結果
This is an example of merging multiple texts into the same footnote.<ref name="main">Remember that all the texts will be included into the reference containing the name="…" attribute.</ref>

<ref follow="main">Simply include the additional text in a tag with the follow="…" attribute, matching the first ref's name.</ref>

<span id="References"></span>
==脚注==
<references/>

This is an example of merging multiple texts into the same footnote.[1]


脚注

  1. Remember that all the texts will be included in the reference containing the name="…" attribute. Simply include the additional text in a tag with the follow="…" attribute, matching the first ref's name.

When using this syntax, take care that the "follow" part of the footnote is included on the same page as the first part of the reference.

Note that reference names cannot start with a number, so always include some text like, <ref name="p32"> and <ref follow="p32">.


カスタマイズ

The format of the output of ‎<ref> and ‎<references> is almost completely customizable through MediaWiki messages, that can be modified, for example, through the MediaWiki namespace depending on the configuration of the wiki.

For a list of messages that control the output of ‎<ref> and ‎<references> and the values, if any, that are passed to them ($1, $2, $3 ...), see an up-to-date listing of the default values that can be obtained directly from MediaWiki.

不完全なリスト
  • cite_reference_link_key_with_num
    1. key
    2. num
  • cite_reference_link_prefix
  • cite_reference_link_suffix
  • cite_references_link_prefix
  • cite_references_link_suffix
  • cite_reference_link
    1. 脚注ID
    2. バックリンクID
    3. 表示する番号
  • cite_references_link_one
    • Used to format the source list that ‎<references /> outputs, it configures 3 things: the backlink ID, the ref ID, and text of note.
    1. バックリンクID — Used for creating the number order of the source list.
    2. 脚注ID — Used to link back to the actual reference in the text, this is where you can configure the ^ symbol.
    3. 注釈のテキスト — 上で使用したソースの説明
  • cite_references_link_many
    1. バックリンクID
    2. リンクのリスト
    3. 注釈のテキスト
  • cite_references_link_many_format
    1. 脚注ID
    2. numeric value to use as a backlink
    3. custom value (as defined in cite_references_link_many_format_backlink_labels to use as a backlink)
  • cite_references_link_many_format_backlink_labels
  • cite_references_link_many_sep
  • cite_references_link_many_and
  • cite_references_suffix

Set references to use ^ and letters

To replace the default uparrow (↑) with caret (^), modify the following system message. これらのページの一覧はSpecial:AllMessagesで確認できます。

MediaWiki:Cite reference backlink symbol
変更前 変更後
^
MediaWiki:Cite references link many format

Replacing $2 with $3 changes the links from 1.0, 1.1, 1.2 to a, b, c etc…

変更前 変更後
<sup>[[#$1|$2]]</sup>
<sup>[[#$1|$3]]</sup>

Searching for these pages for the first time will result in no matches. Simply click "Create this page" to edit the code. The changes will not show up until a page with references is rebuilt.

Set reference and reference number highlighting

Starting with MediaWiki 1.26 the selectors for highlighting are now incorporated into Cite/modules/ext.cite.css. そのため、下のCSSは手動で追加する必要はないです。

MediaWiki:Common.cssに以下のスタイルシートを追加してください。

/* Cite拡張機能の脚注リストを小さくし、クリックした脚注は青くなるようにする */
ol.references { font-size: 90%; }
ol.references li:target { background-color: #ddeeff; }
sup.reference:target { background-color: #ddeeff; }


壊れた脚注

If the ‎<ref> or ‎<references /> tags are used incorrectly, the Cite extension will add an error message to the page, and will add the "参照エラーのあるページ" category. These error messages will appear in the user interface language, either in the article content or in the References section. 例:

ウィキテキスト 結果
This is an example of a references error message.<ref broken>Intended text.</ref>

==注記==
<references />

これは脚注のエラーメッセージの例です。Cite error: Invalid parameter in <ref> tag

注記

関連項目