A Sample LaTeX File

A Sample LaTeX File

\headers{\footnotesize\bf Memorial University of Newfoundland} 
{\footnotesize\bf Department of Mathematics and Statistics}
\footers{\footnotesize Applied Mathematics 2130}
{\footnotesize Sample \LaTeX}
{\footnotesize Page \thepage}


{\Large\bf Just a sample document}
You can typeset plain text as with any other typesetting software. The
fun part is when you wish to display mathematical symbols. You can have
mathematics embedded in the text like $y = \sin (x)$ or you can display
mathematics on a line all its own like

y = x^2 + \sqrt{x^4 + 1}.

If you wish to have a displayed line of mathematics along with a number
you do

f(x) = \int_1^x \frac{1}{z} dz.

The label command is not required but if at a later point in your text
you wish to make a reference to that equation  (\ref{eq:first}) you can
do it with the command


The backslash is the symbol used to start any \LaTeX\/ command and the
curly brackets are used for command arguments. 

You can generate itemized lists:
\item first item,
\item second item,
\item etc ...
and you can also generate numbered lists:
\item first item,
\item second item,
\item etc ...

There are lots and lots of special symbols:
\alpha,\ \beta,\ \eta,\ \iota,\ \zeta,\ \omega,\ \Omega,\ \sigma,\ \Sigma,
\ \int,\ \infty,\ \ldots

There are commands for creating arrays like:
\left[ \begin{array}{cc}
        a & b \\
	c & d \\
and there are some for multi-line equations like:
\cos(2\theta) &=& \cos^2(\theta) - \sin^2(\theta) \\
	      &=& 2\cos^2(\theta) - 1 \\
	      &=& 1 - 2\sin^2(\theta)
In that last command (look in the .tex file), the ``*'' suppresses the printing 
of line numbers.  Remove that asterisk and we get
\cos(2\theta) &=& \cos^2(\theta) - \sin^2(\theta) \\
	      &=& 2\cos^2(\theta) - 1 \\
	      &=& 1 - 2\sin^2(\theta)

There are other commands that will permit you to typeset tables of data
(look up the {\bf tabular} environment), figures with captions (look up
the {\bf figure} environment), bibliographies. In short, everything you
can think of that publishers and authors make use of.

\section*{Next in line}
There are sectioning commands that create the appropriate amount of
white space and changes to bold face fonts for the title of the section.
Once again, an asterisk (look in the .tex file) suppresses numbering of
sections. Remove it and the section numbers will be automatically

\section*{The bare bones}
All papers have a beginning and an end. So it is for computer programs and so it is
for {\tt .tex} documents. 

All {\tt .tex} documents must begin with the statements
All {\tt .tex} documents must end with a 
so \LaTeX\/ knows when it is quitting time. At the start, between the {\tt
documentclass} and {\tt begin\{document\}} statements, one can include a whole
bunch of typesetting commands which adjust the layout of the page and load
packages that are not part of the standard implementation, for example, packages
to handle graphics. This area is called the {\tt preamble}. Look at the original
{\tt .tex} file for this document to see what was put in the preamble and try to
guess what it did.