# LaTeX and Overleaf

In this section of MATH 245, all written homework assignments must be completed in the matheamtical typesetting language LaTeX (pronounced “lay-tek”). LaTeX is the standard method of typesetting communication used by mathematicians all over the world.

### What is LaTeX?

LaTeX is a computer program that takes a text file with commands for producing mathematical symbols and formatting and compiles it into a typeset PDF document suitable for viewing or printing. It is not a “WYSIWYG” (what you see is what you get) program like Word, where what you type and how you format your type in the document is exactly what is printed in the final document. What you type in a LaTeX document resembles a very simple computer program written in plain text, and by compiling with LaTeX a very different-looking typeset document is created. For example, if you type “$\sqrt{\sin x^2}$” in a Word document and print it, you will see exactly what you typed: “$\sqrt{\sin x^2}$”. If you type the same thing in a LaTeX document and compile it, it will be typeset as $$\sqrt{\sin x^2}$$.

### What is Overleaf?

Overleaf is a browser-based collaborative tool for LaTeX. Multiple people can simultaneously type in an Overleaf document at the same time, so it’s easy to work with other people. It’s basically like Google Docs except that the document you work with is in LaTeX, and Overleaf displays both the LaTeX code and the pretty typeset output of the code side-by-side, like this:

Sign up for a free account at overleaf.com and try it out yourself; type in the left window and wait a second for the code to compile, then look in the right window for the output. Don’t worry if you cause a compliation error after typing something random; just “undo” if something goes wrong. In a minute we’ll talk about how you can get started learning LaTeX syntax.

### Start by playing with the LaTeX Sampler

I’ve put together a LaTeX Sampler with lots of symbols and formatting you can learn about by comparing the LaTeX code to the compiled output. Click on the link in the previous sentence for read-only access. It should look like this:

In your document, compare the code on the left line-by-line with the output on the right. Really look at each line in the LaTeX code and pay attention to what it makes in the output; LaTeX is best learned through studying examples.

When you’re ready to try experimenting and changing things, click on the Overleaf logo to get back to the main screen and start a new project. Choose the “blank” template and open it, then cut and paste the entire sampler into your new document, replacing everything that started in the “blank” document. Now you can play around changing symbols and code to see what happens. After each change you’ll have to wait a few seconds for the LaTeX code to compile, and then the results will show up in the right-hand viewing window. Look at the compiled view often so you can catch and fix compilation errors as soon as they happen. LaTeX is finicky, so a lot can go wrong!

### A template for Homework Writeups

All homework writeups in this class must be typed in LaTeX for full credit. Use the Template for Writeups as a starting point for those writeups. It looks like this:

Again, you only have read access to the link in the previous sentence. To experiment with your own copy, open a new Overleaf document and replace the code with a cut-and-paste of the writeup template. Compare the typeset output on the right line-by-line with the LaTeX code on the left for information about how to implement tables, aligned equations, and other formats in LaTeX, as well as expectations and best practices for proof-writing style.

When you’re ready to start collaborating on a writeup with your group, click “Share” in the Overleaf header of the document to share access with your group members. After that you’ll be able to work simultaneously in the same LaTeX document to complete your writeup together. Note that you can write comments to each other in the document by using the “%” character in the LaTeX, or also by adding all-caps or color-font text to the document that can be removed after comments are addressed.