Norm (‖x‖) in LaTeX
A norm measures the length or size of a vector and is written with double vertical bars, ‖x‖; in LaTeX the bars are \lVert x \rVert (amsmath), or \|x\| for a quick version with no package.
Main page: Absolute value and norm in LaTeX →
LaTeX command
\lVert x \rVertNot the symbol you meant? Draw it to find the command →
Typing up handwritten notes? Convert a whole page of handwriting to LaTeX →
\lVert and \rVert are the left and right double bars from amsmath. Marking which bar opens and which closes lets LaTeX space what sits next to them: in \lVert -x \rVert the minus is spaced as a sign, while in \|-x\| the plain bar is an ordinary symbol, so the minus after it is spaced as subtraction. Both forms print the same glyph; only the spacing differs.
For tall contents, such as a fraction or a sum inside the norm, put \left and \right in front: \left\lVert \frac{a}{b} \right\rVert stretches the bars to the height of the fraction. For a fixed size, \bigl\lVert with \bigr\rVert, or \Bigl and \Bigr, pick one of TeX's set sizes, which often looks better than \left and \right in running text.
A subscript names the kind of norm: \lVert x \rVert_2 for the Euclidean norm, \lVert x \rVert_\infty for the maximum norm and \lVert f \rVert_{L^2} for a function norm. Put the subscript straight after \rVert, where it sits low beside the closing bar.
A \norm command (mathtools or physics)
LaTeX has no \norm built in, which is why \norm{x} stops with "Undefined control sequence". The tidiest fix is mathtools: declare the command once in the preamble, then \norm{x} prints ‖x‖, \norm*{\frac{a}{b}} grows with its contents, and \norm[\big]{x} picks a fixed size.
The physics package also provides \norm, with automatic sizing, but it redefines other commands too (its \div is the divergence, not the division sign), so mathtools is the safer choice in a long document.
\usepackage{mathtools}\DeclarePairedDelimiter{\norm}{\lVert}{\rVert}$\norm{x}$Other forms
\|x\|quick double bars, no package\left\lVert \frac{a}{b} \right\rVertbars that grow with the contents\lVert x \rVert_2a subscript names the normExamples
$\lVert \mathbf{v} \rVert = \sqrt{v_1^2 + v_2^2 + v_3^2}$the length of a vector in three dimensions
$\lVert x \rVert_\infty = \max_i \lvert x_i \rvert$the maximum norm, with single bars for the absolute value inside
$\lVert x + y \rVert \leq \lVert x \rVert + \lVert y \rVert$the triangle inequality
$\left\lVert \frac{x}{\lVert x \rVert} \right\rVert = 1$bars that grow around a fraction: a unit vector
$\lVert f \rVert_{L^2} = \left( \int \lvert f \rvert^2 \, dx \right)^{1/2}$a function norm named by its subscript
Tips and common mistakes
- Prefer
\lVertand\rVertto \| whenever a sign follows the opening bar:\lVert-x\rVertspaces the minus as a sign, \|-x\| spaces it as subtraction. \lVertand\rVertcome from amsmath; \| and\Vertwork with no package at all.- Do not type two single bars, ||x||: the gap between them is wrong and the pair cannot stretch with
\leftand\right. - Always pair the forms:
\left\lVertwith\right\rVert,\bigl\lVertwith\bigr\rVert. - Keep single bars,
\lvertx\rvert, for the absolute value of a number and double bars for norms, so readers can tell them apart.
Working from handwritten notes?
LatexNotes turns a photo or PDF of handwritten mathematics into LaTeX, graphs and all. It is built with real pdflatex before you see it, and the .tex file is yours to edit or take to Overleaf. Free to try, no sign-up.
See how handwriting to LaTeX works, step by step, or go from GoodNotes to LaTeX if you write on an iPad (Notability works the same way).
Convert your maths to LaTeX →FAQ
How do I write the norm symbol in LaTeX?
Use \lVert x \rVert from amsmath, which prints ‖x‖ with correct spacing. With no package, \|x\| prints the same bars.
Why does \norm give Undefined control sequence?
LaTeX has no built-in \norm. Define one with mathtools, \DeclarePairedDelimiter{\norm}{\lVert}{\rVert}, or load the physics package, which provides it.
What is the difference between \| and \lVert?
They print the same double bar. \lVert and \rVert are marked as an opening and a closing delimiter, so signs next to them are spaced correctly; \| is an ordinary symbol.
How do I make the norm bars bigger?
Put \left and \right in front, as in \left\lVert ... \right\rVert, to fit the contents, or choose a fixed size with \bigl\lVert ... \bigr\rVert or \Bigl\lVert ... \Bigr\rVert.