skip to main content

A Brief Introduction to TeX and LaTeX

TeX is a mathematical document formatting language invented by the computer scientist Donald Knuth. TeX is available for free for various platforms (Unix, Macintosh, DOS), or you can pay money to get versions that have bells and whistles.

How to produce a document.

To produce a TeX or LaTeX document, follow these steps. All steps require commands to be typed in a window. Except for previewing, the steps can be done remotely on a non-Sun machine or using a modem.

  1. Using a text editor, create a file ending with the suffix .tex . For example, if your paper is about St. Ignatius, you might call it ignatz.tex. Save your document.

  2. "Cook" the TeX or LaTeX file: type
    tex ignatz
    or
    latex ignatz
    Note that the suffix .tex is dropped.

    You now have a "cooked" file ignatz.dvi . You will also have ignatz.log , containing all the informative and error messages the program produced. You may also get ignatz.aux and ignatz.toc if you are using LaTeX and doing fancy things.

  3. Preview the file to make sure it's right. Type
    xdvi ignatz
    A new window will come up with your formatted text in it. Use the slider on the left of the window to move up and down, and use the buttons to change pages.

  4. If you need to make corrections, repeat the edit-tex-preview cycle.

  5. To print, you must first convert the .dvi file to Postscript format:
    dvips ignatz
    This will produce a file ignatz.ps . To print, use your favorite print command, such as gspr -d epson ignatz.ps Note that you DO need to include the .ps suffix at this step.

Example TeX and LaTeX files.