\documentclass{article}

\newcommand{\And}{\wedge}
\newcommand{\Or}{\vee}
\newcommand{\Not}{\neg}
\newcommand{\implies}{\rightarrow}
\newcommand{\bicond}{\leftrightarrow}
\newcommand{\xor}{\oplus}

\title{A Brief Introduction to \LaTeX}
\author{Eric Eaton}

\begin{document}

\maketitle

\LaTeX\ is a text processing system that uses an embedded command
language in plain text to generate a formatted document.  \LaTeX\ has
excellent support for mathematical formulas and references, and is
usually easy to use for people who are comfortable with programming
languages.  \LaTeX\ is {\em not} a WYSIWYG (``What You See Is What You
Get'') word processor.  However, it is (in my opinion) much more
powerful and flexible than most WYSIWYG systems, including Microsoft
Word.

\section{Running LaTeX}

\LaTeX\ runs (at least) on the gl linux machines and should run on the
cs machines.  The easiest way to create a \LaTeX\ file is to use emacs
(you may use any other text editor, but emacs is very \LaTeX\
friendly).  There is a very simple sample file on the class website,
in the file {\tt sample.tex}.  Here's how you produce a typeset
document from this file (after copying it into your own directory).

\begin{verbatim}
% latex sample
% xdvi sample
% dvips -P pdf -G0 -t letter -o sample.ps sample.dvi
% ghostview sample.ps
\end{verbatim}

The command {\tt latex} processes the input {\tt .tex} file, producing
an output {\tt .dvi} file.  You can view this file on your screen
using {\tt xdvi}.  If it looks the way you want it to, you can convert
it to a PostScript file using the {\tt dvips} command, with the
switches shown in the script above.  Now take a look at the PostScript
file using {\tt ghostview}.  You may also convert a {\tt .ps} file to
an Adobe Acrobat file ({\tt .pdf}) by:

\begin{verbatim}
% ps2pdf sample.ps sample.pdf
\end{verbatim}

If the document (either {\tt .ps} or {\tt .pdf}) looks the way you
want it, you may print it out using the respective viewer or simply
use {\tt lpr} on the {\tt .ps} file.

\begin{verbatim}
% lpr sample.eps
\end{verbatim}

A more rapid way of obtaining a {\tt .pdf} document is to use {\tt pdflatex} as follows:

\begin{verbatim}
% pdflatex sample.tex
\end{verbatim} 

\section{Example Files}

Here's what the {\tt sample.tex} file looks like:

\begin{verbatim}
\documentclass{article}

\title{Title of My Document}
\author{My Name Goes Here}

\begin{document}
\maketitle

Hello, world!

{\em Hello, world!}

{\bf Hello, world!!}

{\tiny \bf Hello, world!!!}

{\Large \bf Hello, world!!!!}
\end{document}
\end{verbatim}

The \verb+\documentclass{article}+ command on the first line of the
file tells \LaTeX\ that this is in fact a \LaTeX\ document, of class
``article.''  (There are other document classes, such as {\tt report}
and {\tt book}, but typically you'll use the article class.)

The lines after the \verb+\documentclass+ command and before the
beginning of the document are called the {\em preamble.}  The preamble
includes any initialization commands and general specifications for
the document style.  In this file, the preamble just contains the
title and author commands, on the next two lines.  You can also
specify, in the preamble, the date you want to appear on the document,
using the command \verb+\date{Your Preferred Date}+, or leave the date
blank using \verb+\date{}+; if no date is specified, \LaTeX\ will use
today's date.  To not include a date, you can use the command
\verb+\nodate+.

Now the body of the document starts; this is signaled to \LaTeX\ by the
\verb+\begin{document}+ command.  The first command within the
document body is \verb+\maketitle+, which uses the title and author
defined in the preamble to create a title section in the output file.

After the title is the rest of the document: in this case, five
paragraphs (which are delineated by blank lines), each greeting the
world in a different style: normal, emphasized (i.e., italic),
boldface, small boldface, and large boldface.  Note that the
font-changing commands and text to be changed are enclosed in curly
braces \verb+{}+; these delineate the scope of the font-changing
commands.

The last line of the file, \verb+\end{document}+, tells \LaTeX\ that
the body of the document is complete.

That's it!

% need to edit below

All exams for this course are formatted in \LaTeX\.  Along with the
first assignment, the {\tt ex1.tex} source, which contains solutions
to the examples discussed in the first lecture, will be available for
download.  You may use this template for formatting your homework
assignments or create any template you would like.

Strictly speaking, you are not required to format your homework
solutions in \LaTeX\ (although you are required for the first several homeworks), but
as far as I can tell, \LaTeX\ is the best available system for
generating mathematical and technical documents.  If you cannot tell
by now, I highly recommend using \LaTeX\ for CMSC 203 and future
mathematically oriented courses (e.g., CMSC 441, CMSC 471).  {\bf You
are required to typeset your problem set solutions, so if you choose
not to use \LaTeX\ you assume all responsibility for poorly formatted
mathematical notation that may be subject to grade reductions}.  Your
solutions must be typeset, printed on 8.5 $\times$ 11 white paper, and
turned in in hard copy format at the beginning of class on their due
date.

This file (that is, the one you're reading now) is also on the
website, in {\tt latex.tex}.

\section{Resources}

The standard \LaTeX\ reference book is {\em \LaTeX: A
Document Preparation System, 2/e},
Leslie Lamport, Addison-Wesley, 1994, ISBN 0-201-52983-1. 

Here are several useful websites.  I will post these on the course
resource page.
\begin{itemize}
\item \LaTeX\ Project home page:\\{\tt http://www.latex-project.org/}
  \begin{itemize}
    \item \LaTeX\ Project FAQ: \\{\tt
http://www.tex.ac.uk/cgi-bin/texfaq2html?introduction=yes}
  \end{itemize}
\item CTAN: the Comprehensive TeX Archive Network: \\{\tt
http://www.ctan.org/}
\item Peter Flynn's ``Beginner's \LaTeX'' guide to basic \LaTeX:
    \\{\tt http://www.silmaril.ie/downloads/documents/beginlatex.pdf}
\item The AMS maintains several widely used extensions of LaTeX.  The
{\tt amsmath} part provides just about every math symbol you can
imagine, and more: {\tt http://www.ams.org/tex/amslatex.html}
\item ``Simplified \LaTeX,'' a beginner's guide with a nice tutorial
section at the beginning:
\\{\tt http://www.ctan.org/tex-archive/info/simplified-latex/} 
\item In order to run \LaTeX\ on your own computer, you will need to
      install TeX and \LaTeX. I haven't tried to download it, but a
      number of freeware and shareware implementations are available.
      You can look through the CTAN or \LaTeX\ Project websites above
      for pointers. If you're running Windows, you might want to try
      this TeX/\LaTeX\ implementation, which looks promising: 
      {\tt http://www.miktex.org/ }.
\end{itemize}

\section{Acknowledgements}
Thanks to Marie desJardins and Matt Gaston for sharing course material and \LaTeX\ templates.  This document is due in large part to Dr. desJardins.

\end{document}
