Knowledge base dedicated to Linux and applied mathematics.

Home > Latex > FAQ > Latex - FAQ > **Latex how to write text in math mode**

All the versions of this article: <English> <français>

It is sometimes useful to add text in Latex formulas or equations. However, it is clear that the text in question is displayed in italics. How to put text in math and what is the way of embedding text into math mode: \textrm , \text

To write text in math mode use **\textrm**:

`$u_2 = \textrm{Second element of the sequence } u_n$`

$$u_2 = \textrm{Second element of the sequence } u_n$$

Do not forget the space before closing !!!

Without \textrm, it is not beautiful:

`$u_2 = Second element of the sequence u_n$`

$$u_2 = Second element of the sequence u_n$$

Do not forget in preamble to add amsmath package:

`\usepackage{amsmath}`

To write text in math mode use with amsmath package **\text**:

`$u_2 = \text{Second element of the sequence } u_n$`

$$u_2 = \text{Second element of the sequence } u_n$$

- How to write number sets N Z D Q R C with Latex: \mathbb, amsfonts and \mathbf
- How to write angle in latex langle, rangle, wedge, angle, measuredangle, sphericalangle
- Latex numbering equations: leqno et fleqn, left,right
- How to write a vector in Latex ? \vec,\overrightarrow
- Latex how to insert a blank or empty page with or without numbering \thispagestyle,\newpage,\usepackage{afterpage}
- Latex arrows
- Latex natural numbers
- Latex real numbers
- Latex binomial coefficient
- Latex overset and underset
- LateX Derivatives, Limits, Sums, Products and Integrals
- Latex absolute value
- Latex piecewise function
- Latex how to hide page number
- How to get dots in Latex \ldots,\cdots,\vdots and \ddots
- How to write algorithm and pseudocode in Latex ?\usepackage{algorithm},\usepackage{algorithmic}
- How to display formulas inside a box or frame in Latex ? \boxed
- Latex how to write underscore
- How to write table in Latex ? begin{tabular}...end{tabular}
- Latex norm for vector and sum
- Latex infinity symbol
- Latex how to write percent
- Latex how to write a fraction
- Latex how to write bar
- Latex how to write text in math mode
- Latex rational numbers
- Latex quaternion numbers
- Latex complex numbers
- Latex indicator function
- Latex plus or minus symbol
- Latex symbol for all x
- Latex symbol exists
- Latex symbol not exists
- How to write matrices in Latex ? matrix, pmatrix, bmatrix, vmatrix, Vmatrix
- Latex horizontal space: qquad,hspace, thinspace,enspace
- Horizontal and vertical curly Latex braces: \left\{,\right\},\underbrace{} and \overbrace{}