[Tex/LaTex] Using achemso package, can’t reference equations with \label and \ref

achemsocross-referencingequations

I have a manuscript in preparation with achemso class and package. I have equations in the equation environment, with \label and \ref used to automatically reference them in the text. This was working fine, along with labels in figures, schemes and tables, until yesterday when I updated the achemso, cleveref, hyperref packages. Now the references to figures, schemes and tables still works fine, but when I try to use it with my equations, I get ?? in the text no matter how many times I compile, even if I trash the aux files and start over.

Here is what I think the relevant error message is from the log file/console output:

LaTeX Warning: Reference `eq:structprop' on page 1 undefined on input line 38. 
[1{/usr/local/texlive/2011/texmf-var/fonts/map/pdftex/updmap/pdftex.map}]
(./minimalexample.aux)     
LaTeX Warning: There were undefined references. 

and here is a minimal working example:

\documentclass[journal=jacsat,manuscript=article,layout=traditional]{achemso}

\setkeys{acs}{maxauthors=0} 

\usepackage[version=3]{mhchem}  

\title{title}

\author{some guy}

\email{someguy@someplace.somedomain}

\affiliation{some place}

\begin{document} 

\section{Introduction} 

some introductory text 

\begin{equation}

\label{eq:structprop}

\delta_{g\to e^{\prime}}\propto\frac{M_{ge}^{2}M_{ee^{\prime}}^{2}}{(E_{ge}-\hbar\omega)^{2}\Gamma_{ge^{\prime}}}

\end{equation} 

In \ref{eq:structprop}, $M$ represents a blah blah blah.

\end{document}

I hope this is sufficient information to help anyone kind enough to help me. If not I would be glad to add other information that could help.
I note that if I just use the book class without achemso, I can get references to numbered equations to work right, this is why I think there is something specific about achemso that results in what I see.

EDIT

I have checked out my problem on both my PC at work and my Mac at home. I get the same problem, even when removing unnecessary line breaks in the equation environment.

I saw Joseph Wright's comment, so I ran \listfiles (results pasted below). I also saw his last comment, so I checked my package versions and those are all the ones that I have.

My hunch is that the issue lies with the new version of cleveref, since I was able to get \ref to work with equations before I updated cleveref, but not after, regardless of which version of achemso I was using. I could of course be wrong on that. I'll be happy to help if I can, but I don't know what else I can do from here. For now I'll try to go back to an earlier version of cleveref, if I can find one; otherwise I may just put equations within a user defined float and see if I can make it work like that.

Thanks to everyone who has responded and helped.

\listfiles result (from PC, using MiKTeX):

 *File List*
 achemso.cls    2011/12/30 v3.5k Submission to ACS journals
 article.cls    2007/10/19 v1.4h Standard LaTeX document class
  size12.clo    2007/10/19 v1.4h Standard LaTeX file (size option)
 xkeyval.sty    2008/08/13 v2.6a package option processing (HA)
 xkeyval.tex    2008/08/13 v2.6a key=value parser (HA)
mciteplus.sty    2008/09/30 v1.1 enhanced mcite
 fontenc.sty
   t1enc.def    2005/09/27 v1.99g Standard LaTeX file
geometry.sty    2002/07/08 v3.2 Page Geometry
geometry.cfg
  helvet.sty    2005/04/12 PSNFSS-v9.2a (WaS) 
 caption.sty    2011/11/10 v3.2e Customizing captions (AR)
caption3.sty    2011/11/01 v1.4a caption3 kernel (AR)
 courier.sty    2005/04/12 PSNFSS-v9.2a (WaS)     
   float.sty    2001/11/08 v1.3d Float enhancements (AL) 
graphicx.sty    1999/02/16 v1.0f Enhanced LaTeX Graphics (DPC,SPQR)
graphics.sty    2009/02/05 v1.0o Standard LaTeX Graphics (DPC,SPQR)
    trig.sty    1999/03/16 v1.09 sin cos tan (DPC)
graphics.cfg    2007/01/18 v1.5 graphics configuration of teTeX/TeXLive
  pdftex.def    2011/05/27 v0.06d Graphics/color for pdfTeX    
infwarerr.sty    2010/04/08 v1.3 Providing info/warning/message (HO)
 ltxcmds.sty    2011/04/18 v1.20 LaTeX kernel commands for general use (HO)
mathptmx.sty    2005/04/12 PSNFSS-v9.2a Times w/ Math, improved (SPQR, WaS) 
setspace.sty    2011/12/19 v6.7a set line spacing
     url.sty    2006/04/12  ver 3.3  Verb mode for urls, etc.
cleveref.sty    2011/12/24{} v0.18.1{} Intelligent cross-referencing
  jacsat.cfg    2011/12/30 v3.5k achemso configuration: J. Am. Chem. Soc.
  natbib.sty    2010/09/13 8.31b (PWD, AO)
 natmove.sty    2010/01/15 v1.1a Automatic citation moving with natbib
  mhchem.sty    2011/06/03 v3.11 for typesetting chemical formulae
  ifthen.sty    2001/05/26 v1.1c Standard LaTeX ifthen package (DPC)
    calc.sty    2007/08/22 v4.3 Infix arithmetic (KKT,FJ)
  twoopt.sty    2008/08/11 v1.5 Definitions with two optional arguments (HO)
 amsmath.sty    2000/07/18 v2.13 AMS math features
 amstext.sty    2000/06/29 v2.01
  amsgen.sty    1999/11/30 v2.0
  amsbsy.sty    1999/11/29 v1.2d
  amsopn.sty    1999/12/14 v2.01 operator names
   t1ptm.fd    2001/06/04 font definitions for T1/ptm.
   t1phv.fd    2001/06/04 scalable font definitions for T1/phv.
ot1ztmcm.fd    2000/01/03 Fontinst v1.801 font definitions for OT1/ztmcm.
omlztmcm.fd    2000/01/03 Fontinst v1.801 font definitions for OML/ztmcm.
omsztmcm.fd    2000/01/03 Fontinst v1.801 font definitions for OMS/ztmcm.
omxztmcm.fd    2000/01/03 Fontinst v1.801 font definitions for OMX/ztmcm.
  ot1ptm.fd    2001/06/04 font definitions for OT1/ptm.

END EDIT

Best Answer

The problem comes down to a change in cleveref, which now seems to have a load order requirement with amsmath which was not previously the case. With the minimal example

\documentclass{article}
\usepackage{cleveref}
\usepackage{amsmath}

\begin{document} 

\begin{equation}
\label{eq:structprop}
a
\end{equation} 

\cref{eq:structprop}

\end{document}

The issue is visible with the current cleveref release, but did not occur previously.

Related Question