引用と参考文献
[@key]を使用して引用します。出典は、BibTeXファイル、Source要素、またはその両方から取得されます:
<KScript.Document template="paper" title="Cited" to="'cited.pdf'">
<Paragraph>Life is universal [@berlekamp1982; @rendell2002].</Paragraph>
<Bibliography path="refs.bib">
<Source id="rendell2002" type="inproceedings" author="Paul Rendell" title="Turing Universality of the Game of Life" booktitle="Collision-Based Computing" year="2002" />
</Bibliography>
</KScript.Document>import KScript.Document
Document(template: paper, title: 'Cited', to: 'cited.pdf') {
Paragraph "Life is universal [@berlekamp1982; @rendell2002]."
Bibliography(path: 'refs.bib') {
Source(id: 'rendell2002', type: 'inproceedings', author: 'Paul Rendell', title: 'Turing Universality of the Game of Life', booktitle: "Collision-Based Computing", year: 2002)
}
}引用された文献のみが一覧に掲載されます。citations: numeric(既定)を使用すると、初めて引用された順に[1]のように番号が付けられます。citations: author-yearを使用すると、(Berlekamp et al., 1982)の形式で表示され、一覧は著者順に並べられます。Sourceでは、任意のBibTeXフィールドを属性として指定できます。authorでは、人物をandで区切ります。文献を引用しているもののBibliographyを省略した場合、参考文献は末尾に配置されます。
存在しない id を指す引用や相互参照はエラーです。同じ id が二度使われている場合も、エラーになります。id: は他のテキストと同じ扱いなので、ループで各項目に対して作成することができます: Section(title: $chapter.title, id: "ch-{ $chapter.number }")。