Learn how to include the absolute value symbol in your LaTeX documents through several examples.
- Absolute Value Symbol
- Method 2: Using left vertical and right vertical commands
- Method 3: Using mid command
- Big absolute value latex
- Conclusion
Absolute Value Symbol
The general method to display an absolute value (or the modulus symbol) in LaTeX is by surrounding the number, variable, or expression with two vertical lines, |
.
|x + y| = 1
The keyboard shortcut for the this symbol isĀ Alt + 124. To use this shortcut, press Down the [Alt] key whilst typing 124.
Check the following example:
% Abs symbol in LaTeX This is an example of an absolute value symbol $|x+y|$.
Compiling of this piece of code yields:
Method 2: Using left vertical and right vertical commands
In this method, we can use the \lvert
and \rvert
command. These two commands require loading the amsmath
package. Check this example:
% Required package \usepackage{amsmath} %... Modulus symbol for inline equations, $\lvert x + y \rvert = 1$
which yields the following output:
Method 3: Using mid command
Another similar command is \mid
command. This will have larger spaces between the modulus symbol and other characters.
Modulus symbol for inline equations, $\mid x + y \mid = 1$
Big absolute value latex
The following table highlights different LaTeX commands that can be used to get big vertical line for absolute value symbol (big modulus symbol):
Description | LaTeX command | Output |
---|---|---|
Absolute value symbol | | \frac{e^2}{2}x | | \( | \frac{e^2}{2}x | \) |
Using right and left commands | \left| \frac{e^2}{2}x \right| | \( \left | \frac{e^2}{2}x \right | \) |
Using big command | \big | \frac{e^2}{2}x \big | | \( \big | \frac{e^2}{2}x \big | \) |
Using bigg command | \bigg | \frac{e^2}{2}x \bigg | | \( \bigg | \frac{e^2}{2}x \bigg | \) |
Using Bigg command | \Bigg | \frac{e^2}{2}x \Bigg | | \( \Bigg | \frac{e^2}{2}x \Bigg | \) |
This has been considered in a previous post: “How do you make big parentheses in LaTeX?”.
Conclusion
In this short post, we presented different commands to typeset absolute value symbols in LaTeX.