The following code
\documentclass{report}
\begin{document}
\begin{equation}
\setlength\arraycolsep{1.5pt}
\begin{array}{l@{\qquad} r c r c r}
(P) & z(P) = \min & cx \\
& \mathrm{s.t.} & Ax & = & b \\
& & x & \in & X \\
\end{array}
\end{equation}
\end{document}
produces a single equation number associated with the whole model as can be seen from the picture below.
How can I define a number for each constraint (without writing it myself)?
See example below.
Best Answer
This answer uses the
optidef
package. I appears to require writing the objective function differently to what was posted as an example. Otherwise, the function and the constraints are individually numbered.The following examples illustrate four different usages, providing different alignments, and a long and short style of notation.
This is the result:
This is the code: