Will todonotes work inside an align environment?
todonotes
As mentioned in \marginpar and \begin{align} \marginpar
that is used by todonotes
doesn't work inside align
, but \marginnote
from the marginnote
package does. Hence, you could redefine a command from todonotes
to use marginnote
, and it works. Three compilation passes is needed.
\documentclass{report}
\usepackage{amssymb,amsmath}
\usepackage{todonotes}
\usepackage{marginnote}
\makeatletter
\renewcommand{\@todonotes@drawMarginNoteWithLine}{%
\begin{tikzpicture}[remember picture, overlay, baseline=-0.75ex]%
\node [coordinate] (inText) {};%
\end{tikzpicture}%
\marginnote[{% Draw note in left margin
\@todonotes@drawMarginNote%
\@todonotes@drawLineToLeftMargin%
}]{% Draw note in right margin
\@todonotes@drawMarginNote%
\@todonotes@drawLineToRightMargin%
}%
}
\makeatother
\begin{document}
\begin{align}
a^2&=b^2+c^2 \todo{check this calculation}
\end{align}
\end{document}
luatodonotes
If you're using lualatex
to compile your documents, then replacing todonotes
with luatodonotes
is another option.
(Note (for TeX Live 2015 users at least): at the moment there is a problem with luatex.sty
, which is loaded by luatodonotes
, so a small patch suggested by David Carlisle in chat is
required.)
% ---------
% temporarily required
\makeatletter
\@namedef{[email protected]}{}
\makeatother
% ----------
\documentclass{report}
\usepackage{amsmath}
\usepackage{luatodonotes}
\begin{document}
\begin{align}
a^2&=b^2+c^2 \todo{check this calculation}
\end{align}
\end{document}