# A letter under word

How can I write a letter under a word. Eg: Assume that I have to write $\textbf{P}$ centered under the word "maximize". When I tried with "_", the output is

$$maximize_{\textbf{P}}$$


You can use \DeclareMathOperator, from the amsmath package; this will give you the proper font and proper spacing. Since your operator should have subscripts placed in "limits" as with \lim, you need to use the starred form \DeclareMathOperator*. An example:

\documentclass{article}
\usepackage{amsmath}

\DeclareMathOperator*{\maxi}{maximize}

\begin{document}

in-line math: $\maxi_{\mathbf{P}}$

displayed expression:
$\maxi_{\mathbf{P}}$

\end{document}


The just-submitted stackengine package is set up to do this (Being just submitted, CTAN has not yet installed it). Nice thing is you can specify the undergap as an optional argument, as shown in this example. If you want the arguments set in math-mode format, enclose them in math delimiters.

\documentclass{article}
\usepackage{stackengine}
\begin{document}
$$\stackunder{maximize}{\textbf{P}}$$
$$\stackunder[5pt]{maximize}{\textbf{P}}$$
\end{document}


Use \mathop{}:

$$\mathop{maximize}_{\textbf{P}}$$

• This command works in Markdown as well, hence jupyter notebooks. – Jaswin Oct 10 at 10:41