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 Brackets at Delimiters →

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 poweredSumulat ng LaTeX gamit ang AI

Pinakamahusay na AI LaTeX Editor, Alternatibo sa Overleaf

Tinutulungan ng Octree ang mga researcher mula sa 15+ na unibersidad na sumulat ng research papers nang mas mabilis gamit ang AI

  • Gumawa ng magagandang TikZ diagrams gamit ang AI
  • Mag-upload ng larawan at i-convert ito sa LaTeX nang walang problema
  • Makakuha ng instant na tulong sa pagsulat at pag-format ng research papers