LaTeX is a very powerful system for typesetting a wide variety of mathematical, scientific, and technical documents. It’s very helpful to anyone studying math or going into a technical field. The purpose of this page is to help you learn how to use it effectively.
If you’re just starting out, I recommend getting an account at Overleaf, which provides a free online editor and compiler, and takes a lot of setup work off your hands. It also has a bunch of sample documents, which tend to be the easiest way to get started. (There are a number of similar services; I recommend Overleaf primarily because that’s what I've used in the past).
At some point you may want more control and responsiveness and want to install the system on your computer. For a back-end you can install MikTeX or TeX Live. There are a number of front-ends which vary from platform to platform. If you’re the sort of person who has a “favorite text editor”, then your favorite text editor probably has LaTeX support.
In many ways the most important part of a TeX file is the “preamble”, which contains a lot of options and “use package” commands. If you are using someone else’s code and getting errors you don’t understand, making sure you have the same packages called as they do can often help a lot. To get started, just steal someone else’s preamble, since it’s not obvious exactly what you need to do.
Useful resources:
- Possibly the most useful resource is some sample documents to steal from. I have this short paper and its code (as a tex file and as a plain text file) its bibliography file available for anyone who wants to borrow from them. I’ve also posted a sample Beamer talk and the code (tex file and plain text), although not any of the graphics files.
- Google is an incredibly useful resource; there are many people using LaTeX and many of them also post on the internet. When I google a LaTeX question I generally find a ton of useful information, especially on Math Overflow and Stack Exchange.
- The best general resource on LaTeX I know of is the Wikibook.
- There is an online app called Detexify that allows you to draw a symbol with your mouse, and finds the relevant TeX code and the packages you need.
- The LaTeX Cheat Sheet has a list of commonly needed symbols and codes and commands; it can be quite useful as you’re getting started. There's also another cheat sheet aimed specifically at undergraduate math majors.
- The Comprehensive LaTeX Symbol List used to be essentially necessary, but Detexify has largely replaced the process of searching through a three hundred page book for a copy of the symbol you want.
- Google Scholar will generate citations for you in whatever format you want. If you want a BibTeX citation, you can search any article on there, click “Cite” and then click “BibTeX” at the bottom of the popup, then copy that into your bibliography file.
- Here is a display of all the Beamer styles that come by default.
Helpful Troubleshooting Tips
- LaTeX is case-sensitive.
- A lot of the most mysterious errors happen either when you have an environment that you don’t close properly, or when you close an environment that you never opened. Make sure your
\begin{environment}
and\end{environment}
commands are all correctly paired, as well as your{
and}
. - If you have something that is numbered and you would like it to stop, add an
*
. For instance,\section{Intro}
will have a number, but\section*{Intro}
will not. - The
\begin{align*} ... \end{align*}
environment is invaluable for making blocks of equations appear non-terrible and lined up.