5

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}
1
  • 1
    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, 2012 at 14:37

1 Answer 1

7

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}

enter image description here

2
  • 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, 2012 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, 2012 at 23:34

Not the answer you're looking for? Browse other questions tagged .