A Basic Latex Document

0.1 Logging into the Computers

The computers in the IGDS are all running Windows, but unfortunately they don't have Latex installed. Log in using the username and password on the yellow sticker, and then use Putty (or another ssh client) to log onto unix0.york.ac.uk (which does have Latex installed).

0.2 Writing Latex

You can use any text editor to write Latex. Word processors are usually not suitable, because it can be difficult to persuade them to write plain text without cluttering it up with fount and formatting commands.

If you're happy using Unix then you can use emacs or vi to create your Latex document. Otherwise you'll need to create (and edit) your file on the Windows PC and copy it actoss. A good free text editor for Windows is Notepad2, simply click on the link to download a local copy to your computer. You can copy it to unix0 by using ftp to connect to ftp.york.ac.uk.

0.3 Exercise 1

Now we have enough information to create a very simple Latex page:

% First we choose the document class (can be book, report, article etc.)
\documentclass[11pt]{report}

% Now we start the main document stuff
\begin{document}

% I don't know what to write! Let's just say:
This is my first Latex document.

% Now we need to end the document
\end{document}

Create a blank document like this, and save it with the .tex extension. Copy it to unix0 if you're not creating it there. To turn it into a PDF you need to do two things.

  1. Use Latex to convert your document into a "device-independent file", or DVI
    latex mydocument.tex
    You should see the file mydocument.dvi appear, along with a few auxiliary files.
  2. Create a PDF from the DVI file:
    dvipdfm mydocument.dvi
    You could create a postscript file instead using
    dvips mydocument.dvi
You'll probably need to copy this PDF (or PS) back to your PC to view it.

In fact most Latex distributions now have a command called pdflatex, and if you use that it will generate a PDF file directly from your Latex source, without having to go via a DVI.


Previous page Next page