How To Use TeX Or LaTeX

Here is a step-by-step guide for complete novices. I shall assume that you are using X Windows on a Linux system, and I shall refer to the file you are editing as myfile.tex for convenience.
  1. Type in your document as a file of TeX or LaTeX commands using your favourite text editor.
  2. Convert your file to a ``DVI file'' using the command

    tex myfile.tex

    for a TeX file, or

    latex myfile.tex

    for a LaTeX file. You may well get an error message at this point. If so, type ``h'' to get some help on what the error message means, and ``x'' to exit the tex or latex program. Edit your document to correct the mistake, and then try converting it again, until tex or latex runs without errors.

  3. Preview what your document will look like with the command

    xdvi myfile.dvi &

    This will pop up a window with your formatted document in it. The ampersand on the end of the command means that it runs in the background, so you can type other commands without quitting xdvi. It is a good idea to keep the xdvi window iconised (minimised) while making corrections to your document, so that it doesn't try to display myfile.dvi while it is changing.

  4. You will probably see some corrections you need to make at this stage, so go back, edit myfile.tex again, run the appropriate command of tex myfile.tex or latex myfile.tex, and look at the xdvi window to see the result. Keep doing this until you're satisfied with how your document looks.
  5. Now print your document:

    dvips -Pps10 myfile.dvi

    ps10 is the printer in the photocopier room; you could replace it by the name of another printer in the command above.

  6. You may wish to remove myfile.dvi to save disk space. Do not remove myfile.tex!