# autonum and cleveref conflict

The following code produces erroneous output. When I put cleveref first, it doesn't pick up the references at all. When I put autonum first, really weird stuff happens. See the images below.

I found this reference: enter link description here This appears related, but I have autonum version 3.8, so the issue mentioned there ought to be fixed. Thoughts?

P.S.:To see the behavior, ensure that you clear the aux file after changing the order of autonum and cleveref.

\documentclass{amsart}

\usepackage{autonum}
\usepackage{cleveref}

\listfiles

\begin{document}

\begin{multline} \label{eq:longeq}
z=a+b+c+d+e+f+g\\
+ h+i+j+k+\ell+m+n+o+p+q+r+s+t+u+v+w+x+y.
\end{multline}

Equation \cref{eq:longeq}.

\begin{multline}
z=a+b+c+d+e+f+g\\
+ h+i+j+k+\ell+m+n+o+p+q+r+s+t+u+v+w+x+y.\label{eq:longeq2}
\end{multline}

Equation \cref{eq:longeq2}.

\begin{gather} \label{eq:shorteq}
x=y
\end{gather}

Equation \cref{eq:shorteq}
\end{document}


• Simply put, the two packages are not compatible. – egreg Sep 2 '15 at 16:20
• Thank you, but autonum claims to be compatible! – JPi Sep 2 '15 at 16:32
• If it's loaded before cleveref, then align and gather produce funny output. In the reverse order, multline doesn't get referenced. I'm inclined to think this means the two packages don't go along well together. ;-) – egreg Sep 2 '15 at 16:38
• It's more complicated than that: in the reverse order it matters where you stick the label in multline. If you stick it at the beginning then it doesn't get referenced whereas if you stick it at the end then it does. Weird. – JPi Sep 2 '15 at 16:52

The packages are compatible if you read the documentation. More specifically, amsmath must be loaded before cleveref which must be loaded before autonum. For example:

\documentclass{article}
\usepackage{amsmath,cleveref,autonum}
\begin{document}
\begin{multline}\label{eq:a}
z=a+b+c+d+e+f+g\\
+ h+i+j+k+\ell+m+n+o+p+q+r+s+t+u+v+w+x+y.
\end{multline}
\begin{multline}\label{eq:b}
z=a+b+c+d+e+f+g\\
+ h+i+j+k+\ell+m+n+o+p+q+r+s+t+u+v+w+x+y.
\end{multline}
\begin{gather}\label{eq:c}
x=y
\end{gather}
\begin{gather}\label{eq:d}
x=y
\end{gather}
We reference the first \verb|multline| environment, but not the second, and the second \verb|gather| environment, but not the first.
Hence. only \cref{eq:a} and \cref{eq:d} will be numbered, even though all equations are labelled.
\end{document}


However, there is an incompatibility here with the amsart class. Whereas the packages are compatible with the standard class, things don't work so well switching to amsart:

• I did look at the manual and noticed the loading order. I had not realized that amsart would not do, and the manual is silent about that. – JPi Sep 3 '15 at 2:19
• @JPi Yes. It is odd, isn't it? On the other hand, I assume that the class and both packages are essentially fiddling with the way reference numbers are created - the AMS classes are designed, after all, to impose AMS's 'look' to some extent. Might be worth emailing the package author and suggesting this be added to the documentation. – cfr Sep 3 '15 at 11:46