3
\documentclass[sfdefaults=false,12pt]{article}
\usepackage{amsmath}
\usepackage{amssymb}
\begin{document}
\begin{equation}\label{latency}
\min_{\alpha_i,\beta_i,l^{C}_{ij}}\sum^{M}_{i=1}
\begin{bmatrix}
\alpha_iy_i\frac{q_i}{l^{UE}_{i}} + & (1-\alpha_i)\frac{y_i}{r_{i,j}} + & \beta_iy_i\frac{q_i}{l^{C}_{ij}} + & (1-\alpha_i-\beta_i)\frac{y_i}{r_j} 
\end{bmatrix},
\end{equation}
subject to
\begin{subequations}
\begin{equation}
\begin{matrix}
C1: \sum^{M}_{i=1}l^{C}_{ij} \leq l^{C.\max}_{j} & \forall = 1,2,\dots,N. \\
\end{matrix}
\end{equation}
\begin{equation}
\begin{matrix}
C2: e^{UE}_{i} + e^{off}_{i} \leq E^{UE.\max}_{i} & \forall = 1,2,\dots,M. \\
\end{matrix}
\end{equation}
\begin{equation}
\begin{matrix}
C3: 0 \leq \alpha_i \leq 1 & \forall = 1,2,\dots,M. \\
\end{matrix}
\end{equation}
\begin{equation}
\begin{matrix}
C4: 0 \leq \beta_i \leq 1-\alpha_i & \forall = 1,2,\dots,M. \\
\end{matrix}
\end{equation}
\end{subequations}
\end{document}

but the result is this enter image description here

what I want is that to continue like 12a 12b 12c 12d not 13a 13b... and align C1-C4 to left and \forall.... to middle or just keeping the alignment with enough gap is enough for me. Can you help me please?

1 Answer 1

5

Use a single alignment environment. You can add \displaybreak where you need a page break, in extreme cases.

\documentclass[12pt]{article}
\usepackage{amsmath}
\usepackage{amssymb}

\begin{document}

\begin{subequations}\label{latency}
\begin{equation}\tag{\ref{latency}}
\min_{\alpha_i,\beta_i,l^{C}_{ij}}\sum^{M}_{i=1}\Bigl[
  \alpha_iy_i\frac{q_i}{l^{UE}_{i}}
  + (1-\alpha_i)\frac{y_i}{r_{i,j}}
  + \beta_iy_i\frac{q_i}{l^{C}_{ij}}
  + (1-\alpha_i-\beta_i)\frac{y_i}{r_j}
\Bigr],
\end{equation}
subject to
\begin{alignat}{2}
\text{C1:\quad} & \sum^{M}_{i=1}l^{C}_{ij} \leq l^{C.\max}_{j} &\qquad& \forall = 1,2,\dots,N.
\\
\text{C2:\quad} & e^{UE}_{i} + e^{off}_{i} \leq E^{UE.\max}_{i} &\qquad& \forall = 1,2,\dots,M.
\\
\text{C3:\quad} & 0 \leq \alpha_i \leq 1 &\qquad& \forall = 1,2,\dots,M.
\\
\text{C4:\quad} & 0 \leq \beta_i \leq 1-\alpha_i &\qquad& \forall = 1,2,\dots,M.
\end{alignat}
\end{subequations}

\end{document}

enter image description here

With the label to subequations you can use \tag for numbering the equation.

All matrix environments have disappeared; note that you don't need bmatrix in the first equation.

Quite likely, the superscript C, UE and off should be inside \mathrm. Also \forall should be followed by variables; personally, I'd write i,j=1,2,\dots,M avoiding \forall in the first case, i=1,2,\dots,M in the others.

1
  • 1
    @campa Yes, fixed.
    – egreg
    Feb 22 at 10:03

You must log in to answer this question.

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