In LaTeX, to place text above an arrow, you can use the command \xrightarrow included in the amsmath package.

Text above arrow in LaTeX

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.