Double Vertical Bar in LaTeX (\|)

∥\|
LaTeX command
\|
Package
No package needed: built into LaTeX
Mode
Math mode only
Copy the Unicode character
∥U+2225

Where it is used

Double vertical bar, the delimiter for norms and the symbol for parallel in some contexts.

\| prints two vertical lines and is mostly used in pairs for norms, \|x\|. As a plain symbol it has ordinary spacing, so when you mean the relation is parallel to, use \parallel, which adds relation spacing. For norms, \lVert and \rVert are recommended, because they tell LaTeX which side opens and closes, giving correct spacing next to operators and minus signs. It can be sized with \left\| ... \right\| or \big\|. In text mode \| does not give the bars; use \textbardbl or switch to math.

Minimal compilable example

Paste this into an empty .tex file and compile it with pdfLaTeX, XeLaTeX or LuaLaTeX.

∥x∥2=x12+x22+⋯+xn2\|x\|_2 = \sqrt{x_1^2 + x_2^2 + \cdots + x_n^2}
\documentclass{article}
\begin{document}
Double Vertical Bar: $\|$

\[ \|x\|_2 = \sqrt{x_1^2 + x_2^2 + \cdots + x_n^2} \]
\end{document}

Related symbols

All 括弧・区切り →

Frequently asked questions

How do I write Double Vertical Bar in LaTeX?
Type \| in math mode, for example $\|x\|_2 = \sqrt{x_1^2 + x_2^2 + \cdots + x_n^2}$. It works in plain LaTeX without loading any package.
Which package do I need for \|?
None. \| is part of standard LaTeX, so it compiles with nothing in the preamble but the document class.
Can I use \| in text mode, or only in math mode?
Only in math mode. Outside $...$ LaTeX stops with "Missing $ inserted", so write $\|$ in running text. If you only need the glyph in text, paste the Unicode character ∥ instead (with XeLaTeX or LuaLaTeX and a font that has it).
Math poweredAIでLaTeXを書く

最高のAI LaTeXエディタ、Overleaf代替

Octreeは15以上の大学の研究者がAIを使って論文をより速く書くのを支援

  • AIで美しいTikZダイアグラムを生成
  • 画像をアップロードしてシームレスにLaTeXに変換
  • 論文の執筆とフォーマットに即座にサポートを取得