*This article aims to show you a simple way to create an **absolute value symbol in LaTeX**.*

By definition, the absolute value or modulus is the non-negative value of x without regard to its sign. But if you need to insert it in your LaTeX documents, today you will learn how to do it.

Table of Contents

**Absolute Value Symbol**

The most common way to represent the absolute value symbol is using two vertical lines on each side of the expression. For example

There are many commands of ways to insert the absolute value, but in this article, we will focus on the most common ways to write the symbol.

**Absolute Value \mid **

The first option is using the command \mid, it generates a vertical line where you type it, therefore you will need two \mid commands for the absolute value, it requires math mode enabled. For example

\begin{document}

Absolute using $\backslash$mid $\mid x+y \mid$

\end{document}

The \mid command has bigger blank spaces on the argument of the absolute value, this is my go-to option to write inline equations.

**Absolute Value Lines**

The second option is using the key “|”, your keyboard has it but you can also write it by typing alt + 124. It goes to each side of the argument of the absolute value, and it requires the math mode. As you can see absolute value symbol is not an actual command but rather just a key.

For example,

\begin{document}

Absolute value using “$|$” $|x+z|$

\end{document}

**Absolute Value Vertical Commands**

You can also use two commands to create the vertical lines on each side, for the left side you use the command \lvert, and for the right side \rvert, both commands require importing the amsmath package. For example

\documentclass{article}

\usepackage{amsmath}

\begin{document}

Absolute value using $\backslash$lvert and $\backslash$rvert

$$\lvert y + 3 \rvert$$

\end{document}

\lvert stands for left vertical, and \rvert for right vertical. As you can see these commands don’t have a lot of blank space for the argument of the absolute value.

**Resizable Value Symbol**

To this point we have only used inline equation, but what about including integrals or summation, you can use all of the options above, for example

\documentclass{article}

\usepackage{amsmath}

\begin{document}

$$|\int x^2 dx|$$

$$\mid \sum_{i=0}^{\infty} \dfrac{x_{i}}{x^2 + 4} \mid$$

$$\lvert \dfrac{x^3+x^2+x+6}{x-9} \rvert$$

\end{document}

As you can see, the vertical bars on each side of the expressions do not have the same height as the argument. To solve this you have to use two commands \left and \right, just before inserting the vertical bars, let’s recreate the example above but using these two new commands,

\documentclass{article}

\usepackage{amsmath}

\begin{document}

$$\left | \int x^2 dx \right |$$

$$\left \lvert \dfrac{x^3+x^2+x+6}{x-9} \right \rvert$$

\end{document}

You may be probably noticing that the \mid command is missing, and that’s because the \left and \right commands don’t work with the \mid command.

Now you have it, all the knowledge you may need to correctly write the absolute value symbols in different ways in your LaTeX document, remember you can always look at the documentation of the packages (amsmath).

I hope this tutorial was helpful in guiding you in LaTeX, and as always keep writing in LaTeX.

**Further Reading**

**LaTex Tutorial** **on Symbols**

- How To Create A Cross Product Symbol In LaTeX
- How to create a hat symbol in LaTeX?
- How to create a prime symbol in LaTeX?
- How to create an approximate symbol in LaTeX?
- How to create an intersection symbol in LaTeX?
- How to create the empty set symbol in LaTeX?
- How to write a degree symbol in LaTeX?
- How to write a dot product in LaTeX?
- How to Write a Greater Than Symbol in LaTeX?
- How to write a norm symbol in LaTeX?
- How to write A Plus-Minus Symbol in LaTeX
- How to write a proportional to symbol in LaTeX?
- How to write a real number symbol in LaTeX?
- How to write a tilde symbol in LaTeX?
- How to write a union symbol in LaTeX?
- How to write a vector in LaTeX?
- How to write an infinity symbol in LaTeX?
- How to write bold text in LaTeX?
- How To Write Dots Symbols In LaTeX?
- How to write the arrow symbols in LaTeX
- How to write the Degree celsius symbol in LaTeX?
- How to write the equal or not equal symbol in LaTeX?
- How to write the Euro symbol in LaTeX?
- How to write the floor symbol in LaTeX?
- How to write the gradient operator symbol in LaTeX
- How To Write The Greater Than Or Equal To Symbol In LaTeX?
- How to write the integer number symbol in LaTeX?
- How to write the less than symbol in LaTeX?
- How to write the Natural numbers symbol in LaTeX?
- How to write the parallel symbol in LaTeX?
- How to write the percent symbol in LaTeX?
- How to write the square root symbol in LaTeX?
- How To Write The Symbol For A Subset In LaTeX?
- How to write the symbol for therefore in LaTeX?
- How to write with the mathbb in LaTeX?