How can I get a symbol below a word?

3,320

I think you are looking for an operator \argmax which can be defined in the following way (needs amsmath)

\DeclareMathOperator*{\argmax}{arg\,max}

To have "theta below argmax in the middle" in inline math, you have to specify \limits when using it.

MWE:

\documentclass{article}

\usepackage{amsmath}

\DeclareMathOperator*{\argmax}{arg\,max}

\begin{document}

\noindent Inline math: $\theta_i = \argmax\limits_{\theta} Q(\theta, \theta_i)$

\bigskip\bigskip

\noindent Displayed math

\[\theta_i = \argmax_{\theta} Q(\theta, \theta_i)\]

\end{document} 

Output

enter image description here

Share:
3,320

Related videos on Youtube

MSKantulu
Author by

MSKantulu

A computer science student. Presently working on Machine learning. Also I am learning Python,R and Latex.

Updated on August 10, 2020

Comments

  • MSKantulu
    MSKantulu about 3 years

    I wanted to get theta below argmax in the middle

    I wanted to get theta below argmax in the middle . I used the following code:

    \usepackage{amsmath,amssymb,graphicx,enumerate,algorithm}
    \begin{document}
    $\theta_i$ = $argmax_{\theta} Q(\theta, \theta_i)$
    \end{document}
    
    • daleif
      daleif about 7 years
      (1) welcome, (2) the limit only goes under the argmax when it is used in display math context, you are using $...$ which is inline math mode, there the limit is not shown below argmax as it will disturb the line spacing.
    • daleif
      daleif about 7 years
      BTW: next time please provide a full example, you are missing the document class. Besides in your formula, the two middle $ are not needed, the = should also be math mode
    • Admin
      Admin about 7 years
      You can highlight code in your post using back-ticks. For code-blocks indent them by four spaces or use the {} on the gui.
  • MSKantulu
    MSKantulu about 7 years
    @egreg I could get the format of code for answers and questions by using the back-quote but same didn't work for writing a code snippet in the comment section. Could you please explain?
  • egreg
    egreg about 7 years
    @MSKantulu Comments obey slightly different rules; for instance, in order to print \\ you need double back quotes.
  • MSKantulu
    MSKantulu about 7 years
    @egreg can you give any helping link for these formatting stuffs in comments? The double back quotes didn't get me on the next line
  • egreg
    egreg about 7 years
    @MSKantulu Look at posts under meta.tex.stackexchange.com/search?q=code+comment