Vertical Bar in LaTeX (\left| x \right|)

∣x∣\left| x \right|
LaTeX command
\left| x \right|
Package
No package needed: built into LaTeX
Mode
Math mode only

Where it is used

Vertical bars that resize to their content, for absolute values and determinants.

Use \left| ... \right| when an absolute value contains a fraction or sum, as in \left| \frac{a}{b} \right|, and for determinants of tall matrices (though vmatrix is simpler). Plain | is ambiguous to LaTeX: it cannot tell an opening bar from a closing one, which can spoil spacing around a leading minus sign. For consistent results define a macro with \lvert and \rvert, or use \left\lvert ... \right\rvert. For set-builder separators and conditional probabilities, use \mid or \middle| instead.

Minimal compilable example

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

∣∫abf(x) dx∣≤∫ab∣f(x)∣ dx\left| \int_a^b f(x)\,dx \right| \le \int_a^b |f(x)|\,dx
\documentclass{article}
\begin{document}
Vertical Bar: $\left| x \right|$

\[ \left| \int_a^b f(x)\,dx \right| \le \int_a^b |f(x)|\,dx \]
\end{document}

Related symbols

All الأقواس والمحددات →

Frequently asked questions

How do I write Vertical Bar in LaTeX?
Type \left| x \right| in math mode, for example $\left| \int_a^b f(x)\,dx \right| \le \int_a^b |f(x)|\,dx$. It works in plain LaTeX without loading any package.
Which package do I need for \left| x \right|?
None. \left| x \right| is part of standard LaTeX, so it compiles with nothing in the preamble but the document class.
Can I use \left| x \right| in text mode, or only in math mode?
Only in math mode. Outside $...$ LaTeX stops with "Missing $ inserted", so write $\left| x \right|$ in running text.
Math poweredاكتب LaTeX باستخدام الذكاء الاصطناعي

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

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

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