latex

How To Write and Use Plus or Minus Symbol in LaTeX

LaTeX is a scientific document processor. This tool changes the source code or rich text to a properly formatted research paper. However, learning about the simple source code is essential to turn them into scientific symbols.

Mathematical symbols like plus and minus look simple, but they require a specific source code to write in LaTeX. So, if you are also confused about using a plus or minus symbol in LaTeX, please read this tutorial. This tutorial will explain the source code to write and use plus or minus symbols in LaTeX.

How To Write and Use Plus or Minus Symbol in LaTeX

In LaTeX, you can easily write the plus or minus symbol. Let’s take a simple example through the following source code:

\documentclass{article}

\usepackage{amsmath}

\begin{document}

$x \pm 8$

\end{document}

Output:

As shown in the previous source code, we have used \pm code to change it into a plus or minus (±) symbol after compiling. In this example, we will write a quadratic formula in LaTeX. The following is the source code:

\documentclass{article}

\usepackage{amsmath}

\begin{document}

\[ x= \frac{-b\pm \sqrt{b^2 - 4ac}}{2a}\]

\end{document}

Output:

For the correct formation of the plus or minus symbol, you must use the amsmath usepackage in the source code.

If you want to use the minus or plus symbol, use the \mp source code instead of \pm.

\documentclass{article}

\usepackage{amsmath}

\begin{document}

$x \mp 8$

\end{document}

Output:

Conclusion

The plus or minus symbol is essential in mathematics to represent the specific condition between two numbers or variables. That’s why LaTeX contains a particular source code, i.e., \pm, to write the plus or minus symbol correctly. In this tutorial, we explained examples of writing and using the plus or minus symbol in LaTeX. For articles similar to this, check out Linux Hint for more.

About the author

Prateek Jangid

A passionate Linux user for personal and professional reasons, always exploring what is new in the world of Linux and sharing with my readers.