Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Just this afternoon I seem to have a package clash that resulted in all my equation numbers disappearing. I seem to have resolved the issue by putting \usepackage{amsmath} at the top of the preamble rather than halfway down, where it has been for the last couple of years. In particular, it seems I need to load amsmath before cleveref. I am sure this is new today. I am now worried that there might be some other package clash caused by moving amsmath to the top (although it seems to be compiling OK now).

M(non-W)E

\documentclass{report}

\usepackage{cleveref}
\usepackage{amsmath}

\begin{document}

\begin{equation}
  \label{eq:j}
  J = \frac{1}{2}(a - b)
\end{equation}

I want to reference \cref{eq:j}

\end{document}

Does this work for anyone else? I use MikTex2.9 by the way. Are there likely to be any other package clashes caused by moving amsmath to the top?

Including my full package list just in case anyone can spot something wrong:

\documentclass[12pt, a4paper, oneside, fleqn]{report}

\usepackage{amsmath}
\usepackage{setspace}                % allow different line spacing
\usepackage[showframe, top=2.5cm, left=3.5cm, bottom=2.5cm, right=2.5cm, includehead]
\usepackage{hyphenat}
\usepackage[T1]{fontenc}   % allows < > to work properly
\usepackage{textcomp}
\usepackage{lmodern}       % gives bold italic font
\usepackage{import}        % import files from subdirectories
\usepackage[toc]{glossaries} % add a glossary
\usepackage[subfigure,titles]{tocloft}
\usepackage[noabbrev]{cleveref}      % reference object types automatically
\usepackage{url}                     % split URLs across lines
\usepackage{graphicx}      % needed for including graphics
\usepackage{epstopdf}
\usepackage{grffile}
\usepackage{placeins}      % insert floatbarriers
\usepackage[singlelinecheck=0,font={sf,small},labelfont=bf]{caption, subfig}
\usepackage{fancyhdr}
\usepackage{appendix}               % allow formatting of appendix titles
\usepackage{subdepth}                   % allow more levels of subsection
\usepackage{sectsty}          % put section headings in sans-serif font
\usepackage{mathtools}
\usepackage{xfrac}                   % allow placement of fractions in text
\usepackage{xspace}                  % automatically put spaces after defined symbols
\usepackage{siunitx}          % good unit formatting
\usepackage{array,booktabs}
\usepackage{enumitem}
\usepackage[round]{natbib}
\usepackage[british]{babel}
share|improve this question
2  
cleverref is documented as having to be loaded 'late' –  Joseph Wright Jun 20 at 16:15
    
@JosephWright I can't understand it though, I didn't change anything about the order of those two. I'd been playing around with my bibligraphy and added hyphenat but even removing that made no difference. I know I didn't change the order because I pulled the old file out of dropbox ;-) –  FionaSmith Jun 20 at 16:30
    
What about mathtools - it loads amsmath. So, if you had mathtools loaded before cleveref everything would have worked fine. Did you change any other package orders? –  Werner Jun 20 at 16:51
    
@Werner thanks for that also. I have just double checked: at some point I moved tocloft from below 'url' to above cleveref - but it is still there and it doesn't seem to be complaining about that. This package stuff is fraught with danger - that list has been compiled gradually over about five years - how anyone's supposed to remember what clashes with what I don't know! –  FionaSmith Jun 20 at 17:39
    
You load the obsolete package subfigure and also, in a very non standard way, subfig; remove subfigure and move subfig to \usepackage{subfig} by itself. –  egreg Jun 20 at 19:53

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.