When trying to cross-reference one of the multi-case equations in the subnumcases environment with cleveref, only the equation number is shown and not the letter. Example:


   x^2 + 1, & $n = 1$ \label{eq:1}\\
   3x^2 + 2, & $n > 1$ \label{eq:2}

We first want to refer to equation 1a with \Cref{eq:1}.
Then to equation 1b with \Cref{eq:2}.



enter image description here

What is going wrong here?

  • The equation number 1a etc. is not transported into \@currentlabel which stores the reference value to the .aux file finally -- that's wrong with it – user31729 Feb 15 at 20:41
  • Possibly related: cleveref and cases packages clash – Bubaya Feb 15 at 20:44

A quick and dirty hack would be to take the solution for the linked question, and alter it in the following way: we define a new environment mysubnumcases, which contains empheq, but first we

  1. save the old value of the equation counter to a new one,
  2. reset the equation counter to zero,
  3. alter the appearance of equation numbers by renewing \theequation,
  4. have the empheq environment,
  5. restore the value of the equation counter.

so we have:

\usepackage{empheq} % loading `mathtools` % loading `amsmath`
\usepackage{cleveref} % load this as very last package

        A=B \label{eq1}
    Some text
    Some text
        A=B \label{eq4}
    Cleveref references: \cref{eq1} \cref{eq2} \cref{eq3} \cref{eq4}.

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.