# \underbrace error [closed]

I'm trying to write an equation, but I keep getting an "Undined control sequence error on the line my equation is one, and I can't seem to figure out what the error is. Can any of you guys seen an errors in the equation?

\documentclass[a4paper,12pt]{article}
\begin{document}
$\theta^* = \bf{argmin}\underbrace{{1\over2}(g-F(\theta))^T(g-F(\theta))}_\text{f(\theta)}$
\end{document}

-

## closed as too localized by Andrew Swann, lockstep, Claudio Fiandrino, Thorsten, Martin SchröderDec 27 '12 at 16:48

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center. If this question can be reworded to fit the rules in the help center, please edit the question.

You probably have \text marked as undefined; you need \usepackage{amsmath}, for it. By the way, \bf{argmin} is wrong: use \mathbf{argmin} or, better yet, \operatorname{\mathbf{argmin}}. However, \text is wrong in that context: just _{f(\theta)} should be used. –  egreg Dec 13 '12 at 14:37

First you need the amsmath package for the text command. And then you should use \mathbf{} for the boldface math and \textbf{} for text. \bf,\it etc. is obsolete. Does it matter if I use \textit or \it, \bfseries or \bf, etc

Then \text{} is used for non-math content but \theta needs math mode.

So overall the following works.

\documentclass[a4paper,12pt]{article}
\usepackage{amsmath}
\begin{document}
$\theta^* = \mathbf{argmin}\underbrace{{1\over2}(g-F(\theta))^T(g-F(\theta))}_{\text{f}(\theta)}$
\end{document}


-
I'm still not convinced that the "f" should be upright. Also \operatorname{\mathbf{argmin}} is more correct and \over should be changed into \frac or perhaps \dfrac. –  egreg Dec 27 '12 at 12:55
@egreg Indeed I didn't pay too much attention to the content but rather trying to replicate the problem. So I just tried to make it work. –  percusse Dec 27 '12 at 23:34