# Using todonotes in math-mode

Is it possible to create notes via the package todonotes in a displayed math environment? Here is a minimal example where it fails:

\documentclass{minimal}

\usepackage{todonotes}

\begin{document}
$\todo{think about it twice}foo = bar$
\end{document}


Anyone an idea?

-
todo notes are floats. I'd say it's probably not possible... –  Jubobs Mar 11 '13 at 13:14

The todo note needs to be added to material in the vertical list that (La)TeX is building. You can use \vadjust to add such material when in other contexts. So the following produces the desired result:

\documentclass{article}

\usepackage{todonotes}

\begin{document}

$\vadjust{\todo{think about it twice}} x^2 = y^2 + z^2$

\end{document}


Note that this will not work with eqnarray nor the ams math environments, whose internals are rather different.

-