summaryrefslogtreecommitdiff
path: root/usergrps/uktug/baskervi/5_1/bailey.tex
blob: e736d041c38a4cc89c97a6b38d2e2ebf0bc0a1e0 (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
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
\def\Cite#1{[\cite{#1}]}
%%%
%%% An article for Baskerville, intended to be the third of n parts
%%%
\title[Maths in \LaTeX: Part~3]{Maths in \LaTeX: Part~3, Different Sorts of Mathematical Object}
\author[R. A. Bailey]{R.~A.~Bailey\\
Queen Mary and Westfield College, University of London}
\newcommand{\writer}[1]{{#1}:}
\newcommand{\book}[1]{{\it #1},}
\newcommand{\publish}[2]{{\rm #1, #2,}}
\newcommand{\byear}[1]{{\rm (#1).}}
\newtheorem{preqn}{Exercise}
\newenvironment{qn}{\begin{preqn}\normalfont\rm}{\end{preqn}}
%%% Dear Mr Editor, I should like the content of exercises
%%% to come out in what all copy-editors call ROMAN, not in what
%%% Frank Mittelbach calls roman. And this should be irrespective
%%% of the surrounding text.
%%%
\newcommand{\latexword}[1]{{\normalfont\tt #1}}
\newcommand{\lamport}{{\it \LaTeX: A Document Preparation System\/} by Leslie 
Lamport}
\newcommand{\shortlamp}{{\it The Manual}}
%%%

\begin{Article}
\section{Recall}
This is the third in a sequence of tutorials on typesetting Mathematics in 
\LaTeX. The first two appeared in issues~4.4 and~4.5 of \BV. The series
includes some things which can be found in \Cite{leslie}, but I am 
working in more things which, while straightforward and necessary for 
Mathematical work, are  not in \Cite{leslie} or \Cite{newleslie}.
In case you missed the first two
tutorials, two warnings are now repeated.

I expect you, the reader, to do some work. Every so 
often comes a group of exercises, which you are supposed to do. Use \LaTeX\ to 
typeset everything in the exercise except sentences in italics, which are 
instructions. If you are not satisfied that you can do the exercise, then tell 
me. Either write
to me 
at
\begin{verse}
School of Mathematical Sciences\\
Queen Mary and Westfield College\\
Mile End Road\\
London E1 4NS
\end{verse}
with hard copy of your input and output, 
or email me at \mbox{\tt r.a.bailey@qmw.ac.uk}
with a copy of the 
smallest possible piece of \LaTeX\ input file that contains your
attempt at the answer.
In either case
I will include a solution in the following issue of \BV: you will remain 
anonymous if you wish.

A word on the controversial issue of fonts. 
Fonts in Mathematics are handled differently in \LaTeX\ 2.09, 
in NFSS, and in the new standard \LaTeX, \LaTeXe. 
Rather than compare these systems every time that I mention fonts, I 
usually limit myself to \LaTeX\ 2.09. 
When you upgrade to \LaTeXe, all these commands will still work, so long as 
you use the standard styles \latexword{article}, \latexword{report} and 
\latexword{book}. In the `Answers' section below I expand a little on the 
dangers of using the font-changing commands given in 
[\cite[Section~3.1]{newleslie}].

Many of the more complicated Mathematical things in this tutorial are
not documented in \Cite{leslie} or in \Cite{newleslie}. The
\LaTeX\ team warns me that they feel no obligation to support commands
that are not in \Cite{newleslie}, so there is a danger that some of
these things may change.  However, everything given here works, in
both \LaTeX\ 2.09 and in \LaTeXe, as at January 1995.

Some of the tricks described in this tutorial are at the edge of what you can 
conveniently do without using the \latexword{amstex} package. That package is 
undergoing change at the moment: I hope that by the time I reach the end of 
this sequence of tutorials the \latexword{amstex}
 package will have stabilized enough for someone
to write an article explaining how to use it, including giving better methods 
than I can give here.

\section{Answers}
I promised to answer all questions arising from this series of articles (as far
as I can).

\subsection{Uneven subscripts}
In \BV~4.5 Malcolm Clark asks about uneven baselines in subscripts. He gives a 
method of ensuring that all subscripts have the same baseline. I think that 
many Mathematical writers will not require that; nonetheless, some of us are 
uncomfortable with the unevenness in a single term such as
\[
4z_1z_2^3
\]
The easy way around this is to put a dummy superscript on the $z_1$, because 
it is the superscript on the $z_2$ that is pushing the $2$ down: thus
\begin{quote}
\verb+4 z_1^{} z_2^3+ \qquad $4 z_1^{} z_2^3$.
\end{quote}

\subsection{Roman text in notation}
He also muses on whether to use \verb+\textrm+ or \verb+\mathrm+ or \verb+\rm+ 
in subscripts, if you are using \LaTeXe. My advice is never to use 
\verb+\textrm+ in
Mathematical notation.  In the first place, \verb+\textrm+ does {\em not\/} 
give you roman type, according to such expert references as 
\Cite{hart,chamb,chicago}, all of whom say that `roman' type is upright, as 
opposed to italic. All that \verb+\textrm+ does is give you back serifs and 
proportional spacing, if you had turned them off. Perhaps he meant 
\verb+\textup+. But, secondly, I don't think that you should use {\em any\/}
of the commands \verb+\text...+ in Mathematical notation, because their effect 
depends on the surrounding text font but notation should be independent of the 
surrounding text. For example, try the following and compare the output:
\begin{verbatim}
{\rm $x_{\textup{big}} + \textup{size}_3$}
{\bf $x_{\textup{big}} + \textup{size}_3$}
{\bf $x_{\textrm{big}} + \textrm{size}_3$}
\end{verbatim}

%{\rm $x_{\textup{big}} + \textup{size}_3$}
%{\bf $x_{\textup{big}} + \textup{size}_3$}
%{\bf $x_{\textrm{big}} + \textrm{size}_3$}


Malcolm was concerned because he wanted to obey the instruction in 
\Cite{companion} to always use commands like \verb+\textit{...}+ rather than 
switches like \verb+\it+. The trouble with that instruction is
%In fact, I disagree quite strongly with the suggestion in \Cite{companion} that
%we should refrain from using commands like \verb+\rm+.  
that the new commands 
\verb+\text...+ all work in a relative way. In my experience of writing 
(a lot of) 
Mathematics I have {\em never\/} needed such a relative change. I always need 
to specify my fonts absolutely, so that, say, the font chosen for long names of
variables to be analysed does not change as the surrounding text font changes. 
Of course, it is sensible to do this with a macro such as \verb+\variablename+;
but that macro needs to call something with a syntax similar to 
\verb+\textsl{...}+ but which makes an absolute font change. I tried to 
persuade the \LaTeX\ team to include commands like \verb+\basesl{...}+, 
\verb+\basett{...}+ for such absolute changes, but I failed. Since the team 
wants to reserve the right to remove switches like \verb+\tt+ at some future 
time, this means that most of us will have to write our own macros, with our 
own idiosyncratic names, something like the following:
\begin{verbatim}
\DeclareTextFontCommand{\basett}%
     {\normalfont\ttfamily}
\end{verbatim}
%\newcommand{\basett}[1]%
%   {{\normalfont\ttfamily #1}}
 

\subsection{Spaces in subscripts}
Malcolm also asked how to get spaces into subscripts.
If I need to put a verbal phrase in a subscript then I use \verb+\rm+ and put 
in the interword spaces by hand.
\begin{quote}
\begin{tabular}{c}
\verb+\sum_{p{\rm\ is\ prime}} \frac{1}{p}+\\[\jot]
$\displaystyle\sum_{p{\rm\ is\ prime}} \frac{1}{p}$
\end{tabular}
\end{quote}

\subsection{Empty set}
Kathleen Lyle has queried the symbol I gave last time for the empty set, with 
the command \verb+\emptyset+. She points out that \Cite{companion} shows a 
different symbol given by this command, a symbol which looks like a circle with 
a diagonal line through it and  which is much closer to a 
Mathematician's idea of the empty set than is~$\emptyset$. But \Cite{companion}
also gives the command \verb+\varnothing+, available with the package 
\latexword{amssymb}, which produces the symbol~$\emptyset$. 
It appears that Knuth made a mistake in using the name \verb+\emptyset+ for the
glyph which most of us think of as a variant form of zero. To correct this 
mistake, the AMS has redefined the command \verb+\emptyset+ to 
produce the symbol more like the empty set and given us \verb+\varnothing+ for 
the sake of those authors who really do want a zero with a line through it.
It is a pity that \Cite{companion} does not say that its 
\verb+\emptyset+ is the AMS one rather than the Knuth one.

What to do when a software author makes a mistake like this is a controversial 
question. Personally,
much as I prefer the AMS's empty set, I deplore such redefinition of a command,
 because it 
destroys portability of documents. Suppose that I write a document without the 
\latexword{amssymb} package and use \verb+\emptyset+. I may send this document 
to someone (perhaps the AMS itself\/) who always uses the \latexword{amssymb} 
package when compiling documents. Even though I have made no explicit calls to 
commands defined by the package, my empty sets will come out looking different.
A topologist may be content with the change; a computer scientist may not. In 
either case the document is printed with different symbols in the two cases, 
and this really should not happen. I think that it would have been better if 
the AMS had used a different name, such as \verb+\trueemptyset+, for their empty
set: then authors with access to the \latexword{amssymb} package could choose 
whether or not to include
\begin{verbatim}
\renewcommmand{\emptyset}{\trueemptyset}
\end{verbatim}
at the start of their files.

\addtocounter{section}{2}
\section{A Spaced-out Interlude}
\subsection{Quads}
Traditionally, there are certain lengths of space (depending on the type size) 
which are always used in certain places in Mathematical typesetting. The most 
useful are the {\it quad\/} space and the two-quad space. When I was a
copy-editor  I used to just put the marks for these two types of space in the 
appropriate places in the copy; I did not have to know how big they were. 
Neither do you. In displayed Maths, use \verb+\qquad+ to obtain a two-quad 
space between a formula and a short verbal condition or justification. 
\begin{verbatim}
y \in Y \qquad\mbox{by defintion of~$Y$}
\end{verbatim}
If there
are two short formulas linked in a display by a short verbal phrase (perhaps 
only one word) use \verb+\quad+ to produce a quad space on either side of the 
phrase.
\begin{verbatim}
A \subseteq B \quad\mbox{and}\quad A \ne B
\end{verbatim}

\subsection{Other Spaces}
A sequence of much smaller horizontal spaces that you can insert yourself is, 
in increasing order of magnitude,
\begin{quote}
\verb+\,+ \quad \verb+\:+ \quad \verb+\;+ \quad \verb*+\ + 
\end{quote}
%\begin{quote}
%a \thinspace b \medspace c \thickspace d
%rubbish, the last two don't exist
%\end{quote}
They are called {\it thin space}, {\it medium space}, {\it thick space\/} and 
{\it interword space\/} respectively; their size also depends on the current 
type size.
The thin space is usually needed after the \verb+!+ in factorials and often 
needed after a square root.
\begin{quote}
\begin{tabular}{cc}
\verb+\sqrt{3} \, a+ & $\sqrt{3} \, a$\\
\verb+5!\,4!+ & $5!\,4!$
\end{tabular}
\end{quote}
It is also used before each $dx$~term in an integral. On the other hand, in 
multiple integrals the integral signs may be too far apart, in which case the 
{\it negative\/} thin space \verb+\!+ should be inserted between them.

For consistency, these adjustments should all be made via macros. For example,
\begin{verbatim}
\newcommand{\sqrtsp}[1]{\sqrt{#1}\,}
\end{verbatim}
will make \verb+\sqrtsp+ into the command for a square root with a little extra
space, and a macro for factorials can be made similarly. For the integral signs
you can use
\begin{verbatim}
\newcommand{\intt}{\int\!}
\end{verbatim}
or the rather different solution provided in \latexword{amstex}. A suitable 
macro for the $dx$ is
\begin{verbatim}
\newcommand{\diff}[1]{\, d #1}
\end{verbatim}
which has the added advantage that if you believe that only variables should be
in Maths italic then the \verb+{\, d #1}+ can be changed to 
\verb+{\, {\rm d} #1}+.

%These adjustments are all rather finicky, and should usually be left until the 
%document is almost complete.

\subsection{Phantoms}
The useful command \verb+\phantom+ allows you to leave a space whose horizontal
and vertical dimensions are those of its argument. For example, if you want to 
define the notation $[\phantom{x}]$ as the least-integer function without 
specifying a dummy variable, you can type \verb+[\phantom{x}]+. 

All digits are the same width, so \verb+\phantom{0}+ produces a phantom digit. 
It is very useful in tables of data when all other methods of alignment fail.
Make yourself a macro for it.

There are also horizontal and vertical phantoms \verb+\hphantom+ and 
\verb+\vphantom+ respectively. Each of these measures only one dimension of its
argument.

\subsection{Horizontal Expanders}
In the first tutorial we saw that \verb+\widehat+ and \verb+\widetilde+ expand 
as far as necessary (up to a given upper bound) to cover their arguments. The 
following commands also expand horizontally to match the arguments:
\begin{quote}
\begin{tabular}{cc}
\verb+\overline+ & \verb+\underline+\\
\verb+\overrightarrow+ & \verb+\overleftarrow+\\
\verb+\overbrace+ & \verb+\underbrace+
\end{tabular}
\end{quote}
You can use a superscript to put a label on an overbrace, and a subscript with 
an underbrace.
\begin{verbatim}
n\bar{y}^2 + 
\overbrace{(y_1-\bar{y})^2 + \cdots +
(y_n-\bar{y})^2}^{\rm sum\ of\ squares}
\end{verbatim}
\[
n\bar{y}^2 + 
\overbrace{(y_1 - \bar{y})^2 + \cdots + (y_n - \bar{y})^2}^{\rm sum\ 
of\ squares}
\]

\section{Exercises}
\addtocounter{preqn}{22}
\begin{qn}
\[(x_1 + x_2)^3 = x_1^3 + 3x_1^2x^{}_2 + 3x_1^{}x_2^{2} + x_2^3\]
\end{qn}

\begin{qn}
\[\sum_{n\ {\rm divides}\ 10} n = 18\]
\end{qn}

\begin{qn}
In geometry, $\overrightarrow{AB} + \overrightarrow{BC} = \overrightarrow{AC}$.
\end{qn}

\begin{qn}
We define $P_g$ by 
\[t(vP_g) = (t^{g^{-1}})v \qquad\mbox{for $v\in {\bf R}^{\cal T}$.}\]
\end{qn}

\begin{qn}
\[
2^a \times 2^b = \underbrace{2 \times \cdots \times 2}_{a\ \rm factors} \times
                 \underbrace{2 \times \cdots \times 2}_{b\ \rm factors} 
        = 2^{a+b}.
\]
\end{qn}

\begin{qn}
An inner product $\langle\phantom{\chi},\phantom{\chi}\rangle$ is defined 
on~$G^*$ by
\[
\langle\theta,\phi\rangle = \frac{1}{|G|}\sum_{g\in G} \theta(g) 
\overline{\phi}(g).
\]
\end{qn}


\begin{qn}
If~ $\overline{\phantom{\chi}}$ denotes complex conjugation, then
\[
\overline{\xi + \zeta} = \overline{\xi} + \overline{\zeta}\quad\mbox{and}\quad
\overline{\xi\zeta} = \overline{\xi}\,\overline{\zeta}.
\]
\end{qn}

\begin{qn}
\[ \int \! \int \phi(r, \theta) \, dr \, d\theta \]
\end{qn}

\begin{qn}
\[
{}^6 C_2 = \frac{6!}{4!\,2!}
\]
\end{qn}


\section{Operators and relations}
\subsection{Limits}
In the second tutorial I introduced various things that could have their 
limits, or ranges, typed in as sub- and super-scripts: standard functions with 
English names, like \verb+\log+; repeated binary operators, like \verb+\sum+;
and the integral sign \verb+\int+. \TeX\ thinks of all of these as 
\latexword{operator}s. Some operators have the limits set above and 
below in dispayed Maths, but to the right in text; others always have their 
limits set to the right. You can override these defaults by using one of the 
commands \verb+\limits+, \verb+\nolimits+, \verb+\displaylimits+ after the 
name of the operator. The integral sign normally has its limits set to the 
right: if you want them set above and below type \verb+\int\limits+. 
\[
\begin{tabular}{cc}
\verb+\int_0^2 x^3 \, dx=4+ &
$\int_0^2 x^3 \, dx = 4$\\[\jot]
\verb+\int\limits_0^2 x^3 \, dx=4+ &
$\int\limits_0^2 x^3 \, dx = 4$
\end{tabular}
\]
If you want 
the limits to be above and below if the operator happens to be in displayed 
Maths, but to the right otherwise, use \verb+\displaylimits+ instead of 
\verb+\limits+. Finally, to ensure that the limits always come to the right, 
use \verb+\nolimits+.

If you want to change the size of the operator as well as the position of its 
limits, you probably need to see the section on styles below.

\subsection{Operators}
The standard functions with English names already provided by \TeX\ cannot be 
enough for the whole of Mathematics. You make new ones by using \verb+\mathop+,
usually inside a \verb+\newcommand+. For example,
\begin{verbatim}
\newcommand{\var}{\mathop{\rm Var}\nolimits}
\var X \geq 0
\end{verbatim}
\newcommand{\var}{\mathop{\rm Var}\nolimits}
\[\var X \geq 0\]
(If you have \LaTeXe, you may feel safer using \verb+{\mathrm{Var}}+ in place of
\verb+{\rm Var}+.)
You may put one of \verb+\limits+, \verb+\nolimits+,
\verb+\displaylimits+
after the contents of the \latexword{mathop}, to specify how sub- and 
super-scripts should behave. Putting nothing is equivalent to putting 
\verb+\displaylimits+.

There is a school of thought that all operators should be in the same font, so 
that the \verb+\rm+ in the definition of \verb+\var+ should be replaced by a 
command like \verb+\operatorfont+, which would, of course, be defined in the 
style file or in the preamble to the document. I do not agree with this. It is 
not at all unusal to use bold for the expectation operator while retaining 
roman for the variance.

If you make a single letter into an \latexword{operator}, it will be vertically 
centred, which may not be what you intend:
\begin{verbatim}
\newcommand{\ee}{\mathop{\rm E}\nolimits}
\[\ee X + \ee Y = \ee(X+Y)\]
\end{verbatim}
\newcommand{\ee}{\mathop{\rm E}\nolimits}
\[\ee X + \ee Y = \ee(X+Y)\]
To override this, put the single letter in a box:
\begin{verbatim}
...\mathop{\mbox{\rm E}}...
\end{verbatim}

\subsection{Novel uses of operators}
In the first tutorial I said that you did not need to think of the 
symbol~\verb+'+ as a superscript. Usually you do not, but \TeX\ always does, so
you occasionally get unexpected results. You might want to write
$\mathop{\sum\nolimits'}$ for a variant of the usual summation, perhaps to 
indicate omission of all~$i$ for which $\lambda_i=0$, as in
\[\mathop{\sum\nolimits'}_{i=1}^n \frac{1}{\lambda_i} P_i.\] 
If you use \verb+\sum'+ it will come out as
\[\sum'\]
in display,
%\[\sum'_{0}^{m}\]
and even worse things happen when you try to put limits on. Writing
\verb+\sum\nolimits'+
cures the problem about placing the dash, but then you no longer have an 
\latexword{operator} to put limits on. So you need to make the whole of 
$\sum\nolimits'$ into an \latexword{operator}:
\begin{verbatim}
\newcommand{\summ}{\mathop{\sum\nolimits'}}
\[\summ_{i=3}^{7}\]
\end{verbatim}
\newcommand{\summ}{\mathop{\sum\nolimits'}}
\[\summ_{i=3}^{7}\]
If you look closely you will now see that the limits are centred on the whole 
of $\summ$. This is logical, but may not be exactly what you intended. I do not
know how to do the illogical but more aesthetically pleasing version, but a 
method is provided in \latexword{amstex}.

Sometimes you want to put a range of summation under (or over) the middle of a 
pair of summation signs. Do this by turning the pair of summation signs into an
\latexword{operator}:
\begin{verbatim}
\newcommand{\twosum}{\mathop{\sum\sum}}
\[\twosum_{1<i<j<n} x_i x_j\]
\end{verbatim}
\newcommand{\twosum}{\mathop{\sum\sum}}
\[\twosum_{1<i<j<n} x_i x_j\]

To get two ranges of summation under a summation sign, make an 
\latexword{operator} containing the summation sign and the interior range(s), 
and then put a subscript on that:
\begin{verbatim}
\[\mathop{\sum_{j=1}^{n}}_{j\ne i} Y_j\]
\end{verbatim}
\[\mathop{\sum_{j=1}^{n}}_{j\ne i} Y_j\]
You would normally do this only in displayed Maths.

%% the line below is what DEK says: it comes out just the same.
%%\[\sum_{\scriptstyle j=1 \atop  \scriptstyle j\ne i}^{n} Y_j \]

\subsection{Binary operators}
\TeX\ does not class ordinary binary operators as \latexword{operator}s.
Use \verb+\mathbin+ to make something into an infix binary operator.  
For example, 
\verb+$n\mathbin{**}r$+ gives $n\mathbin{**}r$. (What does \verb+$n**r$+ 
produce?)
Usually this is 
done with a \verb+\newcommand+. 
Even a single symbol may need to be explicitly turned into a 
\latexword{mathbin}, if it is not one already, so that the spacing and 
linebreaks around it are correct: this is as true for single symbols that 
already exist as for those that you build up laboriously out of pieces.
If the new binary operator is (part of) an 
English word, you will need to specify the font, just as for \verb+\mathop+.

\subsection{Binary relations}
In the same way, \verb+\mathrel+ is used to make new binary relations. The 
considerations are similar to those for \latexword{mathbin}s. Note that 
\latexword{mathbin}s and \latexword{mathrel}s are different in several subtle 
ways, such as the spacing around them, the linebreaks near them, and their 
behaviour when they do not find themselves between two ordinary symbols
(compare \verb+$n**r$+ with \verb+$n==r$+). If you are not a Mathematician you 
will probably have to ask the author of the document whether a particular 
squiggle is an operator or a relation.

If the new relation consists of two parts, one on top of the other, you can 
make the new relation in one step with \verb+\stackrel+.
\[
\verb+\Phi\stackrel{\rm rev}{\sim}\Psi+
\qquad
\Phi\stackrel{\rm rev}{\sim}\Psi
\]

\subsection{Styles}
When \verb+\sum+ appears in displayed Maths it is larger than in text Maths, 
and has its limits in a different place. However, once it is inside a fraction 
or an array, even in displayed Maths, it reverts to its appearance in text 
Maths. To force one style or the other, precede \verb+\sum+ with either 
\verb+\displaystyle+ or \verb+\textstyle+.
\begin{quote}
\verb+\[\frac{\sum_i x_i}{n}\]+
\qquad
$\displaystyle\frac{\sum_i x_i}{n}$
\end{quote}
\[
\begin{tabular}{c}
\verb+\[\frac{\displaystyle\sum_i x_i}{n}\]+\\[2\jot]
$\displaystyle\frac{\displaystyle\sum_i x_i}{n}$
\end{tabular}
\]
These two commands can affect the appearance of many items in Maths mode, 
including \verb+\frac+.

There are analogous commands \verb+\scriptstyle+, which sets the following 
items as if they were in a subscript, and \verb+\scriptscriptstyle+, which sets
them as if they were in a second-level subscript.

None of these four commands takes an argument. They are all switches, like 
\verb+\rm+ and \verb+\large+, and 
apply until the end of the current subformula
(such as the numerator of a \verb+\frac+).
%
%obey the normal scoping rules. hoho, not quite, they don't obey environments
%

\section{Exercises}
\begin{qn}
If $f$~is a probability density function then
\[\int\limits_{-\infty}^{\infty} f = 1.\]
\end{qn}

\begin{qn}
\newcommand{\cov}{\mathop{\rm Cov}\nolimits}
We assume that $Y$ is a random vector with
$$\cov Y = \sum_{\alpha\in A} \xi_\alpha S_\alpha,$$
where the $S_\alpha$ are known 
symmetric matrices satisfying $S_\alpha S_\beta = 
\delta_{\alpha\beta} S_\alpha$ and $\sum_{\alpha\in A} S_\alpha = I$.
\end{qn}

\begin{qn}
\newcommand{\expect}{\mathop{\mbox{\bf E}}\nolimits}
The definition of variance is: $\var X = \expect\left(X - \expect X\right)^2$.
\end{qn}

\begin{qn}
\newcommand{\opt}{\mathop{\rm opt}\limits}
The optimize function $\opt$ is defined so that 
$\opt_{i=1}^n M_i$ is equal to $\max\{\max_i M_i, 0\}$.
\end{qn}

\begin{qn}
\[
\mathop{\sum_{i=1}^{n} \sum_{j=1}^{n}}_{j\ne i} y_i y_j
 = \left(\sum_{i=1}^{n} y_i \right)^2 - \sum_{i=1}^{n} y_i^2.
\]
\end{qn}

\begin{qn}
\[
\mathop{\sum_{0 < i < m}}_{0 < j < n} P(i,j).
\]
\end{qn}

\begin{qn}
\newcommand{\fplus}{\mathbin{\framebox{+}}}
Define the operator~$\fplus$ on finite sets of integers as follows.
If $A$~and~$B$ are two finite sets of integers, then
$A\fplus B$ is the multiset of integers in which the number 
of times that $n$ occurs is equal to \[\left|\{(a,b): a\in A,\ b\in B,\ 
a+b=n\}\right|.\]
\end{qn}

\begin{qn}
\newcommand{\rw}{\mathbin{\rm rw}}
We want to write our wreath products in reverse order, so we put
$G\rw H = H\wr G$.
\end{qn}

\begin{qn}
\newcommand{\aunt}{\mathrel{\rho}}
The relation~$\aunt$ is said to be symmetric if
\[ x \aunt y \quad \mbox{implies} \quad y \aunt x.\]
\end{qn}


\begin{qn}
The strong law of large numbers states that if $X_1$, $X_2$, \ldots\ are 
independent and identically distributed with finite fourth moment then
\[
\frac{X_1 + \cdots + X_n}{n} \stackrel{\rm a.s.}{\longrightarrow} Y,
\]
where $\Pr[Y=E(X_1)] = 1$.
\label{lln}
\end{qn}

\begin{qn}
\newcommand{\odddiv}{\mathrel{<_2}}
Define the relation $\odddiv$
on the natural numbers by 
$n\odddiv m$ if $n\mid m$ and $m/n$ is odd.
This is a partial order.
\end{qn}

\begin{qn}
\newcommand{\bincolon}{\mathbin{:}}
\it
Create a binary operator for the colon in $G\bincolon H$ and compare it with 
`:' and \verb+\colon+.
%$G:H$ and $G\colon H$
\end{qn}

\begin{qn}
({\it
Redo Exercise~16 with a built-up fraction instead of the solidus, with the 
large operators remaining the same size.})
\[
\prod_{k\ge 0} \frac{1}{(1 - q^kz)} = 
\frac{\displaystyle
\sum_{n\ge 0} z^n }{\displaystyle\prod_{1\le 
k\le n} (1 - q^k)} 
\]
\label{dek}
\end{qn}

\begin{qn}
\it
Redo Question~\ref{lln} with the `a.s.'\ in normal-sized type.
\end{qn}

\begin{qn}
More on binomial coefficients:
\[
\sum_{
    \scriptstyle 1\leq n \leq m\atop
\scriptstyle 1\leq r \leq n}
  \frac{n!}{r!\,(n-r)!} \quad=\quad \sum_{n=1}^{m} 2^n \quad=\quad 2^{m+1} -2.
\]
\end{qn}
\begin{qn}
\newcommand{\pistar}{\mathop{\prod\nolimits^{*}}}
\[
\pistar_{i=0}^{m} f(\lambda_i)
\]
\end{qn}

\begin{thebibliography}{9}
\bibitem{hart}
%\writer{Oxford University Press}
\book{Hart's Rules for Compositors and Readers}
\publish{Oxford University Press}{Oxford}
\byear{1967}
\bibitem{chamb}
\book{The Chambers Dictionary}
\publish{Chambers Harrap}{Edinburgh}
\byear{1993}
\bibitem{chicago}
\book{The Chicago Manual of Style}
\publish{The University of Chicago Press}{Chicago}
\byear{1982}
\bibitem{companion}
\writer{Goossens,~M., Mittelbach,~F. \& Samarin,~A.}
\book{The \LaTeX\ Companion}
\publish{Addison-Wesley}{Reading, Mass.}
\byear{1994}
\bibitem{leslie}
\writer{Lamport,~L.}
\book{\LaTeX: A Document Preparation System}
first edition,
\publish{Addison-Wesley}{Reading, Mass.}
\byear{1986}
\bibitem{newleslie}
\writer{Lamport,~L.}
\book{\LaTeX: A Document Preparation System}
second edition, 
\publish{Addison-Wesley}{Reading, Mass.}
\byear{1994}

\end{thebibliography}
\end{Article}