Is it possible to place a character or a formula below an other part of a larger formula in Latex?
foo f(x) = ...
x
In case that this example is not clear. I'd like to make one of my custom functions - just defined as \text{foo}
in a math environment - look like one of the built-in functions like sum, min or max which accept parameters that are placed above or below the function symbol.
Simply using \text{foo}_x
does not work.
The important things being: \underset which takes two arguments, the first is put under the second. \mathrm to make median appear upright and differentiate it from a multiplication of 6 variables named m, e, d, i, a, and n. \{ and \} need backslashes because { and } are part of the LaTeX base language.
To write text as a subscript, use an underscore followed by the text in curly brackets. The symbol "&" on its own is used as part of a code in LaTeX. To enter and use this symbol as a character, simply use the \& command. Commands written in the math environment appear in red.
In both the OP's use case and in my answer, \max is used in display math mode -- in which case it's not necessary to use \limits . If, in contrast, \max is used inline math mode, then \limits is indeed needed if the objective is to place the argument below "max".
$$ ? LaTeX defines inline- and display-maths commands, apparently duplicating the TeX primitive maths sequences which surround maths commands with single (or pairs of) dollar signs. In fact, LaTeX's inline maths grouping, \( ... \) , has (almost) exactly the same effect as the TeX primitive version $ ...
The function you're looking for is \underset
provided by the amsmath
package. Here's an example:
\documentclass{article}
\usepackage{amsmath}
\begin{document}
$\underset{below}{above}$
\end{document}
Output:
You can declare the foo as a math operator. Then use it in any equation environment. See below
\DeclareMathOperator*{\foo}{foo} %in preamble
\begin{align}
\foo_x f(x) = ...
\end{align}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With