I'm trying to create a nicely looking optimization problem in LaTeX using amsmath. Here is a MWE:
\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{subequations}
\begin{alignat}{2}
\text{maximize} \quad & \rlap{some looooooooooooooong objective function of $x,u$ } \\
\text{with} \quad & \text{constraint 1} \quad & k=0,\ldots N{-}1 \\
& \text{constraint 2} & k=0,\ldots N{-}1
\end{alignat}
\end{subequations}
\end{document}
I need the \rlap
because the 'k=0...' needs to be vertically aligned and I don't want to introduce alignment characters in my objective function.
As you can see, the equation number 1a overlaps the formula in the first line. Is there a clean way to prevent this?
multlined
environment.