% This is part of the book TeX for the Impatient.
% Copyright (C) 2003 Paul W. Abrahams, Kathryn A. Hargreaves, Karl Berry.
% See file fdl.tex for copying conditions.

\input macros
\chapter{Examples}

\chapterdef{examples}

This section of the book contains a set of examples 
to help get you started and to show you how to do various things with \TeX.
Each example has \TeX\ output on the left-hand page and the \TeX \
input that led to that output on the right-hand page.
You can use these examples both as forms to imitate and
as a way of finding the
\TeX\ commands that you need in order to achieve a particular effect.
However, these examples can illustrate only a few of the
about $900$ \TeX\ commands.

Some of the examples are self-descriptive---that is, they discuss the very
features of \TeX\ that they are illustrating.  These discussions are
necessarily sketchy because there isn't room in the examples for all the
information you'd need.  The capsule summary of commands
(\chapterref{capsule})
and the index will help you
locate the complete explanation of every \TeX\ feature shown in the
examples.

Because we've designed the examples to illustrate 
many things at once, some examples contain a great variety of
typographical effects.  These examples generally are \emph{not} good
models of typographical practice.  For instance, Example~8 has some of its
equation numbers on the left and some on the right.  You'd never want to
do that in a real publication.

\xrdef{xmphead}
Each example except for the first one starts with a macro (see 
\xref{macro}) named |\xmpheader|.  We've used |\xmpheader| in order to
conserve space in the input, since without it each example would have
several lines of material you'd already seen.
|\xmpheader| produces the title of an example and the
extra space that goes with it.  You can see in the first example 
what |\xmpheader| does, so you can imitate it if you wish.
Except for |\xmpheader|, every command that we use in these examples is
defined in \plainTeX.

% The first example does the necessary eject here.
{%
   \let\bye = \relax % We don't want to obey \bye in the example input.
   % These switches can't be done by a macro since \bye is outer.
   \doexamples {xmptext}% Typeset the actual examples.
}%


\endchapter
\byebye

.
