%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Contents: Things you need to know
% File: things.tex (lshort2e.tex)
% Change: 16/11/94 (to)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
\section{Things You Need to Know}
\subsection{The Name of the Game}
\subsubsection{\TeX}
 
\TeX{} is a computer program by \index{Knuth, Donald E.}Donald
E.~Knuth~\cite{texbook}.  It is aimed at typesetting text and
mathematical formulae.

\TeX{} is pronounced ``Tech,'' with a ``ch'' as in the German word
``Ach'' or in Scottish ``Loch.'' In an |ASCII| environment \TeX{}
becomes |TeX|.

\subsubsection{\LaTeX}
 
\LaTeX{} is a macro package which enables authors to typeset and print
their work at the highest typographical quality, using a predefined,
professional layout. \LaTeX{} was originally written by
\index{Lamport, Leslie}Leslie Lamport~\cite{manual}. It uses the
\TeX{} formatter as its typesetting engine.

Recently the \LaTeX{} package has been updated by the
\index{LaTeX3@\LaTeX 3}\LaTeX 3 team, led by \index{Mittelbach,
  Frank}Frank Mittelbach, to include some long-requested improvements
and to reunify all the patched versions which have cropped up since
the release of \index{LaTeX 2.09@\LaTeX{} 2.09}\LaTeX{} 2.09 some
years ago. To distinguish the new version from the old, it is called
\index{LaTeX 2e@\LaTeXe}\LaTeXe. This documentation deals with
\LaTeXe.

\LaTeX{} is pronounced ``Lay-tech.'' If you refer to \LaTeX{}
in an |ASCII| environment you type |LaTeX|. \LaTeXe{} is pronounced
``Lay-tech two e'' and typed |LaTeX2e|.


\subsection{Basics}
 
\subsubsection{Author, Book Designer, and Typesetter}

To publish something, authors give their typed manuscript to a
publishing company. A book designer of the publishing company then
decides the layout of the document (column width, fonts, space before
and after headings,~\ldots). The book designer writes his instructions
into the manuscript and then gives it to a typesetter, who typesets the
book according to these instructions.

A human book designer tries to find out what the author had in mind
while writing the manuscript. He decides on chapter headings,
citations, examples, formulae, etc.\ based on his professional
knowledge and from the contents of the manuscript.

In a \LaTeX{} environment, \LaTeX{} takes the role of the book
designer and uses \TeX{} as its typesetter. But \LaTeX{} is ``only'' a
program and therefore needs more guidance. The author has to provide
additional information which describes the logical structure of his
work. This information is written into the text as ``\LaTeX{}
commands.''

This is quite different from the \wi{WYSIWYG}\footnote{What you see is
  what you get.} approach which most modern word processors such as
\emph{Word for Windows} or \emph{WordPerfect} take. With these
applications, authors specify the document layout interactively while
typing text into the computer. All along the way, they can see on the
screen how the final work will look when it is printed.

When using \LaTeX{} it is normally not possible to see the final output
while typing the text. But the final output can be previewed on the
screen after processing the file with \LaTeX. Then corrections can be
made before actually sending the document to the printer.

\subsubsection{Layout Design}

Typographical design is a craft. Unskilled authors often commit
serious formatting errors by assuming that book design is mostly a
question of aesthetics---``If a document looks good artistically
it is well designed.'' But as a document has to be read and not hung
up in a picture gallery, the readability and understandability is of
much greater importance than the beautiful look of it.
Examples: 
\begin{itemize}
\item The font size and numbering of headings have to be chosen to make
  the structure of chapters and sections clear to the reader.
\item The line length has to be short enough that it does not strain
  the eyes of the reader, while long enough to fill the page
  beautifully.
\end{itemize}

With \wi{WYSIWYG} systems, authors often generate aesthetically
pleasing documents with very little or inconsistent structure.
\LaTeX{} prevents such formatting errors by forcing the author to
declare the \emph{logical} structure of his document. \LaTeX{} then
chooses the most suitable layout.

\subsubsection{Advantages and Disadvantages}

A topic often discussed when people from the \wi{WYSIWYG} world meet
\LaTeX{} people, is ``the \wi{advantages of \LaTeX{}} over a normal word
processor'' or the opposite. 
The best thing you can do when such a discussion starts, is to keep a
low profile, as it often gets out of hand. But sometimes you cannot
escape \ldots

\medskip\noindent The main advantages of \LaTeX{} over normal word
processors are the following:

\begin{itemize}

\item Professionally crafted layouts are available which make a
  document really look as if ``printed.''
\item The typesetting of mathematical formulae is supported in a
  convenient way.
\item The user only needs to learn a few easy to understand commands,
  which specify the logical structure of a document. They {\tiny
    almost} never need to tinker with the actual layout of the
  document.
\item Even complex structures such as footnotes, references, table of
  contents, and bibliographies can be easily generated.
\item For many typographical tasks not directly supported by basic
  \LaTeX, there exist free add-on packages. For example, packages are
  available to include \textsc{PostScript} graphics or to typeset
  bibliographies conforming to exact standards. Many of these add-on
  packages are described in \companion.
\item \LaTeX{} encourages authors to write well structured texts
  because this is how \LaTeX{} works---by specifying structure.
\item \TeX, the formatting engine of \LaTeXe, is highly portable.
  Therefore the system runs on almost any hardware platform
  available.

%
% Add examples ...
%
\end{itemize}

\medskip

\noindent\LaTeX{} also has some disadvantages:

\begin{itemize}
\item More resources (memory, disk-space, computing power) are
  required to run a \LaTeX{} system than a simple word processor.  But
  things are getting better, as Word for Windows 6.0 needs even more
  disk space than a normal \LaTeX{} system. When it comes down to
  processor usage, \LaTeX{} beats any WYSIWYG system, as it only needs
  a lot of CPU time when a document is actually processed, while
  WYSIWYG packages hog the CPU all the time.
\item Although within a predefined document layout some parameters can
  be adjusted, the design of a whole new layout is difficult and takes
  a lot of time.\footnote{Rumour says, that this is one of the key
    elements which will be addressed in the upcoming \LaTeX 3
    system}\index{LaTeX3@\LaTeX 3}
\end{itemize}
 
\subsection{\LaTeX{} Input Files}

The input for \LaTeX{} is a plain |ASCII| text file. You can create it
with any text editor. It contains the text of the document as well as
the commands which tell \LaTeX{} how to typeset the text.

\subsubsection{Spaces}

``Whitespace'' characters such a blank or the carriage return are
treated uniformly as ``\wi{space}'' by \LaTeX{}. \emph{Several
  consecutive} \wi{whitespace} characters are treated as \emph{one}
``space.''  Whitespace at the start of a line is generally ignored.
\index{whitespace!at the start of a line}

An empty line between two lines of text defines the end of a
paragraph. \emph{Several} empty lines are treated the same as
\emph{one} empty line. The text below is an example. On the right hand
side is the text from the input file and on the left hand side is the
formatted output.

\begin{example}
It does not matter whether you
enter one or several     spaces
after a word.

An empty line starts a new 
paragraph.
\end{example}
 
\subsubsection{Special Characters}

The following symbols are \wi{reserved characters}, that either have a
special meaning under \LaTeX{} or are not available in all the fonts.
If you enter them in your text directly, they will normally not print,
but rather coerce \LaTeX{} to do things you did not intend. 
\begin{code}
\verb.$ & % # _ { }  ~  ^  \ . 
\end{code}

As you will see, these characters can be used in your documents all
the same by adding a prefix backslash:
\begin{example}
\$ \& \% \# \_ \{ \}
\end{example}

The other symbols and many more can be printed in mathematical
formulae or as accents with special commands.

\subsubsection{\LaTeX{} Commands}

\LaTeX{} \wi{commands} are case sensitive and take one of the following
two formats:

\begin{itemize}
\item They start with a \wi{backslash} |\| and then have a name
 consisting only of letters. Command names are terminated by a
 space, a number or a special character
\item They consist of a backslash and exactly one % numerical or
 special character.
\end{itemize}

%
% \\* doesn't complay !
%

%
% Can \3 be a valid command ? (jacoboni)
%

\LaTeX{} ignores whitespace after commands. If you want to get a
\index{whitespace!after commands}space after a command, you have to
put either |{}| and a blank or a special spacing command after the
command name.

\begin{example}
I read that Knuth divides the 
people working with \TeX{} into 
\TeX{}nicians and \TeX perts.\\
Today is \today.
\end{example}

Some commands need a \wi{parameter} which has to be given between
\wi{curly braces} |{ }| after the command name. Some commands support
\wi{optional parameters} which are added after the command name in
\wi{square brackets}~|[ ]|.

\begin{example}
You can \textsl{lean} on me!
\end{example}
\begin{example}
Please, start a new line
right here!\linebreak[3]
Thank you!
\end{example}

\subsubsection{Comments}
\index{comments}

When \LaTeX{} encounters a |%| character while processing an input file,
it ignores the rest of the present line. This is useful for adding
notes to the input file, which will not show up in the printed
version.

\begin{example}
This is an % stupid
% Better: instructive <----
example.
\end{example}
 
\subsubsection{Input File Structure}

When \LaTeXe{} processes an input file it expects it to follow a
certain \wi{structure}. Thus every input file must start with the
command
\begin{code}
|\documentclass{...}|
\end{code}
This specifies what sort of document you intend to write. After that,
you can include commands which influence the style of the whole
document or you can load \wi{package}s which add new
features to the \LaTeX{} system. To load such a package you use the
command
\begin{code}
|\usepackage{...}|
\end{code}
When all the setup work is done\footnote{The area between
  \texttt{\bs documentclass} and \texttt{\bs begin\{document\}} is called
  \emph{\wi{preamble}}.}, you start the body of the text with the
command

\begin{code}
|\begin{document}|
\end{code}

Now you enter the text mixed with some useful \LaTeX{} commands.  At
the end of the document you add the
\begin{code}
|\end{document}|
\end{code}
command, which tells \LaTeX{} to call it a day. Anything which
follows this command will be ignored by \LaTeX.

Figure~\ref{mini} shows the contents of a minimal \LaTeXe{} file. A
slightly more complicated \wi{input file} is given in
Figure~\ref{document}.

\begin{figure}[!bp]
\begin{lined}{6cm}
\begin{verbatim}
\documentclass{article}
\begin{document}
Small is beautiful.
\end{document}
\end{verbatim}
\end{lined}
\caption{A Minimal \LaTeX{} File} \label{mini}
\end{figure}
 
\begin{figure}[!bp]
\begin{lined}{10cm}
\begin{verbatim}
\documentclass[a4paper,11pt]{article}
\usepackage{latexsym}
\author{H.~Partl}
\title{Minimalism}
\frenchspacing
\begin{document}
\maketitle
\tableofcontents
\section{Start}
Well and here begins my lovely article.
\section{End}
\ldots{} and here it ends.
\end{document}
\end{verbatim}
\end{lined}
\caption{Example of a Realistic Journal Article} \label{document}
\end{figure}
 
\subsection{The Layout of the Document}
 
\subsubsection {Document Classes}\label{sec:documentclass}

The first information \LaTeX{} needs to know when processing an
input file is the type of document the author wants to create. This
is specified with the \ci{documentclass} command.
\begin{command}
\ci{documentclass}|[|\emph{options}|]{|\emph{class}|}|
\end{command}
\noindent Here \emph{class} specifies the type of document to be created.
Table~\ref{documentclasses} lists the document classes explained in
this introduction. The \LaTeXe{} distribution provides additional
classes for other documents including letters and slides.  The
\emph{\wi{option}s} parameter customises the behaviour of the document
class. The options have to be separated by commas. In
Table~\ref{options} the most common options for the standard document
classes are listed.


\begin{table}[!bp]
\caption{Document Classes} \label{documentclasses}
\begin{lined}{12cm}
\begin{description}
 
\item [|article|] for articles in scientific journals, presentations,
  short reports, program documentation, invitations, \ldots
  \index{article class}
\item [|report|] for longer reports containing several chapters, small
  books, PhD theses, \ldots \index{report class}
 
\item [|book|] for real books \index{book class}
\end{description}
\end{lined}
\end{table}

\begin{table}[!bp]
\caption{Document Class Options} \label{options}
\begin{lined}{12cm}
\begin{description}

\item[|10pt|, |11pt|, |12pt|] \quad Sets the size of the main font for the
 document. If no option is specified, 10\,pt is assumed.
 \index{document font size}\index{base font size}
\item[|a4paper|, |letterpaper|, \ldots] \quad Defines the papersize. The
  default size is |letterpaper|. Besides that, |a5paper|, |b5paper|,
  |executivepaper|, and |legalpaper| can be specified.  \index{legal paper}
  \index{paper size}\index{A4 paper}\index{letter paper} 
  \index{A5 paper}\index{B5 paper}\index{executive paper}
\item[|fleqn|] \quad Typesets displayed formulae left-aligned instead centered.

\item[|leqno|] \quad Places the numbering of formulae on the left hand
  side instead of the right.

\item[|titlepage|, |notitlepage|] \quad Specifies whether a new page
 should be started after the \wi{document title} or not. The |article|
 class does not start a new page by default, while |report| and
 |book| do.
 \index{title}
\item[|twocolumn|] \quad Instructs \LaTeX{} to typeset the document in
 \wi{two column}s.

\item[|twoside, oneside|] \quad Specifies whether double or single sided
 output should be generated. The classes |article| and |report| are
 \wi{single sided} and the |book| class is \wi{double sided} by default.

\item[|openright, openany|] \quad Makes chapters begin either only on
  right hand pages or on the next page available. This does not work
  with the |article| class, as it does not know chapters. The |report|
  class by default starts chapters on the next page available and the
  |book| class starts them on right hand pages.

\end{description}
\end{lined}
\end{table}

Example: The input file for this booklet starts with the line
\begin{code}
\ci{documentclass}|[11pt,twoside,a4paper]{article}|
\end{code}
it instructs \LaTeX{} to typeset the document as an \emph{article}
with a base fontsize of \emph{eleven points} and to produce a
layout suitable for \emph{double sided} printing.
\pagebreak[2]
\subsubsection{Packages}
\index{package} While writing your document, you will probably find
that there are some areas where basic \LaTeX{} cannot solve your
problem. If you want to include \wi{graphics}, \wi{coloured text} or
source code from a file into your document, you need to enhance the
capabilities of \LaTeX.  Such enhancements are called packages.
Packages are activated with the
\begin{command}
\ci{usepackage}|[|\emph{options}|]{|\emph{package}|}|
\end{command}
\noindent command. Where \emph{package} is the name of the package and
\emph{options} is a list of keywords which trigger special
features in the package. Some packages come with the \LaTeXe{} base
distribution (See Table~\ref{packages}). Others are provided
separately. You may find more information on the packages installed
at your site in your \guide. Many important packages are described
in \companion.

\begin{table}[!btp]
\caption{Some of the Packages Distributed with \LaTeX} \label{packages}
\begin{lined}{11cm}
\begin{description}
\item[|doc|] Allows the documentation of \LaTeX{} programs.\\
 Described in |doc.dtx| and in \companion.

\item[|exscale|] Provides scaled versions of the maths extension
 font.\\ 
 Described in |ltexscale.dtx|.

\item[|fontenc|] Specifies which \wi{font encoding} \LaTeX{} should
 use.\\ 
 Described in |ltoutenc.dtx|.

\item[|ifthen|] Provides commands of the form\\
`if\ldots then do\ldots otherwise do\ldots.'\\
Described in |ifthen.dtx| and \companion.

\item[|latexsym|] To access the \LaTeX{} symbol font, you should
 use the |latexsym| package. Described in |latexsym.dtx| and in
 \companion
 
\item[|makeidx|] Provides commands for producing
 indexes.  Described in section~ref{sec:indexing} and in \companion.

\item[|syntonly|] Processes a document without typesetting it.\\
 Described in |syntonly.dtx| and in \companion. This is useful for 
 quick error checking.

\item[|tracefnt|] Allows you to control how much information about
 \LaTeX's font loading is displayed.  Described in \companion.
\end{description}
\end{lined}
\end{table}

%
% Package Info pointer
%
%

\subsubsection{Page Styles}
 
\LaTeX{} supports three predefined \wi{header}/\wi{footer}
combinations---so-called \wi{page style}s. The \emph{style} parameter
of the \index{page style!plain@\texttt{plain}}\index{plain@\texttt{plain}}
\index{page style!headings@\texttt{headings}}\index{headings@texttt{headings}}
\index{page style!empty@\texttt{empty}}\index{empty@\texttt{empty}}
\begin{command}
\ci{pagestyle}|{|\emph{style}|}|
\end{command}
\noindent command defines which one to use. 
Table~\ref{pagestyle}
lists the predefined page styles.

\begin{table}[!bp]
\caption{The Predefined Page Styles of \LaTeX} \label{pagestyle}
\begin{lined}{8cm}
\begin{description}

\item[|plain|] prints the page numbers on the bottom of the page in
 the middle of the footer. This is the default page style.

\item[|headings|] prints the current chapter heading and the page
 number in the header on each page while the footer remains empty.

\item[|empty|] sets both the header and the footer to be empty.

\end{description}
\end{lined}
\end{table}

It is possible to change the page style of the current page
with the command
\begin{command}
\ci{thispagestyle}|{|\emph{style}|}|
\end{command}
In \companion{} there is a description how to create your own
headers and footers.

%
% Pointer to the Fancy headings Package description !
%


%
% Add Info on page-numbering, ...
% \pagenumbering

\endinput


%%% Local Variables: 
%%% mode: latex
%%% TeX-master: "lshort2e"
%%% End: 
