-
Notifications
You must be signed in to change notification settings - Fork 18
/
chapter24.tex
655 lines (599 loc) · 25.7 KB
/
chapter24.tex
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
% -*- coding: utf-8 -*-
\documentclass{book}
\input{preamble}
\setcounter{chapter}{23}
\begin{document}
%\chapter{Display Math}\label{displaymath}
\chapter{Display Math}\label{displaymath}
%Displayed formulas are set on a line of their own, usually
%somewhere in a paragraph. This chapter explains
%how surrounding white space (both above/below and to the
%left/right) is calculated.
Displayed formulas are set on a line of their own, usually
somewhere in a paragraph. This chapter explains
how surrounding white space (both above/below and to the
left/right) is calculated.
%\label{cschap:abovedisplayskip}\label{cschap:belowdisplayskip}\label{cschap:abovedisplayshortskip}\label{cschap:belowdisplayshortskip}\label{cschap:predisplaypenalty}\label{cschap:postdisplaypenalty}\label{cschap:displayindent}\label{cschap:displaywidth}\label{cschap:predisplaysize}\label{cschap:everydisplay}\label{cschap:eqno}\label{cschap:leqno}
%\begin{inventory}
%\item [\cs{abovedisplayskip \cs{belowdisplayskip}}]
%\mdqon
% Glue above/""below a display.
%\mdqoff
% Plain \TeX\ default:~\n{12pt plus 3pt minus 9pt}
\label{cschap:abovedisplayskip}\label{cschap:belowdisplayskip}\label{cschap:abovedisplayshortskip}\label{cschap:belowdisplayshortskip}\label{cschap:predisplaypenalty}\label{cschap:postdisplaypenalty}\label{cschap:displayindent}\label{cschap:displaywidth}\label{cschap:predisplaysize}\label{cschap:everydisplay}\label{cschap:eqno}\label{cschap:leqno}
\begin{inventory}
\item [\cs{abovedisplayskip \cs{belowdisplayskip}}]
\mdqon
Glue above/""below a display.
\mdqoff
Plain \TeX\ default:~\n{12pt plus 3pt minus 9pt}
%\item [\cs{abovedisplayshortskip \cs{belowdisplayshortskip}}]
%\mdqon
% Glue above/""below a display if the line preceding the display
%\mdqoff
% was short.
% Plain \TeX\ defaults:~\n{0pt plus 3pt} and
% \n{7pt plus 3pt minus 4pt} respectively.
\item [\cs{abovedisplayshortskip \cs{belowdisplayshortskip}}]
\mdqon
Glue above/""below a display if the line preceding the display
\mdqoff
was short.
Plain \TeX\ defaults:~\n{0pt plus 3pt} and
\n{7pt plus 3pt minus 4pt} respectively.
%\item [\cs{predisplaypenalty \cs{postdisplaypenalty}}]
%\mdqon
% Penalty placed in the vertical list above/""below a display.
%\mdqoff
% Plain \TeX\ defaults:~\n{10$\,$000} and~\n{0}
% respectively.
\item [\cs{predisplaypenalty \cs{postdisplaypenalty}}]
\mdqon
Penalty placed in the vertical list above/""below a display.
\mdqoff
Plain \TeX\ defaults:~\n{10$\,$000} and~\n{0}
respectively.
%\item [\cs{displayindent}]
% Distance by which the box, in which the display
% is centred, is indented owing to hanging indentation.
\item [\cs{displayindent}]
Distance by which the box, in which the display
is centred, is indented owing to hanging indentation.
%\item [\cs{displaywidth}]
% Width of the box in which the display is centred.
\item [\cs{displaywidth}]
Width of the box in which the display is centred.
%\item [\cs{predisplaysize}]
% Effective width of the line preceding the display.
\item [\cs{predisplaysize}]
Effective width of the line preceding the display.
%\item [\cs{everydisplay}]
% Token list inserted at the start of a display.
\item [\cs{everydisplay}]
Token list inserted at the start of a display.
%\item [\cs{eqno}]
% Place a right equation number in a display formula.
\item [\cs{eqno}]
Place a right equation number in a display formula.
%\item [\cs{leqno}]
% Place a left equation number in a display formula.
\item [\cs{leqno}]
Place a left equation number in a display formula.
%\end{inventory}
\end{inventory}
%%\point Displays
%\section{Displays}
%\point Displays
\section{Displays}
%\TeX\ starts building a \indexterm{display math} formula
%when it encounters two
%math shift characters (characters of category~3\index{category!3},
%\verb>$>~in plain \TeX) in a row.
%Another such pair (possibly followed
%\alt by one optional space) indicates the end of the display.
\TeX\ starts building a \indexterm{display math} formula
when it encounters two
math shift characters (characters of category~3\index{category!3},
\verb>$>~in plain \TeX) in a row.
Another such pair (possibly followed
\alt by one optional space) indicates the end of the display.
%Math shift is a \gr{horizontal command}, but displays are only
%allowed in unrestricted horizontal mode
%(\verb>$$>~is an empty math formula in restricted horizontal mode).
%Displays themselves, however, are started in the
%surrounding (possibly internal) vertical mode in order to calculate
%quantities such as~\cs{prevgraf}; the result of the display is
%appended to the vertical list.
Math shift is a \gr{horizontal command}, but displays are only
allowed in unrestricted horizontal mode
(\verb>$$>~is an empty math formula in restricted horizontal mode).
Displays themselves, however, are started in the
surrounding (possibly internal) vertical mode in order to calculate
quantities such as~\cs{prevgraf}; the result of the display is
appended to the vertical list.
%The part of the paragraph above the display is broken into
%lines as an independent paragraph (but \cs{prevgraf} is
%carried over; see below), and the remainder of the
%paragraph is set, starting with an empty list and \cs{spacefactor}
%equal to~1000.
%The \cs{everypar} tokens are not inserted for the part of the
%paragraph after the display, nor is \cs{parskip} glue inserted.
%
%Right at the beginning of the display the \csidx{everydisplay}
%token list is inserted (but after the calculation of
%\cs{displayindent}, \cs{displaywidth}, and \cs{predisplaysize}).
%See page~\pageref{left:display} for an example of the use
%of \cs{everydisplay}.
The part of the paragraph above the display is broken into
lines as an independent paragraph (but \cs{prevgraf} is
carried over; see below), and the remainder of the
paragraph is set, starting with an empty list and \cs{spacefactor}
equal to~1000.
The \cs{everypar} tokens are not inserted for the part of the
paragraph after the display, nor is \cs{parskip} glue inserted.
Right at the beginning of the display the \csidx{everydisplay}
token list is inserted (but after the calculation of
\cs{displayindent}, \cs{displaywidth}, and \cs{predisplaysize}).
See page~\pageref{left:display} for an example of the use
of \cs{everydisplay}.
%The page builder is exercised
%before the display
%(but after the \cs{everydisplay} tokens have been inserted),
%and after the display finishes.
The page builder is exercised
before the display
(but after the \cs{everydisplay} tokens have been inserted),
and after the display finishes.
%The `display style' of math typesetting was treated in
%Chapter~\ref{mathfont}.
The `display style' of math typesetting was treated in
Chapter~\ref{mathfont}.
%%\point Displays in paragraphs
%\section{Displays in paragraphs}
%\point Displays in paragraphs
\section{Displays in paragraphs}
%Positioning of a display in a paragraph may be influenced
%by hanging indentation or a \cs{parshape} specification.
%For this, \TeX\ uses the \cs{prevgraf} parameter
%(see Chapter~\ref{par:shape}), and
%acts as if the display is three lines deep.
Positioning of a display in a paragraph may be influenced
by hanging indentation or a \cs{parshape} specification.
For this, \TeX\ uses the \cs{prevgraf} parameter
(see Chapter~\ref{par:shape}), and
acts as if the display is three lines deep.
%If $n$ is the value of \cs{prevgraf} when the display starts
%\ldash so there are $n$ lines of text above the display \rdash
%\cs{prevgraf} is set to to $n+3$ when the paragraph resumes.
%The display occupies, as it were, lines $n+1$, $n+2$, and~$n+3$.
%The shift and line width for the display are those
%that would hold for line~$n+2$.
If $n$ is the value of \cs{prevgraf} when the display starts
\ldash so there are $n$ lines of text above the display \rdash
\cs{prevgraf} is set to to $n+3$ when the paragraph resumes.
The display occupies, as it were, lines $n+1$, $n+2$, and~$n+3$.
The shift and line width for the display are those
that would hold for line~$n+2$.
%The shift for the display is recorded in \cs{displayindent};
%\cstoidx displayindent\par\cstoidx displaywidth\par
%the line width is recorded in\handbreak \cs{displaywidth}. These parameters
%(and the \cs{predisplaysize} explained below)
%are set immediately after the \verb>$$> has been scanned.
%Usually they are equal to zero and \cs{hsize} respectively.
%The user can change the values of these parameters;
%\TeX\ will use the
%values that hold after the math list
%of the display has been processed.
The shift for the display is recorded in \cs{displayindent};
\cstoidx displayindent\par\cstoidx displaywidth\par
the line width is recorded in\handbreak \cs{displaywidth}. These parameters
(and the \cs{predisplaysize} explained below)
are set immediately after the \verb>$$> has been scanned.
Usually they are equal to zero and \cs{hsize} respectively.
The user can change the values of these parameters;
\TeX\ will use the
values that hold after the math list
of the display has been processed.
%A~display is vertical material, and therefore
%not influenced by settings of \cs{leftskip} and \cs{rightskip}.
A~display is vertical material, and therefore
not influenced by settings of \cs{leftskip} and \cs{rightskip}.
%%\point Vertical material around displays
%\section{Vertical material around displays}
%\point Vertical material around displays
\section{Vertical material around displays}
%A display is preceded in the vertical list by
%\begin{itemize}\item a penalty of size \cs{predisplaypenalty}
% \cstoidx predisplaypenalty\par\cstoidx abovedisplayskip\par
% \cstoidx abovedisplayshortskip\par
%(plain \TeX\ default~$10\,000$), and
%\item glue of size \cs{abovedisplayskip}
%or \cs{abovedisplayshortskip}; this glue is omitted in
%cases where a~\cs{leqno} equation number is set on
%a line of its own (see below).\end{itemize}
%A display is followed by
%\begin{itemize}\item a penalty of size \cs{postdisplaypenalty}
% \cstoidx postdisplaypenalty\par\cstoidx belowdisplayskip\par
% \cstoidx belowdisplayshortskip\par
%(default~0), and possibly
%\item glue of size \cs{belowdisplayskip} or
%\cs{belowdisplayshortskip}; this glue is omitted in cases
%where an~\cs{eqno} equation number is set on a line of
%its own (see below).\end{itemize}
A display is preceded in the vertical list by
\begin{itemize}\item a penalty of size \cs{predisplaypenalty}
\cstoidx predisplaypenalty\par\cstoidx abovedisplayskip\par
\cstoidx abovedisplayshortskip\par
(plain \TeX\ default~$10\,000$), and
\item glue of size \cs{abovedisplayskip}
or \cs{abovedisplayshortskip}; this glue is omitted in
cases where a~\cs{leqno} equation number is set on
a line of its own (see below).\end{itemize}
A display is followed by
\begin{itemize}\item a penalty of size \cs{postdisplaypenalty}
\cstoidx postdisplaypenalty\par\cstoidx belowdisplayskip\par
\cstoidx belowdisplayshortskip\par
(default~0), and possibly
\item glue of size \cs{belowdisplayskip} or
\cs{belowdisplayshortskip}; this glue is omitted in cases
where an~\cs{eqno} equation number is set on a line of
its own (see below).\end{itemize}
%The `short' variants of the glue are taken if
%there is no \cs{leqno} left equation number, and if
%the last line of the paragraph above the display is
%short enough for the display to be raised a bit without
%coming too close to that line.
%In order to decide this, the effective width of the
%preceding line is saved in \csidx{predisplaysize}.
%This value is calculated immediately after the opening \verb>$$>
%of the display has
%been scanned, together with the \cs{displaywidth}
%and \cs{displayindent} explained above.
The `short' variants of the glue are taken if
there is no \cs{leqno} left equation number, and if
the last line of the paragraph above the display is
short enough for the display to be raised a bit without
coming too close to that line.
In order to decide this, the effective width of the
preceding line is saved in \csidx{predisplaysize}.
This value is calculated immediately after the opening \verb>$$>
of the display has
been scanned, together with the \cs{displaywidth}
and \cs{displayindent} explained above.
%Remembering that the part of the paragraph above the display
%has already been broken into lines, the following method
%for finding the effective width of the last line ensues.
%\TeX\ takes the last box of the list, which is a horizontal
%box containing the last line, and locates the right edge
%of the last box in it. The \cs{predisplaysize} is then
%the place of that rightmost edge, plus any amount by which
%the last line was shifted, plus two ems in the current font.
Remembering that the part of the paragraph above the display
has already been broken into lines, the following method
for finding the effective width of the last line ensues.
\TeX\ takes the last box of the list, which is a horizontal
box containing the last line, and locates the right edge
of the last box in it. The \cs{predisplaysize} is then
the place of that rightmost edge, plus any amount by which
the last line was shifted, plus two ems in the current font.
%There are two exceptions to this. The \cs{predisplaysize}
%is taken to be $-$\cs{maxdimen} if there was no previous line,
%that is,
%the display started the paragraph, or it followed another display;
%\cs{predisplaysize} is taken to be \cs{maxdimen}
%if the glue in the last line was not set at its natural width,
%which may happen if the \cs{parfillskip} contained only finite
%stretch. The reason for the last clause is that glue
%\mdqon
%setting is slightly \emph{machine"-dependent}\index{machine dependence},
%and such dependences
%\mdqoff
%should be kept out of \TeX's global decision processes.
There are two exceptions to this. The \cs{predisplaysize}
is taken to be $-$\cs{maxdimen} if there was no previous line,
that is,
the display started the paragraph, or it followed another display;
\cs{predisplaysize} is taken to be \cs{maxdimen}
if the glue in the last line was not set at its natural width,
which may happen if the \cs{parfillskip} contained only finite
stretch. The reason for the last clause is that glue
\mdqon
setting is slightly \emph{machine"-dependent}\index{machine dependence},
and such dependences
\mdqoff
should be kept out of \TeX's global decision processes.
%%\point Glue setting of the display math list
%\section{Glue setting of the display math list}
%\point Glue setting of the display math list
\section{Glue setting of the display math list}
%The display has to fit in \cs{displaywidth},
%but in addition to the formula there
%may be an equation number. The minimum separation
%between the formula and the equation number should
%be one em in the symbol font, that is,
%\mdqon
%\cs{font\-dimen\-6}""\cs{textfont2}.
%\mdqoff
The display has to fit in \cs{displaywidth},
but in addition to the formula there
may be an equation number. The minimum separation
between the formula and the equation number should
be one em in the symbol font, that is,
\mdqon
\cs{font\-dimen\-6}""\cs{textfont2}.
\mdqoff
%If the formula plus any equation number
%and separation fit into \cs{displaywidth},
%the glue in the formula is set at its natural width.
%If it does not fit,
%but the formula contains enough shrink, it is shrunk.
%Otherwise \TeX\ puts any equation number
%on a line of its own, and the glue in the formula is
%set to fit it in \cs{displaywidth}.
%With the equation
%number on a separate line the formula may now very well fit in the
%display width; however,
%if it was a very long formula the box in which it is
%set may still be overfull. \TeX\ nevers breaks a displayed
%formula.
If the formula plus any equation number
and separation fit into \cs{displaywidth},
the glue in the formula is set at its natural width.
If it does not fit,
but the formula contains enough shrink, it is shrunk.
Otherwise \TeX\ puts any equation number
on a line of its own, and the glue in the formula is
set to fit it in \cs{displaywidth}.
With the equation
number on a separate line the formula may now very well fit in the
display width; however,
if it was a very long formula the box in which it is
set may still be overfull. \TeX\ nevers breaks a displayed
formula.
%%\point Centring the display formula: displacement
%\section{Centring the display formula: displacement}
%\point Centring the display formula: displacement
\section{Centring the display formula: displacement}
%Based on the width of the box containing the formula \ldash which
%may not really `contain' it; it may be overfull \rdash
%\TeX\ tries to centre the formula in the \cs{displaywidth},
%that is, without taking the equation number into account.
%Initially, a displacement is calculated that is
%half the difference between \cs{displaywidth} and the
%width of the formula box.
Based on the width of the box containing the formula \ldash which
may not really `contain' it; it may be overfull \rdash
\TeX\ tries to centre the formula in the \cs{displaywidth},
that is, without taking the equation number into account.
Initially, a displacement is calculated that is
half the difference between \cs{displaywidth} and the
width of the formula box.
%However, if there is an equation number that will not
%be put on a separate line and the displacement is less than
%twice the width of the equation number, a new displacement
%is calculated. This new displacement is zero if the formula
%started with glue; otherwise it is such that the
%formula box is centred in the space left by the equation
%number.
However, if there is an equation number that will not
be put on a separate line and the displacement is less than
twice the width of the equation number, a new displacement
is calculated. This new displacement is zero if the formula
started with glue; otherwise it is such that the
formula box is centred in the space left by the equation
number.
%If there was no equation number, or if the equation number
%will be put on a separate line, the formula box
%is now placed, shifted right by \cs{displayindent} plus
%the displacement calculated above.
If there was no equation number, or if the equation number
will be put on a separate line, the formula box
is now placed, shifted right by \cs{displayindent} plus
the displacement calculated above.
%\section{Equation numbers}
\section{Equation numbers}
%\index{equation numbering|(}
\index{equation numbering|(}
%The user can specify a equation number for a display
%by ending it with
%\cstoidx eqno\par\cstoidx leqno\par
%\begin{Disp}\cs{eqno}\gr{math mode material}\verb>$$>\end{Disp}
%for an equation number placed on the right, or
%\begin{Disp}\cs{leqno}\gr{math mode material}\verb>$$>\end{Disp}
%for an equation number placed on the left.
The user can specify a equation number for a display
by ending it with
\cstoidx eqno\par\cstoidx leqno\par
\begin{Disp}\cs{eqno}\gr{math mode material}\verb>$$>\end{Disp}
for an equation number placed on the right, or
\begin{Disp}\cs{leqno}\gr{math mode material}\verb>$$>\end{Disp}
for an equation number placed on the left.
%%\spoint Ordinary equation numbers
%\subsection{Ordinary equation numbers}
%\spoint Ordinary equation numbers
\subsection{Ordinary equation numbers}
%Above it was described how \TeX\ calculates a displacement
%from the display formula and the equation number, if this
%is to be put on the same line as the formula.
Above it was described how \TeX\ calculates a displacement
from the display formula and the equation number, if this
is to be put on the same line as the formula.
%If the equation number was a \cs{leqno} number,
%\TeX\ places a box containing
%\begin{itemize}\item the equation number,
%\item a kern with the size of the displacement calculated, and
%\item the formula.\end{itemize}
%This box is shifted right by \cs{displayindent}.
If the equation number was a \cs{leqno} number,
\TeX\ places a box containing
\begin{itemize}\item the equation number,
\item a kern with the size of the displacement calculated, and
\item the formula.\end{itemize}
This box is shifted right by \cs{displayindent}.
%If the equation number was an \cs{eqno} number,
%\TeX\ places a box containing
%\begin{itemize}\item the formula,
%\item a kern with the size of the displacement calculated, and
%\item the equation number.\end{itemize}
%This box is shifted right by \cs{displayindent} plus
%the displacement calculated.
If the equation number was an \cs{eqno} number,
\TeX\ places a box containing
\begin{itemize}\item the formula,
\item a kern with the size of the displacement calculated, and
\item the equation number.\end{itemize}
This box is shifted right by \cs{displayindent} plus
the displacement calculated.
%%\spoint The equation number on a separate line
%\subsection{The equation number on a separate line}
%\spoint The equation number on a separate line
\subsection{The equation number on a separate line}
%Since displayed formulas may become rather big, \TeX\ can decide
%(as was described above)
%that any equation number should be placed on a line of its own.
%A~left-placed equation number is then to be placed above the
%display, in a box that is shifted right by \cs{displayindent};
%a right-placed equation number will be placed below the display,
%in a box that is shifted to the right
%by \cs{displayindent} plus \cs{displaywidth} minus the width of
%the equation number box.
Since displayed formulas may become rather big, \TeX\ can decide
(as was described above)
that any equation number should be placed on a line of its own.
A~left-placed equation number is then to be placed above the
display, in a box that is shifted right by \cs{displayindent};
a right-placed equation number will be placed below the display,
in a box that is shifted to the right
by \cs{displayindent} plus \cs{displaywidth} minus the width of
the equation number box.
%In both cases a penalty of $10\,000$ is placed between the equation
%number box and the formula.
In both cases a penalty of $10\,000$ is placed between the equation
number box and the formula.
%\TeX\ does not put extra glue above a left-placed
%equation number or below
%a right-placed equation number; \TeX\ here relies on
%the baselineskip mechanism.
\TeX\ does not put extra glue above a left-placed
equation number or below
a right-placed equation number; \TeX\ here relies on
the baselineskip mechanism.
%\index{equation numbering|)}
\index{equation numbering|)}
%\section{Non-centred displays}
%\label{left:display}
\section{Non-centred displays}
\label{left:display}
%As a default, \TeX\ will center displays.
%In order to get \indextermbus{non-centred}{displays} some
%macro trickery is needed.
As a default, \TeX\ will center displays.
In order to get \indextermbus{non-centred}{displays} some
macro trickery is needed.
%One approach would
%be to write a macro \cs{DisplayEquation}
%that would basically look like
%\begin{verbatim}
%\def\DisplayEquation#1{%
% \par \vskip\abovedisplayskip
% \hbox{\kern\parindent$\displaystyle#1$}
% \vskip\belowdisplayskip \noindent}
%\end{verbatim}
%but it would be nicer if one could just write
%\begin{verbatim}
%$$ ... \eqno ... $$
%\end{verbatim}
%\mdqon
%and having this come out as a left"-aligning display.
%\mdqoff
One approach would
be to write a macro \cs{DisplayEquation}
that would basically look like
\begin{verbatim}
\def\DisplayEquation#1{%
\par \vskip\abovedisplayskip
\hbox{\kern\parindent$\displaystyle#1$}
\vskip\belowdisplayskip \noindent}
\end{verbatim}
but it would be nicer if one could just write
\begin{verbatim}
$$ ... \eqno ... $$
\end{verbatim}
\mdqon
and having this come out as a left"-aligning display.
\mdqoff
%Using the \cs{everydisplay} token list, the above
%idea can be realized. The basic idea is to write
%\begin{verbatim}
%\everydisplay{\IndentedDisplay}
%\def\IndentedDisplay#1$${ ...
%\end{verbatim}
%so that the macro \cs{IndentedDisplay}
%will receive the formula, including any equation number.
%The first step is now to extract an equation number
%if it is present. This makes creative use of delimited
%macro parameters.
%\begin{verbatim}
%\def\ExtractEqNo#1\eqno#2\eqno#3\relax
% {\def\Equation{#1}\def\EqNo{#2}}
%\def\IndentedDisplay#1$${%
% \ExtractEqNo#1\eqno\eqno\relax
%\end{verbatim}
%Next the equation should be set in the available
%space \cs{displaywidth}:
%\begin{verbatim}
% \hbox to \displaywidth
% {\kern\parindent
% $\displaystyle\Equation$\hfil$\EqNo$}$$
% }
%\end{verbatim}
%Note that the macro ends in the closing \verb>$$>
%to balance the opening dollars that caused
%insertion of the \cs{everydisplay} tokens.
%This also means that the box containing the
%displayed material will automatically be
%surrounded by \cs{abovedisplayskip} and
%\cs{belowdisplayskip} glue.
%There is no need to use \cs{displayindent} anywhere
%in this macro, because \TeX\ itself will shift the
%display appropriately.
Using the \cs{everydisplay} token list, the above
idea can be realized. The basic idea is to write
\begin{verbatim}
\everydisplay{\IndentedDisplay}
\def\IndentedDisplay#1$${ ...
\end{verbatim}
so that the macro \cs{IndentedDisplay}
will receive the formula, including any equation number.
The first step is now to extract an equation number
if it is present. This makes creative use of delimited
macro parameters.
\begin{verbatim}
\def\ExtractEqNo#1\eqno#2\eqno#3\relax
{\def\Equation{#1}\def\EqNo{#2}}
\def\IndentedDisplay#1$${%
\ExtractEqNo#1\eqno\eqno\relax
\end{verbatim}
Next the equation should be set in the available
space \cs{displaywidth}:
\begin{verbatim}
\hbox to \displaywidth
{\kern\parindent
$\displaystyle\Equation$\hfil$\EqNo$}$$
}
\end{verbatim}
Note that the macro ends in the closing \verb>$$>
to balance the opening dollars that caused
insertion of the \cs{everydisplay} tokens.
This also means that the box containing the
displayed material will automatically be
surrounded by \cs{abovedisplayskip} and
\cs{belowdisplayskip} glue.
There is no need to use \cs{displayindent} anywhere
in this macro, because \TeX\ itself will shift the
display appropriately.
%%
%\endofchapter
%
\endofchapter
\end{document}