\rvert right vertical bar (|) in LaTeX
| Command | \rvert |
|---|---|
| Mode | math |
| Package | amsmath |
| Unicode | | U+007C |
| Kind | Brackets and delimiters |
\rvert typesets the symbol “right vertical bar” (|). It is a delimiter.
Try it
Open this formula in the editor The preview is drawn in your browser by KaTeX, which knows the common math commands. The editor compiles the formula with pdfTeX.
Example
\documentclass{article}
\usepackage{amsmath}
\begin{document}
\( \lvert x \rvert \)
\end{document}Compiled with pdfLaTeX from TeX Live 2023.
How to use it
\rvert works only in math mode. In running text, put it between $...$ or \(...\). Outside math mode LaTeX stops with Missing $ inserted. The command comes from the amsmath package. Add \usepackage{amsmath} to the preamble. Without it LaTeX reports Undefined control sequence.
About brackets and delimiters
Delimiters enclose an expression. Put \left before the opening one and \right before the closing one and both grow to the height of the content. \big, \Big, \bigg and \Bigg set a fixed size instead.