Managing todonotes Layout and Customizing Appearance in LaTeX
When using the todonotes package in LaTeX, notes may extend beyond the page margin if the marginal note width is not constrained. Set the width explicitly to keep annotations within bounds:
\usepackage{todonotes}
\setlength{\marginparwidth}{2.25cm} % restrict marginal note width
To fine-tune spacing and text scale for a specific note, wrap it with line-spacing and font-size commands:
{\linespread{1.0} \todo[size=\small]{A sample inline task note}}
LaTeX provides a hierarchy of relative font-size commands, ordered from smallest to largest:
\tiny— minimal size\scriptsize— very small\footnotesize— suitable for footnotes\small— slightly larger than footnote size\normalsize— default body text size\large— larger than normal\Large— even larger\LARGE— extra large\huge— very large\Huge— maximum size
Apply locally by enclosing text:
{\footnotesize Text in footnote scale.}
To alter the whole document’s base size, invoke the command immediately after \begin{document}:
\documentclass{article}
\begin{document}
\small
Document content in reduced typeface.
\end{document}
The todonotes package supports several key options for the \todo command:
inline— render the note inside the main text flow instead of in the margincolor— set text color of the notelinecolor— define color of the marginal linebackgroundcolor— specify fill color behind the notebordercolor— choose border line colorsize— adjust font size within the notecaption— assign a heading; can incorporate font styling commandsdisable— suppress rendering of the note entirely
Options may be combined. For instance:
\todo[color=blue, caption={\Large Custom Task}, size=\footnotesize]{Custom styled annotation}
Color blending syntax permits subtle background tints. In backgroundcolor=yellow!20, the notation means 20% yellow mixed with 80% white, yielding a pale highlight. This relies on the xcolor package. Adjust the percentage to achieve the desired contrast:
\todo[backgroundcolor=yellow!20]{Highlighted note with soft yellow shade}
Refer to the todonotes and xcolor documentation for the full range of customization parameters.