If I set the counter of corollaries to follow theorem
, cleveref
incorrectly uses the label theorem in the text, rather than corollary. How can I correct this?
Minimum working example:
\documentclass{article}
\usepackage{amsthm}
\newtheorem{theorem}{Theorem}
\newtheorem{corollary}[theorem]{Corollary}
% \newtheorem{corollary}{Corollary} % This works
\usepackage{cleveref}
\begin{document}
\begin{theorem} \label{thm1}
Theorem level result.
\end{theorem}
\begin{corollary} \label{cor1}
Corollary of \cref{thm1}.
\end{corollary}
Reference to \cref{cor1}.
\end{document}