-
Notifications
You must be signed in to change notification settings - Fork 8
/
modes.tex
2604 lines (2432 loc) · 104 KB
/
modes.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 -*-
% This is part of the book TeX for the Impatient.
% Copyright (C) 2003 Paul W. Abrahams, Kathryn A. Hargreaves, Karl Berry.
% See file fdl.tex for copying conditions.
\input macros
%\chapter {Commands for \linebreak horizontal and \linebreak vertical modes}
\chapter {水平和竖直模式命令}
\chapterdef{hvmodes}
%This section covers commands that have corresponding or identical
%forms for both horizontal and vertical modes.
%These commands provide boxes, spaces, rules, leaders,
%and alignments.
%For an explanation of the conventions used in this section,
%see \headcit{Descriptions of the commands}{cmddesc}.
这一章介绍水平和竖直模式下具有对应或一致形式的命令。这些命令提供盒子、间隔、标线、指引线以及阵列。有关本章中使用的惯例的说明,参见\headcit{命令的描述}{cmddesc}。
\begindescriptions
%==========================================================================
%\section {Producing space}
\section {产生间隔}
%==========================================================================
%\subsection {Fixed-width horizontal space}
\subsection {固定宽度水平间隔}
%\begindesc
%\bix^^{space//producing}
%\bix^^{horizontal space}
%\cts thinspace {}
%\explain
%This command produces a positive \minref{kern}
%whose width is one-sixth of an em
%(\xref{dimdefs})
%i.e., it causes \TeX\ to move its position right by that amount.
%It is useful
%when you have a nested quotation, for example,
%and you want to separate the levels of quotes.
%\TeX\ won't break a line at
%a |\thinspace|.\minrefs{line break}
\begindesc
\bix^^{间隔//产生间隔}
\bix^^{水平间隔}
\cts thinspace {}
\explain
该命令产生一个正的\minref{紧排},它的宽度是 1/6 em(\xref{dimdefs}),也就是说,它使得 \TeX\ 向右移动一个相应的距离。例如,当你需要嵌套引用,并希望将不同层次的引号分开时,它便非常有用。\TeX\ 不会在 |\thinspace| 处断行。\minrefs{line break}
\example
``\thinspace`一个引用。'\thinspace''\par
24,\thinspace 29--31,\thinspace 45,\thinspace 102
|
\produces
%``\thinspace`A quote.'\thinspace''\par
``\thinspace`一个引用。'\thinspace''\par
24,\thinspace 29--31,\thinspace 45,\thinspace 102
\endexample
\enddesc
\begindesc
\cts negthinspace {}
\explain
%This command
%produces a negative kern whose width is one-sixth of an em
%(\xref{dimdefs}),
%i.e., it causes \TeX\ to move its position left by that amount.
%It is useful for bringing together characters that are a little too
%far apart.
%\TeX\ won't break a line at a |\negthinspace|.\minrefs{line break}
该命令产生一个负的\minref{紧排},它的宽度是 1/6 em(\xref{dimdefs}),也就是说,它使得 \TeX\ 向左移动一个相应的距离。当需要将两个间隔稍远的字符靠近一些时便非常有用。\TeX\ 不会在 |\negthinspace| 处断行。\minrefs{line break}
\example
The horror, the horror\negthinspace, the horror of it all!!
|
\produces
The horror, the horror\negthinspace, the horror of it all!
\endexample
\enddesc
\begindesc
\cts enspace {}
\explain
%This command produces a \minref{kern} whose width is one ^{en}
%(half of an em, see \xrefpg{dimdefs}).
%\TeX\ won't break a line
%at an |\enspace| unless it's followed by glue.
%In a bulleted list, the bullets are usually separated from the following
%text by an |\enspace|.
该命令产生一个宽度为 1 ^{en} 的\minref{紧排}(1 em 的一半,参见 \xrefpg{dimdefs})。\TeX\ 不会在 |\enspace| 处断行,除非紧接其后的是粘连。在符号列表中,符号与其后的文字通常由 |\enspace| 来分隔。
\example
引理 1.\enspace 这里有一只白兔。
|
\produces
%Lemma 1.\enspace There exists a white rabbit.
引理 1.\enspace 这里有一只白兔。
\endexample
% the enspace here follows the \proclaim convention (Knuth p. 355).
\enddesc
\begindesc
\easy\cts enskip {}
\cts quad {}
\cts qquad {}
\explain
^^{en}
%Each of these commands
%produces a glob of horizontal \minref{glue}
%that can neither stretch nor shrink.
%\TeX\ can break a line \minrefs{line break} at such glue.
%The width of these glues (which are relative to the current font)
%are as follows for |cmr10|, the default \plainTeX\ font:
这里的每个命令都产生一个既不能伸展也不能收缩的水平\minref{粘连}。\TeX\ 不能在这些粘连处断行。对于 \plainTeX\ 的默认字体 |cmr10| 来说,这些粘连的宽度(与当前字体有关)如下:
\medskip
\def\distance#1{\hbox{\strut $\rightarrow$\vrule\hskip #1\vrule$\leftarrow$}}
%{\def\l#1{\hfil$#1$\thinspace em}
%\tabskip 3pc \halign{#&#&\hfil#\hfil\cr
%{\it Command}&{\it Space}&{\it Illustration}\cr
%\noalign{\vskip 4pt}
%|\enskip|&\l{\frac 1/2}&\distance{.5em}\cr
%|\quad|&\l1&\distance{1em}\cr
%|\qquad|&\l2&\distance{2em}\cr
%}}
%\example
%en\enskip skip; quad\quad skip; qquad\qquad skip
%|
%\produces
%en\enskip skip; quad\quad skip; qquad\qquad skip
%\endexample
%\eix^^{horizontal space}
%\enddesc
{\def\l#1{\hfil$#1$\thinspace em}
\tabskip 3pc \halign{#&#&\hfil#\hfil\cr
{\it 命令}&{\it 间距}&{\it 图示}\cr
\noalign{\vskip 4pt}
|\enskip|&\l{\frac 1/2}&\distance{.5em}\cr
|\quad|&\l1&\distance{1em}\cr
|\qquad|&\l2&\distance{2em}\cr
}}
\example
en\enskip skip; quad\quad skip; qquad\qquad skip
|
\produces
en\enskip skip; quad\quad skip; qquad\qquad skip
\endexample
\eix^^{水平间隔}
\enddesc
%==========================================================================
%\subsection {Fixed-length vertical space}
\subsection {固定长度竖直间隔}
%\begindesc
%\bix^^{vertical space}
%\easy\cts smallskip {}
%\cts medskip {}
%\cts bigskip {}
%\explain
%These commands produce successively larger
%amounts of vertical space:
\begindesc
\bix^^{竖直间隔}
\easy\cts smallskip {}
\cts medskip {}
\cts bigskip {}
\explain
这些命令可以产生连续较大的竖直间隔:
\display{{\def\bar{\kern 2pt\hrule width 5pc}
\def\lbl#1{\hbox to 5pc{\hfil #1skip\hfil}}
\leavevmode
\vtop{\lbl{small}\bar\smallskip\bar}\quad
\vtop{\lbl{med}\bar\medskip\bar}\quad\vtop{\lbl{big}\bar\bigskip\bar}}}
\noindent
%|\smallskip| skips by $3$ points and can stretch or
%shrink by $1$ point. |\med!-skip| is equivalent to two |\smallskip|s
%and |\bigskip| is equivalent to two |\medskip|s.
|\smallskip| 产生 $3$ 点的竖直间隔,并可以伸展或收缩 1 点。
|\med!-skip| 相当于两个 |\smallskip|,而 |\bigskip| 相当于两个 |\medskip|。
%These commands end a paragraph since they are inherently vertical.
%The skips that they produce
%are in addition to the normal interparagraph skip.
由于这些命令具有固有的竖直特性,因此它们的出现宣告一个段落的结束。由此产生的间距需要再加上正常的段落间距。
\example
Hop \smallskip skip \medskip and \bigskip jump.
|
\produces
Hop \smallskip skip \medskip and \bigskip jump.
\endexample
\enddesc
\begindesc
\cts smallskipamount {\param{glue}}
\cts medskipamount {\param{glue}}
\cts bigskipamount {\param{glue}}
\explain
%These parameters specify the amounts of glue produced by
%the |\small!-skip|, |\med!-skip|, and |\big!-skip| commands.
%By changing these parameters you change the effect of the commands.
%The default values (for \plainTeX)
%correspond to a quarter of a linespace, half a linespace,
%and a full linespace.
%We recommend that you maintain this ratio by changing
%these values whenever
%you change |\baselineskip| (\xref\baselineskip).
%^^|\baselineskip//and {\tt\\smallskipamount}, etc.|
%\eix^^{vertical space}
这些参数用于确定由 |\small!-skip|、|\med!-skip| 和 |\big!-skip| 命令产生的粘连的量。
通过更改这些参数,你可以改变命令的效果。(对于 \plainTeX )它们相应的默认值是 1/4 、1/2 以及 1 行距。
我们建议你保持这个比例,无论何时,你可以通过修改 |\baselineskip|(\xref\baselineskip )来修改参数值。
^^|\baselineskip//和 {\tt\\smallskipamount} 等|
\eix^^{竖直间隔}
\enddesc
%==========================================================================
%\subsection {Variable-size space}
\subsection {可变尺寸间隔}
%\begindesc
%\easy\cts hskip {\<dimen$_1$> {\bt plus} \<dimen$_2$> {\bt minus} \<dimen$_3$>}
%\cts vskip {\<dimen$_1$> {\bt plus} \<dimen$_2$> {\bt minus} \<dimen$_3$>}
%^^{vertical skip}^^{vertical glue}
%^^{horizontal skip}^^{horizontal glue}
%\bix^^{horizontal space}
%\bix^^{vertical space}
%\explain
%These commands produce horizontal and vertical glue respectively.
%In the simplest and most common case when only \<dimen$_1$> is present,
%|\hskip| skips to the right by \<dimen$_1$>
%and |\vskip| skips down the page by \<dimen$_1$>.
%More generally, these commands
%produce \minref{glue} whose natural size is
%\<dimen$_1$>, whose stretch is \<dimen$_2$>, and whose shrink is \<dimen$_3$>.
%Either the |plus| \<dimen$_2$>, the |minus |\<dimen$_3$>,
%or both can be omitted.
%If both are present, the |plus| must come before the |minus|.
%An omitted value
%is taken to be zero. Any of the \<dimen>s can be negative.
\begindesc
\easy\cts hskip {\<dimen$_1$> {\bt plus} \<dimen$_2$> {\bt minus} \<dimen$_3$>}
\cts vskip {\<dimen$_1$> {\bt plus} \<dimen$_2$> {\bt minus} \<dimen$_3$>}
^^{竖直间距}^^{竖直粘连}
^^{水平间距}^^{水平粘连}
\bix^^{水平间隔}
\bix^^{竖直间隔}
\explain
这些命令可以分别产生水平的和竖直的粘连。
在最简单以及最常见的情况下,即当只有 \<dimen$_1$> 存在时,
|\hskip| 向右移动 \<dimen$_1$>,而 |\vskip| 向页面下方移动 \<dimen$_1$>。
在一般情况下,这些命令产生一个\minref{粘连},其自然尺寸为 \<dimen$_1$>,
可伸长量为 \<dimen$_2$>,可收缩量为 \<dimen$_3$>。
命令中的 |plus| \<dimen$_2$> 或 |minus |\<dimen$_3$>,或两者都可以省略。
如果两者都需要,则 |plus| 必须出现在 |minus| 之前。
被省略的变量取值为零。任何 \<dimen> 都可以取负值。
%You can use |\hskip| in math mode, but you can't use |mu| units
%\seeconcept{mathematical unit}
%for any of the dimensions. If you want |mu| units, use |\mskip|
%(\xref\mskip) instead.
在数学模式下,你可以使用 |\hskip|,
但不能使用 |mu|\seeconcept{数学单位}作为任何尺寸的单位。
如果你希望使用 |mu| 作为单位,可以使用 |\mskip|(\xref\mskip )代替之。
\example
\hbox to 2in{one\hskip 0pt plus .5in two}
|
\produces
\hbox to 2in{one\hskip 0pt plus 2in two}
\doruler{\8\8}2{in}
\nextexample
\hbox to 2in{Help me!! I can't fit
{\hskip 0pt minus 2in} inside this box!!}
|
\produces
\hbox to 2in{Help me! I can't fit
{\hskip 0pt minus 2in} inside this box!}
\doruler{\8\8}2{in}
\nextexample
\vbox to 4pc{\offinterlineskip% 仅为显示 \vskip 的效果。
\hbox{一}\vskip 0pc plus 1pc \hbox{二}
\vskip .5pc \hbox{三}}
|
\produces
\smallskip
\vbox to 4pc{\offinterlineskip% Just show effects of \vskip.
% \hbox{one}\vskip 0pc plus 1pc \hbox{two}
% \vskip .5pc \hbox{three}}
\hbox{一}\vskip 0pc plus 1pc \hbox{二}
\vskip .5pc \hbox{三}}
\endexample
\enddesc
\begindesc
\cts hglue {\<glue>}
\cts vglue {\<glue>}
^^{竖直粘连}
^^{水平粘连}
\explain
%The |\hglue| command produces horizontal \minref{glue} that won't disappear at
%a line break; the |\vglue| command
%produces vertical \minref{glue} that won't disappear at a page break.
%In other respects these commands are just like |\hskip| and |\vskip|.
%You can use |\vglue| to produce blank space at the top of a page,
%e.g., above a title on the first page of a document, but
%^|\topglue| (next) is usually better for this purpose.
|\hglue| 命令生成水平的\minref{粘连},它不会在断行处消失;|\vglue| 命令生成竖直的\minref{粘连},它不会在分页处消失。除此以外,这些命令与 |\hskip| 和 |\vskip| 相似。你可以使用 |\vglue| 在文档第一页的标题上部等页面顶部产生空白间隔,但就此目的而言,随后的 ^|\topglue| 通常是更好的选择。
\enddesc
\begindesc
\cts topglue {\<glue>}
\explain
\margin{Command added; recent addition to \TeX}
%This command\footnote{|\topglue| was added to \TeX\ in version 3.0,
%later than the other enhancements introduced by ^{\newTeX}
%(\xref{newtex}). It is first described in the \emph{eighteenth\/}
%edition of \texbook.} causes the space from the top of the page to the
%top of the first box on the page to be \<glue> precisely.
%The top of the page is considered to be at the baseline of an
%imaginary line of text just above the top line of the page.
%More precisely, it's a distance |\topskip| above the origin as given by
%|\hoffset| and |\voffset|.
\margin{加入的命令;新近加入到 \TeX}
该命令
\footnote{|\topglue| 是在 \TeX\ 3.0 中引入的,
比其它由 \xinTeX\mcidxref{xinTeX}(\xref{xintex})引入的增强特性稍晚。
在 \texbook 的 \emph{18th\/} 版中第一次得到描述。}
可以精确地产生从页面顶部至该页上第一个盒子顶部的间隔。
可以认为页面顶部位于页面第一行之上的一行无形文字的基线处。
更加准确地,它在 |\hoffset| 和 |\voffset| 确定的原点之上,且间距等于 |\topskip|。
%This command is useful because \TeX\ ordinarily adjusts the glue
%produced by |\topskip| in a complex way. By using |\topglue| you can
%control the position of the first box on the page without worrying about
%those adjustments.
由于 \TeX\ 通常以非常复杂的方式调整由 |\topskip| 产生的粘连,所以这个命令是非常有用的。
通过使用 |\topglue|,你能够控制页面上第一个盒子的位置,而不必担心那些复杂的调整。
\enddesc
\begindesc
\cts kern {\<dimen>}
\explain
%The effect of this command depends on the mode that \TeX\ is in when
%it encounters it:
该命令产生的效果取决于 \TeX\ 遇到它时所处的模式:
\ulist
%\li In a horizontal mode, \TeX\ moves its position to the right (for a positive
%kern) or to the left (for a negative kern).
\li 在水平模式下,\TeX\ 向右(正的紧排)或向左(负的紧排)移动。
%\li In a vertical mode, \TeX\ moves its position down the page (for a positive
%kern) or up the page (for a negative kern).
\li 在竖直模式下,\TeX\ 向页面下方(正的紧排)或页面上方(负的紧排)移动。
\endulist
\noindent
%Thus a positive kern produces empty space while a negative kern
%causes \TeX\ to back up over something that it's already produced.
%This notion of a kern ^^{kerns}
%is different from the notion of a kern in some computerized
%typesetting systems---in \TeX, positive kerns push two letters \emph{apart}
%instead of bringing them closer together.
因此,正的紧排产生空白的间隔,而负的紧排使得 \TeX\ 倒退到已经存在的东西上。
在 \TeX 中,正的紧排将两个字母\emph{分开},而不是使它们更近一些。
^{紧排}的这一设计与一些计算化排版系统是不同的。
%A kern is similar to
%\minref{glue}, except that (a)~a kern can neither stretch nor shrink,
%and (b)~\TeX\ will only break a line or a page at a kern if the kern
%is followed by glue and is not part of a math formula.
%If \TeX\ finds a kern at the
%end of a line or a page, it discards the kern.
%If you want to get the effect of a kern that never disappears,
%use ^|\hglue| or ^|\vglue|.
紧排与\minref{粘连}相似,不同的是 (a)~紧排不能被伸展或收缩;
(b)~如果紧排后紧接粘连,并且不是数学公式的一部分时,\TeX\ 不能在紧排处断行或分页。
如果 \TeX\ 发现紧排位于一行或一页的结尾,该紧排将会被忽略。
如果你希望得到不会消失的紧排的效果,使用 ^|\hglue| 或 ^|\vglue|。
%You can use |\kern| in math mode, but you can't use |mu| units
%\seeconcept{mathematical unit}
%for \<dimen>. If you want |mu| units, use |\mkern|
%(\xref\mkern) instead.
%^^{line breaks//kerns at}
%^^{page breaks//kerns at}
你可以在数学模式中使用 |\kern|,但你不能使用 |mu| 作为 \<dimen> 的单位\seeconcept{数学单位}。
如果你希望使用 |mu| 作为单位,可以使用 |\mkern| (\xref\mkern )代替之。
^^{断行//断行处的紧排}
^^{分页//分页处的紧排}
\example
\centerline{$\Downarrow$}\kern 3pt % 竖直的紧排
\centerline{$\Longrightarrow$\kern 6pt % 水平的紧排
{\bf 留意我的警示!!}\kern 6pt % 另一水平的紧排
$\Longleftarrow$}
\kern 3pt % 另一竖直的紧排
\centerline{$\Uparrow$}
|
\produces
\centerline{$\Downarrow$}\kern 3pt % a vertical kern
\centerline{$\Longrightarrow$\kern 6pt % a horizontal kern
% {\bf Heed my warning!}\kern 6pt % another horizontal kern
{\bf 留意我的警示!}\kern 6pt % another horizontal kern
$\Longleftarrow$}
\kern 3pt % another vertical kern
\centerline{$\Uparrow$}
\endexample
\enddesc
%\begindesc
%\makecolumns 4/2:
%\cts hfil {}
%\cts hfill {}
%\cts vfil {}
%\cts vfill {}
%\explain
%\bix^^{glue//infinitely stretchable}
%These commands produce infinitely stretchable horizontal
%and vertical glue that
%overwhelms any finite stretch that may be present.
%|\hfil| and |\hfill| produce horizontal glue, while
%|\vfil| and |\vfill| produce vertical glue.
\begindesc
\makecolumns 4/2:
\cts hfil {}
\cts hfill {}
\cts vfil {}
\cts vfill {}
\explain
\bix^^{粘连//可无限伸展的粘连}
这些命令产生可无限伸展的水平或竖直的粘连,它们将取代任何存在的有限伸展。|\hfil| 和 |\hfill| 产生水平的粘连,而 |\vfil| 和 |\vfill| 产生竖直的粘连。
%|\hfill| is infinitely larger than |\hfil|.
%If both |\hfill| and |\hfil| appear in the same \minref{box},
%the |\hfill| will consume all the available extra space
%and the |\hfil| will be effectively ignored.
%|\hfill| can in turn be overwhelmed by |\hskip 0pt plus 1filll|.
%The glue produced by
%|\hfil| and |\hfill| never shrinks.
%|\hfill| 无限地大于 |\hfil|。如果 |\hfill| 和 |\hfil| 出现在一同一个\minref{盒子}里,|\hfill| 将占据所有可以获得的额外间隔,而 |\hfil| 的效应将被忽略。而 |\hfill| 可以被 |\hskip 0pt plus 1filll| 取代。由 |\hfil| 和 |\hfill| 产生的粘连不能被压缩。
%The behavior of |\vfil| and |\vfill| is analogous.
|\vfil| 和 |\vfill| 有着类似的行为。
\example
\hbox to 2in{左\hfil 中 \hfil 右}
|
\produces
%\hbox to 2in{Left\hfil Middle \hfil Right}
\hbox to 2in{左\hfil 中 \hfil 右}
\doruler{\8\8}2{in}
\nextexample
\hbox to 2in{左\hfil 中 \hfill 右}
|
\produces
%\hbox to 2in{Left\hfil Middle \hfill Right}
\hbox to 2in{左\hfil 中 \hfill 右}
\doruler{\8\8}2{in}
\nextexample
\leftline{%
\vbox to 4pc{%
\hbox{上}\vfil\hbox{中}\vfil \hbox{下}}\quad
\vbox to 4pc{%
\hbox{上}\vfil\hbox{中}\vfill\hbox{下}}}
|
\produces
\smallskip
\leftline{%
\vbox to 4pc{%
%\hbox{Top}\vfil\hbox{Middle}\vfil \hbox{Bottom}}\quad
\hbox{上}\vfil\hbox{中}\vfil \hbox{下}}\quad
\vbox to 4pc{%
%\hbox{Top}\vfil\hbox{Middle}\vfill\hbox{Bottom}}}
\hbox{上}\vfil\hbox{中}\vfill\hbox{下}}}
\endexample
%\eix^^{glue//infinitely stretchable}
%\enddesc
\eix^^{粘连//可无限伸展的粘连}
\enddesc
\begindesc
\cts hss {}
\cts vss {}
\explain
%These commands produce horizontal and vertical glue
%that is both infinitely stretchable and
%infinitely shrinkable. The glue can shrink
%to a negative distance, producing the effect of backspacing along a line
%(for |\hss|) or moving back up a page (for |\vss|).
这些命令产生水平和竖直的可无限伸展和收缩的粘连。
粘连可以收缩至负的距离,产生的效果是%
(对于 |\hss| 而言)沿一行向左移动或(对于 |\vss| 而言)向页面顶部移动。
\example
\line{正文文本\hfil\hbox to 0pt{页边空白\hss}}
% `页边空白\hss' 收缩到宽度为零的水平盒子中。
|
\produces
%\line{text\hfil\hbox to 0pt{margin\hss}}
\line{正文文本\hfil\hbox to 0pt{页边空白\hss}}
\nextexample
\vbox to 1pc{\hrule width 6pc % Top of box.
\hbox{1} \vskip 1pc\hbox to 2pc{\hfil 2}
% \vss 消除了由 \vskip 产生的额外间距。
\vss \hbox to 3pc{\hfil 3}
\hrule width 6pc}% 盒子的底部
|
\produces
\medskip
\vbox to 1pc{\hrule width 6pc % top of box
\hbox{1} \vskip 1pc\hbox to 2pc{\hfil 2}
\vss \hbox to 3pc{\hfil 3}
\hrule width 6pc}% bottom of box
\vskip 2.5pc
\endexample
\enddesc
%\begindesc
%\cts hfilneg {}
%\cts vfilneg {}
%\explain
%^^{glue//negative}
%These commands cancel the effect of a preceding |\hfil|
%or |\vfil|. While |\hfil| and |\vfil|
%produce infinitely stretchable positive \minref{glue}, |\hfilneg|
%and |\vfilneg| produce infinitely stretchable negative glue.
%(Thus, $n$ |\hfilneg|s cancel $n$ ^|\hfil|s, and similarly for
%|\vfilneg|.)
%The main use of |\hfilneg| and |\vfilneg|
%is to counteract the effect of an |\hfil| or |\vfil|
%inserted by a \minref{macro}.
\begindesc
\cts hfilneg {}
\cts vfilneg {}
\explain
^^{粘连//负粘连}
这些命令可以消除其前接的 |\hfil| 或 |\vfil| 产生的效果。当 |\hfil| 和 |\vfil| 产生正的无限可伸展的粘连时,|\hfilneg| 和 |\vfilneg| 产生负的无限可伸展粘连。(因此,$n$ |\hfilneg| 消除 $n$ ^|\hfil| 产生的效果,对于 |\vfilneg| 也是相似的。)|\hfilneg| 和 |\vfilneg| 主要的用途是抵消由\minref{宏} 引入的 |\hfil| 或 |\vfil| 产生的效果。
%|\hfilneg| and |\vfilneg| have
%the curious property that if they are the only infinitely stretchable
%glue in a box, they produce exactly the same effect as |\hfil|
%and |\vfil|.
如果它们是一个盒子中仅有的可无限伸展的粘连,|\hfilneg| 和 |\vfilneg| 则具有奇异的特性,即它们产生与 |\hfil| 和 |\vfil| 完全一致的效果。
\example
\leftline{\hfil 位于右端\hfilneg}
% 消除了 \leftline 在其参数右侧产生的 \hfil。
|
\produces
%\leftline{\hfil on the right \hfilneg}
\leftline{\hfil 位于右端 \hfilneg}
% Cancel the \hfil that \leftline produces to the right
% of its argument.
%
\nextexample
\def\a{\hbox to 1pc{\hfil 2}\vfil}
\vbox to 4pc{\hbox{1} \vfil \a
\vfilneg \hbox to 2pc{\hfil 3}}
|
\produces
\smallskip
\def\a{\hbox to 1pc{\hfil 2}\vfil}
\vbox to 4pc{\hbox{1} \vfil \a
\vfilneg \hbox to 2pc{\hfil 3}}
\endexample\enddesc
%{\emergencystretch=2em
%\see |\hbadness| and |\vbadness| (\xref \vbadness),
%|\hfuzz| and |\vfuzz| (\xref \vfuzz),
%\conceptcit{leaders}.\par}
%\eix^^{space//producing}
%\eix^^{horizontal space}
%\eix^^{vertical space}
\see |\hbadness| 和 |\vbadness|(\xref \vbadness ),
|\hfuzz| 和 |\vfuzz|(\xref \vfuzz ),及\conceptcit{指引线}。
\eix^^{间隔//产生间隔}
\eix^^{水平间隔}
\eix^^{竖直间隔}
%==========================================================================
%\section {Manipulating boxes}
\section {操作盒子}
%==========================================================================
%\subsection {Constructing hboxes and vboxes}
\subsection {构造 hbox 和 vbox}
%\begindesc
%\bix^^{box commands}
%^^{hboxes//constructing with \b\tt\\hbox\e}
\begindesc
\bix^^{盒子命令}
^^{水平盒子//用 \b\tt\\hbox\e 构造}
%
\cts hbox {\rqbraces{\<horizontal mode material>}}
\aux\cts hbox {{\bt to} \<dimen> \rqbraces{\<horizontal mode material>}}
\aux\cts hbox {{\bt spread} \<dimen> \rqbraces{\<horizontal mode material>}}
\explain
%This command produces an hbox
%(horizontal \minref{box}) containing \<horizontal mode material>.
%The braces around \<horizontal mode material> define a group.
%\TeX\ doesn't break the \<horizontal mode material> into lines,
%since it's in restricted horizontal mode when it's assembling the box.
%\TeX\ won't change the size of the box once it's been produced.
该命令产生一个 hbox(水平\minref{盒子})以容纳 \<horizontal mode material>。
\<horizontal mode material> 两侧的大括号定义一个编组。
\TeX\ 不会对 \<horizontal mode material> 断行,
因为当其组装盒子时它处于受限水平模式下。一旦盒子生成后,\TeX\ 不会改变其大小。
%|\hbox| is often useful when you want to keep some text all on one line.
%If your use of |\hbox| prevents \TeX\ from breaking lines in an acceptable
%way, \TeX\ will complain about an overfull hbox.
当你希望将一些文字全部放在一行上时,|\hbox| 是有用的。
如果你所用的 |\hbox| 使得 \TeX\ 不能以一种可以接受的方式断行时,
\TeX\ 会给出 hbox 过满的警告。
%The width of the hbox depends on the arguments to |\hbox|:
%\ulist\compact
%\li If you specify only \<horizontal mode material>,
%the hbox will have its natural \minref{width}.
%\li If you specify |to| \<dimen>, the width of the hbox will be \<dimen>.
%\li If you specify |spread| \<dimen>, the width of the hbox will be
%its natural width plus \<dimen>, i.e., the hbox will be spread out by
%\<dimen>.
%\endulist
hbox 的宽度取决于 |\hbox| 的参数:
\ulist\compact
\li 如果你只设定了 \<horizontal mode material>,hbox 将具有参数本身的\minref{宽度}。
\li 如果你设定了 |to| \<dimen>,则 hbox 的宽度将是 \<dimen>。
\li 如果你设定了 |spread| \<dimen>,则 hbox 的宽度将是参数本身的宽度再加上 \<dimen>,也就是说,hbox 将伸展 \<dimen>。
\endulist
%The ^|\hfil| command (\xref\hfil) is useful for filling out an
%hbox with empty space when the material in the box isn't as wide as
%the width of the box.
当盒子中内容的宽度没有盒子宽,需要使用空白间隔来填充 hbox 时,^|\hfil| 命令(\xref\hfil )是非常有用的。
\example
\hbox{ugly suburban sprawl}
\hbox to 2in{ugly \hfil suburban \hfil sprawl}
\hbox spread 1in {ugly \hfil suburban \hfil sprawl}
% 在上面两行中,如果去掉 \hfil,将会得到 `underfull hbox' 警告。
|
\produces
\hbox{ugly suburban sprawl}
\hbox to 2in{ugly \hfil suburban \hfil sprawl}
\hbox spread 1in {ugly \hfil suburban \hfil sprawl}
% Without \hfil in the two preceding lines,
% you'd get `underfull hbox'es.
\doruler{\8\8\8}3{in}
\endexample
\enddesc
%\begindesc
%\cts vtop {\<vertical mode material>}
%\aux\cts vtop {{\bt to} \<dimen> \rqbraces{\<vertical mode material>}}
%\aux\cts vtop {{\bt spread} \<dimen> \rqbraces{\<vertical mode material>}}
%\cts vbox {\rqbraces{\<vertical mode material>}}
%\aux\cts vbox {{\bt to} \<dimen> \rqbraces{\<vertical mode material>}}
%\aux\cts vbox {{\bt spread} \<dimen> \rqbraces{\<vertical mode material>}}
%\explain
%^^{hbox//constructing with \b\tt\\hbox\e}
%These commands
%produce a \minref{vbox} (vertical \minref{box})
%containing \<vertical mode material>.
%The braces around \<vertical mode material> define a group.
%\TeX\ is in internal vertical mode when it's assembling the box.
%\TeX\ won't change the size of the box once it's been produced.
\begindesc
\cts vtop {\<vertical mode material>}
\aux\cts vtop {{\bt to} \<dimen> \rqbraces{\<vertical mode material>}}
\aux\cts vtop {{\bt spread} \<dimen> \rqbraces{\<vertical mode material>}}
\cts vbox {\rqbraces{\<vertical mode material>}}
\aux\cts vbox {{\bt to} \<dimen> \rqbraces{\<vertical mode material>}}
\aux\cts vbox {{\bt spread} \<dimen> \rqbraces{\<vertical mode material>}}
\explain
^^{水平盒子//用 \b\tt\\hbox\e 构造}
这些命令产生一个 \minref{vbox}(竖直\minref{盒子})以容纳 \<vertical mode material>。
\<vertical mode material> 两侧的大括号定义一个编组。
当 \TeX\ 组装盒子时它处于内部竖直模式下。一旦盒子生成后,\TeX\ 不会改变其大小。
%The difference between |\vtop| and |\vbox| lies in where \TeX\ puts
%the reference point of the constructed vbox.
%Ordinarily, the reference point gotten from |\vtop| tends to be at or near
%the top of the constructed vbox,
%while
%the reference point gotten from |\vbox| tends to be at or near
%the bottom of the constructed vbox.
%Thus a row of vboxes all constructed with |\vtop|
%will tend to have their tops nearly in a line,
%while a row of vboxes all constructed with |\vbox|
%will tend to have their bottoms nearly in a line.
|\vtop| 和 |\vbox| 之间的不同点在于 \TeX\ 放置已构成的 vbox 的基准点的位置。
通常情况下,由 |\vtop| 获得的基准点位于或接近于已构成的 vbox 的顶部;
而 |\vbox| 获得的基准点位于或接近于已构成的 vbox 的底部。
因此,一行全部由 |\vtop| 构成的 vbox,其顶部将会近似在一条线上;
相应地,一行全部由 |\vbox| 构成的 vbox,其底部将会近似在一条线上。
%|\vtop| and |\vbox| are often useful
%when you want to keep some text together on a single page.
%(For this purpose, it usually doesn't matter which command you use.)
%If your use of these commands
%prevents \TeX\ from breaking pages in an acceptable
%way, \TeX\ will complain that it's found an overfull or underfull vbox while
%|\output| is active.
当你希望将一些文字放在单独的一页上时,|\vtop| 和 |\vbox| 是有用的。%
(为了这个目的,它通常不在乎你使用的命令。)%
如果你使用这些命令使得 \TeX\ 不能以一种可以接受的方式分页时,
\TeX\ 会在 |\output| 处于活动的情况下,给出 vbox 过满或不足的警告。
%The height of a vbox depends on
%the arguments to |\vtop| or |\vbox|.
%For |\vbox|, \TeX\ determines the height as follows:
%\ulist\compact
%\li If you specify only \<vertical mode material>,
%the vbox will have its natural height.
%\li If you specify |to| \<dimen>,
%the height of the vbox will be \<dimen>.
%\li If you specify |spread| \<dimen>, the height of the vbox will be
%its natural height plus \<dimen>, i.e.,
%the height of the vbox will be stretched vertically by \<dimen>.
%\endulist
%\noindent
%For |\vtop|,
%\TeX\ constructs the box using its rules for |\vbox| and then
%apportions the vertical extent between the height and the depth as
%described below.
vbox 的高度取决于 |\vtop| 或 |\vbox| 的参数。对于 |\vbox|,\TeX\ 采用如下方法确定其高度:
\ulist\compact
\li 如果你只设定 \<vertical mode material>,vbox 将具有参数本身的高度。
\li 如果你设定 |to| \<dimen>,vbox 的高度将是 \<dimen>。
\li 如果你设定了 |spread| \<dimen>,则 vbox 的高度将是参数本身的高度再加上 \<dimen>,
也就是说,vbox 将在竖直方向上伸展 \<dimen>。
\endulist
\noindent
对于 |\vtop|,\TeX\ 采用 |\vbox| 一样的规则来构造盒子,
然后以下面描述的方法在高度和深度之间分配竖直方向上的扩展。
%Ordinarily, the width of a constructed vbox is the width of the widest
%item inside it.\footnote
%{More precisely, it's the distance from the reference point to the rightmost
%edge of the constructed vbox. Therefore,
%if you move any of the items right using ^|\moveright| or
%^|\moveleft| (with a negative distance),
%the constructed vbox might be wider.}
%The rules for apportioning the vertical extent between the
%height and the depth are more complicated:
%\ulist
%\li For |\vtop|,
%the height is the height of its first item, if that item is a box or rule.
%Otherwise the height is zero. The depth is whatever vertical
%extent remains after the height is subtracted.
%\li For |\vbox|,
%the depth is the depth of its last item, if that item is a box or rule.
%Otherwise the depth is zero. The height is whatever vertical
%extent remains after the depth is subtracted.%
%\footnote{In fact, there's a further complication.
%Suppose that after the depth has been determined
%using the two rules just given, the depth turns out to be greater than
%^|\boxmaxdepth|.
%Then the depth is reduced to |\boxmaxdepth| and the height is adjusted
%accordingly.}
%\endulist
通常,构造的 vbox 的宽度是其内部最宽项目的宽度。
\footnote{更准确地说,是从基准点至构造的 vbox 最右侧之间的距离。
因此,如果你使用 ^|\moveright| 或(负数距离的)^|\moveleft| 向右移动任何项目,
那么构造的 vbox 则可能更宽。}
在高度与深度间分配竖直扩展的规则更加复杂:
\ulist
\li 对于 |\vtop|,如果第一个项目是一个盒子或标线,则其高度是其第一个项目的高度。
否则,其高度是零。深度是减去高度后的竖直扩展。
\li 对于 |\vbox|,如果最后一个项目是一个盒子或标线,则其深度是其最后一个项目的深度。
否则浓度是零。高度是减去深度后的竖直扩展。
\footnote{实际上,规则可以更加复杂。假定在深度确定后,使用给出的两条规则,
则深度将会大于 ^|\boxmaxdepth|。 随后,深度将被缩小至 |\boxmaxdepth|,高度也相应地被调整。}
\endulist
%The |\vfil| command (\xref\vfil) is useful for filling out a vbox
%^^|\vfil//filling a vbox|
%with empty space when the material in the box isn't as tall as
%the vertical extent of the box.
当盒子中内容的高度没有盒子竖直伸展高,
需要使用空白间隔来填充 vbox ^^|\vfil//填充竖直盒子|时,
^|\vfil| 命令(\xref\vfil )是非常有用的。
\example
\hbox{\hsize = 10pc \raggedright\parindent = 1em
\vtop{在这个例子中,我们将看到如何使用 vbox 产生双栏的效果。
每个 vbox 都包含两个段落,除了设置为左对齐以外均依照 \TeX
通常的规则进行排版。\par
这实际上并不是获得真正双栏的最好的方法,因为两栏}
\hskip 2pc
\vtop{\noindent
并不对称,而且我们无法自动选择第一栏在何处断开,
甚至不能确定第一栏的最后一行。\par
然而,将行文放在 vbox 中是一个将文本放在页面上
你希望的位置上的有用的技巧。
}}
|
\produces
\hbox{\hsize = 10pc \raggedright\parindent = 1em
%\vtop{In this example, we see how to use vboxes to
%produce the effect of double columns. Each vbox
%contains two paragraphs, typeset according to \TeX's
%usual rules except that it's ragged right.\par
%This isn't really the best way to get true double
%columns because the columns}
%\hskip 2pc
%\vtop{\noindent
%aren't balanced and we haven't done anything to choose
%the column break automatically or even to fix up the
%last line of the first column.\par
%However, the technique of putting running text into a
%vbox is very useful for placing that text where you
%want it on the page.}}
\vtop{在这个例子中,我们将看到如何使用 vbox 产生双栏的效果。
每个 vbox 都包含两个段落,除了设置为左对齐以外均依照 \TeX
通常的规则进行排版。\par
这实际上并不是获得真正双栏的最好的方法,因为两栏}
\hskip 2pc
\vtop{\noindent
并不对称,而且我们无法自动选择第一栏在何处断开,
甚至不能确定第一栏的最后一行。\par
然而,将行文放在 vbox 中是一个将文本放在页面上
你希望的位置上的有用的技巧。
}}
\nextexample
\hbox{\hsize = 1in \raggedright\parindent = 0pt
\vtop to .75in{\hrule 这个盒子的深度是 .75in。 \vfil\hrule}
\qquad
\vtop{\hrule 这个盒子具体其本身的深度。 \vfil\hrule}
\qquad
\vtop spread .2in{\hrule 这个盒子的深度比其自身的深度多 .2in。\vfil\hrule}}
|
\produces
\hbox{\hsize = 1in \raggedright\parindent=0pt
%\vtop to .75in{\hrule This box is .75in deep. \vfil\hrule}
\vtop to .75in{\hrule 这个盒子的深度是 .75in。 \vfil\hrule}
\qquad
%\vtop{\hrule This box is at its natural depth. \vfil\hrule}
\vtop{\hrule 这个盒子具体其本身的深度。 \vfil\hrule}
\qquad
%\vtop spread .2in{\hrule This box is .2in deeper than
% its natural depth.\vfil\hrule}}
\vtop spread .2in{\hrule 这个盒子的深度比其自身的深度多 .2in。\vfil\hrule}}
\nextexample
% 显示 \vbox 是如何底部对齐,而非顶部对齐的。
\hbox{\hsize = 1in \raggedright
\vbox to .5in{\hrule 这个盒子的深度是 .5in。\vfil\hrule}
\qquad
\vbox to .75in{\hrule 这个盒子的深度是 .75in。\vfil\hrule}}
|
\produces
\hbox{\hsize = 1in \raggedright
%\vbox to .5in{\hrule This box is .5in deep.\vfil\hrule}
\vbox to .5in{\hrule 这个盒子的深度是 .5in。\vfil\hrule}
\qquad
%\vbox to .75in{\hrule This box is .75in deep.\vfil\hrule}}
\vbox to .75in{\hrule 这个盒子的深度是 .75in。\vfil\hrule}}
\vskip 16pt % to avoid running into the next command description
\endexample
\enddesc
\begindesc
%\margin{Two commands interchanged here.}
\margin{可交换的两个命令}
\cts boxmaxdepth {\param{dimen}}
\explain
%This parameter contains a dimension $D$.
%\TeX\ will not construct a box whose depth exceeds $D$.
%If you produce a box whose depth $d$ would exceed $D$,
%\TeX\ will transfer the
%excess depth to the height of the box, effectively moving the
%\minref{reference point} of the box down by $d-D$.
%If you set |\boxmaxdepth| to zero, \TeX\ will line up a row of vboxes
%so that their bottom boundaries all lie on the same horizontal line.
%\PlainTeX\ sets |\boxmaxdepth| to |\maxdimen| \ctsref{\maxdimen},
%so |\boxmaxdepth| won't affect your boxes unless you change it.
这个参数包含的是一个尺寸 $D$。如果盒子的深度超过 $D$,\TeX\ 将不会构造这个盒子。
如果你生成一个盒子,其深度 $d$ 大于 $D$,\TeX\ 将超出的深度传递给盒子的高度,
即高效地将盒子的\minref{基准点}向下移动 $d-D$。如果你将 |\boxmaxdepth| 设为零,
\TeX\ 会将盒子向上排一列,以便它们的底线都位于同一个水平线上。
\PlainTeX\ 将 |\boxmaxdepth| 设为 |\maxdimen|\ctsref{\maxdimen},
因此,|\boxmaxdepth| 不会影响你的盒子,除非你有意改动它。
\enddesc
\begindesc
\cts underbar {\<argument>}
\explain
%This command puts \<argument> into an \minref{hbox}
%and underlines it without regard to anything that protrudes below the
%\minref{baseline} of the box.
这个命令将 \<argument> 放入到一个 \minref{hbox},并在其下划线,而不考虑任何突出到盒子的\minref{基线}以下的东西。
\example
\underbar{为什么不学习 \TeX?}
|
\produces
%\underbar{为什么不学习 \TeX?}
\underbar{Why not learn \TeX?}
\endexample
\enddesc
\begindesc
\cts everyhbox {\param{token list}}
\cts everyvbox {\param{token list}}
\explain
%These parameters contain token lists that \TeX\ expands at the start of
%every \minref{hbox} or \minref{vbox} that it constructs.
%Any items resulting from the expansion then become
%the beginning of the list of items for the box.
%By default these token lists are empty.
这些参数包含的是记号列表。\TeX\ 会在开始构造每个 \minref{hbox} 或 \minref{vbox} 时对其进行扩展。来自于扩展的任何项目随后成为盒子的项目列表的开始。这些记号列表默认是空的。
\enddesc
%==========================================================================
%\subsection {Setting and retrieving the contents of boxes}
\subsection {设置和获取盒子的内容}
%\begindesc
%\bix^^{box registers}
%%
%\cts setbox {\<register>\thinspace{\bt =}\thinspace\<box>}
%\cts box {\<register>}
%\explain
%^^{assignments//of boxes}
%These commands respectively set and retrieve the contents
%of the box register
%whose number is \<register>.
%Note that you set a box register a little differently than
%you set the other kinds of registers: you use
%|\setbox|$\,n$~|=| rather than |\box|$\,n$~|=|.
\begindesc
\bix^^{盒子寄存器}
%
\cts setbox {\<register>\thinspace{\bt =}\thinspace\<box>}
\cts box {\<register>}
\explain
^^{赋值//给盒子赋值}
这些命令分别设置和获取编号为 \<register> 的盒子寄存器的内容。
需要注意,设置盒子寄存器与设置其它寄存器有细微的差别:
你应该使用 |\setbox|$\,n$~|=|,而不是 |\box|$\,n$~|=|。
%\emph{Retrieving the contents of a box register
%with these commands has the side effect of emptying it,
%so that the box register become void.} If you don't want that to happen,
%you can use |\copy| (see below) to retrieve the contents.
%You should use |\box| in preference to |\copy|
%when you don't care about what's in a box register after you've used it,
%so as not to exhaust \TeX's memory by filling it with obsolete boxes.
\emph{使用这些命令获取盒子寄存器中的内容时,有清空其内容的副作用,所以盒子寄存器将失效。}如果你不希望这些发生,你可以使用 |\copy|(参见后面的内容)来获取内容。如果你不在乎你使用之后的盒子寄存器中的内容,你应该优先使用 |\box| 而不是 |\copy|,这样可以不致于用废弃的盒子来消耗 \TeX\ 的内存。
\example
\setbox0 = \hbox{蘑菇}
\setbox1 = \vbox{\copy0\box0\box0}
\box1
|
\produces
%\setbox0 = \hbox{mushroom}
\setbox0 = \hbox{蘑菇}
\setbox1 = \vbox{\copy0\box0\box0}
\box1
\endexample
\enddesc
%\begindesc
%\cts copy {\<register>}
%\explain
%^^{boxes//copying}%\minrefs{box}
%\minrefs{盒子}
%This command
%produces a copy of box register \<register>.
%This command is useful when you want to retrieve the contents of a box
%register but don't want to destroy the contents.
%(Retrieving the register contents with ^|\box| makes the register void.)
\begindesc
\cts copy {\<register>}
\explain
^^{盒子//复制盒子}%\minrefs{box}
\minrefs{盒子}
这个命令可以产生盒子寄存器 \<register> 的一个拷贝。当你希望获取一个盒子的内容,
但又不希望破坏其中的内容时是有用的。(使用 ^|\box| 获取寄取器内容会使寄存器失效。)
\example
\setbox0 = \hbox{美好}
祝你拥有 \copy0 \box0 \box0 的一天!
|
\produces
%\setbox0 = \hbox{good }
%Have a \copy0 \box0 \box0 day!
\setbox0 = \hbox{美好}