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?
marginpar
has no mark, it could just go outside of thefigure
environment!marginpar
is 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