A Basic LaTeX Document

0.1 Logging into the Computers

The computers are all running Windows, but unfortunately they don't have Latex installed. Log in using your username and password, 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 font 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 in front of you. If you create it on your M: drive, then it will be accessible in unix as well as Windows.

A good free text editor for Windows is Notepad2, simply click on the link and download a local copy to your computer.

0.3 Using Unix

If you haven't used Unix before there are a few commands you might find helpful. When you first log into a unix machine you will see a window in which you can type commands. To see what files you have, use the ls command - this will list all the files (and sub-directories) in your current directory.

To change to a different directory, use the cd command, followed by the name of the directory you wish to change to.

You can copy files using the cp command, or move them with the mv command.

A larger summary of unix commands can be found here, or you can look at a longer Linux Introduction for even more information.

0.4 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 short 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 I recommend you use the command pdflatex:
pdflatex mydocument.tex
There is an alternative method using ordinary LaTeX:

  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
    This method also allows you to create a postscript file instead using
    dvips mydocument.dvi


Previous page Next page