\documentclass[a4paper, 11pt]{article}
\title{\LaTeX{} courses\\ Course 1 : Introduction}
\author{Isabelle HURBAIN \\ isabelle.hurbain@free.fr}
\begin{document}
\maketitle
\tableofcontents
\section{But what is \LaTeX{} anyway ?}
\LaTeX{} is a document preparation system. It allows you to create professional-looking documents without pain. The main idea of \LaTeX{} is that the author of the document concentrates on the content and not the form of the document. To achieve this, \LaTeX{} provides a set of macros and predefined styles.

Let's take a basic example. On a ``standard'' word-processing tool, to make a section title, most people use form-modifying commands. For example, they put it in Bold, Underlined, Size 16. With \LaTeX{}, the form of your document is independant of its content : your section title will be in a \verb+\section+ command and you let \LaTeX{} manage how it will be printed and diplayed.

You may ask : ``What's the big point ?'' Well, there are indeed at least three big points. The first is obviously that you don't have to remember what ``style'' you used for your previous sections, subsections, chapters and so on. The second is that when you decide that your section title font is too big, you don't have to change it in the whole document, you can do it with a single modification. The third is that, as the document is marked with sections, subsections and so on, it is much easier to do tables of contents - in fact, it can be done automagically.

The last point I'd like to underline is that \LaTeX{} is really fantastic to typeset mathematical formulaes. You can do things like
$$\sum_{i=0}^n i = \frac{n(n+1)}{2}$$
in a very short time. Even if this formula is really simple, you will soon see that once used, you cannot do without \LaTeX{} for scientific publishing ;-)

I hope that this very short introduction has given you the envy to continue, so let's go !

\section{What do I need to make \LaTeX{} ?}
\LaTeX{} is not, like most word-processors, WYSIWYG (What You See Is What You Get) (or, more frequently, WYSIMOLWYG, What You See Is More Or Less What You Get). You first write your \LaTeX{} source code, then you compile it into a \verb+.dvi+ file, which you can transform in \verb+.ps+ or \verb+.pdf+. There are also means to convert \LaTeX{} into HTML for example.

So what you need are basically : 
\begin{itemize}
\item a text editor - Emacs, Vi, TextPad, UltraEdit or whatever you like
\item a \LaTeX{} distribution. You can find te\TeX{} under Linux Debian, and there is a \TeX{}/\LaTeX{} distribution bundled with almost all Linux distribution. Under Windows, if you use Cygwin there is also a te\TeX{}; you can also find MiK\TeX{} and \TeX Live (I'm sorry for Mac users, I don't use Mac so you'll have to find a Mac distro yourself :P )
\item a \verb+.ps+ or a \verb+.pdf+ viewer (or both). There are numerous - the most famous are gv / Ghostview for \verb+.ps+ and Adobe Acrobat Reader for \verb+.pdf+.
\end{itemize}

All these things can be installed very easily - just do it the way you install any other program.

Once all is installed, let's write our first \LaTeX{} document.


\section{\LaTeX{} Hello World}
\subsection{The document}

We will look at a very simple document :
\begin{verbatim}
\documentclass[a4paper, 11pt]{article}
\title{My first \LaTeX{} Document}
\author{Isabelle HURBAIN}
\begin{document}
\maketitle
Hello, world !
\end{document}
\end{verbatim}

You can copy and past it into, for example, a new text file named "helloworld.tex".


\subsection{Compilation}
Save it, and compile it. To compile the file, just cd to the directory you saved it into and type
\begin{verbatim}
latex helloworld.tex
\end{verbatim}
in a console (or a command in Windows).

You should see some lines displaying, and three new files are created.
\begin{itemize}
\item The \verb+.dvi+ file is the output of the compilation - what you can view and print
\item The \verb+.aux+ file is an auxilliary file, which contains things like section numbers and figures numbers, so that it is possible to create a table of contents or a table of figures
\item The \verb+.log+ file is the file that logs all \LaTeX{} information - \LaTeX{} compilation messages and errors.
\end{itemize}

\subsection{Visualization}
Your \LaTeX{} distribution probably provides a way to visualize \verb+.dvi+ files - in te\TeX{} there is xdvi, in MiK\TeX{} there is YAP...

If you find a \verb+.dvi+ viewer, you can directly view the helloworld.dvi file. If not, you can use
\begin{verbatim}
dvips helloworld.dvi
\end{verbatim}
to get a ps file, or
\begin{verbatim}
dvipdfm helloworld.dvi
\end{verbatim}
to get a pdf file. (\verb+dvipdfm+ can be slightly different, you may also find \verb+dvipdf+ or others).

Nice isn't it ?

\subsection{Explanations}
Let's look a bit more at the code. As you can see, all the commands begin with a $\backslash$ ; $\backslash$ is a special character in \LaTeX{} that can be typed with \verb+$\backslash$+. The other special characters (\{, \}, \$, \%, \# and \_) can be obtained with \verb+\{, \}, \$, \%, \#+ and \verb+\_+. A \verb+\\+ breaks the line (but you should not use this much as we'll see later).

The first line,
\begin{verbatim}
\documentclass[a4paper, 11pt]{article}
\end{verbatim}
is very important. It tells \LaTeX{} several things. \verb+\documentclass{article}+ tells it to follow an article layout. There are other layouts, such as report, book, letter... which we will discover in this course.  The a4paper and 11pt in the square brackets are general parameters of the document. I will talk about it a bit further in these courses. They tell \LaTeX{} that the result will be printed onto A4 paper, with a text character size of 11 points. Of course, if you use letter paper, feel free to replace a4paper with letterpaper.

\begin{verbatim}
\title{My first \LaTeX{} Document}
\end{verbatim}
defines the title of the document, with a lovely \LaTeX{} symbol.

\begin{verbatim}
\author{Isabelle HURBAIN}
\end{verbatim}
defines the author of the document.

\begin{verbatim}
\begin{document}
\end{verbatim}
is the signal for \LaTeX{} that the real document begins. The lines before this line are called the preamble of the document.

\begin{verbatim}
\maketitle
\end{verbatim}
is a command to create a title from the information in the preamble (typically \verb+\title+ and \verb+\author+, eventually \verb+\date+).

After that, you can compose the document (here just ``Hello, world !''), and finish it by
\begin{verbatim}
\end{document}
\end{verbatim}

It is true that it seems a bit complicated for just that. However, look how simple it was to create the title...

\section{In the next course}
In the next course, we will learn how to create a real-world document, with titles and sections, and I will explain more deeply the form-content dissociation advantages.

\end{document}