[Univ of Cambridge] [Dept of Engineering]
next up previous
Next: Excitement and Hard Maths Up: Word Processing Using LaTeX Previous: The LaTeX Icon

An Example Document

Sooner or later you may want to produce more complicated documents using LaTeX. There are many other documents available - see the LaTeX page in the help system. Recommended books -

``The LaTeX Companion'' Goosens, Mittelbach, Samarin. Addison-Wesley 1994 or

``LaTeX: A Document Preparation System (2nd edition).'' Leslie Lamport. Addison-Wesley 1994.

which provide a comprehensive reference for almost everything which can be done with LaTeX. Note that older books won't cover the newer LaTeX2e that we have installed.

To introduce a few more of the more commonly used techniques we now present an example of the source file of a LaTeX document followed by what it really looks like when it has been processed by the latex program.

\documentclass[12pt]{article}
\usepackage{a4}
\begin{document}     
\section*{Excitement and Hard Maths}
Quotation marks are inserted into text using ` for open quotes, and '
for close quotes.  If double quotes are needed you just type two
single quotes --- ``This is a quotation,'' he said.  Notice that you
can produce different length dashes by typing one, two and three
hyphens.  Between hyphenated words use just one inter-word hyphen.
Two hyphens are often used for number ranges (23--45).  Three hyphens
are used a bit like semicolons --- you know the sort of thing.

\LaTeX\ always puts extra space after a full stop like this.
To prevent the extra gap occuring in the middle of a name you insert 
a tie like this (Mr.~Jones).

This is a bit of prose which is gently building up to the excitement
of an equation.  
\begin{eqnarray}
y&=&ax^{2}+bx+c \nonumber\\
E&=&mc^2 \nonumber\\
{\delta y \over \delta x} &=& {{a\over b}\over c}
\end{eqnarray}

\noindent
Don't worry too much if it looks
complicated, the main purpose was to give an \emph{idea\/} of the
quality of maths which \LaTeX\ can produce.  Let's look at a rather
simpler formula. Subscripts are written \( x_{2y} \) and superscripts
are written \( x^{2y} \).  These are both in-line formulae.

\section*{Conclusions}
This example illustrates a number of \LaTeX\ features. By comparing
the original and the processed text you should be able to see
\begin{enumerate}
\item How to open and close both single and double quotes.
\item How to produce dashes and what they look like.
\item How to typeset Ms.~Smith.
\item How to produce subscripts and superscripts.
\item How to emphasize a section of text \emph{like this}.
\item How to produce a numbered list of things.
\end{enumerate}
\end{document}

comes out like this:



Tim Love
Tue Feb 24 10:53:41 GMT 1998