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 poweredاكتب LaTeX باستخدام الذكاء الاصطناعي

أفضل محرر LaTeX بالذكاء الاصطناعي، بديل Overleaf

يساعد Octree الباحثين من أكثر من 15 جامعة على كتابة أوراق البحث بشكل أسرع باستخدام الذكاء الاصطناعي

  • أنشئ رسوم TikZ جميلة باستخدام الذكاء الاصطناعي
  • ارفع صورة وحولها إلى LaTeX بسلاسة
  • احصل على مساعدة فورية في كتابة وتنسيق أوراق البحث