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
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
|
% -*- 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 中引入的,
比其它由^{\newTeX}(\xref{newtex})引入的增强特性稍晚。
在 \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{美好}
祝你拥有 \copy0 \box0 \box0 的一天!
\endexample
\enddesc
%\begindesc
%\cts unhbox {\<register>}
%\cts unvbox {\<register>}
%^^{boxes//extracting contents of}
%\explain
%These commands produce the list contained in box register \<register> and make
%that box register void.
%|\unhbox| applies to box registers containing
%hboxes and |\unvbox| applies to box registers containing vboxes.
%You should use these commands in preference to |\unhcopy| and |\unvcopy|
%(see below)
%when you don't care about what's in the box register after you've used it,
%so as not to exhaust \TeX's memory by filling it with obsolete boxes.
\begindesc
\cts unhbox {\<register>}
\cts unvbox {\<register>}
^^{盒子//提取盒子的内容}
\explain
这些命令可以给出盒子寄存器 \<register> 容纳的列表,并且使盒子寄存器失效。
|\unhbox| 适用于包含 hbox 的盒子寄存器,而 |\unvbox| 适用于包含 vbox 的盒子寄存器。
当你不在乎你使用之后的盒子寄存器中的内容,你应该优先使用这些命令而不是 |\unhcopy| 和 |\unvcopy|,
这样可以不致于用废弃的盒子来消耗 \TeX\ 的内存。
\example
\setbox0=\hbox{素甲鱼深深地叹息着,用一只手背抹着眼泪。}
\setbox1=\hbox{他想说话,可是有好一阵子泣不成声。}
\unhbox0 \unhbox1
% \box0 \box1 将并排设置两个 hbox
% (并且输出难看的过满行)。
\box1 % 什么也不输出。
|
\produces
%\setbox0=\hbox{The Mock Turtle sighed deeply, and
%drew the back of one flapper across his eyes. }
%\setbox1=\hbox{He tried to speak, but sobs choked
% his voice. }
\setbox0=\hbox{素甲鱼深深地叹息着,用一只手背抹着眼泪。}
\setbox1=\hbox{他想说话,可是有好一阵子泣不成声。}
\unhbox0 \unhbox1
% \hbox0 \hbox1 would set two hboxes side by side
% (and produce a badly overfull line).
\box1 % Produces nothing.
\endexample
\enddesc
%\begindesc
%\cts unhcopy {\<register>}
%\cts unvcopy {\<register>}
%^^{boxes//extracting contents of}
%^^{boxes//copying }%\minrefs{box}
%\minrefs{盒子}
%\explain
\begindesc
\cts unhcopy {\<register>}
\cts unvcopy {\<register>}
^^{盒子//提取盒子的内容}
^^{盒子//复制盒子}%\minrefs{box}
\minrefs{盒子}
\explain
%These commands produce the list contained in box register \<register> and
%leave the contents of the register undisturbed.
%|\unhcopy| applies to box registers containing hboxes
%and |\unvcopy| applies to box registers containing vboxes.
这些命令可以给出盒子寄存器 \<register> 容纳的列表,并且保持寄存器的内容不被改变。
|\unhcopy| 适用于包含 hbox 的盒子寄存器,而 |\unvcopy| 适用于包含 vbox 的盒子寄存器。
\example
\setbox0=\hbox{素甲鱼深深地叹息着,用一只手背抹着眼泪。}
\setbox1=\hbox{他想说话,可是有好一阵子泣不成声。}
\unhcopy0 \unhcopy1\par\noindent
% \box0 \box1 将并排设置两个 hbox
% (并且输出难看的过满行)。
\box1 % 输出一个(不能被断行)hbox。
|
\produces
%\setbox0=\hbox{The Mock Turtle sighed deeply, and
%drew the back of one flapper across his eyes. }
%\setbox1=\hbox{He tried to speak, but sobs choked his
% voice. }
\setbox0=\hbox{素甲鱼深深地叹息着,用一只手背抹着眼泪。}
\setbox1=\hbox{他想说话,可是有好一阵子泣不成声。}
\unhcopy0 \unhcopy1\par\noindent
% \hbox0 \hbox1 would set two hboxes side by side
% (and produce a badly overfull line).
\box1 % produces an hbox (which can't be broken)
\endexample
\enddesc
%\see |\wd|, |\dp|, |\ht| (\xref\ht).
%\eix^^{box registers}
\see |\wd|, |\dp|, |\ht|(\xref\ht )。
\eix^^{盒子寄存器}
%==========================================================================
%\subsection {Shifting boxes}
\subsection {移动盒子}
%\begindesc
%\cts moveleft {\<dimen> \<box>}
%\cts moveright {\<dimen> \<box>}
%\bix^^{boxes//shifting}
%%\minrefs{box}
%\minrefs{盒子}
%\explain
%These commands move \<box> left or right by \<dimen> (which can be
%negative). You can only apply |\moveleft| and |\moveright| to a box
%that's in a \minref{vertical list}.
\begindesc
\cts moveleft {\<dimen> \<box>}
\cts moveright {\<dimen> \<box>}
\bix^^{盒子//移动盒子}
%\minrefs{box}
\minrefs{盒子}
\explain
这些命令将 \<box> 向左或右移动 \<dimen>(这个数值可以是负的)。
你只能对存在于\minref{竖直列表} 中的盒子使用 |\moveleft| 和 |\moveright|。
\example
\vbox{\vbox{Phoebe}\vbox{walked}%
\moveleft 20pt\vbox{a}\moveright 20pt\vbox{crooked}%
\vbox{mile.}}
|
\produces
\hfuzz = \maxdimen
\vbox{\vbox{Phoebe}\vbox{walked}%
\moveleft 20pt\vbox{a}\moveright 20pt\vbox{crooked}%
\vbox{mile.}}
\endexample
\enddesc
\begindesc
\cts lower {\<dimen> \<box>}
\cts raise {\<dimen> \<box>}
\explain
%These commands move \<box> up or down by \<dimen>
%(which can be negative).
%You can only apply |\raise| and |\lower| to a box
%that's in a \minref{horizontal list}.
这些命令将 \<box> 向上或下移动 \<dimen>(这个数值可以是负的)。你只能对存在于\minref{水平列表} 中的盒子使用 |\raise| 和 |\lower|。
\example
关于你鼻子上的 \lower 6pt \hbox{肿块},你觉得
\raise 6pt \hbox{沮丧}吗?
|
\produces
%Are you feeling \lower 6pt \hbox{depressed} about the
% \raise 6pt \hbox{bump} on your nose?
关于你鼻子上的 \lower 6pt \hbox{肿块},你觉得
\raise 6pt \hbox{沮丧}吗?
\endexample
\eix^^{盒子//移动盒子}
\enddesc
%==========================================================================
%\subsection {Dimensions of box registers}
\subsection {盒子寄存器的尺寸}
%\begindesc
%\bix^^{box registers}
%\bix^^{dimensions//of box registers}
%\cts ht {\<register>\param{dimen}}
%\cts dp {\<register>\param{dimen}}
%\cts wd {\<register>\param{dimen}}
%\explain
%These parameters refer to the ^{height}, ^{depth}, and ^{width}
%respectively of \minref{box} \minref{register} \<register>.
%You can use them to find out the dimensions of a box.
%You can also change the dimensions of a box, but it's a tricky business;
%if you want to be adventurous you can
%learn all about it from \knuth{pages~388--389}.
\begindesc
\bix^^{盒子寄存器}
\bix^^{尺寸//盒子寄存器的尺寸}
\cts ht {\<register>\param{dimen}}
\cts dp {\<register>\param{dimen}}
\cts wd {\<register>\param{dimen}}
\explain
这些参数分别表示\minref{盒子}\minref{寄存器} \<register> 的^{高度}、^{深度}和^{宽度}。
你可以使用这些命令获得一个盒子的尺寸。你也可以改变一个盒子的尺寸,但这是一个需要技巧的事情;
如果你希望成为冒险者,你可以从 \knuth{pages~388--389} 中获得全部的技巧。
\example
\setbox0 = \vtop{\hbox{一个}\hbox{米黄色的}\hbox{兔子}}%
那个盒子的宽度是 \the\wd0,高度是 \the\ht0,
深度是 \the\dp0。
|
\produces
%\setbox0 = \vtop{\hbox{a}\hbox{beige}\hbox{bunny}}%
%The box has width \the\wd0, height \the\ht0,
%and depth \the\dp0.
\setbox0 = \vtop{\hbox{一个}\hbox{米黄色的}\hbox{兔子}}%
那个盒子的宽度是 \the\wd0,高度是 \the\ht0,
深度是 \the\dp0。
%\endexample
%\eix^^{box registers}
%\eix^^{dimensions//of box registers}
%\enddesc
\endexample
\eix^^{盒子}
\eix^^{尺寸//盒子寄存器的尺寸}
\enddesc
%==========================================================================
%\subsection {Struts, phantoms, and empty boxes}
\subsection {支架、幻影和空盒子}
\begindesc
%\margin{This subsection is a merger of two previous subsections.
%The commands have also been reordered.}
\margin{这一小节是前两个小节的联合体。相应的命令也被重新排序。}
%\bix^^{struts}
%\cts strut {}
%\explain
%This command produces a box whose width is zero
%and whose height (|8.5pt|) and depth (|3.5pt|)
%are those of a more or less typical line of type in |cmr10|,
%the default \plainTeX\ font.
%Its main use is in forcing lines to have the same height
%when you've disabled \TeX's interline glue with
%|\offinter!-lineskip| ^^|\offinterlineskip| or a similar command,
%e.g., when you're constructing an alignment.
%If the natural height of a line is
%too short, you can bring it up to standard by including a |\strut|
%in the line. The strut will force the height and depth of the line
%to be larger, but it won't print anything or consume any horizontal
%space.
\bix^^{支架}
\cts strut {}
\explain
这个命令产生一个宽度为零的盒子,
盒子的高度 (|8.5pt|) 和深度 (|3.5pt|) 与用 \plainTeX\ 的默认字体 |cmr10| 排出的典型的一行文字是一致的。
当你使用 |\offinter!-lineskip| ^^|\offinterlineskip| 或类似的命令关闭 \TeX\ 的行间粘连,
如你正在构建一个阵列时,该命令主要用于强迫一行具有相同的高度。
如果一行的自然高度过矮,你可以在行中插入一个 |\strut| 使它回到标准的高度。
支架将使得一行的高度和深度更大一些,但它不会打印出任何东西,或者消耗任何水平间隔。
%If you're setting type in a font that's bigger or smaller than |cmr10|,
%you should redefine |\strut| for that context.
如果你正在使用一个大于或小于 |cmr10| 的字体排版,你应该根据所处环境重新定义 |\strut|。
\example
\noindent % 使我们处于水平模式下。
\offinterlineskip % 我们得到固有的间隔。
% 下面这些 vbox 中的句号在竖直方向不是等间距的。
\vtop{\hbox{.}\hbox{.(}\hbox{.x}
\hbox{.\vrule height 4pt depth 0pt}}\qquad
% 因为支架的缘故,
%下面这些 vbox 中的句号在竖直方向上则是等间距的。
\vtop{\hbox{.\strut}\hbox{.(\strut}\hbox{.x\strut}
\hbox{.\vrule height 4pt depth 0pt\strut}}
|
\produces
\noindent % So we're in horizontal mode.
\offinterlineskip % So we get the inherent spacing.
% The periods in this vbox are not vertically equidistant.
\vtop{\hbox{.}\hbox{.(}\hbox{.x}
\hbox{.\vrule height 4pt depth 0pt}}\qquad
% The periods in this vbox are vertically equidistant
% because of the struts.
\vtop{\hbox{.\strut}\hbox{.(\strut}\hbox{.x\strut}
\hbox{.\vrule height 4pt depth 0pt\strut}}
\endexample
\enddesc
\begindesc
\cts mathstrut {}
\explain
%This command produces a phantom formula whose width is zero
%and whose height and depth are the same as those of a left parenthesis.
%|\mathstrut| is in fact defined as `|\vphantom(|'.
%Its main use is for getting radicals, underbars, and overbars to line
%up with other radicals, underbars, and overbars in a formula.
%It is much like ^|\strut| (\xref \strut),
%except that it adjusts itself to the different \minref{style}s
%that can occur in math formulas.
这个命令产生一个宽度为零的幻影公式,它的高度与深度与左圆括号是一致的。
|\mathstrut| 实际上的定义是 `|\vphantom(|'。
它主要用于使得根号、下横线和上横线能与公式中其它的根号、下横线和上横线成行排列。
除能根据出现在数学公式中的不同\minref{样式}自动调节以外,它与 ^|\strut| (\xref \strut)非常相似。
\example
$$\displaylines{
\overline{a_1a_2} \land \overline{b_1b_2}
\quad{\rm versus}\quad \overline{a_1a_2\mathstrut}
\land \overline{b_1b_2\mathstrut}\cr
\sqrt{\epsilon} + \sqrt{\xi} \quad{\rm versus}\quad
\sqrt{\epsilon\mathstrut} + \sqrt{\xi\mathstrut}\cr}$$
|
\dproduces
\kern 4pt
$$\displaylines{
\overline{a_1a_2} \land \overline{b_1b_2}
\quad{\rm versus}\quad \overline{a_1a_2\mathstrut}
\land \overline{b_1b_2\mathstrut}\cr
\sqrt{\epsilon} + \sqrt{\xi} \quad{\rm versus}\quad
\sqrt{\epsilon\mathstrut} + \sqrt{\xi\mathstrut}\cr}$$
\endexample
\eix^^{支架}
\enddesc
%\begindesc
%\cts phantom {\<argument>}
%\explain
%\bix^^{boxes//phantom}
%\bix^^{phantoms}
%This command produces an empty \minref{box}
%having the same size and placement
%that \<argument> would have were it typeset.
%One use of |\phantom| is for reserving space for a symbol that for some
%reason needs to be drawn in by hand.
\begindesc
\cts phantom {\<argument>}
\explain
\bix^^{盒子//幻影盒子}
\bix^^{幻影}
此命令产生一个空\minref{盒子},它的大小和位置与假定 \<argument> 被排版出来时的相同。
因某种原因需要手工给一个符号留出空间时,|\phantom| 就可派上用场。
\example
$1\phantom{9}2$
|
\produces
$1\phantom{9}2$
\endexample
\enddesc
\begindesc
\cts hphantom {\<argument>}
\cts vphantom {\<argument>}
\explain
%These commands produce phantom boxes\minrefs{box}\ that
%don't print anything:
%\ulist\compact
%\li |\hphantom| produces a box with the same width as \<argument>
%but zero height and depth.
%\li |\vphantom| produces a box with the same height and depth as \<argu\-ment>
%but zero width.
%\endulist
%\noindent
%Their main purpose is to force a subformula to have a certain minimum
%horizontal or vertical dimension.
这些命令产生幻影盒子\minrefs{box},并不打印任何东西:
\ulist\compact
\li |\hphantom| 产生一个宽度与 \<argument> 一致的盒子,但高度与深度均为零。
\li |\vphantom| 产生一个高度与深度与 \<argu\-ment> 一致的盒子,但宽度为零。
\endulist
\noindent
它们的主要目的是迫使一个子公式具有特定的最小水平或竖直尺寸。
\example
$$\left[\vphantom{u\over v}t\right] \star
\left[{u\over v}\right]\quad
\{\hphantom{xx}\}$$
|
\dproduces
\kern 4pt
$$\left[\vphantom{u\over v}t\right] \star
\left[{u\over v}\right]\quad
\{\hphantom{xx}\}$$
\endexample
\enddesc
\begindesc
\cts smash {\<argument>}
\explain
%This command typesets \<argument>,
%but forces the height and depth of its containing \minref{box} to be zero.
%You can use |\smash| and |\vphantom| in combination to give a subformula
%any height and depth that you wish.
该命令排出 \<argument>,但迫使其包含的\minref{盒子}的高度和深度设为零。你可以联合使用 |\smash| 和 |\vphantom| 来获得任何你期望高度与深度的子公式。
\example
$${\smash{r_m \brace r_n}\vphantom{r}} \Longrightarrow r$$
|
\dproduces
\kern 4pt
$${\smash{r_m \brace r_n}\vphantom{r}} \Longrightarrow r$$
\endexample
%\eix^^{boxes//phantom}
%\eix^^{phantoms}
%\enddesc
\eix^^{盒子//幻影盒子}
\eix^^{幻影}
\enddesc
%\begindesc
%^^{boxes//empty}
%\cts null {}
%\explain
%This command produces an empty \minref{hbox}.
\begindesc
^^{盒子//空盒子}
\cts null {}
\explain
这个命令产生一个空的 \minref{hbox}。
\example
\setbox0 = \null
空盒子 \null 的宽度是 \the\wd0,高度是 \the\ht0,
深度是 \the\dp0。
|
\produces
\setbox0 = \null
%The null box \null has width \the\wd0, height \the\ht0,
%and depth \the\dp0.
空盒子 \null 的宽度是 \the\wd0,高度是 \the\ht0,
深度是 \the\dp0。
\endexample
\enddesc
%==========================================================================
%\subsection {Parameters pertaining to malformed boxes}
\subsection {有关畸形盒子的参数}
%\begindesc
%\bix^^{boxes//overfull}
%\bix^^{boxes//underfull}
%\cts overfullrule {\param{dimen}}
%\explain
%This parameter specifies the width of the rule
%that \TeX\ appends to an overfull \minref{hbox}.
%\PlainTeX\ sets it to |5pt|.
\begindesc
\bix^^{盒子//过满盒子}
\bix^^{盒子//未满盒子}
\cts overfullrule {\param{dimen}}
\explain
这个参数设定 \TeX\ 附加在过满\minref{水平盒子}后的标线的宽度。\PlainTeX\ 将其设为 |5pt|。
\enddesc
\begindesc
\cts hbadness {\param{number}}
\cts vbadness {\param{number}}
\explain
%These parameters specify the thresholds of horizontal and vertical
%\minref{badness} for reporting underfull or overfull boxes.
%|\hbadness| applies to hboxes and |\vbadness| applies to vboxes.
%If the badness of a constructed box exceeds the threshold,
%\TeX\ will report an error. If you raise the thresholds
%(the \plainTeX\ defaults are both $1000$),
%\TeX\ will be less likely to complain.
%Note that the settings of |\hbadness| and |\vbadness| have no effect on
%the appearance of your typeset document; they only affect the error
%messages that you get.
%See \knuth{page~302} for a precise description
%of how \TeX\ decides when to complain about an overfull or underfull
%box.
这些参数设定了报告盒子未满或过满警告时的水平和竖直的\minref{恶劣状态}的阈值。|\hbadness| 适用于 hbox,而 |\vbadness| 适用于 vbox。如果一个盒子的恶劣状态超过了阈值,\TeX\ 将报告一个错误。如果你提高阈值(\plainTeX 的默认值是 $1000$),\TeX\ 将不再经常给出警告。需要注意的是,设定 |\hbadness| 和 |\vbadness| 对你的文档排版结果没有影响,它们只影响你获得的错误信息。参见 \knuth{page~302},以获得 \TeX\ 如何确定在什么时候对过满或未满盒子进行警告的准确描述。
%\margin{The material on tolerance was inappropriate here and has been
%removed. A new example replaces it.}
\margin{在这里讨论容许量的内容是不合适的,被去掉了。因此,采用一个新的例子取代了它。}
\example
\hbadness = 10000 % 取消任何关于 hbadness 的警告。
\hbox to 2in{a b}\par
\hbadness = 500 % 当 hbadness 超过 500 就给出警告。
\hbox to 2in{a\hskip 0pt plus .5in b}
|
\logproduces
Underfull \hbox (badness 5091) detected at line 4
\tenrm a b
\hbox(6.94444+0.0)x144.54, glue set 3.70787
.\tenrm a
.\glue 0.0 plus 36.135
.\tenrm b
|
\endexample
\enddesc
\begindesc
\cts badness {}
\explain
%This command yields the numerical value of the badness of the \minref{box}
%(either horizontal or vertical) that \TeX\ has most recently produced.
%If the box was overfull, |\badness| will be $1000000$; in all other cases
%it will be between $0$ and $10000$.
该命令给出 \TeX\ 刚刚产生的(水平的或竖直的)\minref{盒子}的恶劣状态的数值。
如果盒子是过满的,|\badness| 将是 $1000000$;在所有其它情况下,它将在 $0$ 至 $10000$ 之间。
\enddesc
\begindesc
\cts hfuzz {\param{dimen}}
\cts vfuzz {\param{dimen}}
\explain
%These parameters specify the amount that
%a \minref{box} can exceed its natural size before \TeX\ considers it to be
%overfull. ^^{boxes//overfull}
%|\hfuzz| applies to hboxes and |\vfuzz| applies to vboxes.
%\PlainTeX\ sets both parameters to |0.1pt|.
这些参数设置在 \TeX\ 认为一个盒子过满之前,一个\minref{盒子} 能够超出其本身大小的量。
^^{盒子//过满盒子}|\hfuzz| 适用于水平盒子,而 |\vfuzz| 适用于竖直盒子。\PlainTeX\ 将两个参数均设为 |0.1pt|。
\example
\hfuzz = .5in
\hbox to 2in{This box is longer than two inches.}
% 没有错误的结果。
|
\produces
\hfuzz = .5in
\hbox to 2in{This box is longer than two inches.}
% No error results
\doruler{\8\8\8}3{in}
\endexample
%\eix^^{boxes//overfull}
%\eix^^{boxes//underfull}
%\eix^^{box commands}
%\enddesc
\eix^^{盒子//过满盒子}
\eix^^{盒子//未满盒子}
\eix^^{盒子命令}
\enddesc
%\see |\tolerance| \ctsref{\tolerance}.
\see |\tolerance| \ctsref{\tolerance}。
%==========================================================================
%\section {Retrieving the last item from a list}
\section {从列表中获取最后的项目}
%\begindesc
%^^{boxes//last box in a list}
%^^{kerns//last kern in a list}
%^^{penalties//last penalty in a list}
%^^{glue//last glue item in a list}
%\margin{This section has been moved in its entirety from the chapter
%(`Commands for general operations')}
\begindesc
^^{盒子//列表中最后一个盒子}
^^{紧排//列表中最后一个紧排}
^^{惩罚//列表中最后一个惩罚项}
^^{粘连//列表中最后一个粘连}
\margin{这一节整个儿地从(“常规操作命令”)一章中移过来的。}
\cts lastkern {}
\cts lastskip {}
\cts lastpenalty {}
\cts lastbox {}
\explain
%These control sequences yield the value of the last item on the current
%list. They aren't true commands because they can only appear as
%part of an argument.
%If the last item on the list isn't of the indicated type,
%they yield a zero value (or an empty box, in the case of |\lastbox|).
%For example,
%if the last item on the current list is a \minref{kern},
%|\lastkern| yields the dimension of that kern; if it
%isn't a kern, it yields a dimension of $0$.
这些控制序列产生位于当前列表最后的项目值。它们不是真正的命令,因为它们只能以参数的一部分出现。如果列表中的最后的项目不是指示类型,它们将给出零值(或者空盒子,在 |\lastbox| 的情况下)。例如,如果在当前列表中最后一项是一个\minref{紧排},|\lastkern| 给出那个紧排的尺寸;如果它不是紧排,它给出一个尺寸 $0$。
%Using |\lastbox| has the additional effect of removing the last box from
%the list.
%If you want the original |\last!-box| to remain on the list, you
%have to add a copy of it to the list.
%|\last!-box| is not permitted in a math list or in the main
%vertical~list.
使用 |\lastbox| 具有从列表中移除最后一个盒子的附加效应。如果你希望原来的 |\last!-box| 仍保留在列表中,你不得不向列表中增加它的一个拷贝。|\last!-box| 不允许用于数学列表或主竖直列表。
%These control sequences are
%most useful after macro calls that might have inserted entities of
%the indicated kinds.
这些控制序列在可能插入指标类型的宏调用后是非常有用的。
\example
\def\a{two\kern 15pt}
one \a\a\hskip 2\lastkern three\par
% 在`三'之前产生三倍的紧排。
\def\a{\hbox{二}}
一 \a
\setbox0 = \lastbox % 将`二'去掉。
三 \box0.
|
\produces
\def\a{二\kern 15pt}
一 \a\a\hskip 2\lastkern 三\par
% get three times as much space before `three'
\def\a{\hbox{二}}
一 \a
\setbox0 = \lastbox % removes `two'
三 \box0.
\endexample
\enddesc
\begindesc
\cts unkern {}
\cts unskip {}
\cts unpenalty {}
\explain
%If the last item on the current list is of type \minref{kern},
%\minref{glue}, or \minref{penalty} respectively, these commands remove it
%from that list. If the item isn't of the right type, these commands have
%no effect. Like ^|\lastbox|, you can't apply them to lists in math mode or to
%the main vertical list.
%These commands
%are most useful after a macro call that is known to have inserted
%a specific item that you don't want there.
%\TeX\ doesn't provide an ^|\unbox| command because |\lastbox| produces
%nearly the same effect.
如果当前列表的最后一项分别是\minref{紧排}、\minref{粘连}或\minref{惩罚}的类型,这些命令可以将它们从列表中去除。如果项目不是正确的类型,这些命令将不起作用。与 ^|\lastbox| 类似,你不能将它们应用于处于数学模式或主竖直列表中。在已知道会插入你不希望存在的特定项目的宏调用后,这些命令是非常有用的。\TeX\ 不提供 ^|\unbox| 命令,因为 |\lastbox| 产生了近乎一致的效果。
\enddesc
%==========================================================================
%\section {Rules and leaders}
\section {标线与指引线}
%\begindesc
%\bix^^{rules}
%\bix^^{horizontal rules}
%\bix^^{vertical rules}
\begindesc
\bix^^{标线}
\bix^^{水平标线}
\bix^^{竖直标线}
%
\cts hrule {}
\aux\cts hrule {\bt height \<dimen> width \<dimen> depth \<dimen>}
\cts vrule {}
\aux\cts vrule {{\bt width \<dimen> height \<dimen> depth \<dimen>}}
\explain
%The |\hrule| command produces a horizontal rule; the |\vrule| command
%produces a vertical rule. You can specify any or all of the width,
%height, and depth of the rule---\TeX\ supplies default values for those
%that you omit. You can give the dimensions of the rule in any order;
%the forms listed above show just two of the possible combinations. You
%can even give a dimension of a given kind more than once---if you do,
%the last one is the one that counts.
|\hrule| 命令用于产生水平的标线;相应的 |\vrule| 命令用于产生竖直的标线。
你可以指定标线的宽度、高度或深度的任意或全部。
\TeX\ 会为你省略的那些提供默认值。你可以以任何顺序给定标线的尺寸;
上面给出的形式只是可能的组合中的两个。
你甚至可以为一个给定类型的尺寸给出多个值---如果你这么做,起作用的是最后一个值。
%If you don't specify the width of a horizontal rule, the rule is
%extended horizontally to the boundaries of the innermost \minref{box} or
%\minref{alignment} that contains the rule. If you don't specify the
%height of a horizontal rule, it defaults to |0.4pt|; if you don't
%specify the depth of a horizontal rule, it defaults to |0pt|.
如果你没有设定水平标线的宽度,
则标线将水平地扩展到包含标线的\minref{盒子}或\minref{阵列}的最内侧的边界。
如果你没有设定水平标线的高度,其默认值是 |0.4pt|;
如果你没有设定水平标线的深度,其默认值是 |0pt|。
%If you don't specify the width of a vertical rule, it defaults to
%|0.4pt|. If you don't specify the height or the depth of a vertical
%rule, the rule is extended to the boundary of the innermost \minref{box}
%or \minref{alignment} that contains the rule.
如果你没有设定竖直标线的宽度,其默认值是 |0.4pt|;
如果你没有设定竖直标线的高度或深度,
则标线将地扩展到包含标线的\minref{盒子}或\minref{阵列}的最内侧的边界。
%\TeX\ treats a horizontal rule as an inherently vertical item
%and a vertical rule as an inherently horizontal item.
%Thus a horizontal rule is legal only in a \minref{vertical mode},
%while a vertical rule is legal only in a \minref{horizontal mode}.
%^^{horizontal mode//rules in}
%^^{vertical mode//rules in}
%If this seems surprising, visualize it---a horizontal rule runs
%from left to right and separates vertical items in a sequence, while
%a vertical rule runs up and down and
%separates horizontal items in a sequence.
\TeX\ 以内在的竖直项目处理水平标线,而以内在的水平项目处理竖直标线。
因此,水平标线只有\minref{竖直模式}下是有效的,而竖直标线只在\minref{水平模式}下是有效的。
^^{水平模式//水平模式中的标线}
^^{竖直模式//竖直模式中的标线}
如果觉得意外,可以直观化地观测。水平标线从左向右移动,并且将竖直的项目有序地分开,
而竖直标线从上到下,将水平项目有序地分开。
\example
\hrule\smallskip
\hrule width 2in \smallskip
\hrule width 3in height 2pt \smallskip
\hrule width 3in depth 2pt
|
\produces
\medskip
\hrule\smallskip
\hrule width 2in \smallskip
\hrule width 3in height 2pt \smallskip
\hrule width 3in depth 2pt
\nextexample
% 在这里,你能看到基线与 \hrule 的高度与深度之间有的关系。
\leftline{
\vbox{\hrule width .6in height 5pt depth 0pt}
\vbox{\hrule width .6in height 0pt depth 8pt}
\vbox{\hrule width .6in height 5pt depth 8pt}
\vbox{\hbox{基线}\kern 3pt \hrule width .6in}
}
|
\produces
\medskip
\leftline{
\vbox{\hrule width .6in height 5pt depth 0pt}
\vbox{\hrule width .6in height 0pt depth 8pt}
\vbox{\hrule width .6in height 5pt depth 8pt}
\vbox{\hbox{基线}\kern 3pt \hrule width .6in}
}
\nextexample
\hbox{( {\vrule} {\vrule width 8pt} )}
\hbox {( {\vrule height 13pt depth 0pt}
{\vrule height 13pt depth 7pt} x)}
% 圆括号定义了两个连续的盒子的高度与深度;
% 而 `x' 位于基线之上。
|
\produces
\medskip
\hbox{( {\vrule} {\vrule width 8pt} )}
\hbox {( {\vrule height 13pt depth 0pt}
{\vrule height 13pt depth 7pt} x)}
\endexample
%\eix^^{rules}
%\eix^^{horizontal rules}
%\eix^^{vertical rules}
%\enddesc
\eix^^{标线}
\eix^^{水平标线}
\eix^^{竖直标线}
\enddesc
%\begindesc
%\bix^^{leaders}
%\easy\cts leaders {\<box or rule> \<skip command>}
%\cts cleaders {\<box or rule> \<skip command>}
%\cts xleaders {\<box or rule> \<skip command>}
%\explain
%These commands produce \minref{leaders}, i.e., they fill a
%horizontal or vertical space with
%copies of a pattern \seeconcept{leaders}.
%The \<box> or \<rule> specifies a leader,
%i.e., a single copy of the pattern,
%while the \<skip command> specifies a
%window to be filled with a
%row or a column of the leaders.
%The pattern is repeated as many times as will fit into the window.
%If \<skip command> is a horizontal skip, the window
%contains a row of leaders and \TeX\ must be in a horizontal mode;
%if \<skip command> is a vertical skip, the window
%contains a column of leaders and \TeX\ must be in a vertical mode.
\begindesc
\bix^^{指引线}
\easy\cts leaders {\<box or rule> \<skip command>}
\cts cleaders {\<box or rule> \<skip command>}
\cts xleaders {\<box or rule> \<skip command>}
\explain
这些命令用于产生\minref{指引线},
也就是用某一个模式\seeconcept{指引线}的复本填充水平或竖直的间隔。
\<box> 或 \<rule> 确定一个指引体,即模式的单个复本,
而 \<skip command> 确定了用一行或一列的指引体填充的窗体。
模式将重复多次,直到填充了整个窗体。如果 \<skip command> 是一个水平的间距,
窗体中包括的是行向的指引线,\TeX\ 必须处于水平模式下;
如果 \<skip command> 是一个竖直的间距,
窗体中包括的是列向的指引线,\TeX\ 必须处于竖直模式下。
%The commands differ in how they arrange the repeated pattern in the space
%and where they put any leftover space:
这些命令的差异是它们在空间内如何组织重复的模式以及在什么地方放置剩余的间距:
%\ulist\compact
%\li For |\leaders|, \TeX\ aligns a row of leaders with the left end of
%the innermost \minref{box} $B$ that is to contain the result of the
%|\leaders| command.
%It aligns a column of leaders with the top of $B$.
%Those leaders that fall entirely within the window are retained.
%Any leftover space at the top and bottom of the window is left empty.
%\li For |\cleaders|, the leaders are centered within the window.
%\li For |\xleaders| the pattern is uniformly distributed throughout the window.
%If the leftover space is $l$ and the leader is repeated $n$ times,
%\TeX\ puts space of width or height $l/(n+1)$ between adjacent leaders and
%at the two ends (left and right or top and bottom) of the leaders.
%\endulist
\ulist\compact
\li 对于 |\leaders|,\TeX\ 将一行指引线与包含 |\leaders| 这一命令结果的最内侧的\minref{盒子} $B$ 的左侧对齐。它将一列指引线与 $B$ 的顶端对齐。整个落在窗体中的指引线将被保留。任何在窗体顶部或底部剩余的间隔将空着。
\li 对于 |\cleaders|,指引线在窗体内是居中的。
\li 对于 |\xleaders|,模式是均匀分布在窗体中的。如果剩余空间是 $l$,指引体被重复 $n$ 次,\TeX\ 将在相邻的指引线以及指引线的两个端点(左和右或者上和下)之间填充宽度或高度为 $l/(n+1)$ 的间隔。
\endulist
\example
\def\pattern{\hbox to 15pt{\hfil.\hfil}}
\line{Down the Rabbit-Hole {\leaders\pattern\hfil} 1}
\line{The Pool of Tears {\leaders\pattern\hfil} 9}
\line{A Caucus-Race and a Long Tale {\cleaders\pattern
\hfil} 19}
\line{Pig and Pepper {\xleaders\pattern\hfil} 27}
|
\produces
\def\pattern{\hbox to 15pt{\hfil.\hfil}}\par
\line{Down the Rabbit-Hole {\leaders\pattern\hfil} 1}
\line{The Pool of Tears {\leaders\pattern\hfil} 9}
\line{A Caucus-Race and a Long Tale {\cleaders\pattern
\hfil} 19}
\line{Pig and Pepper {\xleaders\pattern\hfil} 27}
\nextexample
\def\bulletfill{\vbox to 3ex{\vfil\hbox{$\bullet$}\vfil}}%
\def\mybox{\vbox to 1in}
\def\myrule{\hrule width 4pt}\hsize=2in
\hrule \line{%
\mybox{\myrule depth 8pt \leaders\bulletfill\vfill}
\hfil
\mybox{\myrule depth 15pt \leaders\bulletfill\vfill}
\hfil
\mybox{\myrule depth 18pt \cleaders\bulletfill\vfill}
\hfil
\mybox{\myrule depth 12pt \xleaders\bulletfill\vfill}%
}\hrule
|
\produces
\medskip
\def\bulletfill{\vbox to 3ex{\vfil\hbox{$\bullet$}\vfil}}%
\def\mybox{\vbox to 1in}\def\myrule{\hrule width 4pt}\hsize=2in
\hrule \line{%
\mybox{\myrule depth 8pt \leaders\bulletfill\vfill}
\hfil
\mybox{\myrule depth 15pt \leaders\bulletfill\vfill}
\hfil
\mybox{\myrule depth 18pt \cleaders\bulletfill\vfill}
\hfil
\mybox{\myrule depth 12pt \xleaders\bulletfill\vfill}%
}\hrule
\endexample\enddesc
%\begindesc
%\cts dotfill {}
%\cts hrulefill {}
%\explain
%^^{fill}
%These commands respectively fill the enclosing horizontal space with
%a row of dots on the baseline and with
%a horizontal line on the baseline.
%It's usually a good idea to leave a space between
%|\dotfill| or |\hrulefill|
%and any text that precedes or follows it (see the example below).
\begindesc
\cts dotfill {}
\cts hrulefill {}
\explain
^^{填充}
这些命令分别采用一行位于基线上的点和水平线填充封闭的水平空间。
通常,在 |\dotfill| 或 |\hrulefill| 与任何其之前或之后的文字之间留一个空格是一个好的主意(参见下面的例子)。
\example
\hbox to 3in{开始 {\dotfill} 结束}
\hbox to 3in{瑞典语 {\hrulefill} 芬兰语}
|
\produces
\par\hbox to 3in{开始 {\dotfill} 结束}
\hbox to 3in{瑞典语 {\hrulefill} 芬兰语}
\endexample\enddesc
%\begindesc
%\cts leftarrowfill {}
%\cts rightarrowfill {}
%\explain
%^^{fill}
%These commands fill the enclosing horizontal space with
%left-pointing or right-pointing ^{arrows}.
\begindesc
\cts leftarrowfill {}
\cts rightarrowfill {}
\explain
^^{填充}
这些命令用向左或向右的^{箭头}来填充封闭的水平空间。
\example
\hbox to 3in{\vrule \rightarrowfill \ 3 in
\leftarrowfill\vrule}
|
\produces
\medskip
\hbox to 3in{\vrule \rightarrowfill \ 3 in
\leftarrowfill\vrule}
\endexample
%\eix^^{leaders}
%\enddesc
\eix^^{指引线}
\enddesc
%==========================================================================
%\section {Alignments}
\section {阵列}
%==========================================================================
%\subsection {Tabbing alignments}
\subsection {制表阵列}
%\begindesc
%\bix^^{tabbing alignments}
%\bix^^{alignments//commands for}
%%
%\ctspecial + {{\bt \<text>\thinspace\&\thinspace\<text>%
% \thinspace\& $\cdots$ \\cr}}
%\ctsxrdef{@plus}
%\cts tabalign {}
%\explain
\begindesc
\bix^^{制表阵列}
\bix^^{阵列//用于阵列的命令}
%
\ctspecial + {{\bt \<text>\thinspace\&\thinspace\<text>%
\thinspace\& $\cdots$ \\cr}}
\ctsxrdef{@plus}
\cts tabalign {}
\explain
%These commands begin a single line in a tabbed \minref{alignment}.
%The only difference between |\+| and |\tabalign| is that
%|\+| is an outer macro---you can't use it when \TeX\ is reading tokens at
%high speed \seeconcept{outer}.
在制表\minref{阵列}中,这些命令开始单独的一行。
|\+| 与 |\tabalign| 之间唯一的不同在于 |\+| 是一个外部宏,
当 \TeX\ 高速读取记号时,你不能使用它\seeconcept{外部的}。
%If you place an `|&|' at a position
%to the right of all existing tabs in a tabbing alignment,
%the `|&|' establishes a new tab at that position.
在制表阵列中,如你将 `|&|' 放在所有已经存在的制表符的右侧,那么 `|&|' 将在那个位置上建立一个新的制表符。
\example
\cleartabs % Nullify any previous \settabs.
\+ {\bf if }$a[i] < a[i+1]$ &{\bf then}&\cr
\+&&$a[i] := a[i+1]$;\cr
\+&&{\it found }$:=$ {\bf true};\cr
\+&{\bf else}\cr
\+&&{\it found }$:=$ {\bf false};\cr
\+&{\bf end if};\cr
|
\produces
\cleartabs % Nullify any previous \settabs.
\+ {\bf if }$a[i] < a[i+1]$ &{\bf then}&\cr
\+&&$a[i] := a[i+1]$;\cr
\+&&{\it found }$:=$ {\bf true};\cr
\+&{\bf else}\cr
\+&&{\it found }$:=$ {\bf false};\cr
\+&{\bf end if};\cr
\endexample
\enddesc
\begindesc
\cts settabs {\<number> {\bt \\columns}}
\aux\cts settabs {{\bt \\+} \<sample line> {\bt \\cr}}
\explain
%The first form of
%this command defines a set of tab stops ^^{tabs}
%for a tabbing \minref{alignment}.
%It tells \TeX\ to set the tab stops so as to divide each line into
%\<number> equal parts. \TeX\ takes the length of a line to be
%|\hsize|, as usual. You can make the alignment narrower by decreasing
%|\hsize|.
这个命令的第一种形式为制表\minref{阵列}定义一系列制表符^^{制表符}的停止位置。
它告诉 \TeX\ 设置制表符停止位置以便将每一行分成 \<number> 等份。
\TeX\ 仍将行的长度设为 |\hsize|。你可以通过减小 |\hsize| 来使得阵列更加紧密。
%\margin{paragraph ``The tab settings $\ldots$'' moved to below.}
\margin{``制表符设定 $\ldots$''一段被移到下面了。}
\example
{\hsize = 3in \settabs 3 \columns
\+$1$&一&第一\cr
\+$2$&二&第二\cr
\+$3$&三&第三\cr}
|
\produces
{\hsize = 3in \settabs 3 \columns
\+$1$&一&第一\cr
\+$2$&二&第二\cr
\+$3$&三&第三\cr}
\noindent\doruler{\8\8\8}3{in}
\smallskip
\endexample
%The second form of this command defines tab stops by setting the tab stops
%at the positions indicated by the `|&|'s in the sample line.
%The sample line itself does not appear in the output. When you
%use this form you'll usually want to put material into the sample line that is
%somewhat wider than the widest corresponding material in the alignment,
%in order to produce space between the columns.
%That's what we've done in the
%example below. The material following the last tab
%stop is irrelevant, since \TeX\ does not need to position
%anything at the place where the |\cr|~appears.
这个命令的第二利形式是利用样例行中的 `|&|' 指示的位置来定义制表符停止位置。样例行本身不会出现在最终输出中。当你使用这种形式,你通常希望将一些宽度大于需要排列的最宽的内容放在样例行中,以便在列之间产生间隔。正象我们在下面的例子中所做的那样。最后一个制表符后的内容是无关紧要的,因为 \TeX\ 在 |\cr| 出现的地方不需要任何位置指示。
%The tab settings established by |\settabs| remain in effect until
%you issue a new |\settabs| command or end a group containing
%the |\settabs| command.
%This is true for both forms of the command.
由 |\settabs| 建立起来的制表符设置一直有效,直到你使用一个新的 |\settabs| 命令或结束包含 |\settabs| 命令的编组。该命令的两种形式都是这样的。
\example
% The first line establishes the template.
\settabs \+$1$\qquad & three\quad & seventh\cr
\+$1$&一&第一\cr
\+$2$&二&第二\cr
\+$3$&三&第三\cr
|
\produces
\settabs \+$1$\qquad & three\quad & seventh\cr % the sample line
\+$1$&一&第一\cr
\+$2$&二&第二\cr
\+$3$&三&第三\cr
\smallskip
\endexample
\enddesc
\begindesc
\cts cleartabs {}
\explain
%This command clears all the tabs to the right of the current column.
%Its main use is in applications such as typesetting computer programs
%in which the tab positions change from line to line.
这个命令消除位于当前列右侧的所有制表符。它主要用于排版计算机程序等一些应用,在这类应用中,从一行至另一行,制表符的位置是变化的。
\enddesc
%\see |\cr|, |\endline|, |\crcr| (\xref \endline).
%\eix^^{tabbing alignments}
\see |\cr|、|\endline|、|\crcr|(\xref \endline )。
\eix^^{制表阵列}
%==========================================================================
%\subsection {General alignments}
\subsection {常规阵列}
\begindesc
\cts halign {{\bt \rqbraces{\<preamble> \\cr \<row> \\cr $\ldots$ \<row> \\cr}}}
\xrdef{@and}\xrdef{@pound}
\aux\cts halign {{\bt to \<dimen>%
\rqbraces{\<preamble> \\cr \<row> \\cr $\ldots$ \<row> \\cr}}}
\aux\cts halign {{\bt spread \<dimen>%
\rqbraces{\<preamble> \\cr \<row> \\cr $\ldots$ \<row> \\cr}}}
\explain
%This command produces a horizontal \minref{alignment} consisting of a
%sequence of rows, where each row in turn contains a sequence of column
%entries. \TeX\ adjusts the widths of the column entries to accommodate
%the widest one in each column.
这一命令产生由一系列行组成的水平的\minref{阵列},每一行又包括了一系列的列。\TeX\ 调节列的宽度以容纳每一列中最宽的那一个条目。
%A horizontal alignment can only appear when \TeX\ is in a vertical
%\minref{mode}. We recommend that you first study alignments in general
%(\xref{alignment}) before you attempt to use this command.
只有当 \TeX\ 位于竖直\minref{模式}下水平阵列才能出现。
我们建议你在使用该命令之前首先学习一下常见的阵列(\xref{阵列})。
%An alignment consists of a ^{preamble}
%followed by the text to be aligned. The preamble,
%which describes the layout of the rows that follow, consists of a
%sequence of column templates, separated by `|&|' and ended
%by |\cr|.
阵列由^{导言}和随后的需要排列的文字构成。导言描述随后行的版式,
由一系列列的模板构成,列之间由 `|&|' 分隔,用 |\cr| 作为结束标志。
%\bix^^{template}
%\bix^^{entry (column or row)}
%Each row consists of a sequence of column
%entries, also separated by `|&|' and ended by |\cr|. Within
%a template, `|#|' indicates where \TeX\ should insert the
%corresponding text of a column entry.
%In contrast, |\settabs| uses a fixed implicit template of `|#|',
%i.e., it just inserts the text as is.
\bix^^{模板}
\bix^^{条目(在行或列中)}
每一行由一系列列的条目构成,也由 `|&|' 分隔,用 |\cr| 作为结束标志。
在模板中,`|#|' 表示 \TeX\ 应该在一个列条目中插入相应文字的位置。
与之相反,|\settabs| 使用 `|#|' 的固定隐式模板,即它只插入文字本身。
%\TeX\ typesets each column entry in restricted horizontal mode,
%i.e., as the contents of an \minref{hbox},
%and implicitly encloses it in a group.
\TeX\ 在受限水平模式中对每一列条目进行排版,即像 \minref{hbox} 的内容一样,并且隐式地将它封闭在一个编组中。
%The |to| form of this command instructs \TeX\
%to make the width of the alignment be \<dimen>,
%adjusting the space between columns as necessary.
%The |spread| form of this command instructs \TeX\
%to make the alignment wider by \<dimen> than its natural width.
%These forms are like the corresponding forms of |\hbox| \ctsref\hbox.
这个命令的 |to| 形式指导 \TeX\ 构造一个宽度为 \<dimen> 的阵列,在需要的时候调节列的间距。
这个命令的 |spread| 形式指导 \TeX\ 构造一个比其本身宽度再宽 \<dimen> 的阵列。
这些形式与 |\hbox|\ctsref\hbox 相应的形式是类似的。
%See |\tabskip| \ctsref\tabskip{} for an example using the
%|to| form.
参见 |\tabskip| \ctsref\tabskip{}中使用 |to| 形式的例子。
\example
\tabskip = 1em \halign{%
\hfil\it#\hfil&\hfil#\hfil&#&\hfil\$#\cr
美国&华盛顿&美元&1.00\cr
法国&巴黎&法朗&0.174\cr
以色列&耶路撒冷&新谢克尔&0.507\cr
日本&东京&日元&0.0829\cr}
|
\produces
\tabskip = 1em \halign{%
\hfil\it#\hfil&\hfil#\hfil&#&\hfil\$#\cr
美国&华盛顿&美元&1.00\cr
法国&巴黎&法朗&0.174\cr
以色列&耶路撒冷&新谢克尔&0.507\cr
日本&东京&日元&0.0829\cr}
\endexample
\enddesc
\begindesc
{\tighten
\cts valign {{\bt \rqbraces{\<preamble>\\cr \<column>\\cr $\ldots$
\<column>\\cr}}}
\aux\cts valign {{\bt to \<dimen>%
\rqbraces{\<preamble>\\cr \<column>\\cr $\ldots$ \<column>\\cr}}}
\aux\cts valign {{\bt spread \<dimen>%
\rqbraces{\<preamble>\\cr \<column>\\cr $\ldots$ \<column>\\cr}}}
\par}
\explain
%This command produces a vertical \minref{alignment}
%consisting of
%a sequence of columns, where each column in turn contains a sequence
%of row entries.
%\TeX\ adjusts the heights of the row entries to accommodate the tallest one
%in each row.
这一命令产生由一系列列组成的竖直的\minref{阵列},每一列又包括了一系列的行。
\TeX\ 调节行的高度以容纳每一列中最高的那一个条目。
%A vertical alignment
%can only appear when \TeX\ is in a horizontal \minref{mode}.
%Because vertical alignments are (a)~conceptually somewhat difficult and
%(b)~not often used, we recommend that you learn about
%alignments in general
%(\xref{alignment}) and the |\halign| command (see above) before
%you attempt to use the |\valign| command.
只有当 \TeX\ 位于水平\minref{模式}下竖直阵列才能出现。
因为竖直阵列(a)在概念上有一些困难,并且(b)不经常使,
因此,我们建议在你试图使用 |\valign| 命令之前首先学习一下常见的阵列(\xref{阵列})%
以及 |\halign| 命令(参见上面的描述)。
%An alignment consists of a ^{preamble}
%followed by the text to be aligned. The preamble,
%which describes the layout of the columns that follow,
%consists of a
%sequence of row templates, separated by `|&|' and ended
%by |\cr|.
阵列由^{导言}和随后的需要排列的文字构成。导言描述随后列的版式,
由一系列行的模板构成,列之间由 `|&|' 分隔,用 |\cr| 作为结束标志。
%\bix^^{template}
%Each column consists of a sequence of ^{row}
%entries, also separated by `|&|' and ended by |\cr|. Within
%a template, `|#|' indicates where \TeX\ should insert the
%corresponding text of a row entry.
\bix^^{模板}
每一列由一系列行的条目构成,也由 `|&|' 分隔,用 |\cr| 作为结束标志。
在模板中,`|#|' 表示 \TeX\ 应该在一个行条目中插入相应文字的位置。
%\TeX\ typesets each row entry in internal vertical
%mode, i.e., as the contents of a \minref{vbox},
%and implicitly encloses the entry in a group.
%It always gives the vbox zero depth.
%Any text or other horizontal mode material in a row entry then puts \TeX\
%into ordinary horizontal mode.
%(This is just an application of the general rules for \TeX's behavior
%in internal vertical mode.)
%The usual paragraphing parameters apply in this case:
%the row entry has an initial
%indentation of |\parindent| (\xref\parindent) and
%its lines have the
%|\leftskip| and |\rightskip| (\xref\leftskip) \minref{glue}
%appended to~them.
\TeX\ 在内部竖直模式中对每一行条目进行排版,即像\minref{竖直盒子}的内容一样,
并且隐式地将它封闭在一个编组中。它总是将 vbox 的深度设为零。
随后,列中的任何文字或其它水平模式内容将 \TeX\ 带回通常的水平模式。%
(这只是在内部竖直模式下 \TeX 行为常见准则的一个应用。)常见的段落参数适用于这种情形:
行条目具有 |\parindent|(\xref\parindent )的起始缩进,
而且它的每一行都附加了 |\leftskip| 和 |\rightskip|(\xref\leftskip )\minref{粘连}。
%Note in particular that a row entry containing text has
%a width of |\hsize| (\xref\hsize). Unless you reset
%|\hsize| to the row width that you want, you're likely to
%encounter overfull \minref{hbox}es, or find that
%the first column takes up the width of the entire page, or both.
尤其需要注意的是,列条目包含的文字具有 |\hsize|(\xref\hsize )的宽度。
除非你重新设置 |\hsize| 到你希望得到的行宽,否则你总能遇到过满\minref{水平盒子}的情况,
或者发现第一列占据了整页的宽度,或者两种情况都会出现。
\eix^^{条目(在行或列中)}
%Normally, you need to include a \minref{strut}
%^^{struts//in vertical alignments}
%in each
%template so that the rows don't come out crooked as a result
%of the varying heights of the entries in the alignment. You
%can produce a strut with the |\strut| command.
正常情况下,你需要在每个模板中包括\minref{支架}^^{支架//在竖直阵列中},
以便行不会由于阵列中条目高度的变化而变得弯曲。你可以使用 |\strut| 获得支架。
%The |to| form of this command instructs \TeX\
%to make the vertical extent of the alignment be \<dimen>,
%adjusting the space between rows as necessary.
%The |spread| form of this command instructs \TeX\
%to make the alignment taller by \<dimen> than its natural height.
%These forms are like the corresponding forms of |\vbox| \ctsref\vbox.
这个命令的 |to| 形式指导 \TeX\ 构造一个竖直伸展为 \<dimen> 的阵列,在需要的时候调节行的间距。
这个命令的 |spread| 形式指导 \TeX\ 构造一个比其本身高度再高 \<dimen> 的阵列。
这些形式与 |\vbox| \ctsref\vbox 相应的形式是类似的。
\example
{\hsize=1in \parindent=0pt
\valign{#\strut&#\strut&#\strut&#\strut\cr
bernaise&curry&hoisin&hollandaise\cr
ketchup&marinara&mayonnaise&mustard\cr
rarebit&tartar\cr}}
|
\produces
{\hsize=1in \parindent=0pt \leftskip=0pt
\valign{#\strut&#\strut&#\strut&#\strut\cr
bernaise&curry&hoisin&hollandaise\cr
ketchup&marinara&mayonnaise&mustard\cr
rarebit&tartar\cr}}
\nextexample
% 与上例相同的内容,但没有支架
%(这个例子显示了支架存在的必要性)。
{\hsize=1in \parindent=0pt
\valign{#&#&#&#\cr
bernaise&curry&hoisin&hollandaise\cr
ketchup&marinara&mayonnaise&mustard\cr
rarebit&tartar\cr}}
|
\produces
{\hsize=1in \parindent=0pt \leftskip=0pt
\valign{#&#&#&#\cr
bernaise&curry&hoisin&hollandaise\cr
ketchup&marinara&mayonnaise&mustard\cr
rarebit&tartar\cr}}
\endexample
\enddesc
\begindesc
\cts ialign {}
\explain
%This command behaves just like ^|\halign|,
%except that it first sets the |\tabskip| glue to zero and
%sets |\everycr| empty.
除了首先将 |\tabskip| 粘连设为零,并将 |\everycr| 清空以外,这个命令的行为与 ^|\halign| 相似。
\enddesc
\begindesc
\cts cr {}
\explain
%This command ends the preamble of a horizontal or vertical
%alignment, a row of a horizontal or tabbing alignment,
%or a column of a vertical alignment.
%You can cause \TeX\ to take certain actions whenever it sees a |\cr|
%by setting the value of the ^|\everycr| parameter \ctsref\everycr.
这个命令用于结束水平或竖直阵列的导言、水平的或制表阵列的行,或竖直阵列的列。你可以通过设置 ^|\everycr|\ctsref\everycr 参数的值,引导 \TeX\ 采取特定的行动,无论什么时候它遇到 |\cr|。
\enddesc
\begindesc
\cts endline {}
\explain
%This command is a synonym for the ^|\cr| command. It is useful when
%you've redefined |\cr| but still need access to the original definition.
这个命令是 ^|\cr| 的另一种形式。在你重新定义了 |\cr|,但还需要利用其原始的定义是,这个命令是有用的。
\enddesc
\begindesc
\cts crcr {}
\explain
%This command behaves just like ^|\cr|, except that \TeX\ ignores it if
%it comes immediately after a |\cr| or a ^|\noalign|.
%Its main application is as a safety measure to avoid a misleading error
%message caused by a \minref{macro} that expects an argument ending in |\cr|.
%If you put |\crcr| after the `|#|$n$' that denotes such an argument
%in the macro's definition, the
%macro will work properly whether or not the argument ends with |\cr|.
如果该命令紧随 |\cr| 或 ^|\noalign| 之后出现,\TeX\ 会忽略它。除此之外,它的行为与 ^|\cr| 类似。它主要的应用是作为一种安全措施以避免由期望以 |\cr| 作为结束符的\minref{宏包}而引起的错误信息。如果你将 |\crcr| 放在用以表示宏定义中此类参数的后面,宏将正常工作,无论其参数是否以 |\cr| 作为结束标记。
\enddesc
\begindesc
\cts omit {}
\explain
%This command tells \TeX\ to ignore a template in a horizontal or vertical
%\minref{alignment} while processing a particular column or row entry
%respectively.
%|\omit| must appear as the first item in a column or row entry; in effect,
%it overrides the template from the preamble with the simple
%template `|#|'.
这个命令告诉 \TeX\ 在处理特定的列或行条目时,忽略水平的或竖直的\minref{阵列} 中的一个模板。|\omit| 必须以第一个项目出现在列或行条目中,它有效地使用简单的模板 `|#|' 覆盖来自导言中的模板。
\example
\tabskip = 2em\halign{%
\hfil\it#\hfil&\hfil#\hfil&#&\hfil\$#\cr
美国&华盛顿&美元&1.00\cr
\omit \dotfill 法国\dotfill&巴黎&法朗&0.174\cr
以色列&耶路撒冷&新谢克尔&0.507\cr
日本&东京&日元&0.0829\cr}
|
\produces
\tabskip = 2em\halign{%
\hfil\it#\hfil&\hfil#\hfil&#&\hfil\$#\cr
美国&华盛顿&美元&1.00\cr
\omit \dotfill 法国\dotfill&巴黎&法朗&0.174\cr
以色列&耶路撒冷&新谢克尔&0.507\cr
日本&东京&日元&0.0829\cr}
\nextexample
{\hsize=1.2in \parindent=0pt
\valign{(#)\strut&(#)\strut&(#)\strut&(#)\strut\cr
bernaise&curry&hoisin&hollandaise\cr
ketchup&\omit\strut{\bf MARINARA!!}&mayonnaise&mustard\cr
rarebit&tartar\cr}}
|
\produces
{\hsize=1.2in \parindent=0pt \leftskip=0pt
\valign{(#)\strut&(#)\strut&(#)\strut&(#)\strut\cr
bernaise&curry&hoisin&hollandaise\cr
ketchup&\omit\strut{\bf MARINARA!}&mayonnaise&mustard\cr
rarebit&tartar\cr}}
\endexample
\enddesc
\begindesc
\cts span {}
\explain
%The meaning of this command depends on whether it appears in a preamble
%or in an alignment entry.
%\ulist
%\li Normally, \TeX\ does not expand tokens in the preamble
%when it reads them.
%Putting |\span| in front of a token in the preamble causes
%that token to be expanded immediately according to \TeX's usual rules
%of \minref{macro} expansion.
%\li Putting |\span| instead of `|&|' between two column or row entries
%causes those columns or rows to be combined.
%For a horizontal alignment,
%the width of the combined column is the sum of the
%widths of the component columns.
%For a vertical alignment,
%the height of the combined row is the sum of the
%heights of the component rows.
%The template of the combined column or combined row forms a single group,
%so font-setting commands preceding a |\span| affect everything up to
%the next `|&|'.
%\endulist
%\noindent
%|\span| is rarely useful by itself outside of a template,
%but it provides the basic mechanism
%for defining ^|\multispan|.
这个命令的意义取决于它出现在导言中,还是在阵列条目中。
\ulist
\li 通常,\TeX\ 并不扩展它读入的导言中的记号。将 |\span| 放在导言中记号的前面,根据\minref{宏}扩展的 \TeX 常用规则,会导致这些记号立即得到扩展。
\li 用 |\span| 取代 `|&|',放在两列或两行条目之前,会导致这些列或行合并到一起。对于水平阵列,合并的列的宽度是列成员宽度之和。对于竖直阵列,合并的行的高度是行成员高度之和。合并的行或合并的列的模板形成一个编组,因此,在 |\span| 前的字体设置命令影响下一个 `|&|' 前的一切。
\endulist
\noindent
|\span| 很少单独用在模板之外,但它为定义 ^|\multispan| 提供了基本的机制。
\enddesc
\begindesc
\cts multispan {\<number>}
\explain
%This command tells \TeX\ that the following
%\<number> columns in a row of a horizontal alignment,
%or
%\<number> rows in a column of a vertical alignment,
%should be combined into a single column or row (as with
%|\span|) and that their templates should be omitted (as with |\omit|).
该命令告诉 \TeX ,随后水平阵列的行中的 \<number> 列或竖直阵列的列中的 \<number> 行应该合并成一个单独的列或行(就像 |\span| 那样),并且它们的模板应该被忽略(就像 |\omit| 那样)。
\example
\tabskip = 13pt\halign{%
\hfil\it#\hfil&\hfil#\hfil&#&\hfil\$#\cr
美国&华盛顿&美元&1.00\cr
法国&巴黎&法朗&0.174\cr
以色列&耶路撒冷&
\multispan 2 \hfil\it(无信息)\hfil \cr
日本&东京&日元&0.0829\cr}
|
\produces
\tabskip = 13pt\halign{%
\hfil\it#\hfil&\hfil#\hfil&#&\hfil\$#\cr
美国&华盛顿&美元&1.00\cr
法国&巴黎&法朗&0.174\cr
以色列&耶路撒冷&
\multispan 2 \hfil\it(无信息)\hfil \cr
日本&东京&日元&0.0829\cr}
\nextexample
{\hsize=1.2in \parindent=0pt
\valign{(#)\strut&(#)\strut&(#)\strut&(#)\strut\cr
bernaise&curry&hoisin&hollandaise\cr
\multispan 3$$\left\{{{\rm ketchup}\atop{\rm marinara}}
\right\}$$&mustard\cr
rarebit&tartar\cr}}
|
\produces
{\hsize=1.2in \parindent=0pt \leftskip=0pt
\valign{(#)\strut&(#)\strut&(#)\strut&(#)\strut\cr
bernaise&curry&hoisin&hollandaise\cr
\multispan 3$$\left\{{{\rm ketchup}\atop{\rm marinara}}
\right\}$$&mustard\cr
rarebit&tartar\cr}}
\endexample
%\eix^^{template}
%\enddesc
\eix^^{模板}
\enddesc
\begindesc
\cts noalign {\rqbraces{\<vertical mode material>}}
\aux\cts noalign {\rqbraces{\<horizontal mode material>}}
\explain
%This command inserts
%\<vertical mode material>
%after the current row of a horizontal \minref{alignment} or
%\<horizontal mode material> after the current column of a vertical
%\minref{alignment}.
%The material can be text, glue, a rule, or anything else.
该命令在水平\minref{阵列}的当前行之后插入 \<vertical mode material>,或者在竖直\minref{阵列}的当前列之后插入 \<horizontal mode material>。插入的内容可以是文本、粘连、标线,或者其它任何东西。
%The most common use of |\noalign|
%is to put extra space after a row or column.
%If you want to put extra space after \emph{every\/} row of a horizontal
%alignment, use ^|\openup| (\xref\openup).
|\noalign| 最常见的用途是在一行或列后插入额外的间隔。如果你希望在水平阵列的\emph{每}行后都插入额外的间隔,可以使用 ^|\openup|(\xref\openup)。
\example
\halign{%
\hfil\it#\hfil\tabskip=2em&\hfil#\hfil&#&
\hfil\$#\tabskip=0em\cr
% 改变 \tabskip 将阻止下面的标线突出来。
美国&华盛顿&美元&1.00\cr
法国&巴黎&法朗&0.174\cr
\noalign{\smallskip\hrule\smallskip}
以色列&耶路撒冷&新谢克尔&0.507\cr
日本&东京&日元&0.0829\cr}
|
\produces
\halign{%
\hfil\it#\hfil\tabskip=2em&\hfil#\hfil&#&
\hfil\$#\tabskip=0em\cr
% The \tabskip changes prevent the rule below
% from sticking out.
美国&华盛顿&美元&1.00\cr
法国&巴黎&法朗&0.174\cr
\noalign{\smallskip\hrule\smallskip}
以色列&耶路撒冷&新谢克尔&0.507\cr
日本&东京&日元&0.0829\cr}
\nextexample
{\hsize=1in \parindent=0pt
\valign{#\strut&#\strut&#\strut&#\strut\cr
\noalign{\vrule width 2pt\quad}
bernaise&curry&hoisin&hollandaise\cr
\noalign{\vrule width 2pt\quad}
ketchup&marinara&mayonnaise&mustard\cr
\noalign{\vrule width 2pt\quad}
rarebit&tartar\cr
\noalign{\vrule width 2pt\quad}}}
|
\produces
\medskip
{\hsize=1in \parindent=0pt
\valign{#\strut&#\strut&#\strut&#\strut\cr
\noalign{\vrule width 2pt\quad}
bernaise&curry&hoisin&hollandaise\cr
\noalign{\vrule width 2pt\quad}
ketchup&marinara&mayonnaise&mustard\cr
\noalign{\vrule width 2pt\quad}
rarebit&tartar\cr
\noalign{\vrule width 2pt\quad}}}
\endexample
\enddesc
\begindesc
\cts tabskip {\param{glue}}
\explain
%This parameter specifies the amount of horizontal or vertical glue
%that \TeX\ puts between the
%columns of a horizontal alignment or between the
%rows of a vertical alignment.
%\TeX\ also puts the |\tabskip| glue
%to the left of the first column and to the right of the last column
%of a horizontal alignment, and
%above the first row
%and below the last row of a vertical alignment.
%You can change |\tabskip| within a template---%
%the change will affect the glue associated with all the following
%|&|'s as well as the glue after the last row or column.
该参数指定 \TeX 在水平阵列的列之间或竖直阵列的行之间放置水平或竖直粘连的量。\TeX\ 也在水平阵列的第一列的左侧和最后一行的右侧,以及竖直阵列的第一行的上端和最后一行的下端放置 |\tabskip| 粘连。你可以在模板中改变 |\tabskip|---这一改变将影响所有紧接其后的 |&| 的粘连以及最后一行或列之后的粘连。
\example
\halign to 3.5in{%
\hfil\it#\tabskip = 2em plus 8pt
\hfil&\hfil#\hfil&#\tabskip = 1em
&\hfil\$#\tabskip = 0em\cr
美国&华盛顿&美元&1.00\cr
法国&巴黎&法朗&0.174\cr
以色列&耶路撒冷&新谢克尔&0.507\cr
日本&东京&日元&0.0829\cr}
|
\produces
\halign to 3.5in{%
\hfil\it#\tabskip = 2em plus 8pt
\hfil&\hfil#\hfil&#\tabskip = 1em
&\hfil\$#\tabskip = 0em\cr
美国&华盛顿&美元&1.00\cr
法国&巴黎&法朗&0.174\cr
以色列&耶路撒冷&新谢克尔&0.507\cr
日本&东京&日元&0.0829\cr}
\nextexample
{\hsize = 1in \parindent=0pt \tabskip=5pt
\valign{#\strut&#\strut\tabskip = 3pt
&#\strut&#\strut\cr
bernaise&curry&hoisin&hollandaise\cr
ketchup&marinara&mayonnaise&mustard\cr
rarebit&tartar\cr}}
|
\produces
{\hsize = 1in \parindent=0pt \tabskip=5pt
\valign{#\strut&#\strut\tabskip = 3pt
&#\strut&#\strut\cr
bernaise&curry&hoisin&hollandaise\cr
ketchup&marinara&mayonnaise&mustard\cr
rarebit&tartar\cr}}
\endexample
\enddesc
\begindesc
\cts hidewidth {}
\explain
%This command tells \TeX\ to ignore the width of the next column entry in a
%horizontal alignment. It's useful when you have an entry that is longer
%than most of the others in the same column,
%and you'd rather have that entry stick out of the column than
%make all the entries
%in the column wider. If the |\hidewidth| is at the left of the
%entry, the entry sticks out to the left; if the |\hidewidth| is at the
%right of the entry, the entry sticks out to the~right.
该命令告诉 \TeX\ 忽略水平阵列中下一个列条目的宽度。如果你有一个条目长于同一列中其它大多数,并且 ,你希望条目伸到列外,而不是使得该条目所在列变得更宽时,该命令是有用的。如果 |\hidewidth| 在条目的左侧,则条目向左伸展;如果 |\hidewidth| 在条目的右侧,则条目向右伸展。
\example
\tabskip = 25pt\halign{%
\hfil\it#\hfil&\hfil#\hfil&#&\hfil\$#\cr
美国&\hidewidth 华盛顿&美元&1.00\cr
法国&巴黎&法朗&0.174\cr
以色列&耶路撒冷&新谢克尔&0.507\cr
日本&东京&日元&0.0829\cr}
|
\produces
\tabskip = 25pt\halign{%
\hfil\it#\hfil&\hfil#\hfil&#&\hfil\$#\cr
美国&\hidewidth 华盛顿&美元&1.00\cr
法国&巴黎&法朗&0.174\cr
以色列&耶路撒冷&新谢克尔&0.507\cr
日本&东京&日元&0.0829\cr}
\endexample
\enddesc
\begindesc
\cts everycr {\param{token list}}
\explain
%\TeX\ expands \<token list> whenever it executes
%a |\cr|---at the end of every preamble,
%at the end of every row of a horizontal alignment,
%and at the end of every column of a vertical alignment.
%The |\everycr| commands are expanded just after the |\cr|.
%Thus you can cause \TeX\ to
%execute certain commands at the end of a preamble, row, or column by
%assigning a list of those commands to |\everycr|.
无论什么时候,当 \TeX\ 遇到处于每个导言结尾处、水平阵列的每行结尾处以及竖直阵列的每列结尾处的|\cr| 时,它扩展 \<token list>。|\everycr| 只在 |\cr| 后扩展。因此,你可以通过向 |\everycr| 赋与导言、行、列相关列表,引导 \TeX\ 在导言、行或列的结尾处执行特定的命令。
%The |\everycr| tokens shouldn't include any commands other than |\no!-align|.
%That's because
%the |\everycr| tokens will reappear after the last
%|\cr| of the alignment. A command other than
%|\noalign| will then make \TeX\ think that it's starting a new
%row or column.
%\TeX\ will complain about a missing |\cr|, insert
%a |\cr|, insert the |\everycr| tokens again, and repeat these actions
%indefinitely.
|\everycr| 的记号不应该包括 |\no!-align| 以外的任何命令。这是因为,|\everycr| 记号会出现在阵列的最后一个 |\cr|。任何一个非 |\no!-align| 命令会导致 \TeX\ 认为它新开了一行或一列,因此,\TeX\ 会报怨丢失了 |\cr|,插入 |\cr|,再次插入 |\everycr| 记号,并且无限地重复这些动作。
\example
\everycr={\noalign{\smallskip\hrule\smallskip}}
\halign{#\tabskip = 11pt&\hfil#\hfil&\hfil#\hfil
\tabskip = 0pt\cr
$1$&一&第一\cr
$2$&二&第二\cr
$3$&三&第三\cr}
|
\produces
\medskip
\everycr={\noalign{\smallskip\hrule\smallskip}}
\halign{#\tabskip = 11pt&\hfil#\hfil&\hfil#\hfil
\tabskip = 0pt\cr
$1$&一&第一\cr
$2$&二&第二\cr
$3$&三&第三\cr}
\endexample
%\eix^^{alignments//commands for}
%\enddesc
\eix^^{阵列//用于阵列的命令}
\enddesc
\enddescriptions
\ifoldeplain\else\ifcompletebook\else
\vskip4em{\sectionfonts\leftline{本章索引}}
\readindexfile{i}
\fi\fi
\endchapter
\byebye
|