Department of Engineering

Next: Summary of Commands Up: Utilities Previous: Text Processing

## LATEX

The best way to get started with LaTeX is to look at a simple example. A short document is reproduced below, a file with a similar structure can be found in /export/Examples/LaTeX/demo0.tex

% EVERYTHING TO THE RIGHT OF A % IS A COMMENT
% THE FOLLOWING 10 CHARACTERS HAVE SPECIAL MEANINGS
%       &   \$   #   %   _   {   }   ^   ~   \

\documentclass{article}
\usepackage{a4}
\begin{document}

\section{Experimental Results} % This command makes a section title.

Text is just entered in a fairly straightforward way, using a
blank line to separate paragraphs.  Formulae are surrounded by
brackets \emph{e.g.} $$x-3y=7$$ which will produce an equation
in the midst  of the text.

The \emph{e.g.} told latex to set e.g.' in italic type.  You can
also get bold text using \textbf{this is bold}.

Subscripts are written $$x_{2y}$$ and superscripts are written
$$x^{2y}$$.  These are both in-line formulae again.

To get displayed equations you say something like
$y = ax^{2} + bx + c$
Notice that square brackets are used rather than round ones.

\subsection{Conclusions} % This command makes a subsection title.

Double quotes are typed like this: quoted text''.
Single quotes are typed like this: single-quoted text'.
Long dashes are typed as three dash characters---like this.

\end{document}     % The input file ends with this command.

Once you have created a LATEX source file (called myfile.tex, say) it must be processed by LATEX before it can be printed out. Use the command latex myfile.tex which will produce myfile.log, myfile.aux and myfile.dvi. If you are using various sorts of cross referencing then you may have to run LATEX more than once. If you want an automated bibliography you will also have to run bibtex (see the `LaTeX local guide' for details).

When this procedure is complete you will have a myfile.dvi to print out. This is a device independent representation of your document which can be displayed on an X-windows screen using the xdvi program or printed on a laser printer using an appropriate driving program. On the teaching system you can type dvilp myfile.

Next: Summary of Commands Up: Utilities Previous: Text Processing
 | computing help |