Page 394 of the memoir manual provides a snippet by Bastian Veelo for making margin comments out over the part of the stock paper that would be cut away. This very handy for making comments only appearing in the draft.
However if I want to comment a float like for example a figure it complains about not being in outer par mode. How can I adopt the code:
\documentclass[draft]{memoir}
\makeatletter
\ifdraftdoc
\newlength{\draftnotewidth}
\newlength{\draftnotesignwidth}
\newcommand{\draftnote}[1]{\@bsphack%
{%% do not interfere with settings for other marginal notes
\strictpagecheck%
\checkoddpage%
\setlength{\draftnotewidth}{\foremargin}%
\addtolength{\draftnotewidth}{\trimedge}%
\addtolength{\draftnotewidth}{-3\marginparsep}%
\ifoddpage
\setlength{\marginparwidth}{\draftnotewidth}%
\marginpar{\flushleft\textbf{\textit{\HUGE !\ }}\small #1}%
\else
\settowidth{\draftnotesignwidth}{\textbf{\textit{\HUGE\ !}}}%
\addtolength{\draftnotewidth}{-\draftnotesignwidth}%
\marginpar{\raggedleft\makebox[0pt][r]{%% hack around
}% \fi
\parbox[t]{\draftnotewidth}{%%%%%%%%% funny behaviour
\raggedleft\small\hspace{0pt}#1%
}}\textbf{\textit{\HUGE\ !}}%
}\@esphack} \else
\newcommand{\draftnote}[1]{\@bsphack\@esphack} \fi
\makeatother
\begin{document}
\begin{figure}
\draftnote{Lorem ipsum}
\end{figure}
\end{document}
to work also with floats?
\marginpar
s are floats, and TeX doesn't allow floats inside floats. (Thanks to egreg for the tip.) Use themarginnote
package and its command of the same name to define a new\draftnote
command from scratch.memoir
has several other margin writing macros, like\sidepar
and friends. Several of these are not floats and thus can be used within floats.\draftnote
won't work, but chances are high thememoir
authors have come up with another command tailor-made for your problem.