summaryrefslogtreecommitdiff
path: root/info/tcdmanual/la_furth.tex
blob: a901d2732aad28129ddad83a0c92c97cefad5fa7 (plain)
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
336
337
338
339
\sectiontitle{Further Features of \LaTeX}
\label{la-furth}
\subsectiontitle{Producing Blank Space in \LaTeX}
To produce (horizontal) blank space within a paragraph, use
\verb?\hspace? and \verb?\hspace*?, followed by the length
of the blank space enclosed within curly brackets.  The length
of the skip should be expressed in a unit recognized by \TeX.
These recognized units are given in the following table:
\begin{quote}
\begin{tabular}{lll}
\verb?pt?  & point         & (1 in = 72.27 pt) \\
\verb?pc?  & pica          & (1 pc = 12 pt) \\
\verb?in?  & inch          & (1 in = 25.4 mm) \\
\verb?bp?  & big point     & (1 in = 72 bp) \\
\verb?cm?  & centimetre    & (1 cm = 10 mm) \\
\verb?mm?  & millimetre    & \\
\verb?dd?  & didot point   & (1157 dd = 1238 pt) \\
\verb?cc?  & cicero        & (1 cc = 12 dd) \\
\verb?sp?  & scaled point  & (65536 sp = 1 pt)
\end{tabular}
\end{quote}
Thus to produce a horizontal blank space of 20 mm in the middle
of a paragraph one would type \verb?\hspace{20 mm}? (or
\verb?\hspace*{20 mm}?.

   The difference between \verb?\hspace? and \verb?\hspace*?
is that if \TeX\ decides to break between lines at the point
where an \verb?\hspace? is specified, then the \verb?\hspace?
is ignored.  Using \verb?\hspace*? forces \TeX\ to produce a
horizontal space, whether of not \TeX\ breaks between lines.

To produce (vertical) blank space between paragraphs, use
\verb?\vspace? and \verb?\vspace*?, followed by the length
of the blank space enclosed within curly brackets.  A
\verb?\vspace? will be ignored if it comes at a
break between pages, whereas blank space will always be
produced by \verb?\vspace*?, whether or not there is a
page break.  Thus to obtain
\begin{quotation}
{\small This is the first paragraph of some text.  It is
separated from the second paragraph by a vertical skip of
10 millimetres.}

\vspace{10 mm}

{\small This is the second paragraph.}
\end{quotation}
one should type
\begin{quote}
\begin{verbatim}
This is the first paragraph of some text.  It is
separated from the second paragraph by a vertical skip of
10 millimetres.

\vspace{10 mm}

This is the second paragraph.
\end{verbatim}
\end{quote}

\subsectiontitle{Blank Spaces: Fine Tuning}
We describe certain features of \TeX\ relating to blank spaces
and paragraph indentation which will improve the appearance
of the final document.  Experienced users of \TeX\ will improve
the appearance of their documents if they bear these remarks in mind.

   First note that, as a general rule, you should never put
a blank space after a left parenthesis or before a right
parenthesis.  If you were to put a blank space in these
places, then you run the risk that \TeX\ might start a
new line immediately after the left parenthesis or before
the right parenthesis, leaving the parenthesis marooned at
the beginning or end of a line.

   \TeX\ has its own rules for deciding the lengths of blank
spaces.  For instance, \TeX\ will put an extra amount of space
after a full stop if it considers that the full stop marks the
end of a sentence.

\begin{quotation}
\footnotesize
The rule adopted by \TeX\ is to regard a period (full stop) as
the end of a sentence if it is preceded by a lowercase letter.
If the period is preceded by an uppercase letter then
\TeX\ assumes that it is not a full stop but follows the
initials of somebody's name.
\end{quotation}

   This works very well in most cases.  However
\TeX\ occasionally gets things wrong.  This happens with
a number of common abbreviations (as in `Mr.\ Smith' or
in `etc.'), and, in particular, in the names of
journals given in abbreviated form (e.g.,
`Proc.\ Amer.\ Math.\ Soc.').  The way to overcome this
problem is to put a backslash before the blank space in
question.  Thus we should type
\begin{quote}
\begin{verbatim}
Mr.\ Smith
etc.\ and
Proc.\ Amer.\ Math.\ Soc.
\end{verbatim}
\end{quote}

   \TeX\ determines itself how to break up a paragraph into
lines, and will occasionally hyphenate long words where this
is desirable. However it is sometimes necessary to tell
\TeX\ not to break at a particular blank space. The special
character used for this purpose is \verb?~?. It represents
a blank space at which \TeX\ is not allowed to break between
lines. It is often desirable to use \verb?~? in names where
the forenames are represented by initials. Thus to obtain
`W.~R.~Hamilton' it is best to type \verb?W.~R.~Hamilton?.
It is also desirable in phrases like `Example~7' and `the
length~$l$ of the rod', obtained by typing \verb?Example~7?
and \verb?the length~$l$ of the rod?. This feature of
\TeX\ may be safely ignored by beginners, though more
experienced \TeX nical typists should gradually accustom
themselves to using it occasionally where appropriate.

   \TeX\ will automatically indent paragraphs (with the
exception of the first paragraph of a new section).  One
can prevent \TeX\ from indenting a paragraph though by
beginning the paragraph with the control sequence
\verb?\noindent?.  Thus one obtains
\begin{quotation}
\small

\noindent
This is the beginning of a paragraph which is not
indented in the usual way.  This has been achieved
by placing an appropriate control sequence at the
beginning of the paragraph.

\end{quotation}
by typing
\begin{quote}
\begin{verbatim}

\noindent
This is the beginning of a paragraph which is not
indented in the usual way.  This has been achieved
by placing an appropriate control sequence at the
beginning of the paragraph.

\end{verbatim}
\end{quote}

Conversely, the control sequence \verb?\indent? forces
\TeX\ to indent the paragraph.

\subsectiontitle{The Preamble of the \LaTeX\ Input file}
   We describe the options available in \LaTeX\ for specifying
the overall style of a document.

Every \LaTeX\ document should begin with a \verb?\documentstyle?
command followed by the \verb?\begin{document}? command, and
must end with the \verb?\end{document}? command. A typical such
document is the following:
\begin{quote}
%% \begin{verbatim}
%% \documentstyle[tcda,12pt]{article}
\begin{verbatim}
\documentstyle[a4,12pt]{article}
\begin{document}

This is the first paragraph of a typical document. It is
produced in a `12~point' size. A {\it point} is a unit of
length used by printers. One point is approximately
$1/72$~inch. In a `12~point' font the height of the
parentheses is 12~points (i.e. about $1/6$~inch) and the
letter~`m' is about 12 points long. 

This is the second paragraph of the document. There are
also `10 point' and `11 point' styles available in \LaTeX.
The required size is specified in the `documentstyle'
command. If no such size is specified then the 10~point
size is assumed.

\end{document}
\end{verbatim}
\end{quote}

   The syntax of the \verb?\documentstyle? command is as
follows. The command begins with \verb?\documentstyle?
and ends with the names of one of the available styles,
enclosed in curly brackets. The available styles are
`{\tt article}', `{\tt report}', `{\tt book}' and
`{\tt letter}'. Between the ``\verb?\documentstyle?''
and the name of the document style, one may place a
list of {\it options}. These options are separated by
commas and the list of options is enclosed in square
brackets (as in the above example). The options
available (which are usually the names of certain
`style files') include the following:
\begin{description}
\item[11pt] Specifies a size of type known as
   {\it eleven-point}, which is ten percent larger than
   the ten-point type normally used.
\item[12pt] Specifies a twelve-point type size, which is
   twenty percent larger than ten-point.
%%\item[twoside] Formats the output for printing on both
%%   sides of the page.
\item[twocolumn] Produces two-column output.
%% \item[tcda] A (locally produced) `style file' which
\item[a4] A `style file' which
   ensures that the page is appropriately positioned
   on A4 size paper. It is recommended that most \LaTeX\
   documents produced on the LaserWriter in the School of
   Mathematics use this option.
%% \item[tcdh] A (locally produced) `style file' which
%%    ensures that the page is appropriately positioned on
%%    the headed notepaper of the T.C.D. School of Mathematics.
\end{description}

\begin{quotation}
\small
   Typing simply \verb?\documentstyle{article}? will produce a
document in ten-point type size. However the printed output
will not be nicely positioned on A4 paper, since the default
size is intended for a different (American) paper size.
\end{quotation}

   Pages will be automatically numbered at the bottom of the
page, unless you specify otherwise. This can be done using the
\verb?\pagestyle? command. This command should come after the
\verb?\documentstyle? command and before the
\verb?\begin{document}? command. This command has the
syntax \verb?\pagestyle{?{\it option}\verb?}?, where
the {\it option} is one of the following:
\begin{description}
\item[plain] The page number is at the foot of the page.
   This is the default page style for the {\tt article}
   and {\tt report} document styles.
\item[empty] No page number is printed.
\item[headings] The page number (and any other information
   determined by the document style) is put at the top of
   the page.
\item[myheadings] Similar to the {\bf headings} pagestyle,
   except that the material to go at the top of the
   page is determined by \verb?\markboth? and
   \verb?\markright? commands (see the \LaTeX\ manual).
\end{description}
For example, the input file
\begin{quote}
%% \begin{verbatim}
%% \documentstyle[tcda]{article}
\begin{verbatim}
\documentstyle[a4]{article}
\pagestyle{empty}
\begin{document}

The main body of the document is placed here.

\end{document}
\end{verbatim}
\end{quote}
produces a document without page numbers, using the
standard ten-point type size.

\newcommand{\inftyint}{\int_{-\infty}^{+\infty}}
\newcommand{\intwrtx}[1]{\int_{-\infty}^{+\infty} #1 \,dx}
\newcommand{\intwrt}[2]{\int_{-\infty}^{+\infty} #2 \,d #1}

\subsectiontitle{Defining your own Control Sequences in \LaTeX}
Suppose that we are producing a paper that makes frequent
use of some mathematical expression.  For example,
suppose that integrals like
\[ \int_{-\infty}^{+\infty} f(x)\,dx. \]
occur frequently throughout the text.  This formula is
obtained by typing
\begin{quote}
\begin{verbatim}
\[ \int_{-\infty}^{+\infty} f(x)\,dx. \]
\end{verbatim}
\end{quote}
It would be nice if we could type \verb?\inftyint? (say)
to obtain the integral sign at the beginning.  This can
be done using \verb?\newcommand?.  What we do is to place
a line with the command
\begin{quote}
\begin{verbatim}
\newcommand{\inftyint}{\int_{-\infty}^{+\infty}}
\end{verbatim}
\end{quote}
near the beginning of the input file (the best place being
after the \verb?\documentstyle? command but before the
\verb?\begin{document}? command).  Then we only have to
type
\begin{quote}
\begin{verbatim}
\[ \inftyint f(x)\,dx. \]
\end{verbatim}
\end{quote}
to obtain the above formula.

We can modify this procedure slightly.  Suppose that we
we defined a new control sequence \verb?\intwrtx? by
putting the line
\begin{quote}
\begin{verbatim}
\newcommand{\intwrtx}[1]{\int_{-\infty}^{+\infty} #1 \,dx}
\end{verbatim}
\end{quote}
at the beginning of the input file.  If we then type the line
\begin{quote}
\begin{verbatim}
\[ \intwrtx{f(x)}. \]
\end{verbatim}
\end{quote}
then we obtain
\[ \intwrtx{f(x)}. \]
What has happened is that the expression in curly brackets
after \verb?\intwrtx? has been substituted in the expression
defining \verb?\intwrtx?, replacing the \verb?#1? in that
expression.

   The number 1 inside square brackets in the
\verb?\newcommand? line defining \verb?\intwrtx? indicates
to \LaTeX\ that it is to expect one expression (in curly
brackets) after \verb?\intwrtx? to substitute for \verb?#1?
in the definition of \verb?\intwrtx?.  If we defined a
control sequence \verb?\intwrt? by
\begin{quote}
\begin{verbatim}
\newcommand{\intwrt}[2]{\int_{-\infty}^{+\infty} #2 \,d #1}
\end{verbatim}
\end{quote}
then it would expect two expressions to substitute in for
\verb?#1? and \verb?#2? in the  definition of \verb?\intwrt?.
Thus  if we then type
\begin{quote}
\begin{verbatim}
\[ \intwrt{y}{f(y)}. \]
\end{verbatim}
\end{quote}
we obtain
\[ \intwrt{y}{f(y)}. \]