\documentclass[twoside]{article}
\title{LaTeX Basics}
\author{Miki Havl\'{\i}\v{c}kov\'{a}}
\date{\today}
\begin{document}

\maketitle

\pagestyle{myheadings}
\markboth{Miki Havl\'{\i}\v{c}kov\'{a}}{18.099B LaTeX Basics} 

\section{Processing and printing}
"Code" for your document should sit in a file \emph{name.tex}\\
To process this document on Athena, type \emph{add newtex; latex2e name.tex}\\
This will create a few files, in particular \emph{name.dvi}\\
To view your processed file, type \emph{xdvi name.dvi}\\
To print this file, type \emph{dvips -Pprinter name.dvi}\\
To convert your file into a postscript document, type \emph{dvips -o name.ps name.dvi}\\


\section{Document outline}
Your document will look something like this:

\begin{verbatim}
\documentclass[options]{document class}

\author{your name}
\title{whatever it is}
\date{put a date here or write '\today' to put today's date automatically}

Here go other special commands that affect the outline of your document.

\begin{document}

\maketitle

Here goes the text of your document.

\end{document}
\end{verbatim}

\subsection*{Document class}
There are four classes: \emph{article, report, book} and
\emph{letter}. They differ slightly in the way they are preformatted;
we will worry about \emph{article} for now. Its \emph{options} are
things such as font size and type (default \emph{12pt, Times}), or
\emph{twoside} if you want your article to be double-sided (affects
things such as headings, page margins etc.). For example, you can have

\begin{verbatim}
\documentclass[12pt, helvetica, twoside]{article}
\end{verbatim}

\subsection*{Title} 
This should be pretty self-explanatory; note that you have to put the
\verb=\maketitle= command after \verb=\begin{document}= in order for
your author, title and date to actually appear in the document. These
commands are optional; you can omit any one of the three, or just skip
the title entirely.

\subsection*{Outline commands in preamble} 
You can change pagemargins, spacing, and other such things here; see
references for details. Of these the most immediately useful is
spacing; to change it put

\begin{verbatim}
\renewcommand{\baselinestretch}{factor, like 2 for double-spaced}
\end{verbatim}

\subsection*{Text} 
The \emph{article} class comes with sections, subsections, and
subsubsections. To begin say a section, type

\begin{verbatim}
\section{title of your section (can be left empty)}
\end{verbatim}

These are numbered in the way you'd expect; to omit the numbering, put
an asterisk after \emph{section}, that is \verb=\section*{}=.

To force a new line, put \verb=\\= at the desired break place. To
start a new paragraph, leave a blank line. LaTeX will ignore all extra
space left in between words; you can use the command
\verb=\vspace{1cm}= to insert extra space (in cm, mm, pt, or pretty
much anything you want). The command \verb=\hspace{5mm}= accomplishes
the same for vertical spacing.

\subsection*{Footnotes} 
These are generated by the command

\begin{verbatim}
\footnote{text}
\end{verbatim}

They are numbered, incrementing throughout the article (i.e. do not
reset with each section, or anything of the sort). 

\subsection*{Special charaters}

You can print some command characters by putting a backslash in front
of them, like \verb=\&= which will produce \&. Characters from foreign
languages can also be printed; see references for how to do that.

\section{Text formatting}
\begin{itemize}
\item To temporarily change your font size, write

\begin{verbatim}
{\fontsize Text goes here}
\end{verbatim}

Possible font sizes are\\
{\tiny tiny} {\scriptsize scriptsize} {\footnotesize footnotesize}
{\small small} {\normalsize normal} {\large large} {\Large Large}
{\LARGE LARGE} {\huge huge} {\Huge Huge}.

\item To change character of your font, write

\begin{verbatim}
{\command Text goes here}
\end{verbatim}

The main possibilities for \emph{command} are \emph{em}, {\bf bf},
{\sl sl} {\rm rm} (the last one produces the usual font).

\item To center your text, write

\begin{verbatim}
\begin{center}
Text goes here
\end{center}
\end{verbatim}

\end{itemize}

\section{Lists}

The main list formats are \emph{enumerate}, \emph{itemize} and
\emph{description}. The command is

\begin{verbatim}
\begin{enumerate, itemize or description}
\item[name goes here in case of description]
\item[again a name for description]
\end{enumerate, itemize or description}
\end{verbatim}

The first numbers the entries, second bullets them (as in the previous
section), and third puts \emph{name} in bold followed by the text.

\section{Tables}

Table is constructed with

\begin{verbatim}
\begin{tabular}{column descriptions go here}
rows of table
\end{tabular}
\end{verbatim}

The column descriptions have on letter for each column, which can be
\emph{r}, \emph{c} or \emph{l}, indicating where you want the text to
be inside the column (right, center or left). Optionally you can put
one or multiple \verb=|= in between the letters, which will separate
the columns by a vertical line. For example, you can put
\verb={||c|r||}= to make a table with two columns separated by a
vertical line with double line on the outside, where first and second
columnts have respectively center and right indentations of the text.

Lines of the table have the format

\begin{verbatim}
first column entry  &  second column entry  \\\hline
\end{verbatim}

The entries are separated by \& (and can be left empty). The
\verb=\hline= command is optional, and will draw a horizontal line
below the row (if you want a double or any multiple line, just repeat
\verb=\hline\hline= etc.)

For example, to produce this table:

\vspace{1cm}

\begin{tabular}{||l||c|c||}
\hline\hline
Day & Class & Time \\\hline\hline
Monday & 18.01 & 10-11 \\\hline
Tuesday & 14.01 & 12-1 \\\hline
Wednesday & & \\\hline
Thursday & 14.01 & 12-1 \\\hline
Friday & 18.01 & 10-11 \\\hline\hline
\end{tabular}

\vspace{1cm}

I typed the following:

\begin{verbatim}
\begin{tabular}{||l||c|c||}
\hline\hline
Day & Class & Time \\\hline\hline
Monday & 18.01 & 10-11 \\\hline
Tuesday & 14.01 & 12-1 \\\hline
Wednesday & & \\\hline
Thursday & 14.01 & 12-1 \\\hline
Friday & 18.01 & 10-11 \\\hline\hline
\end{tabular}
\end{verbatim}

\section{References}
This document, as well as its .tex version, is on the class website,
along links to various helpful LaTeX sites. You can also pick up an
Athena minicourse package in the Copy Tech, or look at any of various
LaTeX books; I like "A Guide to LATEX 2e" by Helmut Kopka and Patrick
W. Daly.

\end{document}

