I want to put some comments about actual code into my document, and for that I thought I'd use \verb
or \begin{verbatim}
, but it turns out that the todonotes
package does not like that:
\documentclass{minimal}
\usepackage{todonotes}
\begin{document}
\todo{\verb|Hello!|}
\end{document}
Which in turn gives the beautiful error:
! Argument of \reserved@a has an extra }.
<inserted text>
\par
l.7 \todo{\verb|Hello!|}
A similar problem applies to \begin{verbatim}
.
So... how do I get verbatim text/code into my todo notes?
\todo
that doesn't like\verb
:\verb
cannot go in the argument of any command. Do you need special characters such as backslash or braces in the "verbatim"?\ttfamily
instead of\verb
.