1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
|
\sectiontitle{Producing Simple Documents using Plain \TeX}
\label{pl-text}
\subsectiontitle{Producing Ordinary Text using Plain \TeX}
To produce a simple document using Plain \TeX\ one should create
a \TeX\ input file. The input file should end with the
\verb?\bye? command, in order to tell \TeX\ when the end of the
file has been reached.
If one merely wishes to type in ordinary text, without
complicated mathematical formulae or special effects such
as font changes, then one merely has to type it in as it
is, leaving a completely blank line between successive
paragraphs. You do not have to worry about paragraph
indentation: \TeX\ will automatically indent all paragraphs
with the exception of the first paragraph of a new section
(unless you take special action to override the conventions
adopted by \TeX)
For example, suppose that we wish to create a document
containing the following paragraphs:
\begin{quotation}
\small
\noindent
If one merely wishes to type in ordinary text, without
complicated mathematical formulae or special effects such
as font changes, then one merely has to type it in as it
is, leaving a completely blank line between successive
paragraphs.
You do not have to worry about paragraph indentation:
all paragraphs will be indented with the exception of
the first paragraph of a new section.
One must take care to distinguish between the `left quote'
and the `right quote' on the computer terminal. Also, one
should use two `single quote' characters in succession if
one requires ``double quotes''. One should never use the
(undirected) `double quote' character on the computer
terminal, since the computer is unable to tell whether it
is a `left quote' or a `right quote'. One also has to
take care with dashes: a single dash is used for
hyphenation, whereas three dashes in succession are required
to produce a dash of the sort used for punctuation---such as
the one used in this sentence.
\end{quotation}
To create this document using Plain \TeX\ we use the following
input file:
\begin{quote}
\begin{verbatim}
If one merely wishes to type in ordinary text, without
complicated mathematical formulae or special effects such
as font changes, then one merely has to type it in as it
is, leaving a completely blank line between successive
paragraphs.
You do not have to worry about paragraph indentation:
all paragraphs will be indented with the exception of
the first paragraph of a new section.
One must take care to distinguish between the `left quote'
and the `right quote' on the computer terminal. Also, one
should use two `single quote' characters in succession if
one requires ``double quotes''. One should never use the
(undirected) `double quote' character on the computer
terminal, since the computer is unable to tell whether it
is a `left quote' or a `right quote'. One also has to
take care with dashes: a single dash is used for
hyphenation, whereas three dashes in succession are required
to produce a dash of the sort used for punctuation---such as
the one used in this sentence.
\bye
\end{verbatim}
\end{quote}
Having created the input file, one then has to run it
through the \TeX\ program and then print it out the
resulting output file (known as a `DVI' file).
\subsectiontitle{Blank Spaces and Carriage Returns in the Input File}
\TeX\ treats the carriage return at the end of a line
as though it were a blank space. Similarly \TeX\ treats
tab characters as blank spaces. Moreover, \TeX\ regards
a sequence of blank spaces as though it were a single
space, and similarly it will ignore blank spaces at the
beginning or end of a line in the input file. Thus, for
example, if we type
\begin{quote}
\begin{verbatim}
This is
a
silly
example of a
file with many spaces.
This is the beginning
of a new paragraph.
\end{verbatim}
\end{quote}
then we obtain
\begin{quotation}
\small
This is
a
silly
example of a
file with many spaces.
This is the beginning
of a new paragraph.
\end{quotation}
It follows immediately from this that one will obtain
the same results whether one types one space or two spaces
after a full stop: \TeX\ does not distinguish between the
two cases.
Any spaces which follow a control sequence will be ignored
by \TeX.
\begin{quotation}
\footnotesize
If you really need a blank space in the final document
following whatever is produced by the control sequence,
then you must precede this blank by a
{\it backslash} \verb?\?. Thus in order to obtain the
sentence
\begin{quotation}
\TeX\ is a very powerful computer typesetting program.
\end{quotation}
we must type
\begin{quote}
\begin{verbatim}
\TeX\ is a very powerful computer typesetting program.
\end{verbatim}
\end{quote}
(Here the control sequence \verb?\TeX? is used to produce
the \TeX\ logo.)
In general, preceding a blank space by a backslash
forces \TeX\ to include the blank space in the final
document.
\end{quotation}
\subsectiontitle{Quotation Marks}
Single left and right quotation marks are produced by
\verb?`? and \verb?'? respectively. Double left and right quotation
marks are produced by \verb?``? and \verb?''? respectively. Thus
\begin{quotation}
\small
``What did you do yesterday?'' he asked.
\end{quotation}
is produced by typing
\begin{quote}
\begin{verbatim}
``What did you do yesterday?'' he asked.
\end{verbatim}
\end{quote}
You should never use the character \verb?"? to produce
quotation marks. This is because \TeX\ has no way of
knowing whether you want a left quote or a right quote if
you do this.
\begin{quotation}
\footnotesize
You can use the control sequences \verb?\lq? and
\verb?\rq? in place of \verb?`? and \verb?'?. This
is useful if your keyboard does not have a \verb?`?
character.
\end{quotation}
\begin{quotation}
\footnotesize
Sometimes you need two quotation marks following
one another, as in
\begin{quotation}
``I regard computer typesetting as being reasonably
`straightforward'\thinspace'' he said.
\end{quotation}
The way to do this is to use the control sequence
\verb?\thinspace? between the quotation marks. Thus one
would type
\begin{quote}
\begin{verbatim}
``I regard computer typesetting as being reasonably
`straightforward'\,'' he said.
\end{verbatim}
\end{quote}
However this problem arises very rarely.
\end{quotation}
\def\beginsection#1\par{\bigskip{\bf #1}\nobreak
\smallskip\vskip-\parskip\noindent}
\subsectiontitle{Section Headings in Plain \TeX}
The control sequence \verb?\beginsection? is used in
Plain \TeX\ to produce a section heading, printed in a
boldface typestyle. This control sequence should be
followed by the title of the section, and this should
then be followed by a blank line. Thus if we type
\begin{quote}
\begin{verbatim}
\beginsection
Section Headings
In this section, we describe how to obtain section
headings, printed in a boldface font.
\end{verbatim}
\end{quote}
then we obtain
\begin{quotation}
\small
\beginsection
Section Headings
In this section, we describe how to obtain section
headings, printed in a boldface font.
\end{quotation}
\subsectiontitle{Dashes}
\TeX\ allows you to produce dashes of various length. Typing
\verb?-? by itself produces a hyphen, as in `double-quote'.
Typing \verb?--? produces a dash suitable for denoting a
range of numbers, as in the phrase `on pages 155--159',
produced by typing
\begin{quote}
\begin{verbatim}
on pages 155--159.
\end{verbatim}
\end{quote}
Finally, typing \verb?---? produces a punctuation dash---this
is a dash such as the one in this sentence.
\subsectiontitle{Changing Fonts}
Fonts are changed using the control sequences \verb?\rm?,
\verb?\sl?, \verb?\it?, \verb?\tt? and \verb?\bf?.
\begin{quote}
\begin{tabular}{ll}
\verb?\rm? changes to the normal ``roman'' font: & \rm Roman\\
\verb?\sl? changes to a slanted roman font: & \sl Slanted\\
\verb?\it? changes to an italic font: & \it Italic\\
\verb?\tt? changes to an ``typewriter'' font: & \tt Typewriter\\
\verb?\bf? changes to a boldface font: & \bf Boldface
\end{tabular}
\end{quote}
It is best to use the special characters \verb?{? and
\verb?}? when changing fonts. One encloses the text whose
font is to be changed within these curly brackets and places
the font-changing control sequence immediately after the
opening bracket~\verb?{?. Thus the text
\begin{quotation}
\small
In this sentence we have {\it italicized\/} a few words, set
others in {\sl slanting type\/} or {\bf boldface type}, and
typeset others using a {\tt `typewriter' font in which all
the letters have a fixed width}.
\end{quotation}
is produced by typing
\begin{quote}
\begin{verbatim}
In this sentence we have {\it italicized\/} a few words, set
others in {\sl slanting type\/} or {\bf boldface type}, and
typeset others using a {\tt `typewriter' font in which all
the letters have a fixed width}.
\end{verbatim}
\end{quote}
\begin{quotation}
\footnotesize
The control sequence \verb?\/? produces the so-called
{\it italic correction}. The use of this is recommended when
changing back from an {\it italic\/} or {\sl slanted\/}
font into a {\rm roman} or {\bf boldface} font, in order to
produce extra space to compensate for the way in which some
{\it italic\/} and {\sl slanted\/} letters lean into the
following blank space. However this italic correction should
not be used before a comma or a full stop.
\end{quotation}
\subsectiontitle{Accents and other Symbols used in Text}
There are a variety of control sequences for producing accents.
For example, the control sequence \verb?\'{o}? produces an
acute accent on the letter~\verb?o?. Thus typing
\begin{quote}
\begin{verbatim}
Se\'{a}n \'{O} Cinn\'{e}ide.
\end{verbatim}
\end{quote}
produces
\begin{quotation}
\small
Se\'{a}n \'{O} Cinn\'{e}ide.
\end{quotation}
Similarly we use the control sequence \verb?\`? to
produce the grave accent in `alg\`{e}bre' and we use
\verb?\"? to produce the umlaut in `Universit\"{a}t'.
A list of the accents provided by \TeX\ is given in
Appendix~\ref{pl-txtcs}.
The control sequences \verb?\i? and \verb?\j? produce
dotless $i$ and $j$. These are required when placing an
accent on the letter. Thus \={\i} is produced by typing
\verb?\={\i}?. There are also control sequences for
ligatures and other special symbols used within text. These are
listed in Appendix~\ref{pl-txtcs}.
\subsectiontitle{Special Characters}
The characters
\begin{quote}
\begin{verbatim}
# $ % & \ ^ _ { } ~
\end{verbatim}
\end{quote}
have special purposes within \TeX. Thus they cannot be produced
in the final document simply by typing them directly. On the
rare occasions when one needs to use the special characters
\begin{quote}
\#\ \$\ \%\ \&\ \_\ \{\ \}
\end{quote}
in the final document, they can be produced by typing the control
sequences
\begin{quote}
\begin{verbatim}
\# \$ \% \& \_ \{ \}
\end{verbatim}
\end{quote}
respectively. However, somewhat more ingenuity is required to
produce \verb?\?, \verb?^? and \verb?~?.
|