\chapter{Introduction}\label{sec:intro}

This book is just an introduction: it tries to teach you enough
to get you started and explore \LaTeX{} further on your own, and
hopefully let you see the advantages of doing things the \LaTeX{}
way.

This chapter gives a bit of background.

\section{History}

\LaTeX{} is pretty old, and its roots are even older.

In 1977 Donald Knuth, a mathematician, started creating his
typesetting system \TeX{} as a tool for better typesetting,
expecially of mathematics. The first version of \TeX{} appeared in
1978. The second version, which was a complete rewrite, appeared in
1982.

The \TeX{} system is based on a markup language. Contrary to html,
another popular markup language, \TeX{} is designed for precision
typesetting of complex texts, and is also a macro programming
language.

In the early 1980s Leslie Lamport provided a set of macros
providing features such as automatic chapter- and section numbering,
footnotes and automatic cross-referencing.

\LaTeX{} allows authors to concentrate on the meaning and structure
of documents, rather on appearance. This is called \emph{structural
  markup}. If used well, structural markup makes for a faster, less
error-prone publishing process.

There are \LaTeX{} templates or classfiles for most uses of \TeX:
besides articles, reports and books, slides and letters are also
provided for. Most \TeX{} users started using the \LaTeX{} system
for their documents, adding their own stuff as needed, rather than
starting their own macro package from scratch.

\section{The \TeX/\LaTeX{} ecosystem}

\TeX{} and \LaTeX{} caught on, and a large ecosystem grew up around
it. Users around the world contributed macros, fonts, support for
non-Western languages, manuals and utilities. The vast majority is
free.

The \citetitle{ctan} archives are the main repository for \TeX-related
material, but quite possibly your \TeX{} installation already
contains everything you need, or provides an easy way to add the
missing pieces.

The sites of \TeX{} user groups such as \citeurl{tug} and
\citeurl{ntg} host various mailing lists and have links to other
\TeX- and \LaTeX-related sites. I maintain my own site
\citeurl{rugtex} about the RuG \TeX{} installation.

\section{Working with \LaTeX}

\LaTeX{} is not a wysywyg wordprocessor. Preparing a document with
\LaTeX{} is a three-step cycle:
\begin{enumerate}
\item Enter your text, with markup, in a text editor such as Notepad
  or \TS{} or Emacs.
\item `Compile' your document, \emph{i.e.} convert it to pdf; more
  on that later.
\item Preview it in a pdf viewer such as Adobe Reader or SumatraPDF
  or the pdf viewer built into the editor, if there is one.
\end{enumerate}

\nextblock
Below you see a marked-up source fragment at the left and two
typeset results at the right:

\exa
\begin{verbatim}
\subsection{Some mathematics}\label{math}

The econometric model is confronted with observed
data and the parameters are estimated by
econometric techniques, as shown in equation
\ref{eq:smm} below:
\begin{equation}
Y_t = G_1 (Y, X, \hat{\Theta}, \hat{U})
\label{eq:smm}
\end{equation}
\end{verbatim}
\exb
\includegraphics[width=\linewidth]{../samples/jj_math}

\vspace{\baselineskip}
\includegraphics[width=\linewidth]{../samples/jj_math2}
\exc
%
%\exa
%~
%\exb
%\includegraphics[width=\linewidth]{../samples/jj_math2}
%\exc

\nextblock
The difference in appearance is entirely due to changes in the
document header: you can set up the global layout once and for all,
and then just focus on the text itself.

\LaTeX{} excels at automatic numbering and cross-referencing; as
well as at other long-document features such as bibliographies and
indexing. This machinery works efficiently and reliably
whatever the size of the project.
