I am working with marginpar to put some comments in the margin of my document. In one case I would like to put a comment on a caption of a figure, a MWE of which looks like this:
\begin{document}
\begin{figure}
\caption{captiontext \marginpar{marginText}}
\end{figure}
\end{document}
Unfortunately, this fails saying: Argument of \@caption has an extra }
Why is this happening? And how can I fix it/work around it?

marginparhas no mark, it could just go outside of thefigureenvironment! – Andy Nov 12 '14 at 09:12marginparis actually positioned on on the same horizontal level as the position from which you call it, so that is why I would like to use it within the environment – Michiel Nov 12 '14 at 10:23