%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% The following is a brief introduction to Latex.
%
% '%' denotes a comment.  All text following the '%' up to the end-of-line
% is ignored.
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\documentclass[11pt]{article}  % Font size and document type (article)

% List of packages (essentially extensions) to Latex
\usepackage{setspace}          % Single/half/double spacing
\usepackage{pstricks}          % Postscript graphics

% Page layout
\setlength{\topmargin}{-.15in}
\setlength{\textwidth}{6.5in}
\setlength{\textheight}{9.25in}
\setlength{\oddsidemargin}{0in}
\setlength{\parindent}{0in}
\setlength{\parskip}{6pt plus 1pt}

% 'Plain' indicate page numbers at bottom center
\pagestyle{plain}

%
% Start of the document -- all text, figures, etc must follow this 
% (to \end{document}.  Text prior to this causes Latex to fail.
%

\begin{document}

% Default spacing is single spacing

\section{Section Heading}

Each section is denoted by its `section heading'.
Numbering starts at section `1' unless otherwise indicated.

Bibliographic information (i.e., references) can be included using Bibtex
and the citation command: \cite{kn:cn1}.
Multiple citations can also be included as follows \cite{kn:cn6,kn:cn3}, in
this case, two citations are listed.

\newpage  % forces a new page.

\doublespacing

\section{Another Section Heading}

A report can have multiple sections; they can also have subsections and 
subsubsections, as illustrated below.

\subsection{A Subsection}

This is a subsection.
Note that it is numbered.

\subsection{Another Subsection}

This is another subsection, followed by a {\bf subsubsection}.

\subsubsection{A Sub-sub-section}

This is a {\em sub-sub-section}.
Note its numbering.

Note that the default font is Times Roman.
You can get {\bf bold Times Roman} by using the `bold font' command.
Similarly, you can get {\em emphatic Times Roman} using the `emphasis'
command.

\section{Quote marks}

If you want double quotes, you must ``do the following'' or ``do this".
Doing "this" gives strange results.

If you want single quotes, you must `do this'.  Doing 'this' doesn't 
give the right results.

\section{Figures}

Figures can be included in your report.
They can also be referenced by the report using the {\bf reference}
command (see Figure~\ref{FIG_CN}).

\begin{figure}[ht]
\singlespace
\psxunit=0.25in
\psyunit=0.25in
\begin{center}
\pspicture(0,0)(20,10)

\psline[linestyle=solid](0,9)(16,9)
\psline[linestyle=solid](3,5)(20,5)
\psline[linestyle=solid](1,1)(18,1)

\psline[linestyle=dotted](5,1)(6,5)(4,9)
\psline[linestyle=dotted](13,1)(16,5)(14,9)

\psset{fillstyle=solid,fillcolor=white}

\pscircle(1,1){0.5}
\pscircle(9,1){0.5}
\pscircle(18,1){0.5}

\pscircle(11,5){0.5}
\pscircle(20,5){0.5}

\pscircle(1,9){0.5}
\pscircle(8,9){0.5}
\pscircle(11,9){0.5}

\psset{fillstyle=solid,fillcolor=gray}

\pscircle(5,1){0.5}
\pscircle(6,5){0.5}
\pscircle(4,9){0.5}

\pscircle(13,1){0.5}
\pscircle(16,5){0.5}
\pscircle(14,9){0.5}

\endpspicture
\end{center}
\caption{Example of the structure of a Cartesian Network}
\label{FIG_CN}
\end{figure}

Note that Latex `floats' figures and tables, meaning that they will 
appear after the place they were created.
The placement depends upon the vertical size of the figure and the
space remaining on a page.

The above figure (which may follow this text for the reasons described
above) is an example of pstricks, one of the many useful extensions to
Latex; this one for drawing pictures.

\section{Lists}

\subsection{Enumerated Lists}

Lists can be numbered using the {\bf enumerate} list command:

\begin{enumerate}
\item
First item in the list
\item
Second item in the list
\item
And so forth
\end{enumerate}

\subsection{Itemized Lists}

Lists can be itemized using the {\bf itemize} list command:

\begin{itemize}
\item
First item in the list
\item
Second item in the list
\item
And so forth
\end{itemize}

\section{Tables}

Tables can be created using:

\begin{itemize}
\item
The `table' environment, which allows you to create a caption with the
word {\bf Table} and a number in front of it.

\item
The `tabular' environment, which, after a bit of a fight, allows you to
create a table.
\end{itemize}

An example is shown in Table~\ref{TAB_AR}.

\begin{table}[ht]
\singlespace
\label{TAB_AR}
\caption{Arterial Router Actions (VA bit = 0)}
\begin{tabular}{|l|l|p{3in}|}
\hline
Arterial Bit & Incoming Port & Action\\
\hline
Set & Collector (East or West) & Forward on opposite collector port (West or East).\\
\hline
Set & Arterial (North or South) & Forward on both collector ports (East and West).
Forward on opposite arterial port (South or North).\\
\hline
Clear & Collector (East or West) & Set Arterial bit.
Forward on opposite collector port (West or East).
Forward on two arterials (one North and one South).\\
\hline
Clear & Arterial (North or South)& Error.  Discard packet.\\
\hline
\end{tabular}
\end{table}

\section{Verbatim Text}

Text can added `verbatim' (that is, without processing) as
follows:

\begin{verbatim}
This text will appear without being processed by Latex.
 
It can be used for displaying, for example, computer code.
\end{verbatim}

Verbatim text can be included in a sentence in two ways.
The first is to use {\tt the `tt' command}.
The second is to use the \verb!`verb' command!.

The \verb!\verb! command is useful if you want to include a
`\verb!\!' in your text, since `\verb!\!' denotes the start of
a Latex command.
Note that the character following the word `verb' is used to 
denote the beginning and end of the verbatim text, so one
could write \verb#text including '!'#.

\section{Concluding Remarks}

This report template includes the basic template for the a technical 
report and also includes some basic Latex commands and environments.

\section*{Acknowledgements}

Your report should always include acknowledgements.

%
% The following generates the bibliography (remember the citation 
% command?)
%

\singlespace

\bibliography{../cartnet}  % Name of the .bib file containing the bibliographic info
\bibliographystyle{plain}  % Format of the bibliography

\end{document}  % end of the document

Text following '\end{document}' is ignored.  This is a good place
to leave things that you don't want to delete or aren't sure where
to place.