How to place a character below a function in Latex?
Solution 1
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:
Solution 2
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}
t6d
I'm a computer scientist who specializes in developing large scale internet applications. I'm currently working as a software developer for Shopify. I'm is passionate about software design, test driven development and all sorts of modern web-technology. My scientific interests include machine learning and natural language processing.
Updated on July 09, 2022Comments
-
t6d almost 2 years
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. -
t6d about 13 yearsThank you so much. Works like a charm.
-
Alexandre C. about 13 yearsno. Don't do this if your intent is to declare a new operator, like lim, sup or inf. Use @hanoosh's answer instead. Using
\text
won't give the results you want if the surrounding text has a fancy font (like inside a theorem, or on a Beamer slide). -
Alexandre C. about 13 yearsNote the star in
\DeclareMathOperator*
. This triggers the behaviour you want.