[Tex/LaTex] How to place text as subscript under mathematical operator in equation

math-modemath-operators

I would like to put some text in math mode below a mathematical operator (or a symbol), similar to \substack in \sum, as the red text below the \max operator in the following image

example subscript

How to do this?

Best Answer

You should place the expression in the subscript, as shown below. Most LaTeX books explain this. E.g.

\documentclass{article}

\begin{document}
\begin{itemize}
    \item \textbf{Display mode}:
        \[\max_{1 \leq i \leq N}\]
    \item \textbf{Inline mode}: version without \verb!\limits! would look like \(\max_{1 \leq i \leq N}\), version with \verb!\limits! would look like\(\max\limits_{1 \leq i \leq N}\) inside a text.
\end{itemize}
\end{document}

output of code

Note how \limits command force the subscript under operator in inline mode (if you think you need \limits, think again — maybe the defaults look better after all! cf. this answer here on TeX.se).

If you find that the subscripted expression is too long and introduces excessive whitespace, you could use \smashoperator macro from the mathtools package, as in this post.

Related Question