6. Text in math formulas | LaTeX manual

6.1. The \text command

To put normal text inside mathematics, it’s better to use \text command rather than commands like \mathrm. The \text command ensures that the text is set using the correct font size. The font will be the text font in use outside the current math material.

2% -------------------------------------------------------------------------------
4\text{Also, if } \Delta_{\text{max up}} = \Delta_{\text{min down}} \notag \\
5\text{(for all ups and downs) then} \notag \\
6\Delta_{\text{sum of ups}} = \Delta_{\text{sum of downs}}

Text inside mathematics

6.2. Operator names

The names of common math functions (e.g., sin and log) and operators (e.g., min and sup) are typically preferred to be distinguished from variable names that are set in italics. So, they are traditionally set as text in Roman type. There are predefined commands in standard LaTeX for the most common functions and operators. The amsmath package sufficiently extends the set of such commands. The following table lists both the “standard” commands and the commands provided by amsmath. The latter are highlighted in bold. Those set in italics may have a subscript/superscript in the limit position when used in displayed formulas.

 4% -------------------------------------------------------------------------------
 6\lim_{x \rightarrow 0} \frac{ \sin^2(x) }{ x^2 } = 1 \\
 7\varliminf_{n \rightarrow \infty}
 8\abs{a_{n+1}} / \abs{a_n} = 0 \\
 9\varinjlim (m_i^\lambda \cdot M)^* \le
10\varprojlim_{A/p \rightarrow \lambda(A)}A_p \le 0

Functions and operators

It often turns out that this list is not enough. The amsmath package defines a general method to define new “operator names”.


The \DeclareMathOperator command defines cmd to produce text in the appropriate font for “textual operators”. If the new operator is expected to have subscripts/superscripts in the limit position (when used in displays), then the starred form \DeclareMathOperator* should be used. In addition to using the proper font, \DeclareMathOperator sets up good spacing on either side of the operator name. The text argument is processed using a “pseudo-text mode” in which

The following example shows how to provide the command \meas for the new function name “meas” (measure) and the operator functions \esssup and \supminus (both may have subscripts/superscripts in the limit position).

 2\DeclareMathOperator \meas {meas}
 3\DeclareMathOperator*\esssup {ess \, sup}
 4\DeclareMathOperator*\supminus{sup - minus*}
 5\newcommand\abs [1]{\lvert#1\rvert}
 7% -------------------------------------------------------------------------------
 9  \norm{f}_\infty = \esssup_{x \in R^n} \abs{f(x)} \\
10  \meas_1 \{ u \in R_+^1 \colon f^*(u)>\alpha \} \\
11  \quad \esssup_{x \in R^i} \; \meas_i
12  \{ u \in R^n \colon \abs{f(u)} \geq \alpha \} \\
13  \quad (\forall \alpha \in \supminus_{f^*} R_{*+})

New function names and operator names

Such declarations must appear in the preamble, and it’s impossible to change them temporarily. Strictly speaking, \DeclareMathOperator can be used only for command names that haven’t previously been used. To replace an existing command, you must first remove the previous definition before redeclaring it.

 2%% Low-level TeX needed here to cancel the old the definition of \csc:
 3\let \csc \relax
 6% -------------------------------------------------------------------------------
 8\varlimsup_{n\to\infty} \calQ (u_n, u_n - u^{\#})
 9  \ge \csc (\calQ' (u^{\#}))

Redefining a function name

Subscribe to Aspose Product Updates

Get monthly newsletters & offers directly delivered to your mailbox.