ITmet : A LaTeX Tutorial : UoR, Dept Of Meteorology

Internal Pages

A LaTeX Tutorial

Before being able to run LaTeX you will need to add some environment variables. This is done automatically by the "setup" utility;

   demo% setup teTeX

You will need to run setup the first time you want to run LaTeX in a window.

A Short Article

The first example LaTeX document consists of a short article with an imported figure, an equation and a table. You'll need to download the following two files, saving them into the same directory:

Then you need to latex the file

   demo% latex article1.tex

or

   demo% latex article1

This needs to be done twice to that latex can sort out the cross references. LaTeX produces a dvi (device independent) file which describes the layout of the page produced. To look at this, type:

   demo% xdvi article1.dvi

or

   demo% xdvi article1

In order to print the document you need to convert it to postscript. Type:

   demo% dvips article1.dvi

or

   demo% dvips article1

This produces postscript file, article1.ps. Then to print this to say, sheen, type:

   demo% lp -d sheen article1.ps

A Longer Report

The second example is a report containing sub figures, landscape pages, a bibliography and with the input split into different files. You'll need to download the following four files, saving them into the same directory:

In order to latex this report type

   demo% latex report
   demo% bibtex report
   demo% latex report
   demo% latex report

bibTeX is the program that compiles the reference list after LaTeX is run for the first time. LaTeX must then be run twice more to complete the reference list and insert the references in the text. If you then want to look at the results with xdvi the landscape page won't be displayed properly. In order to view the results before printing, create the postscript file:

   demo% dvips report

and look at the postscript file with ghostview

   demo% ghostview report.ps

Note on postscript files included in LaTeX

These must have a bounding box. To insert the correct bounding box in a number of postscript files, type

   demo% makebb <postscriptFileNames>

e.g.

   demo% makebb *.ps

in the directory containing your postscript files. This is preferable to using ps2epsi, as it doesn't create a bitmap preview.