latex

# Absolute Value Latex

The absolute value true number “| x |” is its non-negative numeral, regardless of its symbol. Two vertical bars (|) surround the definite integral sign. Then you’ll believe that since the vertical line is present on a computer standard keyboard, one can effortlessly create vertical bars across both ends of any equation rather than using instructions.

This article will cover the most effective techniques to show the absolute values in Latex. So, make a quick start by launching your Linux system’s terminal application with a “Ctrl+Alt+T” shortcut. Now, launch the texmaker tool of Latex to create documents. Tap on the “File” menu and select the option of New to generate a fresh Latex document. ## Example 01: Using  Sign

Let’s begin with the new fresh example to demonstrate how the latex document can show an absolute value. Firstly, you must know that the absolute value is always written between the “|” sign in an equation.

We will see how latex would react to an absolute value written in a document. So, we have used the basic syntax of latex to create a new document, i.e., utilizing the “\documentclass” command. Within the \begin and \end tag, we have added a text and an absolute value “|a+b|”. Now, pressed both the “arrow” icons one after another to run and open the latex code file in the DVI format.

\documentclass{article}
\begin{document}
Absolute value |a+b|
\end{document} As we haven’t used any commands to show an absolute value in a proper format, the output shows the “|” sign in a horizontal way, i.e., not an absolute value representation. To display it in a proper absolute value format, we have to use the “$” special character before and after the absolute value in the code as displayed in the attached photo. Let’s run this code. \documentclass{article} \usepackage{amsmath} \begin{document} Absolute value$|a+b|$\end{document} After the latex code file update, we have got the absolute value display in its proper format of equations, i.e. “|” sign is now displayed vertically, holding absolute value within. ## Example 02: Using the right/left vertical Commands Latex has introduced the \left and \right vertical commands to show an absolute value in a document with its proper syntax and appearance. Before that, you have to use the package “amsmath” in the code. After the \begin command, we have added \lvert and \rvert commands in the code using the absolute value between. The$ sign is a must here as shown.

\documentclass{article}
\usepackage{amsmath}
\begin{document}
Absolute value $\lvert a+b \rvert = 47$
\end{document} After running this code file and opening the Latex file in a DVI format, we can see that the absolute value has been displayed in its proper manner. To display the summation sign of math’s along with its other metrics as an absolute value, you can also utilize the \lvert and \rvert command. You have to add the summation command as “\sum” along with its other values shown in the code.

\documentclass{article}
\usepackage{amsmath}
\begin{document}
Absolute value $\lvert \sum_{i=1}^{n} x_{i} \rvert$
\end{document} The output will show the absolute value display for the summation equation. You can also display the absolute matrix with double bars. This can be achieved by using the “{vmatrix}” property of \begin command. You need to add space between both horizontal values by & and separate parallel values by the “\\” sign.

\documentclass{article}
\usepackage{amsmath}
\begin{document}
Absolute value $\left \lvert \begin{vmatrix} x & y \\ d & e \end{vmatrix} \right \rvert$
\end{document} The output shows the absolute value of the matrix equation. Within mathematics, we have also discussed the value when it has more than 1 choice. This can also be achieved by the use of the \begin{cases} command. The “{if}” expression is here to show the condition and “\\” is here to separate two conditions.

\documentclass{article}
\usepackage{amsmath}
\begin{document}
Absolute value $\left | Z \right |= \begin{cases} z & \text{ if } z > 2 \\ 0 & \text{ if } z = 0 \\ -z & \text{ if } z < 2 \end{cases}$
\end{document} The output shows a display of this absolute equation. Latex has another “\mid” command to perform the same functionality as the above commands do. It has to be written between the $sign, and the absolute value must be written between it. Let’s save and execute our newly updated code as presented below. \documentclass{article} \usepackage{amsmath} \begin{document} Absolute value$ \mid a+b \mid = 47 $\end{document} The output DVI file shows the same output as we got in the above examples. ## Example 04: Using \frac Command Many other absolute values in mathematics can be displayed in the Latex documents in their proper format using the latex commands. Let’s say you want to display some exponent power within the absolute value. For that, you need the \frac{}{} command in the code. The first curly brackets will store the raise to the power value. The other will store the denominator. \documentclass{article} \usepackage{amsmath} \begin{document} Absolute value$ |\frac{x^5}{9}| $\end{document} The output shows a very proper display of absolute value in the Latex document. If you want to add some other variable within absolute value, you can try it as well by following the below-shown update i.e. “y”. \documentclass{article} \usepackage{amsmath} \begin{document} Absolute value$ |\frac{x^5}{9}y| $\end{document} Here is the output for this \frac command. The same output can be achieved by adding the \left and \right command with the \frac command. \documentclass{article} \usepackage{amsmath} \begin{document} Absolute value$\left|\frac{x^5}{9}y\right| $\end{document} You will see a similar output. If you want to add the partial sign in your absolute value, you just have to use the \partial command within the absolute value. It will be between the \frac command and$ sign as displayed. Run this code to see the output.

\documentclass{article}
\usepackage{amsmath}
\begin{document}
Absolute value $|\frac{\partial x}{\partial y}|$
\end{document} The output file shows the partial sign with the variable in absolute value expression. ## Conclusion

Finally! We have accomplished the whole article with fresh examples showing the absolute value in latex documents. We have tried to cover almost every known command for this purpose like \lvert, \rvert, \left, \right, \frac, \$ sign, \partial, and many more. We have tried to give our best and hope that it will mark up to the expectations of our users. 