You are on page 1of 3

LaTeX ( , , , or ) is a document markup language and document preparation system for the TeX typesetting program.

Within the typesetting system, its name is styled as TX. The term LaTeX refers only to the language in which documents are written, not to the editor used to write those documents. In order to create a document in LaTeX, a .tex file must be created using some form of text editor. While most text editors can be used to create a LaTeX document, a number of editors have been created specifically for working with 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. Type in your document as a file of TeX or LaTeX commands using your favourite text editor.

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.

If you've never used TeX or LaTeX before, or if you're unsure what commands to use to get the result you want, there are books on LaTeX and TeX which you can borrow in my office (D1.09). If you're new to the Unix operating system and don't have a favourite text editor, I recommend emacs. The University Computing Service offer free training courses on LaTeX and Unix. The course timetable is available from the CS website, and you can also book a place online.

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. 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. 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. You may wish to remove myfile.dvi to save disk space. Do not remove myfile.tex! This document was written by the Statistical Laboratory Computer Officer, Eva Myers (eva@statslab.cam.ac.uk). It is available online at http://www.statslab.cam.ac.uk/~eva/texbeginner.html . [Back to my official home page]

You might also like