1
\documentclass{article} 

\begin{document}
$$\underset {{x}_1,{h}_1,{m}_2,{b}_2}{max} {u}_1(x)_1-{h}_1+{\beta}_1{W}_2({m}_2,{b}_2)$$

\end{document}

This is the problem I met, sublime text can display the equation but when I run this code, a warning "Undefined control sequence. [$$\underset]" showed.

3 Answers 3

5

Welcome! You should not use \underset here but the \max operator. Nor should you use $$ ... $$ but \[ ... \] instead. (I am also wondering why you wrap so many symbols in {...}.)

\documentclass{article} 
\begin{document}
\[\max_{x_1,h_1,m_2,b_2} u_1(x)_1-h_1+\beta_1W_2(m_2,b_2)\]
\end{document}

enter image description here

1

The \underset command requires amsmath.

\documentclass{article}
\usepackage{amsmath}    % <----- don't forget

\begin{document}

\[
\underset{x+y+z}{a+b+c+d+e+f+g}
\]

\end{document}

On the other hand, you don't need \underset for your case, as already suggested. The “max” operator is obtained with the command \max and

\[
\max_{1\le k\le n} x_k
\]

will yield the expected output.

I keep seeing code plagued with \underset{x\rightarrow 0}{lim}, where the simpler

\lim_{x\rightarrow 0}

would suffice, besides producing a better output.

0

enter image description here

\documentclass[12pt]{article}
\usepackage{mathtools}
\begin{document}

       $$\underset {{x}_1,{h}_1,{m}_2,{b}_2}{max} {u}_1(x)_1-{h}_1+{\beta}_1{W}_2({m}_2,{b}_2)$$
\end{document}
2
  • 4
    Please write \max, not max.
    – Mico
    May 6, 2020 at 4:46
  • Sorry, but this is bad advice.
    – egreg
    May 6, 2020 at 9:39

You must log in to answer this question.

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