Knowledge base dedicated to Linux and applied mathematics.
Home > Latex > FAQ > Latex - FAQ > Text above arrow in LaTeX
All the versions of this article: <English> <français>
In LaTeX, to place text above an arrow, you can use the command \xrightarrow included in the amsmath package.
In LaTeX, to place text above an arrow, you can use the command \xrightarrow included in the amsmath package.
The syntax of the command is as follows:
$$a \xrightarrow{f} b$$
$$a \xrightarrow{f} b$$
Here is an example of LaTeX code that uses \xrightarrow to place an arrow above a symbol:
f(x) \xrightarrow{\text{def}} x^2 + 1
$$f(x) \xrightarrow{\text{def}} x^2 + 1$$
Note: Examples are generated using the amsmath package, which is included in most modern LaTeX distributions.