2

I am using the following environment to align optimization problem statements from Typesetting an optimisation problem

\documentclass{report}
\usepackage{amsmath}

\newcommand{\norm}[1]{\lVert#1\rVert_2}

\begin{document}

    \begin{subequations}
        \begin{alignat}{2}
        &\!\min_{x}        &\qquad& \norm{f(x)}^2\label{eq:optProb}\\
        &\text{subject to} &      & \alpha + (\beta*\gamma)\geq 0,\label{eq:constraint1}\\
        &                  &      & \beta \geq 0.\label{eq:constraint2}
        \end{alignat}
    \end{subequations}

\end{document}

How can I additionally align the "condition" at the \geq sign such that it looks like this:

enter image description here

5

I suggest using the optidef package instead, which is done for the layout of optimisation problems, and has several variants:

\documentclass{report}
\usepackage{amsmath, optidef}

\newcommand{\norm}[1]{\lVert#1\rVert_2}

\begin{document}

\begin{mini!}
  {x}{ \norm{f(x)}^2 \label{eq:optProb}}{}{}
\addConstraint{\alpha + (\beta*\gamma)}{ \geq 0,\label{eq:constraint1}}
\addConstraint{\beta}{\geq 0.\label{eq:constraint2}}
\end{mini!}

\end{document} 

enter image description here

2

I changed the alignat parameter and added some &

\documentclass{report}
\usepackage{amsmath}

\newcommand{\norm}[1]{\lVert#1\rVert_2}

\begin{document}

    \begin{subequations}
        \begin{alignat}{3}
        &\!\min_{x}        &\qquad& \norm{f(x)}^2           & \label{eq:optProb}\\
        &\text{subject to} &      & \alpha + (\beta*\gamma) & \geq 0,\label{eq:constraint1}\\
        &                  &      & \beta                   &\geq 0.\label{eq:constraint2}
        \end{alignat}
    \end{subequations}

    % edit
    \begin{subequations}
        \begin{alignat}{3}
        &\!\min_{x}        &\qquad&& \norm{f(x)}^2           & \label{eq:optProb}\\
        &\text{subject to} &      && \alpha + (\beta*\gamma) & \geq 0,\label{eq:constraint1}\\
        &                  &      && \beta                   &\geq 0.\label{eq:constraint2}
        \end{alignat}
    \end{subequations}

\end{document}

See, for instance, this post for details.

  • Thanks, this looks better. However the beta parameter is not at the \geq sign. – Manuel Schmidt Jan 15 at 17:03
  • Sorry. See the edit: I added & – NBur Jan 15 at 17:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.