TeX Guide
Table of Contents
LaTeX is a typesetting system considered the standard in mathematics and computer science. Check out the LaTeX project homepage. Consult the list of TeX resources on the web compiled by the TeX Users Group.
1 Installing LaTeX
LaTeX is part of most TeX distributions. These tend to be quite large.
1.1 Windows
Install MiKTeX.
1.2 Unix & Linux
More often than not, LaTeX is installed already. Try which latex
to see whether it is. If it isn't found, look for the TeXLive distribution in your package manager. Note that LaTeX is installed on CSE linux machines.
1.3 macOS
Consider MacTeX. Preview.app nowadays watches its file so it works quite well as a previewer. Optional frontends insclude iTeXMac and/or TeXShop.
1.4 Online
If installing LaTeX proves too difficult, I have also seen students make use of the Overleaf online LaTeX editor, but I cannot vouch for its quality.
2 Editing LaTeX
Again, LaTeX sources (usually) are plain ASCII text files, so any old text editor should do.
Visual Studio Code has a very robust LaTeX package called LaTeX Workshop.
Emacs comes with quite ok (La)TeX support. There's also AUCTeX.
[g]vim comes with syntax colouring etc for .tex files.
There are also WYSIWYG editors for [La]TeX, eg LyX. To me they are some of the worst ideas ever. Your mileage may vary.
3 Math in LaTeX
This wikibook page provides a helpful primer to writing mathematics in LaTeX. If you need help writing any particular notation in LaTeX, ask on the forums and I'm happy to help. For inference rules, the mathpartir
package works well.
If you want to make things look like in Ben-Ari's book, many of his TeX macros can be scavenged from the slides available for download here. The slides from this course scavenges a few things from there.
If you use multi-letter variable names in math mode, please surround them with a mathit
command. Otherwise it will be rendered as the product of every letter in the variable name.
4 Diagrams in LaTeX
For drawing diagrams within LaTeX itself, I highly recommend the wonderful tikz
packages. Satyaki Sikdar provides an excellent guide to drawing automata diagrams with tikz.
To include external diagrams or images in LaTeX documents, consider using the graphicx
package. The following is a somewhat minimal example (assuming there's a file dummy.pdf around):
\documentclass{article} \usepackage{graphicx} \begin{document} \includegraphics{dummy.pdf} \end{document}
Much more can be done, e.g., one could scale the image or overlay LaTeX on top of the diagram. Consult the documentation for the graphicx
package for more details.
Please make sure that the images are either vector based or high enough resolution to be readable, without going over the size limit.