LaTeX Guide

Assignments for CMPU 240 need to be typed. You can use any software you prefer (e.g., Google Docs, LibreOffice, or Microsoft Word), but I strongly recommend using LaTeX. LaTeX is the standard tool used for preparing documents in most mathematical or scientific disciplines, including computer science, so it is likely to be useful outside this course as well.

A LaTeX template will be released to go with each assignment. You’re not required to use the template – or to use LaTeX at all – but if you use LaTeX, the template will show you, e.g., how the math and figures in the problem statements were created.

Getting started

LaTeX is a markup language, meaning that you write a kind of source code for the document that specifies how it should be displayed. In this way, it is more like writing HTML or Markdown than like writing in a word processor.

LaTeX source can be compiled to make a PDF using a command-line tool. I use Tectonic, which is a convenient wrapper around XeLaTeX. However, if you don’t already have a preferred way of using LaTeX, I recommend using Overleaf to edit LaTeX online. Similar to using Google Docs, Overleaf allows you to work in a web browser without installing anything and supports collaborating with a partner without overwriting each other’s work.

Documentation

The Overleaf documentation provides a good introduction to LaTeX, including how to typeset math.

If you need to draw a symbol and don’t know how, you can draw it in Detexify to see potential matches.

Drawing figures

There are many ways to draw figures, such as finite automata, in LaTeX. My preference is to use the TikZ package, and you can see examples of doing this in the template files. For more information on using TikZ to draw state diagrams, see David Chiang’s handout.

If you’d rather using a visual drawing tool – like OmniGraffle – you can do that and include the resulting images; see the Overleaf documentation on inserting images.