forked from JohnWall2016/the-texbook-cn
-
Notifications
You must be signed in to change notification settings - Fork 0
/
chapter18.tex
executable file
·2762 lines (2634 loc) · 142 KB
/
chapter18.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
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
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
% -*- coding: utf-8 -*-
\input macros
%\beginchapter Chapter 18. Fine Points of\\Mathematics\\Typing
\beginchapter Chapter 18. 精致的数学排版
\origpageno=161
%We have discussed most of the facilities needed to construct math
%formulas, but there are several more things a good mathematical typist
%will want to watch for. After you have typed a dozen or so formulas using
%the basic ideas of Chapters 16 and~17, you will find that it's easy to
%visualize the final appearance of a mathematical expression as you type
%it. And once you have gotten to that level, there's only a little bit
%more to learn before you are producing formulas as beautiful as any the
%world has ever seen; tastefully applied touches of \TeX nique will add a
%professional polish that works wonders for the appearance and readability
%of the books and papers that you type. This chapter talks about such
%tricks, and it also fills in a few gaps by mentioning some aspects of math
%that didn't fit comfortably into~Chapters~16~and~17.
\1我们已经讨论了大多数构造数学公式的工具,
但是还有几种东西,好的数学排版者非看不可。%
在用第十六和第十七章的基本方法排版大约一打公式后,
就会发现当输入数学式子时,就能想像出它的结果来。%
而且一旦你达到这种水平,离你排版出世界上所见过的最漂亮的公式只差一点了;
适当地用 \TeX\ 的技巧进行润色会给你排版的书籍和文章在观感和阅读上涂上一层%
专业的光泽。%
本章就讨论这些技巧,
而且还弥补了几个缺陷,它们都是在第十六和第十七章中未完全解决的数学排版问题。
%\subsection Punctuation. When a formula is followed by a ^{period}, ^{comma},
%^{semicolon}, ^{colon}, ^{question mark}, ^{exclamation point}, etc., put the
%^{punctuation} {\sl after\/} the |$|, when the formula is in the text; but
%put the punctuation {\sl before\/} the |$$| when the formula is displayed.
%For example,
%\begintt
%If $x<0$, we have shown that $$y=f(x).$$
%\endtt
%\TeX's spacing rules within paragraphs work best when the
%^{punctuation marks} are not considered to be part of the formulas.
\subsection 标点.
当公式后面跟着一个句点,逗号,分号,冒号,问号,惊叹号%
等等时,且公式出现在文本中时,把标点放在 |$| {\KT{10}后面};
当公式是陈列公式时,把标点放在 |$$| {\KT{10}之前}。%
例如,
\begintt
If $x<0$, we have shown that $$y=f(x).$$
\endtt
当标点符号不看作公式的一部分时,段落中 \TeX\ 的间距规则处理得很好。
%Similarly, don't ever type anything like
%\begintt
%for $x = a, b$, or $c$.
%\endtt
%It should be
%\begintt
%for $x = a$, $b$, or $c$.
%\endtt
%(Better yet, use a ^{tie}: `|or~$c$|'.) \ The reason is that \TeX\ will
%typeset expression `|$x|~|=|~|a,|~|b$|' as a single formula, so it will
%put a ``^{thin space}'' between the comma and the $b$. This space will
%not be the same as the space that \TeX\ puts after the
%comma {\sl after\/} the $b$, since spaces between words are always bigger than
%thin spaces. Such unequal spacing looks bad, but when you type things right
%the spacing will look good.
类似地,不要输入象下面这样的方式:
\begintt
for $x = a, b$, or $c$.
\endtt
应该输入
\begintt
for $x = a$, $b$, or $c$.
\endtt
(要更好的话,用带子:`|or~$c$|'。)
原因是, \TeX\ 将把式子`|$x|~|=|~|a,|~|b$|'看作单个公式来排版,
这样在逗号和 $b$ 之间的是``细间距(thin space)''。%
这个间距与 \TeX\ 放在 $b$~{\KT{10}后面}的逗号后的间距不一样,
因为单词间的间距总比细间距要大。%
如此不等的间距不好看,但是当正确输入时,间距看起来就舒服了。
%Another reason for not typing `|$x| |=| |a,| |b$|' is that it inhibits the
%possibilities for breaking lines in a paragraph: \TeX\ will never break at
%the space between the comma and the |b| because breaks after commas in
%formulas are usually wrong. For example, in the equation
%`|$x|~|=|~|f(a,|~|b)$|' we certainly don't want to put `$x=f(a,$' on one
%line and `$b)$' on the next.
不输入`|$x| |=| |a,| |b$|'的另一个原因是,
它不允许在段落中被断行:
\TeX\ 从不在逗号和 $b$ 之间的间距处断行,
因为在公式中的逗号后断行一般都是不对的。%
例如,在方程`|$x|~|=|~|f(a,|~|b)$|'中,我们当然不希望把 `$x=f(a,$' 放在一行,
而把`$b)$'放在下一行。
%Thus, when typing formulas in the text of a paragraph, keep the math properly
%segregated: Don't take operators like $-$ and $=$ outside of the |$|'s,
%and keep commas inside the formula if they are truly part of the formula.
%But if a comma or period or other punctuation mark belongs linguistically
%to the sentence rather than to the formula, leave it outside the |$|'s.
因此,在段落的文本中输入公式时,要准确地插入数学式子:
不要把象 $-$ 和 $=$ 这样的符号放在 |$| 外面,
而且如果逗号真是公式的一部分,那么要放在公式中。%
但是如果逗号或句点或其它标点符号在语句上属于句子而不是公式,
要把它放在 |$| 外面。
%\exercise Type this: $R(n,t)=O(t^{n/2})$, as $t\to0^+$.
%\answer |$R(n,t)=O(t^{n/2})$, as $t\to0^+$.| \
%(N.B.: `|O(|', not `|0('|.)
\exercise 输入:$R(n,t)=O(t^{n/2})$, as $t\to0^+$。
\answer \1|$R(n,t)=O(t^{n/2})$, as $t\to0^+$.|%
(注意是 `|O(|' 而不是 `|0('|。)
%\danger Some mathematical styles insert a bit of extra space around
%formulas to separate them from the text. For example, when copy is
%being produced on an ordinary typewriter that doesn't have italic
%letters, the best technical typists have traditionally put an extra
%blank space before and after each formula, because this provides a
%useful visual distinction. You might find it helpful to think of
%each |$| as a symbol that has the potential of adding a little space
%to the printed output; then the rule about excluding sentence
%punctuation from formulas may be easier to remember.
\danger \1有些数学文体在公式两边插入一点额外间距从而把它们从文本中分离出来。%
例如,当用无 italic 字母的普通打字机排版时,高超的排版者一般在每个公式%
前后都要放一个额外的空格,因为这带来了视觉上的不同。%
可能把每个 |$| 看作输出时的一个潜在额外间距是有好处的;
这样,把句子的标点放在公式外面这个规则就好记住了。
%\ddanger \TeX\ does, in fact, insert additional ^{space} before and after each
%formula; the amount of such space is called ^|\mathsurround|, which is
%a \<dimen>-valued parameter. For example, if you set |\mathsurround=1pt|,
%each formula will effectively be 2~points wider ($1\pt$ at each side):
%$$\baselineskip13pt\halign{\indent\mathsurround=#pt
% For $x=a$, $b$, or $c$.\hfil&\quad(#)\hfil\cr
%1&|\mathsurround=1pt|\cr 0&|\mathsurround=0pt|\cr}$$
%This extra space will disappear into the left or right margin if the formula
%occurs at the beginning or end of a line. The value of\/ |\mathsurround| that
%is in force when \TeX\ reads the closing |$| of a formula is used at both
%left and right of that formula. Plain \TeX\ takes |\mathsurround=0pt|, so
%you won't see any extra space unless you are using some other format, or
%unless you change |\mathsurround| yourself.
\ddanger 实际上,\TeX\ 的确在每个公式左右两边插入了额外间距;
这个间距的量叫做 |\mathsurround|,它是一个值为 \<dimen> 的参数。
例如,如果你设置 |\mathsurround=1pt|,
那么每个公式的宽度将增加 2 point(两边各为 $1\pt$):
$$\baselineskip13pt\halign{\indent\mathsurround=#pt
For $x=a$, $b$, or $c$.\hfil&\quad(#)\hfil\cr
1&|\mathsurround=1pt|\cr 0&|\mathsurround=0pt|\cr}$$
如果公式出现在行首或行尾,那么这个额外的间距将融入左页边或右页边。
当 \TeX\ 读入公式的闭符号 |$| 时,起作用的 |\mathsurround|
值就插入到此公式的左右两边。Plain \TeX\ 设置 |\mathsurround=0pt|,
因此如果不使用别的格式,或者自己不改变 |\mathsurround|,就不会看到额外间距。
%\subsection Non-italic letters in formulas. The names of algebraic variables
%are usually italic or Greek letters, but common mathematical functions
%like `log' are always set in ^{roman type}. The best way to deal with such
%constructions is to make use of the following 32~control sequences (all of
%which are defined in plain \TeX\ format, see Appendix~B):
%\begintt
%\arccos \cos \csc \exp \ker \limsup \min \sinh
%\arcsin \cosh \deg \gcd \lg \ln \Pr \sup
%\arctan \cot \det \hom \lim \log \sec \tan
%\arg \coth \dim \inf \liminf \max \sin \tanh
%\endtt
%^^|\arccos| ^^|\cos| ^^|\csc| ^^|\exp| ^^|\ker| ^^|\limsup| ^^|\min|
%^^|\sinh| ^^|\arcsin| ^^|\cosh| ^^|\deg| ^^|\gcd| ^^|\lg| ^^|\ln| ^^|\Pr|
%^^|\sup| ^^|\arctan| ^^|\cot| ^^|\det| ^^|\hom| ^^|\lim| ^^|\log| ^^|\sec|
%^^|\tan| ^^|\arg| ^^|\coth| ^^|\dim| ^^|\inf| ^^|\liminf| ^^|\max|
%^^|\sin| ^^|\tanh|
%These control sequences lead to roman type with appropriate
%spacing:\def\sep{&\hskip-1em}
%\beginlongmathdemo
%\it Input\sep\it Output\cr
%\noalign{\vskip2pt}
%|$\sin2\theta=2\sin\theta\cos\theta$|\sep\sin2\theta=2\sin\theta\cos\theta\cr
%|$O(n\log n\log\log n)$|\sep O(n\log n\log\log n)\cr
%|$\Pr(X>x)=\exp(-x/\mu)$|\sep\Pr(X>x)=\exp(-x/\mu)\cr
%|$$\max_{1\le n\le m}\log_2P_n$$|\sep
% \displaystyle{\max_{1\le n\le m}\log_2P_n}\cr
%\noalign{\vskip2pt}
%|$$\lim_{x\to0}{\sin x\over x}=1$$|\sep\displaystyle{\lim_{x\to0}
% {\sin x\over x}=1}\cr
%\endmathdemo
%^^|\mu|
%The last two formulas, which are displays, show that some of the special
%control sequences are treated by \TeX\ as ``large operators'' with limits
%just like $\sum$: The subscript on |\max| is not treated like the subscript
%on |\log|. Subscripts and superscripts will become limits
%when they are attached to |\det|, |\gcd|, |\inf|, |\lim|, |\liminf|,
%|\limsup|, |\max|, |\min|, |\Pr|, and |\sup|, in display style.
\subsection 非意大利体字母.
数学变量的名称一般是 italic 或希腊字母,
但是普通数学函数如`log'总设定为 roman 字体。%
处理这个情况的最好方法是使用下列 32 个控制系列(它们都定义在 plain \TeX\ 格式中,
见附录 B):
\begintt
\arccos \cos \csc \exp \ker \limsup \min \sinh
\arcsin \cosh \deg \gcd \lg \ln \Pr \sup
\arctan \cot \det \hom \lim \log \sec \tan
\arg \coth \dim \inf \liminf \max \sin \tanh
\endtt
这些控制系列得到的是 roman 字体以及相应的间距:
\def\sep{&\hskip-1em}
\beginlongmathdemo
{\KT{10}输入}\sep{\hbox{\KT{10}输出}}\cr
\noalign{\vskip2pt}
|$\sin2\theta=2\sin\theta\cos\theta$|\sep\sin2\theta=2\sin\theta\cos\theta\cr
|$O(n\log n\log\log n)$|\sep O(n\log n\log\log n)\cr
|$\Pr(X>x)=\exp(-x/\mu)$|\sep\Pr(X>x)=\exp(-x/\mu)\cr
|$$\max_{1\le n\le m}\log_2P_n$$|\sep
\displaystyle{\max_{1\le n\le m}\log_2P_n}\cr
\noalign{\vskip2pt}
|$$\lim_{x\to0}{\sin x\over x}=1$$|\sep\displaystyle{\lim_{x\to0}
{\sin x\over x}=1}\cr
\endmathdemo
最后两个公式是陈列公式,它们表明,某些特殊控制系列被 \TeX\ 看作``巨算符'',
其上下限象 $\sum$ 的一样:
~|\max| 上的下标处理方式与 |\log| 的下标不同。%
在陈列样式中,当遇到 |\det|, |\gcd|, |\inf|, |\lim|, |\liminf|,
|\limsup|, |\max|, |\min|, |\Pr| 和 |\sup| 时,
上下标将变成上下限。
%\exercise Express the following display in plain \TeX\ language, using
%`^|\nu|' for `$\nu$':
%$$p_1(n)=\lim_{m\to\infty}\sum_{\nu=0}^\infty
% \bigl(1-\cos^{2m}(\nu!^n\pi/n)\bigr).$$
%\answer |$$p_1(n)=\lim_{m\to\infty}\sum_{\nu=0}^\infty|\parbreak
%| \bigl(1-\cos^{2m}(\nu!^n\pi/n)\bigr).$$|\par
%\smallskip\noindent $\bigl[$Mathematicians may enjoy
%interpreting this formula; cf.~G.~H. ^{Hardy},
%{\sl Messenger of Mathematics\/ \bf35} (1906), 145--146.$\bigr]$
\exercise \1用 plain \TeX\ 给出下列陈列公式,其中`$\nu$'由`|\nu|'得到:
$$p_1(n)=\lim_{m\to\infty}\sum_{\nu=0}^\infty
\bigl(1-\cos^{2m}(\nu!^n\pi/n)\bigr).$$
\answer |$$p_1(n)=\lim_{m\to\infty}\sum_{\nu=0}^\infty|\parbreak
| \bigl(1-\cos^{2m}(\nu!^n\pi/n)\bigr).$$|\par
\smallskip\noindent $\bigl[$ 数学家会喜欢这个公式的解释;请参考 G.~H. ^{Hardy},
{\sl Messenger of Mathematics\/ \bf35} (1906), 145--146.$\bigr]$
%\danger If you need roman type for some mathematical function or operator
%that isn't included in plain \TeX's list of~32, it is easy to define a
%new control sequence by mimicking the definitions in Appendix~B\null. Or, if
%you need roman type just for a ``one shot'' use, it is even easier to
%get what you want by switching to ^|\rm| type, as follows:
%\beginlongmathdemo
%|$\sqrt{{\rm Var}(X)}$|&\sqrt{{\rm Var}(X)}\cr
%|$x_{\rm max}-x_{\rm min}$|&x_{\rm max}-x_{\rm min}\cr
%|${\rm LL}(k)\Rightarrow{\rm LR}(k)$|&{\rm LL}(k)\Rightarrow{\rm LR}(k)\cr
%|$\exp(x+{\rm constant})$|&\exp(x+{\rm constant})\cr
%|$x^3+{\rm lower\ order\ terms}$|&x^3+{\rm lower\ order\ terms}\cr
%\endmathdemo
%Notice the uses of `|\|\]' ^^{control space} in the last case;
%without them, the result would have been `$x^3+{\rm lower order terms}$',
%because ordinary blank ^{spaces} are ignored in math mode.
\danger 如果需要没包括在 plain \TeX\ 的 32 个函数控制系列中的一些数学函数或算符%
的 roman 字体,可以模仿附录 B 来定义新的控制系列。%
或者,如果所需的 roman 字体只要用一次,可以如下转换到 |\rm| 字体来得到它:
\beginlongmathdemo
|$\sqrt{{\rm Var}(X)}$|&\sqrt{{\rm Var}(X)}\cr
|$x_{\rm max}-x_{\rm min}$|&x_{\rm max}-x_{\rm min}\cr
|${\rm LL}(k)\Rightarrow{\rm LR}(k)$|&{\rm LL}(k)\Rightarrow{\rm LR}(k)\cr
|$\exp(x+{\rm constant})$|&\exp(x+{\rm constant})\cr
|$x^3+{\rm lower\ order\ terms}$|&x^3+{\rm lower\ order\ terms}\cr
\endmathdemo
注意,最后一个例子用到了`|\|\]';
如果没有它们,得到的将是 `$x^3+{\rm lower order terms}$',
因为在数学模式下将忽略普通空格。
%\danger You can also use ^|\hbox| instead of\/ |\rm| to get roman letters
%into formulas. For example, four of the last five formulas can be
%generated by
%\beginlongmathdemo
%|$\sqrt{\hbox{Var}(X)}$|&\sqrt{\hbox{Var}(X)}\cr
%|$\hbox{LL}(k)\Rightarrow\hbox{LR}(k)$|&\hbox{LL}(k)\Rightarrow\hbox{LR}(k)\cr
%|$\exp(x+\hbox{constant})$|&\exp(x+\hbox{constant})\cr
%|$x^3+\hbox{lower order terms}$|&x^3+\hbox{lower order terms}\cr
%\endmathdemo
%In this case `|\|\]' isn't necessary, because the material in an
%|\hbox| is processed in horizontal mode, when spaces are significant.
%But such uses of\/ |\hbox| have two disadvantages: \ (1)~The contents of the
%box will be typeset in the same size, whether or not the box occurs as a
%subscript; for example, `|$x_{\hbox{max}}$|' yields `$x_{\hbox{max}}$'.
%\ (2)~The font that's used inside |\hbox| will be the ``^{current font},''
%so it might not be roman. For example, if you are typesetting the statement
%of some theorem that is in slanted type, and if that theorem refers
%to `|$\sqrt{\hbox{Var}(X)}$|', you will get the unintended result
%`{\sl$\sqrt{\hbox{Var}(X)}$}'. In order to make sure that an |\hbox| uses
%roman type, you need to specify |\rm|, e.g., `|$\sqrt{\hbox{\rm Var}(X)}$|';
%and then the |\hbox| serves no purpose. We will see later, however, that
%|\hbox| can be very useful in displayed formulas.
\danger 在公式中,还可以用 |\hbox| 而不是 |\rm| 来得到 roman 字母。%
例如,最后五个公式中的四个也可以如下得到:
\beginlongmathdemo
|$\sqrt{\hbox{Var}(X)}$|&\sqrt{\hbox{Var}(X)}\cr
|$\hbox{LL}(k)\Rightarrow\hbox{LR}(k)$|&\hbox{LL}(k)\Rightarrow\hbox{LR}(k)\cr
|$\exp(x+\hbox{constant})$|&\exp(x+\hbox{constant})\cr
|$x^3+\hbox{lower order terms}$|&x^3+\hbox{lower order terms}\cr
\endmathdemo
在这种情况下,就不需要`|\|\]'了,因为在 |\hbox| 中的内容是在水平模式下处理的,
这时空格是起作用的。%
但是这样使用 |\hbox| 有两个缺点:
(1). 盒子中的内容按同一尺寸排版,不管盒子是不是下标;例如,
`|$x_{\hbox{max}}$|'得到的是`$x_{\hbox{max}}$'。%
(2). 在盒子中使用的字体是``当前字体'', 因此可能不是 roman 字体。%
例如,如果正在用 slanted 字体陈述某些定理,并且定理中出现了`|$\sqrt{\hbox{Var}(X)}$|',
那么就得到不想要的结果`{\sl$\sqrt{\hbox{Var}(X)}$}'。%
为了确保 |\hbox| 使用的是 roman 字体,就要给出 |\rm|,
即`|$\sqrt{\hbox{\rm Var}(X)}$|';
因此 |\hbox| 就没什么用处了。%
但是外面后面将看到,在陈列公式中 |\hbox| 非常有用。
%\ddangerexercise When the displayed formula
%`|$$\lim_{n\to\infty}x_n {\rm\ exists} \iff|\break
%|\limsup_{n\to\infty}x_n = \liminf_{n\to\infty}x_n.$$|' is typeset with
%the standard macros of plain \TeX, you get
%$$\lim_{n\to\infty}x_n{\rm\ exists}\iff
% \limsup_{n\to\infty}x_n=\liminf_{n\to\infty}x_n.$$
%But some people prefer a different notation: Explain how you could change
%the definitions of\/ ^|\limsup| and ^|\liminf| so that the display would be
%$$
%\def\limsup{\mathop{\overline{\rm lim}}}
%\def\liminf{\mathop{\underline{\rm lim}}}
%\lim_{n\to\infty}x_n{\rm\ exists}\iff
% \limsup_{n\to\infty}x_n=\liminf_{n\to\infty}x_n.$$
%\answer |\def\limsup{\mathop{\overline{\rm lim}}}|\parbreak
%|\def\liminf{\mathop{\underline{\rm lim}}}|\par
%\smallskip\noindent
%[Notice that the limits `$n\to\infty$' appear at different levels, in both
%of the displays, because `sup' and the underbar descend below the baseline.
%It is possible to unify the limit positions by using ^{phantoms}, as explained
%later in this chapter. For example,
%\begintt
%\def\limsup{\mathop{\vphantom{\underline{}}\overline{\rm lim}}}
%\endtt
%would give lower limits in the same position as |\liminf|.]
\ddangerexercise 用 plain \TeX\ 标准宏排版下面的陈列公式
\begintt
$$\lim_{n\to\infty}x_n {\rm\ exists} \iff
\limsup_{n\to\infty}x_n = \liminf_{n\to\infty}x_n.$$
\endtt
得到的结果为
$$\lim_{n\to\infty}x_n{\rm\ exists}\iff
\limsup_{n\to\infty}x_n=\liminf_{n\to\infty}x_n.$$
但是有些人喜欢用不同的符号:看看怎样改变 |\limsup| 和 |\liminf| 的定义,
使得结果为
$$
\def\limsup{\mathop{\overline{\rm lim}}}
\def\liminf{\mathop{\underline{\rm lim}}}
\lim_{n\to\infty}x_n{\rm\ exists}\iff
\limsup_{n\to\infty}x_n=\liminf_{n\to\infty}x_n.$$
\answer |\def\limsup{\mathop{\overline{\rm lim}}}|\parbreak
|\def\liminf{\mathop{\underline{\rm lim}}}|\par
\smallskip\noindent
[注意在这两个陈列公式中,极限 `$n\to\infty$' 都出现在不同的水平线,
因为 `sup' 和下划线都下探到基线下边。也可以用^{幻影}统一极限的位置,
这在本章后面将会解释。例如,
\begintt
\def\limsup{\mathop{\vphantom{\underline{}}\overline{\rm lim}}}
\endtt
将给出与 |\liminf| 位置相同的较低的极限。]
%\danger The word `mod' is also generally set in roman type, when it occurs
%in formulas; but this word needs more care, because it is used in two
%different ways that require two different treatments.
%Plain \TeX\ provides two different control sequences,
%^|\bmod| and ^|\pmod|, for the two cases: |\bmod| is to be used when
%`mod' is a ^{binary operation} (i.e., when it occurs between two quantities,
%like a plus sign usually does), and |\pmod| is to be used when
%`mod' occurs parenthetically at the end of a formula. For example,
%\beginmathdemo
%|$\gcd(m,n)=\gcd(n,m\bmod n)$|&\gcd(m,n)=\gcd(n,m\bmod n)\cr
%|$x\equiv y+1\pmod{m^2}$|&x\equiv y+1\pmod{m^2}\cr
%\endmathdemo
%The `|b|' in `|\bmod|' stands for ``binary''; the `|p|' in `|\pmod|' stands
%for ``parenthesized.'' Notice that |\pmod| inserts its own parentheses;
%the quantity that appears after `mod' in the parentheses should be
%enclosed in braces, if it isn't a single symbol.
\danger \1词`mod'一般也在公式中设定为 roman 字体;
但是这个词需要更加小心,因为它用在两种不同的方面,要求两种不同的对待。%
Plain \TeX\ 为两种情形提供了两个不同的控制系列,|\bmod| 和 |\pmod|:
当`mod'是二元运算时用 |\bmod|(即,当它出现在两个量之间,就象加号那样),
当`mod'出现在公式结尾的圆括号中使用 |\pmod|。%
例如,
\beginmathdemo
|$\gcd(m,n)=\gcd(n,m\bmod n)$|&\gcd(m,n)=\gcd(n,m\bmod n)\cr
|$x\equiv y+1\pmod{m^2}$|&x\equiv y+1\pmod{m^2}\cr
\endmathdemo
`|\bmod|'中的`|b|'表示``binary(二元)'';
`|\pmod|'中的`|p|'表示``parenthesized(圆括号)''。%
注意,|\pmod| 自己插入圆括号;
在圆括号中,出现在`mod'后面的量将括在大括号中,只要它不是单个符号。
%\dangerexercise What did poor B. L. ^{User} get when he typed
%`|$x\equiv0 (\pmod y^n)$|'\thinspace?
%\answer $x\equiv0(\pmod y^n)$. He should have typed
%`|$x\equiv0\pmod{y^n}$|'.
\dangerexercise 可怜的^{用户笨笨}输入了 `|$x\equiv0 (\pmod y^n)$|',
他将得到什么结果?
\answer $x\equiv0(\pmod y^n)$。他应该输入 `|$x\equiv0\pmod{y^n}$|'。
%\dangerexercise Explain how to produce \lower12pt\null\
%$\smash{\displaystyle{n\choose k}\equiv{\lfloor n/p\rfloor\choose
%\lfloor k/p\rfloor}{n\bmod p\choose k\bmod p}\pmod p.}$
%\answer |$${n\choose k}\equiv{\lfloor n/p\rfloor\choose|\parbreak
%| \lfloor k/p\rfloor}{n\bmod p\choose k\bmod p}\pmod p.$$|
\dangerexercise 看看怎样得到 \lower12pt\null\
$\smash{\displaystyle{n\choose k}\equiv{\lfloor n/p\rfloor\choose
\lfloor k/p\rfloor}{n\bmod p\choose k\bmod p}\pmod p.}$
\answer |$${n\choose k}\equiv{\lfloor n/p\rfloor\choose|\parbreak
| \lfloor k/p\rfloor}{n\bmod p\choose k\bmod p}\pmod p.$$|
%\danger The same mechanism that works for roman type in formulas can be used
%to get other styles of type as well. For example, ^|\bf| yields ^{boldface}:
%\beginmathdemo
%|$\bf a+b=\Phi_m$|&\bf a+b=\Phi_m\cr
%\endmathdemo
%Notice that whole formula didn't become emboldened in this example; the
%`$+$' and `$=$' stayed the same. Plain \TeX\ sets things up so
%that commands like |\rm| and |\bf| will affect only the uppercase letters
%|A|~to~|Z|, the lowercase letters |a|~to~|z|, the digits |0|~to~|9|,
%the uppercase Greek letters |\Gamma| to~|\Omega|, and math ^{accents}
%like ^|\hat| and ^|\tilde|. Incidentally, no braces were used in this
%example, because |$|'s have the effect of grouping; |\bf| changes the
%current font, but the change is local, so it does not affect the font that
%was current outside the formula.
\danger 要在公式中得到其它字体也是同样的原理。%
例如,|\bf| 得到的是加粗字体:
\beginmathdemo
|$\bf a+b=\Phi_m$|&\bf a+b=\Phi_m\cr
\endmathdemo
注意,本例中的整个公式并未都加粗;
`$+$' 和 `$=$'保持不变。%
Plain \TeX\ 设定象 |\rm| 和 |\bf| 这样的命令只对大写字母 |A| 到 |Z|,
小写字母 |a| 到 |z|, 数字 |0| 到 |9|,大写希腊字母 |\Gamma| 到 |\Omega|,
和象 |\hat| 和 |\tilde| 这样的数学重音起作用。%
顺便说一下,在本例中没有使用大括号,因为 |$| 有编组的作用;
|\bf| 改变了当前字体,但是这个改变是局部的,因此它不影响公式外面的当前字体。
%\ddanger The bold fonts available in plain \TeX\ are ``bold roman,'' rather
%than ``bold italic,'' because the latter are rarely needed. However, \TeX\
%could readily be set up to make use of bold math italics, if desired
%(see Exercise 17.\bmiexno). A more extensive set of math fonts would also
%include ^{script}, ^{Fraktur}, and ``^{blackboard bold}'' styles; plain
%\TeX\ doesn't have these, but other formats like \AmSTeX\ do. ^^{AMS-TeX}
%^^{German black letters}
\ddanger 在 plain \TeX\ 中可用的 bold 字体是``bold roman'',
而不是``bold italic'', 因为后者很少用到。%
但是,如果需要,可以设置 \TeX\ 以使用数学 bold italic 字体(见练习17.20)。%
数学字体的更大集合还包括手写体,Fraktur 和``blackboard bold''字体;
~plain \TeX\ 没有这些,但是其它格式如 \AmSTeX 有。
%\danger Besides |\rm| and |\bf|, you can say ^|\cal| in formulas to get
%uppercase letters in a ``^{calligraphic}'' style. For example, `|$\cal
%A$|' produces `$\cal A$' and `|$\cal Z$|' produces `$\cal Z$'. But beware:
%This works only with the letters |A| to |Z|; you'll get weird results if
%you apply |\cal| to lowercase or Greek letters.
\danger 除了 |\rm| 和 |\bf|, 在公式中可以输入 |\cal| 以得到花体大写字母。%
例如,`|$\cal A$|' 得到的是`$\cal A$', `|$\cal Z$|'得到的是`$\cal Z$'。%
但是要注意:它只有大写字母 |A| 到 |Z|;
如果把 |\cal| 用到小写或希腊字母上将得到奇怪的结果。
%\danger There's also ^|\mit|, which stands for ``^{math italic}.'' This
%affects ^{uppercase Greek}, so that you get
%$\mit(\Gamma,\Delta,\Theta,\Lambda,\Xi,\Pi,\Sigma,\Upsilon,\Phi,\Psi,\Omega)$
%instead of $(\Gamma,\ldots,\Omega)$. When~|\mit| is in effect, the
%ordinary letters |A| to |Z| and |a| to |z| are not changed; they are set
%in italics as usual, because they ordinarily come from the math italic
%font. Conversely, uppercase Greek letters and math accents are unaffected
%by |\rm|, because they ordinarily come from the roman font. Math accents
%should not be used when the |\mit| family has been selected, because the
%math italic font contains no accents.
\danger 还有一种表示``数学 italic''的 |\mit| 字体。%
它对大写希腊字母有作用,这样得到的是 %
$\mit(\Gamma,\Delta,\Theta,\Lambda,\Xi,\Pi,\allowbreak\Sigma,\Upsilon,\Phi,\Psi,\Omega)$~%
而不是 $(\Gamma,\ldots,\Omega)$。%
当 |\mit| 在起作用时,普通字母 |A| 到 |Z| 和 |a| 到 |z| 不改变;
它们象通常那样还是 italic 字体,因为它们一般就是来自数学 italic 字体。%
反过来,大写希腊字母和数学重音不受 |\rm| 的影响,因为它们通常来自 roman 字体。%
当选择 |\mit| 族时,数学重音不应该使用,因为数学 italic 不包含重音符号。
%\dangerexercise Type the formula $\bf\bar x^{\rm T}Mx={\rm0}\iff x=0$,
%using as few keystrokes as possible. ^^{boldface numbers in math}
%\ (The first `0' is roman, the second is bold. The superscript `T' is roman.)
%\answer |$\bf\bar x^{\rm T}Mx={\rm0}\iff x=0$|. \ (If you typed a space between
%|\rm| and~|0|, you wasted a keystroke; but don't feel guilty about it.)
\dangerexercise \1利用尽可能少的字输入公式 $\bf\bar x^{\rm T}Mx={\rm0}\iff x=0$。%
(第一个`0'是罗马体,第二个是粗体。上标`T'是罗马体。)
\answer |$\bf\bar x^{\rm T}Mx={\rm0}\iff x=0$|。%
(如果你在 |\rm|和 |0| 之间留下空格,你将浪费一个按键,但你无需感到愧疚。)
%\dangerexercise Figure out how to typeset
%`$S\subseteq\mit\Sigma\iff S\in\cal S$'.
%\answer |$S\subseteq{\mit\Sigma}\iff S\in{\cal S}$|. In this case the
%braces are redundant and could be eliminated; but you shouldn't try to do
%{\sl everything\/} with fewest keystrokes, or you'll outsmart yourself
%some day.
\dangerexercise 看看怎样输入`$S\subseteq\mit\Sigma\iff S\in\cal S$'。
\answer |$S\subseteq{\mit\Sigma}\iff S\in{\cal S}$|。
在这个例子中花括号是多余的,可以去掉;
但你不应该{\sl 对所有内容}都尝试用更少的按键完成,否则总有一天你将会弄巧成拙。
%\danger Plain \TeX\ also allows you to type ^|\it|, ^|\sl|, or ^|\tt|, if
%you want text italic, slanted, or typewriter letters to occur in a math
%formula. However, these fonts are available only in text size, so you
%should not try to use them in subscripts.
\danger Plain \TeX\ 还允许在数学公式中使用 italic, slanted 或 typewriter 字母,
只要输入 |\it|, |\sl| 或 |\tt| 即可。%
但是这些字体只能用在文本尺寸,因此不要把它们当上标使用。
%\danger If you're paying attention, you probably wonder why both
%|\mit| and |\it| are provided; the answer is that |\mit| is ``math italic''
%(which is normally best for formulas), and |\it| is ``^{text italic}'' (which
%is normally best for running text).
%\beginmathdemo
%|$This\ is\ math\ italic.$|&This\ is\ math\ italic.\cr
%|{\it This is text italic.}|&\hbox{\it This is text italic.}\cr
%\endmathdemo
%The math italic letters are a little wider, and the spacing is different;
%this works better in most formulas, but it fails spectacularly when
%you try to type certain italic words like `$different$' using math mode
%(`|$different$|'). A wide `$f$' is usually desirable in formulas, but it
%is undesirable in text. Therefore wise typists
%use |\it| in a math formula that is supposed
%to contain an actual italic word. Such cases almost never occur in
%classical mathematics, but they are common when ^{computer programs}
%are being typeset, since programmers often use multi-letter ``^{identifiers}'':
%\beginmathdemo
%|$\it last:=first$|&\it last:=first\cr
%|$\it x\_coord(point\_2)$|&\it x\_coord(point\_2)\cr
%\endmathdemo
%The first of these examples shows that \TeX\ recognizes the ^{ligature}
%`{\it fi\/}' when text italic occurs in a math formula;
%the other example illustrates the use of short ^{underlines} to break
%up identifier names. ^^{control-underline}
%When the author typeset this manual, he used `|$\it SS$|' to refer to
%style~$\SS$, since `|$SS$|' makes the $S$'s too far apart: $SS$.
\danger 只要你留心一下,就想知道为什么要提供 |\mit| 和 |\it|;
原因是 |\mit| 是``数学 italic''(一般用于公式好), 而 |\it| 是%
``文本 italic''(一般用于文本好)。
\beginmathdemo
|$This\ is\ math\ italic.$|&This\ is\ math\ italic.\cr
|{\it This is text italic.}|&\hbox{\it This is text italic.}\cr
\endmathdemo
数学 italic 字母要宽一些,并且间距不同;
它用于大部分公式很好,但是在数学模式下输入象%
`$different$'\allowbreak(`|$different$|')这样的单词时却不行。%
在公式中需要宽的`$f$', 但是在文本中不需要。%
这样的情况几乎从未出现在经典数学中,但是却常常出现在排版计算机程序上,
因为程序员常常使用多字母的``标识符(identifier)'':
\beginmathdemo
|$\it last:=first$|&\it last:=first\cr
|$\it x\_coord(point\_2)$|&\it x\_coord(point\_2)\cr
\endmathdemo
这些例子的第一个表明,当在数学公式中出现文本 italic 时,
\TeX\ 找到了连写 `{\it fi\/}';
另一个例子表明,所用的短下划线把标识符名字分开了。
当作者排版本手册时,用 `|$\it SS$|' 来得到字体名称 $\SS$,
因为 `|$SS$|' 使 $S$ 分得太开了:$SS$。
%\dangerexercise What plain \TeX\ commands will produce the following display?
%$$\tenmath
%{\it available}+\sum_{i=1}^n\max\bigl({\it full}(i),{\it reserved}(i)\bigr)
% ={\it capacity}.$$
%\answer |$${\it available}+\sum_{i=1}^n\max\bigl({\it full}(i),|\parbreak
% |{\it reserved}(i)\bigr)={\it capacity}.$$|
%\smallskip\noindent [If\/ |\it| had been used throughout
%the formula, the subscript~$i$ and superscript~$n$ would have caused error
%messages saying `^|\scriptfont| |4| |is| |undefined|',
%since plain \TeX\ makes |\it| available only in text size.]
\dangerexercise 怎样用 plain \TeX\ 命令得到下列陈列公式?
$$\tenmath
{\it available}+\sum_{i=1}^n\max\bigl({\it full}(i),{\it reserved}(i)\bigr)
={\it capacity}.$$
\answer |$${\it available}+\sum_{i=1}^n\max\bigl({\it full}(i),|\parbreak
|{\it reserved}(i)\bigr)={\it capacity}.$$|
\smallskip\noindent [如果在整个公式中使用 |\it|,
下标 $i$ 和上标 $n$ 将导致 `^|\scriptfont| |4| |is| |undefined|' 的错误,
这是因为 plain \TeX\ 的 |\it| 只能用在文本尺寸中。]
%\ddangerexercise How would you go about typesetting the following computer
%program, using the macros of plain \TeX?
%$$\vbox{\let\par=\endgraf
%\obeylines\sfcode`;=3000
%{\bf for $j:=2$ step $1$ until $n$ do}
%\quad {\bf begin} ${\it accum}:=A[j]$; $k:=j-1$; $A[0]:=\it accum$;
%\quad {\bf while $A[k]>\it accum$ do}
%\qquad {\bf begin} $A[k+1]:=A[k]$; $k:=k-1$;
%\qquad {\bf end};
%\quad $A[k+1]:=\it accum$;
%\quad {\bf end}.
%}$$
%\answer |{\obeylines \sfcode`;=3000|^^|\sfcode|\parbreak
%|{\bf for $j:=2$ step $1$ until $n$ do}|\parbreak
%|\quad {\bf begin} ${\it accum}:=A[j]$; $k:=j-1$; $A[0]:=\it accum$;|\parbreak
%|\quad {\bf while $A[k]>\it accum$ do}|\parbreak
%|\qquad {\bf begin} $A[k+1]:=A[k]$; $k:=k-1$;|\parbreak
%|\qquad {\bf end};|\parbreak
%|\quad $A[k+1]:=\it accum$;|\parbreak
%|\quad {\bf end}.\par}|\par
%\smallskip\noindent
%[This is something like the ``poetry'' example in Chapter~14, but much
%more difficult. Some manuals of style say that ^{punctuation} should inherit
%the font of the preceding character, so that three kinds of semicolons
%should be typeset; e.g., these experts recommend `$k:=j-1$; \
%$A[0]:={}${\it accum;} \ {\bf end;}'. The author heartily disagrees.]
\ddangerexercise 怎样利用 plain \TeX\ 宏排版下列计算机程序?
$$\vbox{\let\par=\endgraf
\obeylines\sfcode`;=3000
{\bf for $j:=2$ step $1$ until $n$ do}
\quad {\bf begin} ${\it accum}:=A[j]$; $k:=j-1$; $A[0]:=\it accum$;
\quad {\bf while $A[k]>\it accum$ do}
\qquad {\bf begin} $A[k+1]:=A[k]$; $k:=k-1$;
\qquad {\bf end};
\quad $A[k+1]:=\it accum$;
\quad {\bf end}.
}$$
\answer |{\obeylines \sfcode`;=3000|^^|\sfcode|\parbreak
|{\bf for $j:=2$ step $1$ until $n$ do}|\parbreak
|\quad {\bf begin} ${\it accum}:=A[j]$; $k:=j-1$; $A[0]:=\it accum$;|\parbreak
|\quad {\bf while $A[k]>\it accum$ do}|\parbreak
|\qquad {\bf begin} $A[k+1]:=A[k]$; $k:=k-1$;|\parbreak
|\qquad {\bf end};|\parbreak
|\quad $A[k+1]:=\it accum$;|\parbreak
|\quad {\bf end}.\par}|\par
\smallskip\noindent
[这有些类似第 14 章排版``诗歌''的例子,但更加困难。
有些手册说^{标点}应该继承前面字符的字体,即分号应该用三种字体排版;
比如,这些专家推荐 `$k:=j-1$; \ $A[0]:={}${\it accum;} \ {\bf end;}'。
作者极为不以为然。]
%\subsection Spacing between formulas. ^{Displays} often contain more than one
%formula; for example, an equation is frequently accompanied by a ^{side
%condition}:
%$$F_n=F_{n-1}+F_{n-2},\qquad n\ge2.$$
%In such cases you need to tell \TeX\ how much space to put after the comma,
%because \TeX's normal spacing conventions would bunch things together;
%without special precautions you would get
%$$F_n=F_{n-1}+F_{n-2}, n\ge2.$$
\subsection 公式之间的间距.
\1陈列公式常常不止一个公式;
例如,方程经常伴有一个边条件:
$$F_n=F_{n-1}+F_{n-2},\qquad n\ge2.$$
在这种情况下,需要告诉 \TeX\ 在逗号后面放多大间距,
因为用 \TeX\ 正常的间距约定就挤在一起了;
如果没有特殊措施,得到的将是
$$F_n=F_{n-1}+F_{n-2}, n\ge2.$$
%The traditional hot-metal technology for printing has led to some ingrained
%standards for situations like this, based on what printers call a ``^{quad}''
%of space. Since these standards seem to work well in practice, \TeX\ makes
%it easy for you to continue the tradition: When you type `^|\quad|' in plain
%\TeX\ format, you get a printer's quad of space in the horizontal direction.
%Similarly, `^|\qquad|' gives you a double quad (twice as much); this
%is the normal spacing for situations like
%the $F_n$ example above. Thus, the recommended procedure is to type
%\begintt
%$$ F_n = F_{n-1} + F_{n-2}, \qquad n \ge 2. $$
%\endtt
%It is perhaps worth reiterating that \TeX\ ignores all the spaces in math
%mode (except, of course, the space after `|\qquad|', which is needed
%to distinguish between `|\qquad|~|n|' and `|\qquadn|'); so the same result
%would be obtained if you were to leave out all but one space:
%\begintt
%$$F_n=F_{n-1}+F_{n-2},\qquad n\ge2.$$
%\endtt
%Whenever you want spacing that differs from the normal conventions, you must
%specify it explicitly by using control sequences such as |\quad| and |\qquad|.
传统的排版技术对处理这种情况有一套成熟的标准,它是基于排版工人称为一个``quad''%
的间距。%
因为这些标准看起来在实践中用得很好,所以 \TeX\ 把它这个习惯为你保留下来了:
当用 plain \TeX\ 格式输入`|\quad|'时,就在水平方向上得到排版工人的一 quad 间距。%
类似地,`|\qquad|'给出两个 quad(就象两次那样);
这就是上面 $F_n$ 例子中的正常间距。%
因此,建议输入
\begintt
$$ F_n = F_{n-1} + F_{n-2}, \qquad n \ge 2. $$
\endtt
可能要重申的是, \TeX\ 忽略掉所有数学模式下的空格(当然,除了`|\qquad|'后面的%
空格,需要用它区分开`|\qquad| |n|'和`|\qquadn|');
因此,如果把除它以外的所有空格都去掉,也可得到同样的结果:
\begintt
$$F_n=F_{n-1}+F_{n-2},\qquad n\ge2.$$
\endtt
只要你需要不同于正常约定的间距,就必须用诸如 |\quad| 和 |\qquad| 的控制系列%
明确给出它。
%\danger A quad used to be a square piece of blank type, $1\em$ wide and $1\em$
%tall---approximately the size of a capital M, as explained in Chapter~10. This
%tradition has not been fully retained: The control sequence |\quad| in plain
%\TeX\ is simply an abbreviation for `|\hskip|~|1|^|em||\relax|', so \TeX's
%quad has width but no height.
\danger 过去一 quad 为一个空的方形字,~$1\em$ 宽且 $1\em$ 高——%
近似为大写字母 M 的尺寸,就象在第十章中讨论的那样。%
这个传统没有保留下来:
在 plain \TeX\ 中,控制系列 |\quad| 就是`|\hskip|~|1||em||\relax|',
因此 \TeX\ 的 |\quad| 只有宽度,没有高度。
%\danger You can use |\quad| in text as well as in formulas; for example,
%Chapter~14 illustrates how |\quad| applies to poetry. When |\quad| appears
%in a formula it stands for one~em in the current text font, independent of the
%current math size or style or family. Thus, for example, |\quad| is just
%as wide in a subscript as it is on the main line of a formula.
\danger 也可以象在公式中那样在文本中使用 |\quad|;
例如,第十四章演示了怎样把 |\quad| 用在诗歌上。%
当 |\quad| 出现在公式中时,它表示当前文本字体的 1 em,
与当前数学字体,尺寸和族无关。%
因此,例如,在下标中的 |\quad| 与公式主体中是一样宽。
%Sometimes a careless author will put two formulas next to each other in
%the text of a paragraph. For example, you might find a sentence like this:
%\begindisplay
%The ^{Fibonacci} numbers satisfy $F_n=F_{n-1}+F_{n-2}$, \ $n\ge2$.
%\enddisplay
%Everybody who teaches proper ^{mathematical} ^{style} is agreed that formulas
%ought to be separated by words, not just by commas; the author of that
%sentence should at least have said `for $n\ge2$', not simply `$n\ge2$'.
%But alas, such lapses are commonplace, and many prominent mathematicians
%are hopelessly addicted to clusters of formulas. If we are not allowed to change
%their writing style, we can at least insert extra space where they
%neglected to insert an appropriate word. An additional interword space
%generally works well in such cases; for example, the sentence above was
%typeset thus:
%\begintt
%... $F_n=F_{n-1}+F_{n-2}$, \ $n\ge2$.}$$
%\endtt
%The `|\|\]' ^^{control space} here gives a visual separation that
%partly compensates for the bad style.
有时候粗心的作者可能把文本段落中的两个公式紧挨着放置。%
例如,你可以找到象这样的句子:
\begindisplay
The {Fibonacci} numbers satisfy $F_n=F_{n-1}+F_{n-2}$, \ $n\ge2$.
\enddisplay
受过正确数学训练的人都知道,公式应当用单词隔开,而不仅仅是逗号;
此句的作者至少应该用`for $n\ge2$', 而不只是`$n\ge2$'。%
但是,唉,这样的失误太常见了,并且许多杰出的数学家都无望地陷在公式堆了。%
\1如果不让我们去改变他们的写作样式,那么至少应该在忽略要插入的相应单词后要%
插入额外的间距。%
在这种情况下,额外的词间间距一般效果很好;例如,上面的句子就排版为:
\begintt
... $F_n=F_{n-1}+F_{n-2}$, \ $n\ge2$.}$$
\endtt
这里的`|\|\]'在视觉上部分弥补了那个不好的样式。
%\exercise Put the following paragraph into \TeX\ form, treating punctuation
%and spacing carefully; also insert ^{ties} to prevent bad line breaks.
%\begindisplay\baselineskip13pt
%\vbox{\raggedright\hsize=310pt\parindent=0pt
%Let $H$~be a Hilbert space, \
%$C$~a closed bounded convex subset of~$H$, \
%$T$~a nonexpansive self map of~$C$.
%Suppose that as $n\to\infty$, \ $a_{n,k}\to0$ for each~$k$,
%and $\gamma_n=\sum_{k=0}^\infty(a_{n,k+1}-a_{n,k})^+\to0$.
%Then for each $x$~in~$C$, \
%$A_nx=\sum_{k=0}^\infty a_{n,k}T^kx$ converges weakly
%to a fixed point of~$T$.
%} % taken from Bull. AMS 82 (1976), p 959; chosen by AMS in '78 for demo
%\enddisplay
%\answer |Let $H$~be a Hilbert space, \
%$C$~a closed bounded convex subset of~$H$, \
%$T$~a nonexpansive self map of~$C$.
%Suppose that as $n\to\infty$, \ $a_{n,k}\to0$ for each~$k$,
%and $\gamma_n=\sum_{k=0}^\infty(a_{n,k+1}-|\allowbreak|a_{n,k})^+\to0$.
% Then for each $x$~in~$C$, \
%$A_nx=\sum_{k=0}^\infty a_{n,k}T^kx$ converges weakly
%to a fixed point of~$T$.|\par
%[If any mathematicians are reading this, they might either appreciate
%or resent the following attempt to edit the given paragraph
%into a more acceptable style: ``%
%Let $C$~be a closed, bounded, convex subset of a Hilbert space~$H$,
%and let $T$~be a nonexpansive self map of~$C$.
%Suppose that as $n\to\infty$, we have $a_{n,k}\to0$ for each~$k$,
%and $\gamma_n=\sum_{k=0}^\infty(a_{n,k+1}-a_{n,k})^+\to0$.
%Then for each $x$~in~$C$, the infinite sum
%$A_nx=\sum_{k=0}^\infty a_{n,k}T^kx$ converges weakly
%to a fixed point of~$T$.'']
\exercise 把下列段落输入为 \TeX\ 格式,注意标点和间距;
为了防止不好的断行,还要用到^{带子}。
\begindisplay\baselineskip13pt
\vbox{\raggedright\hsize=310pt\parindent=0pt
Let $H$~be a Hilbert space, \
$C$~a closed bounded convex subset of~$H$, \
$T$~a nonexpansive self map of~$C$.
Suppose that as $n\to\infty$, \ $a_{n,k}\to0$ for each~$k$,
and $\gamma_n=\sum_{k=0}^\infty(a_{n,k+1}-a_{n,k})^+\to0$.
Then for each $x$~in~$C$, \
$A_nx=\sum_{k=0}^\infty a_{n,k}T^kx$ converges weakly
to a fixed point of~$T$.
} % taken from Bull. AMS 82 (1976), p 959; chosen by AMS in '78 for demo
\enddisplay
\answer |Let $H$~be a Hilbert space, \
$C$~a closed bounded convex subset of~$H$, \
$T$~a nonexpansive self map of~$C$.
Suppose that as $n\to\infty$, \ $a_{n,k}\to0$ for each~$k$,
and $\gamma_n=\sum_{k=0}^\infty(a_{n,k+1}-|\allowbreak|a_{n,k})^+\to0$.
Then for each $x$~in~$C$, \
$A_nx=\sum_{k=0}^\infty a_{n,k}T^kx$ converges weakly
to a fixed point of~$T$.|\par
[这个段落可以修改为下面更容易接受的样子:
``Let $C$~be a closed, bounded, convex subset of a Hilbert space~$H$,
and let $T$~be a nonexpansive self map of~$C$.
Suppose that as $n\to\infty$, we have $a_{n,k}\to0$ for each~$k$,
and $\gamma_n=\sum_{k=0}^\infty(a_{n,k+1}-\1a_{n,k})^+\to0$.
Then for each $x$~in~$C$, the infinite sum
$A_nx=\sum_{k=0}^\infty a_{n,k}T^kx$ converges weakly
to a fixed point of~$T$.''%
如果数学家读到这里,他们可能欣赏也可能反感此改动。]
%\subsection Spacing within formulas. Chapter 16 says that \TeX\ does
%automatic ^{spacing} of math formulas so that they look right, and this is
%almost true. But occasionally you must give \TeX\ some help. The number of
%possible math formulas is vast, and \TeX's spacing rules are rather
%simple, so it is natural that exceptions should arise. Of course, it is
%desirable to have fine units of spacing for this purpose, instead of the
%big chunks that arise from |\|\], |\quad| and |\qquad|.
\subsection 公式内部的间距.
第十六章说过, \TeX\ 自动调整数学公式的间距,使得它们看起来不错,
而且这一般都可以了。%
但是有时候你必须帮一下 \TeX。%
数学公式的可能数目太大,而且 \TeX\ 的间距规则又相当简单,
因此自然会出现例外。%
当然,为此希望有间距的精细单位,而不是从 |\|\], |\quad| 和 |\qquad| 得到%
的大块间距。
%The basic elements of space that \TeX\
%puts into formulas are called {\sl ^{thin spaces}}, {\sl ^{medium
%spaces}}, and {\sl ^{thick spaces}}. In order to get a feeling for these
%units, let's take a look at the $F_n$ example again: Thick spaces occur
%just before and after the = sign, and also before and after the $\ge$\thinspace;
%medium spaces occur just before and after the $+$ sign. Thin spaces are
%slightly smaller, but noticeable; it's a thin space that makes the
%difference between `loglog' and `$\log\log$'. The normal space between
%words of a paragraph is approximately equal to two thin spaces.
\TeX\ 放在公式中的间距基本单元叫做{\KT{10}细间距,中间距}, 和{\KT{10}厚间距}。%
为了对这些间距有些体会,让我们再讨论 $F_n$ 的例子:
厚间距只出现在 = 号前后,以及 $\ge$ 前后;
中间距出现在 $+$ 前后。%
细间距略小,但是也能看出来;在`loglog'和`$\log\log$'之间的差就是细间距。%
段落中单词之间的正常间距近似等于两个细间距。
%\TeX\ inserts thin spaces, medium spaces, and thick spaces into formulas
%automatically, but you can add your own spacing whenever you want to,
%by using the control sequences ^^|\,|^^|\!|^^|\;|^^|\>|
%$$\halign{\indent#\hfil&\quad#\hfil\cr
%|\,|&thin space \ (normally 1/6 of a quad);\cr
%|\>|&medium space \ (normally 2/9 of a quad);\cr
%|\;|&thick space \ (normally 5/18 of a quad);\cr
%|\!|&negative thin space \ (normally $-1/6$ of a quad).\cr}$$
%In most cases you can rely on \TeX's spacing while you are typing a manuscript,
%and you'll want to insert or delete space with these four control sequences
%only in rare circumstances after you see what comes out.
\TeX\ 自动把细间距,中间距和厚间距插入到公式中,
但是只要想添加,你就可以加上自己要的间距,使用的控制系列为
$$\halign{\indent#\hfil&\quad#\hfil\cr
|\,|&细间距(正常为 1/6 个 quad);\cr
|\>|&中间距(正常为 2/9 个 quad);\cr
|\;|&厚间距(正常为 5/18 个 quad);\cr
|\!|&负细间距(正常为 $-1/6$ 个 quad)。\cr}$$
在大多数情况下,在输入文稿时可以依靠 \TeX\ 的间距,
只有在很少的情况下,你才发现需要用这四个控制系列插入或去掉间距。
%\ddanger We observed a minute ago that |\quad| spacing does not
%change with the style of formula, nor does it depend on the math font
%families that are being used. But thin spaces, medium spaces, and thick
%spaces do get bigger and smaller as the size of type gets bigger and
%smaller; this is because they are defined in terms of ^\<muglue>, a~special
%brand of glue intended for math spacing. You specify \<muglue> just
%as if it were ordinary glue, except that the units are given in terms of
%`^|mu|' (math units) instead of~|pt| or~|cm| or something else. For
%example, Appendix~B contains the definitions
%\begintt
%\thinmuskip = 3mu
%\medmuskip = 4mu plus 2mu minus 4mu
%\thickmuskip = 5mu plus 5mu
%\endtt
%^^|\thinmuskip|^^|\medmuskip|^^|\thickmuskip|
%and this defines the thin, medium, and thick spaces that \TeX\ inserts
%into formulas. According to these specifications, thin spaces in plain
%\TeX\ do not stretch or shrink; medium spaces can stretch a little, and
%they can shrink to zero; thick spaces can stretch a lot, but they never shrink.
\ddanger 刚才我们看到,~|\quad| 间距不随公式的样式而改变,与所用的字体族也无关。%
但是细间距,中间距和厚间距的确随公式字体的大小而变大或变小;
这是因为它们的定义用的是 \<muglue>, 这是用于数学间距的一种特殊粘连。%
\1你可以把它看成普通的粘连,只是它的单位是`|mu|'(数学单位)而不是 |pt|, |cm|~%
或其它的。%
例如,附录 B 包含定义:
\begintt
\thinmuskip = 3mu
\medmuskip = 4mu plus 2mu minus 4mu
\thickmuskip = 5mu plus 5mu
\endtt
它定义了 \TeX\ 要插入公式的细,中和厚间距。%
按照这些规定,~plain \TeX\ 中的细间距不能伸缩;
中间距可以伸长一点,当收缩为零;
厚间距可以伸长很多,但不能收缩。
%\ddanger There are 18 mu to an em, where the em is taken from family~2
%(the math symbols family). In other words, ^|\textfont|~|2| defines the em
%value for |mu| in display and text styles; ^|\scriptfont|~|2| defines the
%em for script size material; and ^|\scriptscriptfont|~|2| defines it for
%scriptscript size.
\ddanger 18mu 等于 1em,这个 em 来自第 2 族(数学符号族)。
换句话说,|\textfont|~|2| 定义了陈列和文本样式中的 |mu| 的 em 值;
|\scriptfont|~|2| 定义了标号尺寸的 em;
|\scriptscriptfont|~|2| 定义了小标号尺寸的 em。
%\ddanger You can insert math glue into any formula just by giving
%the command `^|\mskip|\<muglue>'. For example, `|\mskip 9mu plus 2mu|'
%inserts one half em of space, in the current size, together with some
%stretchability. Appendix~B defines `|\,|' to be an abbreviation for
%`|\mskip\thinmuskip|'. Similarly, you can use the command `^|\mkern|'
%when there is no stretching or shrinking; `|\mkern18mu|' gives one em of
%horizontal space in the current size. \TeX\ insists that |\mskip| and
%|\mkern| be used only with |mu|; conversely, ^|\hskip| and ^|\kern| (which
%are also allowed in formulas) must never give units in |mu|.
\ddanger 你可以把数学粘连插入任何公式,只要用命令`|\mskip|\<muglue>'即可。%
例如,`|\mskip 9mu plus 2mu|'就插入当前尺寸的半个 em 的间距,以及一些伸长度。%
附录 B 把`|\,|'定义为`|\mskip|\allowbreak|\thinmuskip|'。%
类似地,当无伸缩性时,可以使用命令`|\mkern|';
`|\mkern18mu|'给出当前尺寸的 1 em 的间距。%
\TeX\ 坚持 |\mskip| 和 |\mkern| 只用 |mu|;
而 |\hskip| 和 |\kern|~(它们也允许在公式中使用)只用不是 |mu| 的单位。
%Formulas involving ^{calculus} look best when an extra thin space appears
%before $dx$ ^^{dx} or~$dy$ or~$d\,$whatever; but \TeX\ doesn't do this
%automatically. Therefore a well-trained typist will remember to insert
%`|\,|' in examples like the following:
%\beginmathdemo
%\it Input&\it Output\cr
%\noalign{\vskip2pt}
%|$\int_0^\infty f(x)\,dx$|&\int_0^\infty f(x)\,dx\cr
%|$y\,dx-x\,dy$|&y\,dx-x\,dy\cr
%|$dx\,dy=r\,dr\,d\theta$|&dx\,dy=r\,dr\,d\theta\cr
%|$x\,dy/dx$|&x\,dy/dx\cr \endmathdemo Notice that no `|\,|' was desirable
%after the `|/|' in the last example. Similarly, there's no need for
%`|\,|' in cases like
%\begindisplaymathdemo
%|$$\int_1^x{dt\over t}$$|&\int_1^x{dt\over t}\cr
%\endmathdemo
%since the $dt$ appears all by itself in the numerator of a fraction; this
%detaches it visually from the rest of the formula.
在包含微积分的公式中,只要把额外的细间距添加在 $dx$, ~$dy$ 或 $d\,$ 前面,
效果就很好;
但是 \TeX\ 不能自动实现它。%
因此,一个训练有素的排版者会象下面的例子那样插入`|\,|':
\beginmathdemo
{\KT{10}输入}&{{\KT{10}输出}}\cr
\noalign{\vskip2pt}
|$\int_0^\infty f(x)\,dx$|&\int_0^\infty f(x)\,dx\cr
|$y\,dx-x\,dy$|&y\,dx-x\,dy\cr
|$dx\,dy=r\,dr\,d\theta$|&dx\,dy=r\,dr\,d\theta\cr
|$x\,dy/dx$|&x\,dy/dx\cr \endmathdemo
注意,在最后一个例子中,`|/|'后面不要加`|\,|'。%
类似地,如果象
\begindisplaymathdemo
|$$\int_1^x{dt\over t}$$|&\int_1^x{\,dt\over t}\cr
\endmathdemo
这样,也不需要加`|\,|', 因为 $dt$ 单独出现在分数的分子上;
加上会把分数与公式的其它部分在视觉上分开。
%\exercise Explain how to handle the display
%$$\int_0^\infty{t-ib\over t^2+b^2}e^{iat}\,dt=e^{ab}E_1(ab),\qquad a,b>0.$$
%\answer |$$\int_0^\infty{t-ib\over t^2+b^2}e^{iat}\,dt=|\parbreak
% | e^{ab}E_1(ab),\qquad a,b>0.$$|
%
\exercise 看看怎样得到陈列公式
$$\int_0^\infty{t-ib\over t^2+b^2}e^{iat}\,dt=e^{ab}E_1(ab),\qquad a,b>0.$$
\answer |$$\int_0^\infty{t-ib\over t^2+b^2}e^{iat}\,dt=|\parbreak
| e^{ab}E_1(ab),\qquad a,b>0.$$|
%\danger When physical ^{units} appear in a formula, they should be set in roman
%type and separated from the preceding material by a thin space:
%\beginmathdemo
%|$55\rm\,mi/hr$|&55\rm\,mi/hr\cr
%|$g=9.8\rm\,m/sec^2$|&g=9.8\rm\,m/sec^2\cr
%|$\rm1\,ml=1.000028\,cc$|&\rm1\,ml=1.000028\,cc\cr
%\endmathdemo
\danger \1当物理单位出现在公式中时,应该使用 roman 字体,并把它同前面的内容%
用细间距隔开:
\beginmathdemo
|$55\rm\,mi/hr$|&55\rm\,mi/hr\cr
|$g=9.8\rm\,m/sec^2$|&g=9.8\rm\,m/sec^2\cr
|$\rm1\,ml=1.000028\,cc$|&\rm1\,ml=1.000028\,cc\cr
\endmathdemo
%\dangerexercise Typeset the following display, assuming that `^|\hbar|'
%generates `$\hbar$':
%$$\hbar=1.0545\times10^{-27}\rm\,erg\,sec.$$
%\answer |$$\hbar=1.0545\times10^{-27}\rm\,erg\,sec.$$|
\dangerexercise 排版下列陈列公式,假定`$\hbar$'由`|\hbar|'得到:
$$\hbar=1.0545\times10^{-27}\rm\,erg\,sec.$$
\answer |$$\hbar=1.0545\times10^{-27}\rm\,erg\,sec.$$|
%\danger Thin spaces should also be inserted after ^{exclamation points}
%(which stand for the ``^{factorial}'' operation in a formula), if the next
%character is a letter or a number or an opening delimiter:
%\beginmathdemo
%|$(2n)!/\bigl(n!\,(n+1)!\bigr)$|&(2n)!/\bigl(n!\,(n+1)!\bigr)\cr
%\noalign{\vskip6pt}
%|$${52!\over13!\,13!\,26!}$$|&\displaystyle{52!\over13!\,13!\,26!}\cr
%\endmathdemo
\danger 如果惊叹号(在公式中它表示阶乘)后面跟的是字母,数字或开分界符,