メタデータしたい(document

1#set document(
2  title: [すごいタイトル],
3  author: ("すごい著者"),
4  description: [すごい説明],
5  keywords: (),
6  date: auto,
7)

document要素は、文書の全体のメタデータを設定できます。 このメタデータはPDFファイルなどに埋め込まれる情報で、本文には表示されません。

ユーザーが独自のdocument要素を作ることはできず、setルール(#set document)の形でのみ設定できます。

タイトルしたい(title

1#set document(
2  title: [文書全体のタイトル]
3)

titleオプションで、文書のタイトルを埋め込むことができます。 コンテンツブロックで指定できるので、マークアップしたタイトルや改行付きのタイトルも設定できます。

注釈

マークアップしたタイトルがPDFにどのように埋め込まれるのかは気になります(ただ調べてないだけ)。

著者したい(author

1#set document(
2  author: ("著者1", "著者2")
3)

authorオプションで、文書の著者情報を埋め込むことができます。 配列で指定できるので、複数の著者を設定できます。

説明したい(description

1#set document(
2  description: [文書全体の説明]
3)

descriptionオプションで文書の説明を埋め込むことができます。

キーワードしたい(keywords

1#set document(
2  keywords: ("キーワード1", "キーワード2")
3)

keywordsオプションで、文書のキーワードを埋め込むことができます。

日付したい(date

1#set document(
2  date: datetime(year: 2026, month: 1, day: 17)
3)

dateオプションで、文書の作成日を埋め込むことができます。 デフォルトはautoになっていて、ビルド時の日付が適用されます。 datetimeオブジェクトを使用して、特定の日付を設定できます。

参照したい

1#context {document.title}
2#context {document.author}
3#context {document.description}
4#context {document.keywords}
5#context {document.date}

#context関数を経由してdocument要素の設定値を、本文中で取得できます。

レポートの表紙やヘッダー情報などで、タイトルなどを表示したい場合に再利用できます。

リファレンス