LatexNotes

Absolute value and norm in LaTeX

The absolute value of a number is its distance from zero, written with vertical bars; in LaTeX \lvert x \rvert gives correctly spaced bars and \lVert x \rVert gives a norm.

LaTeX command

\lvert x \rvert

Not the symbol you meant? Draw it to find the command →

The recommended commands are \lvert for the left bar and \rvert for the right, as in \lvert x \rvert. They are true delimiters, so LaTeX gives them the right spacing and treats the enclosed expression correctly. A plain | x | also works but is an ordinary symbol, so its spacing around neighbouring operators can be slightly off.

A norm uses double bars: \lVert x \rVert. This is the standard notation for vector length or the size of a function in a function space. The single-bar and double-bar delimiter commands are supported by KaTeX and give consistent, professional-looking output.

When the content is tall, such as a fraction inside bars, pair the bars with \left and \right so they grow to fit: \left\lvert \frac{a}{b} \right\rvert, or the shorter \left| ... \right|. For heavy reuse, the mathtools package lets you declare a paired delimiter once and call it by name.

Other forms

\lVert x \rVerta norm
|x|quick bars (spacing is worse)

Examples

$\lvert -3 \rvert = 3$

a basic absolute value

$\lVert \mathbf{v} \rVert = \sqrt{v_1^2 + v_2^2}$

a vector norm with double bars

$\left| \frac{a}{b} \right|$

auto-sized bars around a fraction

$\lvert x - a \rvert < \delta$

an epsilon-delta style inequality

Tips and common mistakes

Working from handwritten notes?

LatexNotes turns a photo or PDF of handwritten mathematics into clean, compilable LaTeX - graphs and all. Free to try, no sign-up.

Convert your maths to LaTeX →

FAQ

How do I write absolute value in LaTeX?

Use \lvert x \rvert for correctly spaced bars, or the quick |x| if spacing is not critical. Both render vertical bars around the expression.

How do I write a norm?

Use the double-bar delimiters \lVert x \rVert. This gives the two vertical lines used for vector and function norms.

How do I make the bars stretch around a fraction?

Pair them with \left and \right: \left| \frac{a}{b} \right|, or \left\lvert \frac{a}{b} \right\rvert. The bars then grow to match the height of the content.

See also