% latexho.tex, a sample LaTeX file. 
% Run LaTeX on this file twice for 
% proper section numbers. 
% A '%' causes LaTeX to ignore remaining text on 
% the line. That is, "%" % is used to comment out text. 

\documentclass[12pt]{article} % Specifies the document style. 

% These are formatting commands. Do not change them because
% we want all your technical reports to be formatted in a 
% similar way. 

\textwidth=6in 
\textheight=9in
\hoffset=-0.125in
% Put a % in front of the next line if your TeX document
% has graphics and you are using DVI -> PS
%\voffset=-0.75in 
\usepackage{graphicx}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%% % This is the title information for your report. 
% Insert your title in the braces below. 

\title{A SIMU Introduction to \LaTeX} 

% Insert the authors names in the braces. Put a \cr after
% each author except the last one. 

\author{Herbert A. Medina, Loyola Marymount University} 

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%% % Do not touch the next two commands 

\begin{document} % End of preamble. 

\maketitle % Produces the title. 

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%% % The next paragraph is to produce the abstract. 

\begin{abstract} % Enter your abstract below 

This document gives a brief introduction to using the
typesetting program called \LaTeX. It should give you
enough information to begin writing your abstract, 
technical report, and overhead tranperencies for your presentation using \LaTeX. 

\end{abstract} 

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
% Begin the paper. Sections will be numbered for you. 
% Just enter a section title and then begin typing the section. 

\section{Introduction} {\LaTeX}
is one of the most widely used typesetting programs. It is especially
useful when typesetting documents with mathematical formulas and
symbols. This short document is an introduction to \LaTeX. 

First we will discuss the biggest difference between a word-processing
program like Microsoft Word and a typesetting program like \LaTeX. A
document produced using MS Word only has one file. That file is both the
file into which you type your document and the file in which your
document is displayed. That is, in MS Word, what you type and see is
what is displayed and printed. This type of program is referred to as
``WYSIWYG", {\em what you see is what you get.} A document typeset using
{\LaTeX} has two files: 1.) an input file which has the text of your
document, the basic document information and the special formatting
commands that you may be using, and 2.) an output file which has the
typeset document. The input file is a plain text file that will be
identified with a ``.tex" ending and the output file will
have a ``.dvi" ending; the ``dvi" stands for {\em device independent.}
(A good analogy is the types of files available on the World Wide Web. If you are
familiar with HTML, you know that there is a text file containing the
HTML source code and then there is the file displayed by the browser you
are using once the browser executes the HTML file. Typesetting a
document using {\LaTeX} is similar: the implementation of {\LaTeX} that
you are running will take the input file and produce an output file for
viewing and printing.) 

Attached to this typeset document you will find the {\LaTeX} input file
that was used to create it. The input file will demonstrate some of what
is explained in this document. 

\section{The input file and some very basic commands} In the input file, the ends of words and
sentences are marked by spaces. It does not matter how many spaces you
type; the end of a line counts as a space. One or more blank lines
denote the end of a paragraph. 

{\LaTeX} commands are usually preceded with a backslash ``\verb!\!".
They are often also included in braces, as shown in the input file. For
example, the command \verb!{\LaTeX}! generates the {\LaTeX}
logo. There are also several reserved characters in {\LaTeX}, so you
must type special commands to generate them. These characters include
the following: \$, \&, \%, \#, \{ and \}. (Look at the input file to see
how these were generated.) For example, the ``\$" is reserved to denote
the start and end of ``math mode" so if you want to actually produce a
dollar sign, you will have to type in ``\verb!\$!". Another very important reserved symbol is the \verb!%!. Text after a \verb!%! on any line will be ignored by \LaTeX. In other words, it is the symbol that tells {\LaTeX} that you are about to type some comments that will be readable in the input file but will not produce any typeset text. 

Punctuation symbols can be tricky in {\LaTeX}. Opening quotations are
two of the single opening quotations and you close
a quotation by using the regular quotation marks. ``Look at the input
file to understand this." Dashes come in three sizes: an intra-word
dash, a medium dash for number ranges like 1--2, and a punctuation
dash---like this. You generate these using one, two and three dashes
respectively. 

Should you want to cause some text to appear in \textbf{boldface type},
you can simply place the \verb!\textbf! command before that text and
enclose the text in braces. Should you want a sentence to appear in
\textit{italics}, you similarly can use the \verb!\textit! command. 

{\large You also can cause text to appear in larger or smaller type.
This paragraph uses {\LaTeX}'s ``\verb!\large!'' command.} 

Footnotes\footnote{This is an example of a footnote. By the way, please
excuse all the spelling mistakes in this document. We did not run it
through a spellchecker.} are easy to do with {\LaTeX}.

Another command that is useful and that was used very much when
generating this document is the ``\verb!\verb!" or \verb!\vervatim! command. The command
tells {\LaTeX} that the text between the ``!"'s is to be printed
verbatim, that is, without typesetting it. This is useful if you are
trying to type out some of the commands that you used in a computer
program. If in your paper, you would like to have several lines of Maple code for example, the best way to do it is to use something like 

\verb!\begin{verbatim}!

\verb!This is where the maple code would go.!

\verb!\end{verbatim}! 
Essentially, the verbatim commands turn \LaTeX into a typewritter. 


\section{Typesetting mathematical formulas} {\LaTeX}'s power becomes
apparent when you want to typeset mathematical formulas like: $ x-3y =
7$ or $a_1 > \frac{x^{2n}}{\beta^\alpha} > \sum_{n=0}^\infty x^{n-1}$.
You will have to get used to the notation for mathematics. For example,
the second formula above was generated using the commands \hfill\break
\verb!$a_1 > \frac{x^{2n}}{\beta^\alpha} > \sum_{n=0}^\infty x^{n-1}$!.
\hfill\break Note that you have to let {\LaTeX} know that you are about
to give it mathematical stuff to typeset. To insert mathematics within a
paragraph, you type ``\$" and once you finish inputting mathematics,
you end with ``\$". Also note that to raise something to a power with
more than one symbol, you have to enclose the power in braces or else
{\LaTeX} will not do what you want it to. For example, \verb!$x^2n$!
will produce $x^2n$ and not $x^{2n}$. 

TeX for Windows 3.3, the {\LaTeX} editor that we are using has buttons at the top that can help you with typeseting mathematics. You do not have to use these and once you become familiar with \LaTeX, you probably won't, but they can be helpful in the begining. If you would like to typeset some mathematics, click on the $\Sigma$ icon. You get a dialog box asking you if you'd like in text mathematics or otherwise displayed mathematics and if you would like the displayed mathematics to have an equation number. You also have the option of having an equation array which will align things in a collection of  equations. Once you finish with the mathematics, you click on the ``Done" button and that brings you back to your document. Let us illustrate the difference between the different types of equations.

An equation in the text might be something like $\int_0^\infty \frac{x}{x^3 + 2x^2 - 3x+90}\,dx$. A numbered, displayed equation might be something like \begin{equation}\label{FirstOne}
\sum_{n=0}^\infty \frac{1}{n^2 + 10\sqrt{n}}
\end{equation}
You will notice that you have the option of giving an equation with a number a reference name. This allows you to refer to the equation number later on without actually giving the number; {\LaTeX} will figure out what the number is. This is useful because often times you will insert equations earlier in the document and the equation numbering will change. For example, see the input file to see how we generated a reference to equation (\ref{FirstOne}). 

Finally, this is an equation array where the equal signs and others .

\begin{eqnarray*}
       x & + \ 10y        & =\ 30          \\
        4x & - \  9y       & =\ 40           \\
\end{eqnarray*}


You can learn a lot of {\LaTeX} mathematics notation by trial and error or by letting TeX for Windows generate it for you, 
and much of it is intuitive. How do you think we generate the greek
letters $\alpha, \Pi, \Gamma$, and $\gamma$? How do you think we
generate $\int_0^\infty \frac{\sin x}{x} \, dx$? 

One way to learn some of the {\LaTeX} mathematical symbols commands is
to ask Maple or {\it Mathematica} to generate them for you. For example, if you want to write
mathematical symbols for $\int _{0}^{\pi }\!{\frac {\sqrt
{\sin(x)}}{{x}^{2}}}\,{dx}$ you can go to Maple and execute the command
\begin{verbatim}
latex(int((sin(x)^(1/2) / (x^2), x=0..Pi)));
\end{verbatim}
Maple produces the {\LaTeX} command for the mathematical
symbols. You can cut the output from Maple and insert it into the
{\LaTeX} input file. In this example, Maple would generate 
\begin{verbatim}
\int_{0}^{\pi }\ {\frac {\sqrt {\sin(x)}}{{x}^{2}}}{dx}
\end{verbatim} The corresponding command in {\it Mathematica} is \verb!TeXForm!. For example, to do the example above you execute in {\it Mathematica}
\begin{verbatim}
TeXForm[Integrate[Sin[x]^(1/2)/(x^2), {x, 0, Pi}]]
\end{verbatim}

In summary, mathematical formulas may be placed within paragraphs of text by
offsetting them with single dollar signs. They also may be
displayed by offsetting them with two dollar signs or with a \verb!\begin{equation}! and \verb!\end{equation}!. 

Detailed lists of mathematical symbols and just about everything you
ever wanted to know about {\LaTeX} can be found in \cite{KW}. Also, we
have attached a copy of the {\LaTeX} commands of some of the most common
mathematical symbols to this document. 

\section{Running \LaTeX} To run \LaTeX, first you will have to produce
an input file. This will be done using TeX for Windows 3.3. You may start by
taking the file ``reptemp.tex" and editing it. This is the file that contains the template for your technical report. Enter your name as an
author, a title and then begin naming sections and just typing some
stuff. When you think you are ready to ``\LaTeX" the document, just hit the \LaTeX button. This will produce a temporary DOS window. If your input file does not have any errors, then it will dissapear by itself after a couple of seconds. If you have errors, the {\LaTeX} process will stop in the middle and tell you the error (in an often cryptic fashion) and also on which line the error is. You can discontinue the {\LaTeX} process, by typing ``x" and return. You also can ask {\LaTeX} to continue to work in silence by typing ``s" and return. This will produce an output file even if there are errors in the input file.

Once {\LaTeX} finishes, it will produce a file in the same folder as the input file and with the same name except with a ``.dvi" ending. This is the file that contains your typeset document. You can view this file by envoking the DVI Viewer using the DVI button in TeX for Windows. 

You will now start a process that will go something like:
\begin{itemize} \item Edit input file in TeX for Windows.

\item {\LaTeX} the file using the \LaTeX button. 

\begin{enumerate} \item If {\LaTeX} found errors in your input file,
return to TeX for Windows to edit the input file. 

\item If {\LaTeX} ran without errors, go the next step. 

\end{enumerate} 

\item View the output file in the DVI Viewer. 

\begin{enumerate} 

\item If you need to make changes to your input file, return to TeX for Windows.

\item If you are completely satisfied with the typeset document, then
you are done and can print the output from the DVI Viewer. 

\end{enumerate} 

\end{itemize} 

As with any other important document, make sure that you have your input
file on at least one hard drive and a floppy. 

\section{Other {\LaTeX} commands and information that may be of
interest} The bibliography is easy to make using \LaTeX. The {\LaTeX}
input file for this document shows you how to create it. You will label
the entries with a particular tag and then you can use it to cite
references. For example, see the input file for how this citation was created \cite{CLS}. 

Lists are a little bit more difficult, but you can look at the input
file to see how the lists in the previous section were created. You will
see that once you make a couple of lists, the rest are easy. 

Inseting tables is a little more complicated and will not be
discussed here. You should see \cite{KW} to see how this is done. If
the details are too complicated, then just leave enough blank space in
your document to physically paste a table generated by
another program. 

The printers in your villas may not generate certain mathematical
symbols and fonts. These printers are fine for drafts, but when you want
an ``good" hard copy of your document, you should use the laser printer
in the lab. 

Inserting graphics into your paper is also not too hard using \LaTeX. Once the graphic is created using a program like {\it Mathematica} or Maple you need to save it as an ``eps" (embedded Postscript) file. In {\it Mathematica} you do this by highlighting the graphic and selecting ``Save Selection As" from the Edit menu. Make sure and save the file in the same folder where your {\LaTeX} input file resides. In Maple, select the graphic and then right click over it; now use the command``Export As". Once this is done, then enter the next few lines in your {\LaTeX} input file:

\begin{verbatim}
\begin{figure}[h]
\begin{center}
\includegraphics[width=4in,height=3in]{firstmapleplot.eps}
\caption{The graph of $x \sin 10x$ using Maple}
\label{figure:graphsin}
\end{center}
\end{figure}
\end{verbatim}

This example assumes that the name of the graphic file is ``firstmapleplot.eps". The ``label" part of this is an internal reference that allows you to reference the figure at a later time without using its number. Here is the actual plot. 

\begin{figure}[h]
\begin{center}
\includegraphics[width=4in,height=3in]{firstmapleplot.eps}
\caption{The graph of $x \sin 10x$ using Maple}
\label{figure:graphsin}
\end{center}
\end{figure}

{\LaTeX} will place the graphic on a new page if it does not fit on the current page. You can reference the number that {\LaTeX} assigned to the figure by writing \verb!\ref{figure:graphsin}!. For example, you could produce ``Please refer to figure \ref{figure:graphsin}" without actually giving the number that {\LaTeX} assigned to the figure. This is very handy if you rearrange the order of your figures.

For some reason that we don't fully understand, printing a DVI file with a Postscript graphic does not work using the DVI viewer. You can view the document fine on the screen but when you try printing it, it gives an error message and will print the document without the graphic. Here is the way around it:
\begin{enumerate}

\item Once you have the DVI file looking like you want it to, go back to TeX for Windows. Comment out the \verb!\voffset! command by putting a \verb!%! in front of it. 

\item Click on the DVI $\to$ PS button.

\item Click on the Printer icon. Close the DOS window that was generated by this command. 

\end{enumerate}

Note that you only have to do this if you have Postscript graphics in your report. If you do not have such graphics, then the print command from the DVI Viewer works fine.

\section{SIMU guidelines for abstracts and technical reports} We have
created a templates that you will use to write your technical report for
the SIMU technical report publication and your abstract for submission
to the SACNAS Conference. (Your abstract also will be part of your
technical report.) These templates are available in the lab in the
directory and can be accessed by going to Network Neighborhood $\to$ MateSrv $\to$ SIMU 2000 $\to$ Templates. They also are available on the laptops and the desktops in the villas. You should copy the
files ``reptemp.tex" and ``abstemp.tex" onto your lab directory. There is also a presentation template called ``prestemp.tex" that you can use to help you make the overhead transperencies for your oral presentation.

Your research team will write up a technical report on your research
project. You should use the template that we have provided so that all
your reports are formatted similarly. The specific guidelines for the
paper will be discussed by your seminar leader. In general, your paper
will have a short introduction to the topic, a description of the
problem, the methods used to solve it, your results, and a conclusion
which will include ideas for future work. The way in which you exactly
section the paper should be discussed with your seminar leader and
seminar associates. You also may put in an acknowledgements section in
which you thank anyone whom you want to thank. 

\section{Closing remarks} 

This short introduction to {\LaTeX} is not meant to be comprehensive.
Nevertheless, it should be enough to get you started. I am certain that
once you get the hang of {\LaTeX} you will see its value and power. 

As with any computer language or software, you can learn {\LaTeX} only
by using it on a regular basis. It may seem difficult now, but by the end of the summer you will be \LaTeX perts.

!`Buena suerte! 

% This is pretty much the end of the document.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 

% Now we type up the bibliography. Disregard the "{aaaa}".
\begin{thebibliography}{aaaa} 
\bibitem[1]{CLS} D.  Cox, J. Little, \& D.
O'Shea, \textit{Ideals, Varieties and Algorithms}, 2nd Ed.,
Springer-Verlag, New York, 1997. 

\bibitem[2]{KW} H. Kopka \& P.W. Daly, \textit{A Guide to} {\LaTeX}, 3rd
Ed., Addison-Wesley, New York, 1999. 

\end{thebibliography}

\end{document} % End of document.
