[Tex/LaTex] Subnumbering Equations Under the actual equation number

equationssubequations

I am trying to write an optimization problem like below using eqnarray:

Max   z =a + b   (1)
s.t   a > 1     
      b < 4     

But I want to write the sub-equation numbers as (1.a) and (1.b) like below:

Max   z =a + b   (1)
s.t   a > 1      (1.a)
      b < 4      (1.b)

How can I write it? please help.

Best Answer

It's easy with alignat, using \tag for suppressing the advancement of the numbering and setting the referenced equation number instead.

\documentclass{article}
\usepackage{amsmath}
\begin{document}

\begin{subequations}\label{eq:foo}
\begin{alignat}{2}
\max        &\quad& z &= a + b   \tag{\ref{eq:foo}} \\
\text{s.t.} &     & a &> 1 \\
            &     & b &< 4
\end{alignat}
\end{subequations}

\end{document}

You can of course add labels also for the two conditions.

enter image description here

Related Question