> For the complete documentation index, see [llms.txt](https://ayakaleaf-pro.ayaka.space/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ayakaleaf-pro.ayaka.space/latex/ja/to-2/04-can-i-add-inline-or-margin-comments-to-the-pdf.md).

# PDFにインラインコメントや余白コメントを追加できますか?

はい、次を使用できます。 [`todonotes` パッケージ](https://ctan.org/pkg/todonotes?lang=en) （ここで解説しています）または、次に関するヘルプページをお読みください [余白注釈](/latex/ja/shu-shi-she-ding/15-margin-notes.md)、これは次について説明しています [`\marginpar` コマンドは](/latex/ja/shu-shi-she-ding/15-margin-notes.md#the-5cmarginpar-command) および [`marginnote` パッケージ](/latex/ja/shu-shi-she-ding/15-margin-notes.md#an-alternative-to-5cmarginpar-the-marginnote-package).

## todonotes パッケージの読み込み

次を使用するには `todonotes` パッケージを使用するには、以下の行を文書のプリアンブルに追加してください：

```latex
\usepackage[colorinlistoftodos]{todonotes}
```

次の `colorinlistoftodos` オプションは、ToDo ノートの一覧（下記参照）に小さな色付きの四角を追加し、種類の区別をしやすくします。

* **注意**：読者の皆さんはぜひ次をご覧ください [`todonotes` ドキュメント](http://mirrors.ctan.org/macros/latex/contrib/todonotes/todonotes.pdf) パッケージオプション、役立つコマンド、参考になる例に関する情報を得るために。

コメントを追加するには、次のコマンドを使用します：

```latex
\todo{This is a comment that will appear in the margin}
```

## todonotes パッケージを使った例

以下に、使い始めるための基本例を示します。さまざまな注記スタイルを示し、次のコマンドを使って ToDo ノートの一覧を生成します

```latex
\listoftodos[Title of your list...]
```

これは、次で囲まれた任意引数を取ります `[...]`、注記一覧のタイトルを組版するために使用されます。

```latex
\documentclass[a4paper]{article}
\usepackage[colorlinks]{hyperref}
\usepackage[colorinlistoftodos]{todonotes}
\begin{document}
\listoftodos[A list of things I need to finish]

Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nulla
\todo{Plain todonotes.} urna. Maecenas interdum nunc in augue.
Mauris quis massa in ante tincidunt mollis. Proin imperdiet.
Donec porttitor pede id est. Sed in ante. Integer id arcu. Nam
lectus nisl, posuere sit amet, imperdiet ut, tristique ac, lorem.
In erat. In commodo enim. \todo[color=blue!40]{Todonote with a different color.}%
Phasellus libero ipsum, tempor a, pharetra consequat, pellentesque
sit amet, sem. Praesent ut augue luctus elit adipiscing ultricies.
Vestibulum suscipit cursus leo. Nullam molestie justo.

Morbi dui. Morbi convallis mi sed sem. Nulla convallis lacus vitae
risus. Phasellus adipiscing. Nullam tortor. Sed laoreet aliquam
ante. Vestibulum diam. Pellentesque nec leo. Pellentesque velit.
\todo[nolist]{Todonote that is only shown in the margin and not in
the list of todos.}%
Praesent congue mi eu ipsum cursus fringilla. Etiam leo erat,
tristique et, pharetra eget, mollis vitae, velit. In hac habitasse
\todo[size=\small, color=green!40]{A note with a small fontsize.}%
platea dictumst. In quam nibh, facilisis et, laoreet non, facilisis
tempus, justo. Class aptent taciti sociosqu ad litora torquent per
conubia nostra, per inceptos himenaeos.

\todo[inline]{testing testing}

Donec nulla lectus, faucibus sit amet, auctor non, consectetuer
quis, pede. Nullam dictum. Nullam suscipit, ligula in scelerisque
\todo[noline]{A note with no line back to the text.}%
posuere, sapien purus rutrum magna, vitae pharetra leo quam vel
tortor. Donec eleifend condimentum sapien. Etiam sed orci. Aliquam
\todo[inline, color=red!50]{Inline todonotes.}%
tempor. Pellentesque egestas tortor id eros. Donec mauris justo,
commodo id, pellentesque id, eleifend non, mi. Duis venenatis
sagittis metus. Donec tempus metus id lacus. Praesent vel diam.
Morbi nec ante. Vestibulum varius felis ac lacus. Nulla vitae neque
\todo[inline, color=green!40]{A note with no line back to the text.}%
in nibh bibendum volutpat. Quisque accumsan diam. Aenean ultricies
nisl ac lacus. Aliquam posuere. Aenean venenatis tortor in felis.
\end{document}
```

この例を Overleaf で開く

この例では次の出力が生成されます:

![Overleaf で todonotes パッケージを紹介するデモ](/files/f6d30e7d336e7c459c33205ddcd42dc4d86dd3ff)

## さらに読む

* 次の [`todonotes` ドキュメント](http://mirrors.ctan.org/macros/latex/contrib/todonotes/todonotes.pdf) には、パッケージオプション、便利なコマンド、役立つ例に関する情報があります。
* Overleaf のヘルプページ [余白注釈](/latex/ja/shu-shi-she-ding/15-margin-notes.md) について説明しています [`\marginpar` コマンドは](/latex/ja/shu-shi-she-ding/15-margin-notes.md#the-5cmarginpar-command) および [`marginnote` パッケージ](/latex/ja/shu-shi-she-ding/15-margin-notes.md#an-alternative-to-5cmarginpar-the-marginnote-package).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://ayakaleaf-pro.ayaka.space/latex/ja/to-2/04-can-i-add-inline-or-margin-comments-to-the-pdf.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
