You just need to insert an additional &
instead of \enspace
in your aligned
environment. However, it seems like you're interested in an enumeration of a list of elements, coupled with an alignment around the relations. For that, set each equation as an \item
with some box measurement/manipulation to aid with the lefthand side alignment.
Both options are shown below:
\documentclass{article}
%\usepackage{showframe}
\usepackage{enumitem}
\usepackage{amsmath,eqparbox}
% https://tex.stackexchange.com/a/34412/5764
\makeatletter
\NewDocumentCommand{\eqmathbox}{o O{c} m}{%
\IfValueTF{#1}
{\def\eqmathbox@##1##2{\eqmakebox[#1][#2]{$##1##2$}}}
{\def\eqmathbox@##1##2{\eqmakebox{$##1##2$}}}
\mathpalette\eqmathbox@{#3}
}
\makeatother
\begin{document}
\[
\begin{aligned}
&\textnormal{(i)} & f'(x^*) &= \sum\limits_{i = 1}^m \lambda_i h'_i(x^*) + \sum\limits_{i = 1}^p \mu_i^* g'_i(x^*) \\
&\textnormal{(ii)} & h_i(x^*) &= 0, ~ i = 1,\dots, m, \\
&\textnormal{(iii)} & g_i(x^*) &\geq 0, ~ i = 1, \dots, p, \\
&\textnormal{(iv)} & \mu_i^* g_i(x^*) &= 0, ~ i = 1, \dots, p, \\
&\textnormal{(v)} & \mu_i^* &\geq 0, ~ i = 1, \dots, p.
\end{aligned}
\]
\begin{enumerate}[label={(\roman*)},align=left]
\item
$\displaystyle\eqmathbox[LHS][r]{f'(x^*)} = \sum\limits_{i = 1}^m \lambda_i h'_i(x^*) + \sum\limits_{i = 1}^p \mu_i^* g'_i(x^*)$
\item
$\eqmathbox[LHS][r]{h_i(x^*)} = 0, ~ i = 1,\dots, m$,
\item
$\eqmathbox[LHS][r]{g_i(x^*)} \geq 0, ~ i = 1, \dots, p$,
\item
$\eqmathbox[LHS][r]{\mu_i^* g_i(x^*)} = 0, ~ i = 1, \dots, p$,
\item
$\eqmathbox[LHS][r]{\mu_i^*} \geq 0, ~ i = 1, \dots, p$.
\end{enumerate}
\end{document}
\eqmathbox[<tag>][<align>]{<stuff>}
sets <stuff>
in the widest box possible across all similar <tag>
s, with additional <align>
ment options (default is c
entred, but you can also align to the l
eft or r
ight).
Since eqparbox
(used by \eqmathbox
internally) measures its contents using a mechanism similar to what \label
-\ref
does (via the .aux
), you'll have to compile at least twice with every change of the maximum width in some <tag>
(necessarily also on the first compilation).
showframe
was used to indicate the text block boundary (seen in the image as the black bars along the side).