\documentclass[a4]{seminar}
\usepackage{slidesec}
\usepackage[dvips]{graphicx}
\input{seminar.bug}
\input{seminar.bg2} 
\usepackage{fancyhdr}

\newcommand{\heading}[1]{\begin{center}\large\bf #1\end{center}}
\newcommand{\bold}{\bf}
\fancyhf{} % Clear all fields
\fancyhead[L]{\small Orr Dunkelman}
\fancyhead[R]{\small orrd@vipe.technion.ac.il}
\fancyfoot[L]{\tiny\thedate}
\fancyfoot[C]{\small \LaTeX - Does Your Documents Good}
\fancyfoot[R]{\tiny Slide \theslide}
% To avoid that the headers be too close of the top of the page
\renewcommand{\slidetopmargin}{2cm}

\newcommand{\tex}{\TeX{}}
\newcommand{\latex}{\LaTeX{}}
\newcommand{\bslash}{\mbox{$\backslash$}}

% To center horizontally the headers and footers (see seminar.bug)
\renewcommand{\headwidth}{\textwidth}

% To adjust the frame length to the header and footer ones
\autoslidemarginstrue

	
\begin{document}
\pagestyle{fancy}

%%%%%%%%%%%%%%%%%%%%%Title
\begin{slide}	
\includegraphics{tux.eps}
\center{\Large { \latex - Does Your Documents Good}}
\center{Orr Dunkelman} 
\center{orrd@vipe.technion.ac.il}
\end {slide}

%%%%%%%%%%%%%%%% Intro.
\begin{slide}
\slideheading{Introduction}

In the beginning D. Knuth created \tex; And the \TeX{} was hard to use,
and
people had hard time writing documents in \TeX; And L. Lamport said, Let
there be \LaTeX: and there was \LaTeX;\\

And Lamport saw the \LaTeX, that it is good: and Lamport added new
features and finally wrote new version; And Lamport called the latest
version he wrote \LaTeX 2.09, and the evening and the morning - chapter
1.\\

And the people saw they want more than what Lamport has given them; And
they gathered to write \LaTeX 3, but god himself prohibited that. and all
they succeeded was \LaTeX $2_{\epsilon}$

\end{slide}
 

\begin{slide}
\slideheading{Introduction (cont')}

\TeX{} was first written by D. Knuth in 1977 \TeX{} is a type setting
system,
which was needed by Knuth to finish his "The Art of Computer Programming"
6-volume book.

\TeX{} can be best defined as a programming language for documents. In
order to shape your document the way you want it, you need to use special
commands. However, many needed extensions to \TeX, and among the known
extension one can find \LaTeX{} and AMS-\TeX{} (which was later evolved
into AMS-\LaTeX).

\end{slide}


\begin{slide}
\slideheading{Introduction (cont')}

Currently most of the academic world uses \LaTeX{} (2.09 or
$2_{\epsilon}$) as the document preparation utility.

Advantages of \LaTeX:

\begin{itemize}
\item Unix program which needs almost no CPU power.
\item Has a vast number of utilities which allows creating Postscript and
PDF files.
\item Large number of easy to access mathematic symbols.
\item Flexibility - any mathematical/scientific text can be processed
using \LaTeX.
\end{itemize}

\LaTeX has also graphical interface called LyX.

\end{slide}


\begin{slide}
\slideheading{Getting Started}
Use your favorite editor (vi, emacs, \ldots) to create try.tex.

write down the following text in the file:

\begin{verbatim}
\documentclass[]{report}
\begin{document}
Hello World
\end{document}
\end{verbatim}

Save it, and run {\it latex file.tex}. A dvi file containing the output of
LaTeX will be created. You can see it using {\it xdvi}. You can take the
.dvi and make it a postscript using {\it dvips}.
\end{slide}

\begin{slide}
\slideheading{Getting Started (cont')}
What have we done here?

The first line announces the type of the document being processed -
\bslash{}documentclass[]\{\}.

In \{\} we put the type of the document - it
can be one of the following article, book, letter, report or seminar
(slides like those you are reading now). The difference between report and
article is the length (articles are shorter).

In [] we put the additional packages we want to use, for example [a4]
means we want the output to be in the form of a4 pages, [psfig] asks LaTeX
to allow us including postscripts into our document.
\end{slide}

\begin{slide}
\slideheading{Getting Started (cont')}

As you might have noticed, each command starts with \bslash{}, This is a
reserved symbol, and the only way to integrate \bslash{} into the text is
using ad-hoc solutions (like the one I'm using now and you'll two once we
finish this lecture \ldots I hope).

The first command after you announce what document type you wish for, is
the {\it \bslash{}begin\{document\}}. This structure of command is very
common to LaTeX, when we begin area of special interest to LaTeX (like the
text to be processed) we announce it's beginning using the {\it
\bslash{}begin\{What ever begins here\}}). Logically enough, the end of
the
area is marked by {\it \bslash{}end\{Same as the begin command\}}.
\end{slide}

\begin{slide}
\slideheading{Getting Started (cont')}

The \bslash{}begin\{document\} (and the corresponding \bslash{}end
command) announce the beginning (end) of the document. Till this command
the headers of LaTeX are put (announcing new commands, packages to be
used, document style, etc.) and now the real document starts.

\end{slide}

\begin{slide}
\slideheading{Writing a Document}
Assume for a moment that the right packets have been loaded (For novices
the announcement of {\it documentclass} is more than enough). We want to
be able to write a document.

After the {\it \bslash{}begin\{document\}} command, we can write any text
we wish. The text can be plain English (letter to the government), pure
mathematics (Solving Fermat's last theorem), has graphical content (article
about analyzing people's faces) or a good book (Like the ``LaTeX User's
Guide and Reference Manual'' by L. Lamport).

We will not discuss books in this lecture, and divided the world between
the three main groups - articles (and reports), slides (seminar) and
letters (if time permits).

\end{slide}

\begin{slide}
\slideheading{Articles - Sections}
LaTeX was created by Lamport in order to allow people to write technical
reports and scientific papers using the TeX system. Hence, LaTeX supports
(in the report and article class) in dividing the document into sections,
subsections, subsubsection, and appendixes.

To define a new section one just declare {\it \bslash{}section\{Title of
Section\}}. New subsection uses the command  {\it
\bslash{}subsection\{Title of Subsection\}}. Subsubsection is created in a
very similar way.

LaTeX keeps track of the sections numbering automatically. It allows you
(using a referring mechanism presented later) to move sections in your
document without need to change anything. Another feature is that the
number of the section is presented near the section title. To avoid this
add * between the section (or subsection command) and the \{\}.

\end{slide}

\begin{slide}
\slideheading{Article - Referring}
The referring mechanism resembles VI's method. We leave a mark in the
place we want to refer to, and then we point to the mark.

Marking is done using the command {\it \bslash{}label\{Label Code\}}, and
referring is done using the command {\it \bslash{}ref\{Label Code\}}.

LaTeX keeps separate Label codes for sections, tables and figures.
Meaning that a label inside a table scope will get the number of the table
among the tables.

\end{slide}

\begin{slide}
\slideheading{Article - Basic Functions}
We just write a text. However, there are characters you cannot type in as
they are, due to the fact that they have different meaning in LaTeX.

The symbols are \$~\&~\%~\#~\_~\{~\}~$\sim$~$\hat{~}$~\bslash{}.

The first 7 (\$ \ldots \}) can be written be writing in the text file -
\bslash{}\$ \ldots \bslash{}\}. The other three requires several tricks in
order to write them, including entering to mathematical mode.

\end{slide}

\begin{slide}
\slideheading{Article - Mathematical Mode}
We can enter mathematical mode either by using \$ {\it math text } \$, or
by using \bslash{}[ command (ending it with \bslash{}]).

\$ doesn't open new line and remain in the same line, just like in this
case $x+y = 2^5$. However, \bslash{}[ just starts a new line, and the
formula is centerlized just like in this case
\[
\alpha + \beta^{\gamma_1} = 45^{\circ} \cdot f^2(n^{2^{2^2}})
\]

An equivalent to \$ is the \bslash{}(, \bslash{}) pair.
\end{slide}


\begin{slide}
\slideheading{Article - Mathematical Mode (cont')}
In the mathematical mode we can put numbers, operators, Greek letters
(like $\alpha$ which is created using the command \bslash{}alpha),
special mathematical symbols (like integral, \bslash{}int) and
sub/super-scripts (like $2^5$, which is done by $\hat{~}$\{5\}).

In the previous example you have witnessed the ability to have super super
scripts, and this is done by putting in the $\hat{~}$\{\} segment
additional $\hat{~}$\{\}. Sub script is done similarly with the character
\_ (replaces $\hat{~}$).

Comment: In mathematical mode there are no space, and the text is written
in italic. In order to space use one of the commands {\it \bslash{}quad or
$\sim$}. In order to have a text a normal spacing, put the text in
\bslash{}mbox\{Text Here\}. Thus you can get:

\end{slide}


\begin{slide}
\slideheading{}

\[
\mbox{Example}^{ \mbox{To a very} }_{ \mbox{Clever Way} } ~ To \quad
\mbox{eat apples}
\]


\end{slide}


\begin{slide}
\slideheading{Article - Scopes}
Scope can be defined using two techniques. The first is to get into
mathematical mode. In math mode, everything you do remains inside the math
mode (you can't have super script of sub script if you're not in the math
mode).

Another way is to use \{,\}. This enables changing of font/size for a
scope, for example {\bf \{\bslash{}it abc \}} would produce {\it abc}.

You can of course use the \bslash{}begin \bslash{}end method, by using
{\bf \bslash{}begin\{it\} abc \bslash{}end\{it\} } to achieve the same
text.

The codes are as follows:
\begin{table}
$$\begin{tabular}{ll|ll}
\hline
Code  & Affect & Code & Affect\\
\hline
\bslash{}rm & {\rm Roman} & \bslash{}em & {\em Emphasize}\\
\bslash{}bf & {\bf Bold} & \bslash{}it & {\it Italic}\\
\bslash{}sl & {\sl Slanted} & \bslash{}sf & {\sf Sans Serif}\\
\bslash{}sc & {\sc Small Caps} & \bslash{}tt & {\tt Type Writer}\\
\hline
\bslash{}tiny & {\tiny Tiny} & \bslash{}scriptsize & {\scriptsize Script Size}\\
\bslash{}footnotesize & {\footnotesize Footnote Size} & \bslash{}small & {\small Small}\\
\bslash{}normalsize & {\normalsize Normal Size} & \bslash{}large & {\large large}\\
\bslash{}Large & {\Large Large} & \bslash{}LARGE & {\LARGE LARGE}\\
\bslash{}huge & {\huge huge} & \bslash{}Huge & {\Huge Huge}\\
\hline
\end{tabular}$$
\caption{Codes of Text Manipulation in \LaTeX}
\label{tab:codes}
\end{table}

\end{slide}


\begin{slide}
\slideheading{Article - Tables}
The table itself is called tabular (command
{\it \$\$\bslash{}begin\{tabular\}} and the corresponding {\it
\bslash{}end\{tabular\}\$\$}). However, we can call a block a table (even
if it has no tabular in it!) where we design lines which will be related
to the tabular.

To create the following table
\begin{table}
Lines before
$$\begin{tabular}{lcr}
\hline
first field & second field & third field\\
\hline
\multicolumn{2}{c}{Both fields}&Third Field\\
	    &		   & Banana\\
\cline{1-2}
Bo\\
\hline
\end{tabular}$$
\caption{Example}
\label{tab:example}
\end{table}
\end{slide}


\begin{slide}
\slideheading{Article - Tables (cont')}

The syntax would be:
\begin{verbatim}
\begin{table}
Lines before
$$\begin{tabular}{lcr}
\hline
first field & second field & third field\\
\hline
\multicolumn{2}{c}{Both fields}&Third Field\\
	    &		   & Banana\\
\cline{1-2}
Bo\\
\hline
\end{tabular}$$
\caption{Example}
\label{tab:example}
\end{table}
\end{verbatim}

\end{slide}


\begin{slide}
\slideheading{Article - Tables (cont')}

And we can address the table using {\it \bslash{}ref\{tab:example\}}.

We can also have vertical lines between columns if we define in the
tabular section \{$|$l$|||$c$||$r\}, which will give one vertical line
before
the first field, three between the first and the second, and two between
the second and the third.

As you can see, change of column is done by the \& character. End of line
is done using \bslash{}\bslash{}. Note that you don't need to have all the
columns to be filled in order to end line.

\bslash{}hline draws an horizental line.

\bslash{}multicolumn\{how many columns\}\{l or c or r\} unite columns,
while \bslash{}cline\{which column to start-which column to end\}, tells
LaTeX to put there horizental line (but on several columns).

\end{slide}


\begin{slide}
\slideheading{Article - More on Equations}

Equations can also be refered (with their own counters). The beginning
command is {\it \bslash{}begin\{eqnarray\}} (without counting - put *
between the begin and the \{).

Eqnarray opens an array with 3 columns (an array is a table in the
equation/math mode of LaTeX), again changing column is done using \&, and
in the end of line \bslash{}\bslash{}

Using an array the following can be done:
\[
x= \left\{ \begin{array}{ll}
 y & \mbox{if $y>0$}\\
 z \cdot y & \mbox{otherwise}\\
\end{array} \right.
\]

\end{slide}


\begin{slide}
\slideheading{More on Equations (cont')}
The above was generated from the following LaTeX sequence:
\begin{verbatim}
\[
x= \left\{ \begin{array}{ll}
 y & \mbox{if $y>0$}\\
 z \cdot y & \mbox{otherwise}\\
\end{array}         
\right.
\]
\end{verbatim}


Note that the {\it \bslash{}left} can come with (,[, or $|$~. It needs to 
be closed be appropriate {\it \bslash{}right} (blank which is defined as
. or with some ),],\}).

Comment : it is allowed to have an array inside an array (inside an array,
\ldots).  
\end{slide}


\begin{slide}
\slideheading{Bibliography}
As bibliography is quite tricky, LaTeX keeps a special tables for
bibliography entries. The refering is done using the command {\it
\bslash{}cite\{Cite Key\}}. The ``Cite Key'' can be a number (1) or the
initials of the authors (KP83).

Each \bslash{}cite need to have a corrseponding entry in the
\bslash{}begin\{bibliography\} section (ends with the appropiate
\bslash{}end) where each item begins with \bslash{}bibcite\{Cite Key\}.


\end{slide}


\begin{slide}
\slideheading{Enumrators and List of Items}
\begin{enumerate}
\item It is very common to discuss algorithm as steps.
\item As you might think of, LaTeX give you tool for doing this.
\item The \bslash{}begin command is {\it \bslash{}begin\{enumerate\}}.
\item Each new item is created using {\it \bslash{}item}.
\item If you want just list without numbers - use {\it
\bslash{}begin\{itemize\}}.
\item Don't forget the right \bslash{}end command.
\end{enumerate}
\end{slide}


\begin{slide}
\slideheading{Article - Paragraphs and Page Format}

LaTeX ignores double spaces in the source .tex file. It assumes that when
you want double space you will use the right technique ($\sim$$\sim$ for
example).

In order to break line - \bslash{}\bslash{}.

A new paragraph starts when you have an empty line between the text. If
you want LaTeX to avoid indenting it, you can use the command
{\it \bslash{}noindent}.

\end{slide}


\begin{slide}
\slideheading{New Commands}
One can add commands (macros) to LaTeX or rewrite commands using the
command (before the document starts) - {\it \bslash{}newcommand\{\bslash
new command name\}\{What it does\}}. Note that the command can stand for
just putting a text. For example, the for example can be put as a macro:
\begin{verbatim}
\newcommand{\fe}{For Example}
\end{verbatim}

And once you use \bslash{}fe it will be replaced with ``For Example''.

To redefine a predefined command we use {\it \bslash{}renewcommand}.

Note that it is most wise to use \bslash{}mbox in defining macros (and new
commands containing text) due to LaTeX properties.

\end{slide}

\begin{slide}
\slideheading{New Commands (cont')}

One can also have newcommand with parameters:
\begin{verbatim}
\newcommand{\exp}[2]{\mbox{$#1^{#2}}}
\end{verbatim}

Will cuase \bslash{}exp\{2\}\{3\} to produce $2^{3}$.

\end{slide}



\begin{slide}
\slideheading{}

\end{slide}


\begin{slide}
\slideheading{}

\end{slide}


\begin{slide}
\slideheading{}

\end{slide}


\begin{slide}
\slideheading{}

\end{slide}


\begin{slide}
\slideheading{}

\end{slide}


\begin{slide}
\slideheading{}

\end{slide}


\begin{slide}
\slideheading{}

\end{slide}


\begin{slide}
\begin{thebibliography}{99}
\bibitem{1}{\it \LaTeX User's Guide \& Refernce Manual}, L. Lamport,
Addison Wesley, 1986.
\bibitem{2}{\it The Not So Short Introduction to \LaTeXe}, T. Oetiker et
al., {\sl http://ctan.tug.org/tex-archive/info/lshort/english/lshort.pdf}
\end{thebibliography}
\end{slide}
\end{document}

