summaryrefslogtreecommitdiff
path: root/info/impatient/examples.tex
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
committerNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
commite0c6872cf40896c7be36b11dcc744620f10adf1d (patch)
tree60335e10d2f4354b0674ec22d7b53f0f8abee672 /info/impatient/examples.tex
Initial commit
Diffstat (limited to 'info/impatient/examples.tex')
-rw-r--r--info/impatient/examples.tex56
1 files changed, 56 insertions, 0 deletions
diff --git a/info/impatient/examples.tex b/info/impatient/examples.tex
new file mode 100644
index 0000000000..1b244362d6
--- /dev/null
+++ b/info/impatient/examples.tex
@@ -0,0 +1,56 @@
+% 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