3

I am using subequations and equation tags so I can number the objective function with (1) and all others constraints with (1a) (1b) and so on. However, the problem is that when I use these tags I don't get an aligning just like the solution on this page: here

Here is a minimal example:

\documentclass[conference]{IEEEtran}
\usepackage{amsmath}

\begin{document}

\begin{subequations}\label{MCRequation:main}
\begin{equation}
\text{min} \quad  F \left( x \right)  = \sum _{d \in D_{}}^{} \sum _{p \in P_{d} }^{} \xi _{dp} x_{dp} \tag{\ref{MCRequation:main}} 
\end{equation}
\begin{align}
\text{s.t.} \quad
\sum _{p \in P_{d} }^{}x_{dp}= h_{d},  \quad &d \in D \label{MCRequation:d}\\
\sum _{d \in D~ }^{} \sum _{p \in P_{d} }^{} \delta _{dpl} x_{dp} \leq  c_{l}, \quad l \in L \label{MCRequation:c}
\end{align}
\end{subequations}

\end{document}
2
  • Welcome! See tex.stackexchange.com/a/225520.
    – user194703
    Commented Sep 10, 2019 at 4:42
  • Unrelated: Note that \text{min} is probably not what you want here as it will be italic if the text outside math is italic, probably better to just use \min.
    – daleif
    Commented Sep 10, 2019 at 10:36

2 Answers 2

3

Like this?

\documentclass[conference]{IEEEtran}
\usepackage{amsmath}

\begin{document}

\begin{subequations}\label{MCRequation:main}
\begin{align}
& \text{min}  && F(x) = \sum_{d \in D_{}}^{} \sum_{p \in P_d}^{} \xi _{dp} x_{dp}     &   & \tag{\ref{MCRequation:main}} \\
& \text{s.t.} && \sum_{p \in P_d}^{}x_{dp} = h_d,                                     & d & \in D \label{MCRequation:d}  \\
&             && \sum_{d \in D~}^{} \sum_{p \in P_d}^{} \delta_{dpl} x_{dp} \leq c_l, & l & \in L \label{MCRequation:c}
\end{align}
\end{subequations}

\end{document}

enter image description here

2
3

You can use the mini! environment, from the dedicated package optidef, which defines several possible layouts. By default, the objective function part is the first subequation, but you can easily have the parent equation number using \tag{some number}:

\documentclass[conference]{IEEEtran}
\usepackage{amsmath}
\usepackage[short]{optidef}

\begin{document}

\begin{mini!}[2]
 {}{F(x) = \sum_{d \in D_{}}^{} \sum_{p \in P_d}^{} \xi _{dp} x_{dp}\tag{1} \label{MCRequation:d}}{\label{MCRequation:d}}{}
 %
\addConstraint{ \sum_{p \in P_d}^{}x_{dp} = h_d, }{\enspace d \in D \label{MCRequation:d}}
\addConstraint{ \sum_{d \in D~} \sum_{p \in P_d} \delta_{dpl} x_{dp} \leq c_l,}{\enspace l \in L \label{MCRequation:c}}
 \end{mini!}

\end{document}

enter image description here

1
  • Thank you! I appreciate it. Commented Sep 10, 2019 at 12:53

You must log in to answer this question.

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