For nearly two decades, I’ve routinely needed to enter math equations into computer programs for display. I’ve used a lot of markup languages to describe these equations, but I’ve found nothing is as easy, beautiful, reliable, or comprehensive as LaTeX. And even though you might not know LaTeX yourself, I’m pretty sure that nothing approaches its ubiquity either. This article is a love poem to LaTeX, and a collection of resources to help you learn more about it. If you don’t know LaTeX, and you ever put math equations into documents on a computer, I encourage you to indulge your curiosity!

### What is LaTeX?

LaTeX (I pronounce it lay-tek) LaTeX is free software for computer typesetting. It is also a syntax—a plain-text markup language. It’s based on the TeX typesetting language. It can produce beautiful mathematical equations, but it’s also great at many other things, including typesetting books. For decades it has been the standard for publishing most scientific papers, books, and so forth.

Here’s a simple equation—the quadratic equation—typeset in LaTeX.

The code that’s used to typeset that is as follows:

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

It’s a mixture of literals and backslashed commands, such as the `frac`

command to create a fraction.

In this article I want to focus on some of the variety of math typesetting tools and resources related to LaTeX.

### Learning LaTeX

The LaTeX language is sophisticated but it’s not hard to learn. If you want to learn LaTeX, either for general typesetting or for math equation typesetting, my favorite resources are:

- The not so short guide to LaTeX, by Tobi Oetiker.
- A Guide To LaTeX by Kopka and Daly, which I own and like.

### Programs That Understand LaTeX

The LaTeX syntax for mathematical equations is supported by lots of other programs beyond LaTeX itself. For example, there’s MathJax and KaTeX, JavaScript libraries for rendering equations in websites. (This website uses KaTeX.) And there’s Google Docs, which lets you input equations in LaTeX both natively and through mechanisms like Google Docs add-ons and Chrome extensions. The list goes on, and on. Even Apple’s Keynote presentation program added LaTeX support in 2018!

### Programs That Can Create LaTeX

Sometimes the easiest way to create the right LaTeX code is to use a visual editor and export the resulting code. A few ways to do this are:

- Use Desmos and after entering your equation, reveal or copy it as LaTeX.
- Use the Grapher program that comes with a Mac. You can right-click and copy your equation as LaTeX.
- Use Mathpix, which is frankly mindblowing—you can handwrite your equation and scan it, or scan anything on the screen of your computer. I’ve used it to generate LaTeX code for extremely complicated equations and it’s worked great. It sometimes makes mistakes but not often. A huge time saver!

Mathpix in action (spot the mistake):

### Online LaTeX Editors

I usually use LaTeX by installing a distribution of the software, such as the TeX Live distribution. This installs commandline and GUI programs to write TeX and LaTeX documents. But I appreciate the modern era of web-based software, with no need to install and maintain it. A couple of the most popular options are ShareLaTeX and Overleaf. Both make it convenient and easy to collaborate on sophisticated LaTeX documents online.

### Just For Fun

Math equation typesetting is immensely complex, but I think it’s also very beautiful.

(Source)

Hanno Rein created a LaTeX package that will add a coffee stain to your documents, saving a lot of time compared to printing the document and then adding the stain with a coffee cup!