autonum은 \caption의 \ref를 좋아하지 않습니다.

autonum은 \caption의 \ref를 좋아하지 않습니다.

다음은 캡션 내에서 일부 레이블에 대한 참조가 작동하지 않는 최소한의 예입니다.자동 패키지.

\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}

컴파일 시 다음과 같은 오류가 발생합니다.

! Argument of \@caption has an extra }.
! Paragraph ended before \@caption was complete.

방정식 대신 다른 수치를 참조하면 동일한 결과를 얻습니다.

이 오류를 방지하려면 어떻게 해야 합니까?

답변1

사용\protect

\caption{\protect\ref{eq::label}}

관련 정보