3

Minimal example:

\documentclass[12pt,a4paper]{report}
\usepackage{todonotes}
\usepackage{siunitx}
\begin{document}
\todo{\today}
\end{document}

This gives the following error:

! Missing number, treated as zero.
<to be read again>
                   \
l.5 \todo{\today}

The same code works if you don't use the siunitx package, if you use \today outside \todo, or if you write today instead of \today.

Why? Is there any workaround?

3

I suspect the problem occurs because \today is not "robust" (in the LaTeX sense of the word). If you change

\todo{\today}

to

\todo{\protect\today}

you can use both packages just fine. Alternatively, load the etoolbox package and issue the instruction \robustify{\today} in the preamble.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.