# LaTeX

As mentioned in lecture, use of LaTeX for homework submissions is encouraged. This post will cover the basics on installing and using it and will link useful resources for learning it.

## What is LaTeX? Why should I use it?

LaTeX (pronounced LAH-tekh or LAY-tekh, not like an x) is a markup language that produces good looking documents and is particularly well-suited for mathematical and scientific material since it incorporates various symbols and formulas. It can also create fancier things we'll encounter this semester, such as automata and graphs. Knowing LaTeX is a useful skill to have, and will help you produce high-quality homework submissions without the hassle of scanning and uploading huge PDF files.

## Step 1.5: Installing the 2800 macros

To help you get started, we typically distribute LaTeX files for the homeworks on Piazza (in the "resources" section). In addition to the homework files, you also need to have the provided .cls and .sty files in the same directory.

## Step 2: Writing LaTeX

You can use a text editor of your choice to create LaTeX documents. Popular choices like Emacs, Vim, and Sublime have plugins available to support LaTeX. You could also use a LaTeX-specific editor:

## Step (wait-shouldn't-this-be-before-I-start-writing) 3: Learning LaTeX

LaTeX isn't that hard, so feel free to jump in before "learning" it. Like the stereotypical montage in an underdog movie, you will learn what you need in the coming months. That said, below are some well-written tutorials/guides:

See 'Additional Resources' below for more

## Step 4: Compiling LaTeX

You need to compile the file you create as a PDF before you submit it on Gradescope. Navigate to your .tex file with your OS command line and enter `pdflatex filename.tex`. The LaTeX distribution should create a pdf file in that directory. Alternatively, the editors mentioned above allow you to generate the pdf directly from their interface.

## How do I make _____ in LaTeX?

Following the link for most symbols in this wiki will link to a page with the corresponding LaTeX code (let us know on Piazza if we missed one). You can see Special:WhatLinksHere/LaTeX for a list of all the pages that mention LaTeX, which will include all of the symbols.

Many of the diagrams were also generated with LaTeX; if you click on them, they will take you to the LaTeX code.

Try these:

## Um...no thanks

It's fine if you'd rather use Word or scan handwritten work. Modern version of MS Word have decent in-built support for mathematical symbols and equations. However, if you're at all likely to go to grad school or be involved in research, now is a great time to learn something you will unquestionably need in the future. LaTeX is just plain old typing for the most part.

If you wish to ease in to LaTeX, LyX is a document processor that utilizes LaTeX formatting without having you write it directly. It's as easy as it gets, but you'll be faster at writing LaTeX once you have practice, so use LyX for the proverbial dipping of your toe in LaTeX.