Mathematical expressions is one of the main reasons that LaTeX is popular in the sciences. Those who've used—or tried to use—Microsoft Word for math-heavy documents will really appreciate what LaTeX can do! LaTeX makes creating simple mathematical expressions easy and simple. Even large, complex expressions are not very difficult to create, and they all look great!
There are two kinds of mathematical expressions in LaTeX:
Some very good information about inserting math expressions in LaTeX can be found in the following online documents:
If you have only a few mathematical statements or formulas in a document, LaTeX already has built-in features that will probably provide everything you need. Don't worry about math packages, unless things don't display properly.
On the other hand, if you are writing a scientific article or document with complex equations or other mathematical statements, use either the amsmath or the mathtools package. Of the two, mathtools reportedly fixes a few minor "quirks" of the amsmath package, but this author has used the amsmath package extensively with zero trouble.
The amsmath package is produced by the American Mathematical Society. It is part of the larger bundle, which is a collection of packages.
You can enable the more advanced math capability in LaTeX with one of the following commands in the preamble of your document. As always, the comments (the % sign and everything after) are optional but recommended.
— OR —
To create an inline math expression, we will begin it with \( and end it with \). This tells the LaTeX software that the rules for math apply.
Here's the text needed for a simple, inline expression:
Display mode shows the mathematical expression separately from the content text. The image is centered and treated like its own paragraph. To create a display math expression, we will begin it with \[ and end it with \]. Here's the text for a simple display expression:
This equation looks like this in a document (cropped screenshot from Overleaf). Display mode is useful for complex expressions that are too large to be placed inline, with the text. It can also help to draw attention to an important mathematical expression.