The following is a minimal non-working example of a reference to some label within a caption while using the autonum package.
\documentclass{article}
\usepackage{autonum}
\begin{document}
\begin{align}
E = mc^2 \label{eq::label}
\end{align}
\begin{figure}
y \caption{ \ref{eq::label} }
\end{figure}
\end{document}
Upon compiling I get the following errors:
! Argument of \@caption has an extra }.
! Paragraph ended before \@caption was complete.
I get the same result, if I refer to, say another figure, instead of an equation.
How can I avoid this error?