How do I cross-reference (preferably with cleveref) a whole optidef problem that has labels on subequations?

For example, consider the last example in the doc:


I can reference each subequation, e.g. (28a). But how do I reference the whole problem: (28)?


1 Answer 1


Let's consider the code of the mini! optimization problem given on the final page of the package's user guide:

{w}{f(w)+ R(w+6x)\label{eq:ObjectiveExample3}}
\addConstraint{g(w)}{=0 \label{eq:C1Example3}}
\addConstraint{n(w)}{= 6 \label{eq:C2Example3}}
\addConstraint{L(w)+r(x)}{=Kw+p \label{eq:C3Example3}}

The mini! environment takes 3 optional arguments -- here: s, 2, and b -- and 4 required arguments, the third of which is given as follows: \label{eq:Example3}.

In section 3.1, "Definition of problem parameters" (pp. 5f.), of the package's user guide, one finds the following characterization of the third required argument (under item #vii): "it defines the main and general reference for the optimization problem. It is used for the mini and mini! enviro[n]ments."

Hence, do give eq.~\eqref{eq:Example3} or -- since you would like to use the cleveref package -- \cref{eq:Example3} a try.

  • 1
    I totally missed that; thanks.
    – Zohar Levi
    Commented Sep 4, 2020 at 7:26

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .