3

I am looking for a way to align the label of an equation environment to the base line of the formula text. The default behavior of

\begin{equation}
\begin{array}{llr} 
\hat x &= \underset{x} {\text{arg\,min}} & f(x)+ \sum_i \lambda_i g_i(x)
\end{array} \tag{SomeLabel}
\end{equation}

seems to produce

equation

Here, the label is actually vertically centered to the whole equation. I think it would be nicer if it was aligned with the base line. Anyone know how to fix this?

  • Unfortunately "you're doing it wrong." There's no need for an array here. – Werner Dec 23 '19 at 17:36
  • Also see Command for argmin or argmax? – Werner Dec 23 '19 at 17:36
  • If you must use array, move the label down one line, just before the \end{equation}. – barbara beeton Dec 23 '19 at 20:58
5

Why array?

\documentclass{article}
\usepackage{amsmath}

\DeclareMathOperator*{\argmin}{arg\,min}

\begin{document}

\begin{equation}
\hat x = \argmin_{x} f(x)+ \sum_i \lambda_i g_i(x)
\tag{SomeLabel}
\end{equation}

\end{document}

enter image description here

| improve this answer | |
  • You are absolutely right. I used 'array' because sometimes there are additional constraints to the optimization problem, so multiple lines. But, here it is not needed. Thanks. – Sirg Dec 30 '19 at 14:50

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.