% This is a sample LaTeX input file.
%
% A '%' character causes LaTeX to ignore all remaining text on the line,
% and is used for comments like this one.

\documentclass[11pt]{report}    % Specifies the document style.


\begin{document}           % Beginning of text.
                           % Anything before this is called `preamble'.

\chapter{A Sample \LaTeX\ File}  % Automatically numbers chapter and sets up
                                 % chapter heading.

This is a sample \LaTeX\ input file.  Comparing it with the output
it generates can show you how to produce a simple document of your
own.

\section{Ordinary Text}  % Produces section heading.  Lower-level
                         % sections are begun with similar
                         % \subsection and \subsubsection commands.

The ends  of words and sentences are marked
  by   spaces. It  doesn't matter how many
spaces    you type; one is as good as 100.  The end of   a line
counts as a space.

One   or more   blank lines denote the  end of  a paragraph.

Since any number of consecutive spaces are treated like a single
one, the formatting of the input file makes no difference to
      \LaTeX,       % The \LaTeX command generates the LaTeX logo.
but it makes a difference to you. Making your input file as easy
to read as possible will be a great help as you write your
document and when you change it.  This sample file shows how you
can add comments to your own input file.

Because printing is different from typewriting, there are a number
of things that you have to do differently when preparing an input
file than if you were just typing the document directly. Quotation
marks like
       ``this''
have to be handled specially.

Dashes come in three sizes: an
       intra-word
dash, a medium dash for number ranges like
       1--2,
and a punctuation
       dash---like
this.

A sentence-ending space should be larger than the space between
words within a sentence.  You sometimes have to type special
commands in conjunction with punctuation characters to get this
right, as in the following sentence.
       Gnats, gnus, etc.\    % `\ ' makes an inter-word space.
       all begin with G\@.   % \@ marks end-of-sentence punctuation.
You should check the spaces after periods when reading your output
to make sure you haven't forgotten any special cases. Generating
an ellipsis
       \ldots\    % `\ ' needed because LaTeX ignores spaces after
                  % command names like \ldots made from \ + letters.
                  %
                  % Note how a `%' character causes LaTeX to ignore the
                  % end of the input line, so these blank lines do not
                  % start a new paragraph.
with the right spacing around the periods requires a special
command.

\LaTeX\ interprets some common characters as commands, so you must type
special commands to generate them.  These characters include the
following:
       \$ \& \% \# \{ and \}.

In printing, text is emphasized by using
       \emph{italics}.

\begin{em}
   A long segment of text can also be emphasized in this way.  Text within
   such a segment given additional emphasis
          with \emph{Roman}
   type.  Italic type loses its ability to emphasize and become simply
   distracting when used excessively.
\end{em}

It is sometimes necessary to prevent \LaTeX\ from breaking a line
where it might otherwise do so.  This may be at a space, as
between the ``Mr.'' and ``Jones'' in
       ``Mr.~Jones'',        % ~ produces an unbreakable interword space.
or within a word---especially when the word is a symbol such as
       \hbox{\emph{itemnum}}
that makes little sense when hyphenated across
       lines.

Footnotes\footnote{This is an example of a footnote.} pose no
problem.

\section{Lists}

A frequently-displayed structure is a list. The following is an
example of an \emph{itemized} list.
\begin{itemize}
   \item  This is the first item of an itemized list.  Each item
          in the list is marked with a ``tick''.  The document
          style determines what kind of tick mark is used.

   \item  This is the second item of the list.  It contains another
          list nested inside it.  The inner list is an \emph{enumerated}
          list.
          \begin{enumerate}
              \item This is the first item of an enumerated list that
                    is nested within the itemized list.

              \item This is the second item of the inner list.  \LaTeX\
                    allows you to nest lists deeper than you really should.
          \end{enumerate}
          This is the rest of the second item of the outer list.  It
          is no more interesting than any other part of the item.
   \item  This is the third item of the list.
\end{itemize}

Other list structures allow automatically numbered items and
user-defined labels (instead of bullets or numbers).


\section{Mathematics}

\LaTeX\ is good at typesetting mathematical formulas like
       $ x-3y = 7 $             % `$' signs delimit maths mode.
                                % Equivalently, \( and \) could be used
                                % as below.
or
      $ a_{1} > x^{2n} / y^{2n} > x' $.
Remember that a letter like $x$ is a formula when it denotes a
mathematical symbol, and should be treated as one.

Mathematical formulas may also be displayed.  A displayed formula
is one-line long; multiline formulas require special formatting
instructions.
   $$  x' + y^{2} = z_{i}^{2}$$      % `$$' delimit displayed maths.
                                     % Equivalently, \[ and \] could be used.
Don't start a paragraph with a displayed equation, nor make one a
paragraph by itself.

Numbered equations are also useful:
\begin{equation}
         \bar{y} = \frac{1}{n} \sum_{i=1}^{n} y_i
                \label{eq:mean}  % the \label command stores the equation
                                 % number for use in cross-referencing with
                                 % the \ref command.  See below.
\end{equation}
Clearly, equation (\ref{eq:mean}) gives the sample mean.  The
sample standard deviation can be calculated similarly:
\begin{equation}
        s_y = \sqrt{ \frac{1}{n-1} \sum_{i=1}^n (y_i-\bar{y})^2 }.
\end{equation}
                        % Since I don't intend using this equation elsewhere,
                        % I didn't bother with the \label command.

\end{document}             % End of document.

