# I want to number two formula in equation, aligned and split environment

This is my code:

\begin{aligned} &\begin{split} \max\,\, z=&P_1d_1^-+P_2d_2^-+P_3(240d_3^-+220d_4^-+250d_5^-)\\ &+P_4(240d_6^-+220d_7^-+250d_8^-)+P_5d_9^-+P_6d_2^- \end{split} \\ &\text{s.t.}\quad \begin{cases} 960x_1+1320x_2+2500x_3+d_1^--d_1^+=486400 \\ 4x_1+6x_2+10x_3+d_2^--d_2^+=1800 \\ x_1+d_3^--d_3^+=50 \\ x_2+d_4^--d_4^+=60 \\ x_3+d_5^--d_5^+=65 \\ x_1+d_6^--d_6^+=90 \\ x_2+d_7^--d_7^+=125 \\ x_3+d_8^--d_8^+=90 \\ 4x_1+6x_2+10x_3+d_9^--d_9^+=2100 \end{cases} \end{aligned}


I want to number the part of split and the following cases respectively, the above code is my best outcome to look but still one number. I want to have two number in this long formula and stay the up and down parts align to left.

For example, I want to number a (7) in the part of “max”, and number a (8) in the part of “s.t.”

• Welcome to TeX.SE! Please make your code snippet be compilable, then we do not have to guess what you are doing ... Commented Jul 14 at 10:05
• use align rather than aligned in equation to number separately Commented Jul 14 at 10:34

Use align instead of equation if you want multiple tags.

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

\begin{align}
&
\begin{aligned}
\max\,\, z ={} % note the empty group
& P_1d_1^-+P_2d_2^-+P_3(240d_3^-+220d_4^-+250d_5^-) \\
& + P_4(240d_6^-+220d_7^-+250d_8^-)+P_5d_9^-+P_6d_2^-
\end{aligned} \\
\begin{cases}
960x_1+1320x_2+2500x_3+d_1^--d_1^+=486400 \\
4x_1+6x_2+10x_3+d_2^--d_2^+=1800 \\
x_1+d_3^--d_3^+=50 \\
x_2+d_4^--d_4^+=60 \\
x_3+d_5^--d_5^+=65 \\
x_1+d_6^--d_6^+=90 \\
x_2+d_7^--d_7^+=125 \\
x_3+d_8^--d_8^+=90 \\
4x_1+6x_2+10x_3+d_9^--d_9^+=2100
\end{cases}
\end{align}

\end{document}


PS: If you set alignment points after relation symbols such as =, \leq and \geq and operators like + and -. You should add an empty group after those symbols, otherwise the spacing is incorrect.

You must use an environment allowing multiple equations, in this case align.

Since the second part doesn't actually have an alignment point with respect to the first part, I set the alignment point at the left.

However this requires a couple of tricks:

1. when \max (or other operator) immediately follows & in align, a correcting \! has to be used.

2. in order to move right the second line, I use a phantom.

The second part doesn't use cases, because it's not meant for lists of equations without side conditions.

\documentclass{article}
\usepackage{amsmath}

\newcommand{\st}{\textup{s.t.}}

\begin{document}

\begin{align}
\begin{split}
&\!\max z=P_1d_1^-+P_2d_2^-+P_3(240d_3^-+220d_4^-+250d_5^-)\\
\end{split} \\[1ex]
\left\{\begin{aligned}
& 960x_1+1320x_2+2500x_3+d_1^--d_1^+=486400 \\
& 4x_1+6x_2+10x_3+d_2^--d_2^+=1800 \\
& x_1+d_3^--d_3^+=50 \\
& x_2+d_4^--d_4^+=60 \\
& x_3+d_5^--d_5^+=65 \\
& x_1+d_6^--d_6^+=90 \\
& x_2+d_7^--d_7^+=125 \\
& x_3+d_8^--d_8^+=90 \\
& 4x_1+6x_2+10x_3+d_9^--d_9^+=2100
\end{aligned}\right.
\end{align}

\end{document}