\documentclass[pdf,contemporain,slideColor,colorBG,accumulate,nototal]{prosper}

\title{\LaTeX} 
\subtitle{UCLA Linux User Group, March 2004}
\author{Ben Clifford}
\email{benc@linux.ucla.edu}

\begin{document}
\maketitle

\begin{slide}{Learning \LaTeX}

\begin{itemize}
\item There is a good \LaTeX{} guide available at:

http://www.ctan.org/tex-archive/info/lshort/english/

\item Another good way to learn \LaTeX{} is by example: get the source for
a document that looks like what you want, and see how it does what it
does.
\end{itemize}
\end{slide}

\begin{slide}{\TeX{} and \LaTeX{}}

\begin{itemize}
\item \TeX{}  is a markup language for typesetting.

\item \LaTeX{}  is a more useful language built on top of \TeX{}.

\item No direct control of formatting. This seems Bad if you are used
      to WYSIWYG wordprocessors, but it is actually Good.

\item Input files are text -- you can write documents in your favourite
      text editor.

\end{itemize}
\end{slide}


\begin{slide}{A simple example}

\begin{verbatim}

\documentclass{article}
\begin{document}
Small is beautiful.
\end{document}

\end{verbatim}

\end{slide}

\begin{slide}{Building the example}

\begin{itemize}
\item Put the contents of previous slide in \texttt{whatever.latex}
(use emacs or vi)

\item \texttt{latex whatever.latex} -- outputs whatever.dvi

\item \texttt{xdvi whatever.dvi} -- views the output on-screen

\item \texttt{dvipdf whatever.dvi} -- converts to \texttt{whatever.pdf}.

\end{itemize}
\end{slide}

\begin{slide}{Example output}

Small is beautiful.

\end{slide}

\begin{slide}{Two kinds of markup}

\begin{itemize}
\item \emph{Commands} look like \verb+\somecommand[opt params]{params}+

\item \emph{Environments} look like:

\verb+\begin{someenvironment}+ \newline
some text here \newline
\verb+\end{someenvironment}+ 
\end{itemize}

\end{slide}

\begin{slide}{More examples}

\begin{verbatim}
We can have paragraph breaks.

by putting in a blank line.
We can \emph{emphasise text!} 
and \\ use 
some ``special'' symbols\ldots

\end{verbatim}

We can have paragraph breaks

by putting in a blank line.
We can \emph{emphasise text!} 
and \\ use 
some ``special'' symbols\ldots
\

\end{slide}


\begin{slide}{Mathematics}

\begin{verbatim}
We can embed maths, such 
as $ x^2 $ inside a paragraph.

\end{verbatim}

We can embed maths, such 
as $ x^2 $ inside a paragraph.

\begin{verbatim}
\begin{equation}
a^2 + b^2 = c^2
\end{equation}
\end{verbatim}

\begin{equation}
a^2 + b^2 = c^2
\end{equation}

\end{slide}

\begin{slide}{Mathematics}

Some things to do:

\begin{tabular}{|l|l|l|}
\hline

superscripts & \verb+x^2+ & $ x^2 $ \\
subscripts & \verb+x_2+ & $ x_2 $ \\
greek letters & \verb+\Delta x+ & $ \Delta x $ \\
special symbols & \verb+\forall x \in U+ & $ \forall x \in U $ \\
fractions & \verb+\frac{x}{y-1}+ & $ \frac{x}{y-1} $ \\

\hline

\end{tabular}

\end{slide}

\begin{slide}{Mathematics}

These can be combined into very complex layouts:

\begin{verbatim}

$ \lim_{ n \to \infty }
\sum_{k=1}^n 
\frac{1}{k^2}$

\end{verbatim}

$ \lim_{ n \to \infty }
\sum_{k=1}^n
\frac{1}{k^2}$

\end{slide}


\begin{slide}{Footnotes}

\begin{verbatim}
You can easily\footnote{Well, quite 
easily} put footnotes in-line into 
your text, and they will be placed on 
the appropriate page.

\end{verbatim}

You can easily\footnote{Well, quite 
easily} put footnotes in-line into 
your text, and they will be placed on 
the appropriate page.

\end{slide}

\begin{slide}{Numbered Lists}

\begin{verbatim}
There are two kinds of list:
\begin{enumerate}
\item With numbers (enumerate)
\item Without numbers (itemize)
\end{enumerate}

\end{verbatim}

There are two kinds of list:
\begin{enumerate}
\item With numbers (enumerate)
\item Without numbers (itemize)
\end{enumerate}

\end{slide}

\begin{slide}{Un-numbered Lists}

\begin{verbatim}
There are two kinds of list:
\begin{itemize}
\item With numbers (enumerate)
\item Without numbers (itemize)
\end{itemize}

\end{verbatim}

There are two kinds of list:
\begin{itemize}
\item With numbers (enumerate)
\item Without numbers (itemize)
\end{itemize}

\end{slide}

\begin{slide}{Verbatim}

\begin{verbatim}
\begin{verbatim}
This is 
verbatim text.
\end{verbatim}
\verb+\end{verbatim}+


\begin{verbatim}
This is 
verbatim text.
\end{verbatim}

\end{slide}

\begin{slide}{Tables}
\begin{verbatim}
\begin{tabular}{|lr|c|}
\hline
I like & cheese  & true \\
       & cabbage & false \\
\hline
I hate & mushrooms & true \\
\hline
\end{tabular}
\end{verbatim}
\begin{tabular}{|lr|c|}
\hline
I like & cheese  & true \\
       & cabbage & false \\
\hline
I hate & mushrooms & true \\
\hline
\end{tabular}
\end{slide}

\begin{slide}{Sections}
\begin{verbatim}
\section{Act, the first}
\subsection{The Happy Subsection}
This subsection is very happy.
\end{verbatim}
\section{Act, the first}
\subsection{The Happy Subsection}
This subsection is very happy.
\end{slide}

\begin{slide}{More sections}

\begin{verbatim}
\section{Act, the second}
\label{secondact}
This is the second Act, 
which we label for future reference.
\end{verbatim}

\section{Act, the second}
\label{secondact}
This is the second Act,
which we label for future reference.
\end{slide}

\begin{slide}{Other section commands}
\begin{verbatim}
\section{section}
\subsection{subsection}
\subsubsection{subsubsection}
\paragraph{paragraph}
\subparagraph{subparagraph}
\end{verbatim}

\end{slide}

\begin{slide}{Table of Contents}
\begin{verbatim}
\tableofcontents
\end{verbatim}
\tableofcontents
\end{slide}

\begin{slide}{A note on multipass building}

\TeX{} only makes one pass through the document each time you run it.

Can't build a table of contents at the start until we've passed through the
whole document.

So need to run build command two (or sometimes three) times in a row to
get everything right.

This also applies for crossreferences.
\end{slide}

\begin{slide}{Crossreferences}
\begin{verbatim}
On slide \pageref{secondact}, in
section \ref{secondact}, we defined a 
label ``secondact''.
\end{verbatim}

On slide \pageref{secondact}, in
section \ref{secondact}, we defined a 
label ``secondact''.

\end{slide}

\begin{slide}{Document classes}

Most formatting for document is controlled by the 
\emph{document class}.

The first line of a \LaTeX{} document looks something like:

\verb+\documentclass{article}+

The string ``article'' says the document is to be formatted as an article.

For this presentation, I use:

\verb+\documentclass{prosper}+

``prosper'' is a document class which causes my document to be formatted
as a slide show.

\end{slide}

\begin{slide}{More document classes}

Some document classes that come with \LaTeX{} are:

\begin{tabular}{|l|l|}
\hline
article & short articles \\
\hline 
report & Technical reports and Ph.D theses \\
\hline 
book & Real books \\
\hline
\end{tabular}

\end{slide}

\begin{slide}{More layout stuff}

\verb+\newpage+ starts a new page

\verb+\\+ starts new line without starting a new paragraph

\verb+\-+ is a discretionary hypen -- it indicates to \LaTeX{} where it should
break the word if it needs to.

\verb+\mbox{my text here}+ means the text will never be split by word wrapping
or hypenation.

\end{slide}

\begin{slide}{Things that can go wrong}

Like any Real Man's language, the error output is at times obscure.

The following slides are some errors I came across while making these
slides.

\end{slide}

\begin{slide}{File not found}

\emph{latex ook.tex}

\texttt{! I can't find file `ook.tex'.}

Wrong filename

\end{slide}

\begin{slide}{Overfull hbox}


\texttt{Overfull hbox (214.66396pt too wide) in paragraph at lines 322--322}

\TeX{}  tries to lay things out nicely. But in this case, it ended up with a 
paragraph that it couldn't get quite right and had to spill into the margins
(so your document will look more ugly or some text will fall of the page)

Line 322 refers to a line in the source document, containing the offending 
paragraph.

\begin{verbatim}
here is an example of some text that causes this kind of error
\end{verbatim}

\end{slide}

\begin{slide}{Undefined control sequence}


\begin{verbatim}
Undefined control sequence.
l.306 \textt {! I like cheese.}

\end{verbatim}

On line 306, I had used:

\begin{verbatim}
\textt{I like cheese.}
\end{verbatim}
when I should have used
\begin{verbatim}
\texttt{I like cheese.}
\end{verbatim}

\end{slide}

\begin{slide}{forgotten endgroup}

\begin{verbatim}
! Extra }, or forgotten \endgroup.
\endminipage ...pagefalse \color@endgroup \egroup
     \expandafter \@iiiparbox \...
l.55 \end{slide}
\end{verbatim}

This is because I ended a slide section with
\begin{verbatim}
\end{slide}
\end{verbatim}
when I still had another environment open -- I had forgetten to 
say
\begin{verbatim}
\end{itemize}
\end{verbatim}

\end{slide}

\begin{slide}{Other things you can do}

\begin{itemize}
\item Many other formatting commands

\item Advanced bibliography handling with bib\TeX{}

\item Construct indexes

\item \TeX{} and \LaTeX{} can be used to typeset slides, such as this
presentation, using the \emph{prosper} package.

\item Packages for lots of interesting extra functionality are
available from CTAN, the \emph{Comprehensive \TeX{} Archive Network.}
(prosper is an example).
\end{itemize}
\end{slide}

\end{document}

