In the context of optimization problems, I'm using
\usepackage{amsmath}
\DeclareMathOperator*{\minimize}{\text{minimize}}
\DeclareMathOperator*{\subjto}{\text{subject to}}
to declare some operators to be used as \minimize_{x, \beta}, etc.
These work:

However, to get the correct spacing, I have to use
\minimize_{x, \beta} \quad& x^T x - 2\beta \\
\subjto \quad& \beta > 0 \\
\subjto \quad& \sum_{i=1}^{n} x_i^2 < 1
I don't want to have to use manual \quad spacing, for obvious reasons: convenience, elegance, flexibility (what if I want \ or \qquad later?), etc.
I tried
- using
\DeclareMathOperator*{\minimize}{\text{minimize}\quad}, but this causes the subscript spacing ofx, \betato be wrong—it's shifted to the right because the box is wider. - using
\DeclareMathOperator*{\temp@minimize}{\text{minimize}}with\newcommand{\minimize}[0]{\temp@minimize\quad}(with appropriate catcodes), but this didn't work because the operator doesn't take a command, it expects a subscript. - using a similar version with
[1]argument, failing for the same reason. - using a similar version with
\def, failing for the same reason.
Ideas? What's the most elegant way to do this?


\text{...}wrappers in the second argument of\DeclareMathOperator*needed (or possibly even counterproductive)? If the wrapper must be kept, it's probably better to change it to\textup{...}; this avoids settingminimizeandsubject toin italics if the material happens to occur in a chunk -- e.g., the body of a theorem -- that's set in italics. – Mico Jul 20 '14 at 05:59