> For the complete documentation index, see [llms.txt](https://overleaf-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://overleaf-pro.ayaka.space/latex/it/domande-e-risposte/04-can-i-add-inline-or-margin-comments-to-the-pdf.md).

# Posso aggiungere commenti in linea o a margine al PDF?

Sì, puoi usare il [`todonotes` che fornisce i comandi e le funzionalità necessarie per includere file grafici esterni. L'esempio sopra carica il](https://ctan.org/pkg/todonotes?lang=en) (trattato qui) oppure leggi la nostra pagina di aiuto su [note a margine](/latex/it/formattazione/15-margin-notes.md), che tratta [`\marginpar` comando](/latex/it/formattazione/15-margin-notes.md#the-5cmarginpar-command) e il [`marginnote` che fornisce i comandi e le funzionalità necessarie per includere file grafici esterni. L'esempio sopra carica il](/latex/it/formattazione/15-margin-notes.md#an-alternative-to-5cmarginpar-the-marginnote-package).

## Caricamento del pacchetto todonotes

Per usare il `todonotes` pacchetto, aggiungi la seguente riga al preambolo del tuo documento:

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

Il `colorinlistoftodos` l'opzione aggiunge piccoli quadrati colorati all'elenco delle note TODO (vedi sotto), aiutando a distinguere tra diversi tipi.

* **Nota**: Si consiglia vivamente ai lettori di consultare [`todonotes` documentazione](http://mirrors.ctan.org/macros/latex/contrib/todonotes/todonotes.pdf) per informazioni sulle opzioni del pacchetto, comandi utili ed esempi pratici.

Usa il seguente comando per aggiungere un commento:

```latex
\todo{Questo è un commento che apparirà nel margine}
```

## Esempio con il pacchetto todonotes

Di seguito è riportato un esempio di base per aiutarti a iniziare: mostra vari stili di nota e produce un elenco di note TODO tramite il comando

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

che accetta un argomento opzionale, racchiuso in `[...]`, usato per comporre un titolo per l'elenco delle note.

```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{Todonotes semplici.} 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]{Nota TODO di un colore diverso.}%
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]{Nota TODO mostrata solo nel margine e non in
nell'elenco delle TODO.}%
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]{Una nota con un carattere piccolo.}%
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]{prova prova}

Donec nulla lectus, faucibus sit amet, auctor non, consectetuer
quis, pede. Nullam dictum. Nullam suscipit, ligula in scelerisque
\todo[noline]{Una nota senza linea di richiamo al testo.}%
posuere, sapien purus rutrum magna, vitae pharetra leo quam vel
tortor. Donec eleifend condimentum sapien. Etiam sed orci. Aliquam
\todo[inline, color=red!50]{Note TODO in linea.}%
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]{Una nota senza linea di richiamo al testo.}%
in nibh bibendum volutpat. Quisque accumsan diam. Aenean ultricies
nisl ac lacus. Aliquam posuere. Aenean venenatis tortor in felis.
\end{document}
```

Apri questo esempio in Overleaf

Questo esempio produce il seguente output:

![Dimostrazione del pacchetto todonotes su Overleaf](/files/16e6d11215656434723bdda3867047bc8e38561b)

## Approfondimenti

* Il [`todonotes` documentazione](http://mirrors.ctan.org/macros/latex/contrib/todonotes/todonotes.pdf) contiene informazioni sulle opzioni del pacchetto, comandi utili ed esempi pratici.
* La pagina di aiuto di Overleaf su [note a margine](/latex/it/formattazione/15-margin-notes.md) tratta [`\marginpar` comando](/latex/it/formattazione/15-margin-notes.md#the-5cmarginpar-command) e il [`marginnote` che fornisce i comandi e le funzionalità necessarie per includere file grafici esterni. L'esempio sopra carica il](/latex/it/formattazione/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://overleaf-pro.ayaka.space/latex/it/domande-e-risposte/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.
