[ 124A home ] [ lectures ] [ homework ] [ exams ]

Math 124A
LaTeX info

Below are some rudimentary notes on how to get your TeX system setup and running.

Please let me know if you find any typos, errors, or have any suggestions.



TeX and its flavors (AMS-TeX, LaTeX, etc) is a typesetting (markup) language used to produce high quality documents. The original TeX was created by Donald Knuth for typesetting complex mathematical formulas. Leslie Lamport wrote the LaTeX extension format, which is the lingua franca of modern TeX markup (I use TeX and LaTeX interchangeably in this note).

The way LaTeX typesetting works -- one creates a text file using the syntax of the markup language (much like HTML) and saves it with an extension .tex. Then a TeX compiler reads this file, and outputs a DVI/PDF file.

Needed software

Below I list some information on setting up your complete LaTeX system, and include some links to detailed references on different aspects of working with LaTeX.

By now most of you know what LaTeX is. To be able to use LaTeX for document preparation you need the following:

1. TeX implementation - used to compile the source file into a high quality printable document.

2. Text editor - used to create the source text file. Some text editors allow syntax highlighting - a coloring of LaTeX commands to distinguish them from the rest of the text, while others are full-fledged IDEs.

3. DVI viewer - the TeX typesetting system outputs documents in a .dvi, a DVI viewer is used to view such documents in the typesetting process.

4. PostScript converter - after typesetting one may want to convert the file to a postscript format for printing. (Modern Linux distributions come with PostScript converters/viewers, and one doesn't need them under Mac OS X due to having PDF as native format).

Fortunately some of these are integrated into single products, that do several things. All the products that I list below are free (as in lunch), and most of them are also open source, i.e. free (as in speech), unless mentioned otherwise.

MS Windows

By far the most popular TeX implementation for Windows is MiKTeX. The current stable version of MiKTeX is 2.8, which you can download here. There are 2 options for installing MiKTeX: the basic system, and the complete system, which has a myriad of packages for making documents with different designs and purposes. For most purposes of this class, the basic system is more than enough. The basic system has the ability of downloading missing packages over the net, should you need them in the future, and the main advantage is its relatively small download size (91Mb) compared to the complete system (over 600Mb). MiKTeX contains a YAP, which is a DVI viewer with a built in forward/inverse search that allows seeing the output corresponding to the line of the source text, and directly going to the line in the source file by clicking on a typeset formula in the output.

There are quite a few editors specifically designed for LaTeX typesetting. Some Windows editors worth mentioning based on the popularity and hype are: LyX (open-source, WYSIWYM), WinEdt (proprietary, commercial), LaTeX Editor (proprietary, freeware), TeXnicCenter (open-source). The choice of a text editor is largely a matter of taste. I haven't used any of these extensively, since I do not routinely use Windows, and the text editors that I use under other operating systems are not available under Windows (with the exception of Emacs+AucTeX, which is a bit cumbersome to setup under Windows and has a steeeeep learning curve). However, I installed TeXnicCenter to try out LaTeX typesetting under Windows, and it looks quite well made, and may be a good first choice for a TeX beginner.

The PostScript software for Windows is Ghostscript, with the GSview GUI. The stable latest versions can be downloades from Ghostscript site, and GSview page. You may want to download and install these before installing your favorite LaTeX editor, since the editor may automatically detect these as viewer/converter (TeXnicCenter does this, and otherwise asks for a postscript viewer during initial setup).

An alternative way to setup a TeX system on your Windows computer is to download and install proTeXt - a TeX distribution which is based on MiKTeX and contains TeXnicCenter and ghostscript. It has a download size of 750Mb and seems to come with a simple installation guide. I haven't tried installing it myself, since getting a much smaller basic_MiKTeX+TeXnicCenter+Ghostscript system working is simple by itself.

Useful guides to consider (may be a bit outdated) Eric Schechter's, mactex-wiki's TeX on Windows.

Mac OS X

The TeX implementation to get for Mac OS X is MacTeX, based on TeX Live. The download size for the complete system is 1.2Gb, which includes a ton of packages. However a BasicTeX system is also available with a size of 54Mb.

One of the most popular TeX editors for Mac OS X is TeXShop. This is the front end/editor that I use when working under Mac OS X for its simplicity and ease of use. Other editors to consider are: LyX (has a Mac version too) and iTeXMac.

MacTeX wiki contains links to a number of guides about TeX on Mac.

Linux and friends

TeX Live is the distribution to get for 'nix systems. The best way to have a working TeX system on your machine is to use the official repositories of your specific distribution to install TeX Live. However you can always download and install it directly from its website.

There are a number of TeX editors for Linux, a few of the most popular are: LyX (has a Linux version too), Emacs+AucTeX, Kile. Again, you should be able to obtain all of these from the official repositories of your distro. I used Emacs for a while, but switched to Kile eventually and am quite happy with it.

Depending on your distro, you may have ghostscript and DVI viewers as parts of the distribution. However you should be able to obtain them from the repositories if they are not already installed. As for a DVI viewer - Evince for GNOME and Okular for KDE are both versatile document viewers for all your needs.

LaTeX syntax

LaTeX comands start with the backslash '\'. For example the command for square root of x-squared plus y-squared is \sqrt{x^2+y^2}. In order to create LaTeX source files, one needs to know the commands for mathematical symbols one intends to use. This PDF document has huge list of the commands for math symbols. In a .tex the math formulas are written in a math mode, which is separated from plain text by dollar signs $.

A .tex file must start with documentsyle declaration. A basic LaTeX file will be


The length of the vector $V(x, y)$ is defined as $|V|=\sqrt{x^2+y^2}$.

You can use this Online LaTeX equation editor to try out TeX commands for math expressions.

The LaTeX wikibook will teach you more LaTeX syntax, as will some of these references, and other guides, notes, books are just a google search away.

[ 124A home ] [ lectures ] [ homework ] [ exams ]