The todonotes package
Marks open tasks in a draft: \todo puts a coloured note in the margin, \listoftodos collects all notes, \missingfigure holds the place of a figure.
Loading the package
\usepackage{todonotes}A comment with % is invisible in the PDF. \todo{...} prints the reminder in the margin, connected by a line to the place in the text where it stands. \todo[inline]{...} prints it as a block in the text instead.
\listoftodos prints a list of all notes with page numbers, which shows what is left before a deadline. For the final version, the option disable removes every note and the list without touching the text.
The package loads tikz and xcolor.
Main commands
\todo{Add the numbers.} | Note in the margin. |
\todo[inline]{Rewrite this paragraph.} | Note as a block across the text width. |
\todo[color=green!40]{...} | Note in another colour, for example one colour per author. |
\missingfigure{Plot of the series} | Placeholder box for a figure that does not exist yet. |
\listoftodos | List of all notes with their page numbers. |
\usepackage[disable]{todonotes} | Hides all notes, placeholders and the list. |
\usepackage[textsize=small]{todonotes} | Smaller type in the notes. |
Complete example
\documentclass{article}
\usepackage[colorinlistoftodos, textsize=small]{todonotes}
\begin{document}
\listoftodos
\section{Results}
The first experiment confirms the model.\todo{Add the exact numbers.}
The second one is still running.\todo[color=green!40]{Ask for the data.}
\todo[inline]{Rewrite this paragraph before submission.}
\missingfigure[figwidth=6cm]{Plot of the measurement series}
\end{document}Compiled with pdfLaTeX from TeX Live 2023. Tools run in this order: pdflatex → pdflatex.
Pitfalls
- A margin note inside a float, a footnote or a
minipagegives Float(s) lost. Use\todo[inline]{...}there. - A note is as wide as
\marginparwidth. Below 2 cm the package prints a warning, and with page margins narrower than the note, the note sticks out over the edge of the page. Widen the margin or use inline notes. - Several notes close together push each other down the margin; the log then shows Marginpar on page 1 moved.
\listoftodosneeds a second LaTeX run, like a table of contents.
Related pages
- How-to Comments in LaTeX source
- Package
marginnote - Package
xcolor - Error Float(s) lost
- Error Marginpar on page 1 moved