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
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083
4084
4085
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
4098
4099
|
% $Id: concepts.tex,v 1.5 2020/01/01 23:55:26 karl Exp $
% This is part of the book TeX for the Impatient.
% Copyright (C) 2003-2020 Paul W. Abrahams, Kathryn A. Hargreaves, Karl Berry.
% See file fdl.tex for copying conditions.
\input macros
\chapter{Concepts}
\chapterdef{concepts}
This part of the book contains definitions and explanations of
the concepts that we use in describing \TeX.
The concepts include both
technical terms that we use in explaining the commands and
important topics that don't fit elsewhere in the book.
The concepts are arranged alphabetically.
The inside back cover of the book contains a complete list of
concepts and the pages on which they are explained.
We suggest that you make a copy of the inside back cover and keep it nearby
so that you'll be able to identify and look up an unfamiliar
concept immediately.
As far as possible, we've kept our terminology consistent with that of
\texbook.\idxref{\texbook}
\beginconcepts
\conceptindex{active characters}
\concept {active character}
An \defterm{active character} is a \refterm{character}
that has a definition, e.g., a macro definition, associated with it.
^^{macros//named by active characters}
You can think of an active character as a special kind of control sequence.
When \TeX\ encounters an active character, it
executes the definition associated with the character.
If \TeX\ encounters an active character that does not have
an associated definition, it will complain about an
undefined control sequence.
An active character has a \refterm{category code} of $13$ (the value
of ^|\active|).
To define an active character, you should first
use the ^|\catcode| command
\ctsref{\catcode} to make it active
and then provide the definition of the character, using
a command such as |\def|, |\let|, or |\chardef|.
The definition of an active character has the same form as
the definition of a \refterm{control sequence}.
^^{category codes//of active characters}
If you try to define the macro for an active character
before you make the character active, \TeX\ will complain about a
missing control sequence.
For example, the tilde character (|~|) is defined as an active character
in \plainTeX. It
produces a space between two words but links those words so that
\TeX\ will not turn the space into a \refterm{line break}.
\refterm{\PlainTeX:\plainTeX} defines `|~|' by the commands:
\csdisplay
\catcode `~ = \active \def~{\penalty10000\!visiblespace}
|
(The |\penalty| inhibits a line break and the `|\!visiblespace|'
inserts a space.)
\endconcept
\conceptindex{alignments}
\concept alignment
\bix^^{tables}
An \defterm{alignment} is a construct for aligning material, such as a
table, in columns or rows. To form an alignment you need to
(a)~describe the layout of the columns or rows and (b)~tell \TeX\ what
material goes into the columns or rows. A tabbing alignment or a
horizontal alignment is organized as a sequence of rows; a vertical
alignment is organized as a sequence of columns. We first describe
tabbing and horizontal alignments and then more briefly describe
vertical alignments.
Tabbing alignments are defined by \plainTeX. They are simpler but less
flexible than horizontal alignments. Tabbing and horizontal alignments
differ principally in how you describe their layouts.
\bix^^|\settabs|
\bix\ctsidxref{+}
\bix\ctsidxref{cr}
To construct a tabbing alignment you first issue a |\settabs| command
\ctsref{\settabs} that specifies how \TeX\ should divide the available
horizontal space into columns. Then you provide a sequence of rows for
the table. Each row consists of a |\+| control sequence \ctsref{\@plus}
followed by a list of ``entries'', i.e., row\slash column intersections.
^^{entry (column or row)}
Adjacent entries in a row are separated by an ampersand (|&|).
\xrdef{@and}
\ttidxref{&}
The end of a row is indicated by ^|\cr| after its
last entry.
If a row has fewer entries than there are columns in the alignment,
\TeX\ effectively fills out the row with blank entries.
As long as it's preceded by a |\settabs| command, you can put a row of a
tabbing alignment anywhere in your document. In particular, you can put
other things between the rows of a tabbing alignment or describe several
tabbing alignments with a single |\settabs|. Here's an example of a
tabbing alignment:
\xrdef{tabbedexample}\csdisplay
{\hsize = 1.7 in \settabs 2 \columns
\+cattle&herd\cr
\+fish&school\cr
\+lions&pride\cr}
|
The |\settabs 2 \columns| command in this example \ctsref{\settabs}
tells \TeX\ to produce two equally wide columns.
The line length is $1.7$ inches.
The typeset alignment looks like this:
{\def\+{\tabalign}% so it isn't \outer.
\vdisplay{%
\hsize 1.7 in \settabs 2 \columns
\+cattle&herd\cr
\+fish&school\cr
\+lions&pride\cr}
}%
\margin{Missing explanation added here.}
There's another form of tabbing alignment in which you specify the column
widths with a template. The column widths in the template
determine the column widths in the rest of the alignment:
\csdisplay
{\settabs\+cattle\quad&school\cr
\+cattle&herd\cr
\+fish&school\cr
\+lions&pride\cr}
|
Here's the result:
{\def\+{\tabalign}% so it isn't \outer.
\vdisplay{%
\settabs\+cattle\quad&school\cr
\+cattle&herd\cr
\+fish&school\cr
\+lions&pride\cr}
}%
\eix^^|\settabs|
\eix\ctsidxref{+}
\bix^^|\halign|
Horizontal alignments are constructed with |\halign| \ctsref\halign.
\TeX\ adjusts the column widths of a horizontal alignment according to
what is in the columns. When \TeX\ encounters the |\halign| command
that begins a horizontal alignment, it first examines all the rows of
the alignment to see how wide the entries are. It then sets each column
width to accommodate the widest entry in that column.
A horizontal alignment governed by |\halign| consists of a
``\pix^{preamble}'' that indicates the row layout followed by the rows
themselves.
\ulist
\li The preamble consists of a sequence of \pix^{template}s, one for each
column. The template for a column specifies how the text for that
column should be typeset. Each template must include a single |#|
character
\ttidxref{#}\xrdef{@asharp}
to indicate where \TeX\ should substitute the text of an entry into the
template. The templates are separated by ampersands (|&|), \ttidxref{&}
and the end of the preamble is indicated by |\cr|. By providing an
appropriate template you can obtain effects such as centering a column,
left or right justifying a column, or setting a column in a particular
\refterm{font}.
\li The rows have the same form as in a tabbing alignment, except that
you omit the |\+| at the beginning of each row.
As before, entries are separated by |&| and the end of the row
is indicated by |\cr|.
\TeX\ treats each entry as a
\refterm{group}, so any
font-setting command or other \refterm{assignment}
in a column template is in effect only for the entries in that column.
\endulist
\noindent The preamble and the rows must all be enclosed in the braces
that follow |\halign|. Each |\halign| alignment must include
its own preamble.
For example, the horizontal alignment:
\csdisplay
\tabskip=2pc
\halign{\hfil#\hfil &\hfil#\hfil &\hfil#\hfil \cr
&&\it Table\cr
\noalign{\kern -2pt}
\it Creature&\it Victual&\it Position\cr
\noalign{\kern 2pt}
Alice&crumpet&left\cr
Dormouse&muffin&middle\cr
Hatter&tea&right\cr}
|
\noindent produces the result:
\xrdef{halignexample}
\vdisplay{%
\tabskip=2pc \halign{\hfil#\hfil &\hfil#\hfil &\hfil#\hfil \cr
&&\it Table\cr
\noalign{\kern -2pt}
\it Creature&\it Victual&\it Position\cr
\noalign{\kern 2pt}
Alice&crumpet&left\cr
Dormouse&muffin&middle\cr
Hatter&tea&right\cr}
}%
\noindent The ^|\tabskip| \ctsref{\tabskip} in this example
tells \TeX\ to insert |2pc| of
\refterm{glue} between the columns.
The ^|\noalign| \ctsref{\noalign} commands tell \TeX\ to insert
\refterm{vertical mode} material between two rows.
In this example we've
used |\noalign| to produce some extra space between the title rows and
the data rows, and also to bring ``Table'' and ``Position'' closer together.
(You can also use |\noalign| before the first row or after the
last row.)
\eix^^|\halign|
You can construct a vertical alignment with the ^|\valign| command
\ctsref{\valign}. A vertical alignment is organized as a series of
columns rather than as a series of rows. A vertical alignment follows
the same rules as a horizontal alignment except that the roles of rows
and columns are interchanged. For example, the vertical alignment:
\csdisplay
{\hsize=0.6in \parindent=0pt
\valign{#\strut&#\strut&#\strut\cr
one&two&three\cr
four&five&six\cr
seven&eight&nine\cr
ten&eleven\cr}}
|
\noindent yields:
\vdisplay{%
{\hsize=0.6in \parindent=\listleftindent % Because lists and displays
% are not indented just by \parindent.
\valign{#\strut&#\strut&#\strut\cr
one&two&three\cr
four&five&six\cr
seven&eight&nine\cr
ten&eleven\cr}}
}
The ^|\strut| commands \ctsref{\strut}
in the template are necessary to get the entries in each row
to line up properly, i.e., to have a common \refterm{baseline},
and to keep the distance between baselines uniform.
\eix\ctsidxref{cr}
\eix^^{tables}
\endconcept
\concept{\anatomy}
\texbook\ describes the way that {\TeX} processes its input in terms of \TeX's
``digestive tract''---its ``^{eyes}'', ``^{mouth}'',
``^{gullet}'', ``^{stomach}'', and ``^{intestines}''. Knowing how this
processing works can be helpful when you're trying to understand subtle
aspects of \TeX's behavior as it's digesting a document.
\ulist
\li Using its ``\pix^{eyes}'', \TeX\ reads \refterm{characters:character} from
^{input files} and passes them to its mouth. Since an input file
can contain ^|\input| commands \ctsref{\input},
\TeX\ can in effect ``shift its gaze'' from one file to another.
\li Using its ``\pix^{mouth}'', {\TeX} assembles the characters into
\refterm{tokens:token} and passes them to its gullet.
Each token is either a \refterm{control sequence} or a single
character. A control sequence always starts with an \refterm{escape
character}. Note that spaces and ends-of-line are characters in their
own right, although \TeX\ compresses a sequence of input spaces into a single
space token. See \knuth{pages~46--47} for the rules by which \TeX\ assembles
characters into tokens.
^^{tokens//assembled from characters}
\li Using its ``\pix^{gullet}'', {\TeX} expands any macros, conditionals, and
^^{macros//expanded in \TeX's stomach}
^^{tokens//passed to \TeX's stomach}
similar constructs that it finds (see \knuth{pages~212--216}) and passes
the resulting sequence of \refterm{tokens:token}
to \TeX's stomach. Expanding one token
may yield other tokens that in turn need to be expanded. {\TeX} carries
out this expansion from left to right unless the order is modified by
a command such as |\expandafter| \ctsref{\expandafter}.
In other words, \TeX's gullet always expands the leftmost un\-ex\-panded
token that it has not yet sent to \TeX's stomach.
\li Using its ``\pix^{stomach}'', {\TeX} processes the tokens in
groups.
Each group contains a primitive command followed by its arguments, if any.
Most of the commands are of the ``typeset this character'' variety,
so their groups consist of just one token.
Obeying the instructions given by the commands,
\TeX's stomach assembles larger and larger
units, starting with
characters and ending with pages,
and passes the pages to \TeX's intestines.
^^{pages//assembled in \TeX's stomach}
\TeX's stomach handles the tasks of \refterm{line break}ing---%
^^{line breaking}
i.e., breaking each paragraph into a sequence of lines---%
and of \refterm{page break}ing---i.e., breaking a continuous sequence of lines
and other vertical mode material
into pages.
\li Using its ``\pix^{intestines}'', \TeX\ transforms the pages produced by its
stomach into a form intended for processing
by other programs. It then sends the transformed output to the
\dvifile.
^^{\dvifile//created by \TeX's intestines}
\endulist
Most of the time you can think of the processes that take place in \TeX's
eyes, mouth, gullet, stomach, and intestines
as happening one after the other. But the
truth of the matter is that commands executed in \TeX's stomach can
influence the earlier stages of digestion. For instance, when \TeX's stomach
encounters the |\input| command \ctsref{\input},
its eyes start reading from a different
file; when \TeX's stomach encounters a |\catcode| command
\ctsref{\catcode} specifying a category code
for a character $c$, the interpretation of $c$ by \TeX's mouth is affected.
And when
\TeX's stomach encounters a \refterm{macro} definition, the expansions carried
out in \TeX's gullet are affected.
You can understand how the processes interact by imagining that each
process eagerly gobbles up the output of its predecessor as soon as it
becomes available. For instance, once \TeX's stomach has seen
the last character of the filename in an |\input| command, \TeX's gaze
immediately shifts to the first character of the specified input file.
\endconcept
\pagebreak
\conceptindex{arguments}
\concept argument
^^{commands//arguments of}
An \defterm{argument} contains text that is passed to a
\refterm{command}.
The arguments of a command complete the description of what
the command is supposed to do.
The command can either be a \refterm{primitive} command or a
\refterm{macro}.
Each primitive command ^^{primitive//command}
has its own convention about the form of its
arguments. For instance, the sequence of \refterm{tokens:token}:
\csdisplay
\hskip 3pc plus 1em
|
consists of the command `|\hskip|' and the arguments
`|3pc plus 1em|'. But if you were to write:
\csdisplay
\count11 3pc plus 1em
|
you'd get an entirely different effect.
\TeX\ would treat `|\count11|' as a command with argument `|3|',
followed by the ordinary text tokens `|pc plus 1em|'
(because count registers expect a number to be assigned to them)%
---probably not what
you intended. The effect of the command, by the way, would be to
assign $3$ to count register $11$ (see the discussion of ^|\count|,
\xref\count).
Macros, on the other hand, all follow the same convention
for their arguments.
^^{macros//arguments of}
Each argument passed to a macro
corresponds to a \refterm{parameter}
^^{parameters//and arguments}
in the definition of that
macro. ^^{macros//parameters of}
A macro parameter is either ``delimited'' or ``undelimited''.
The macro definition determines the number and nature of the macro parameters
and therefore the number and nature of the macro arguments.
The difference between a delimited argument and an undelimited argument
lies in the way that \TeX\ decides where the argument ends.
^^{delimited arguments}
^^{undelimited arguments}
\ulist
\li A delimited argument consists of the tokens
from the start of the argument up to, but not including, the
particular sequence of tokens that serves as the delimiter for that argument.
The delimiter is specified in the macro definition. Thus you
supply a delimited argument to a macro by writing the argument itself
followed by the delimiter. A delimited argument can be empty, i.e., have
no text at all in it. Any braces in a delimited argument must be paired
properly, i.e., every left brace must have a corresponding right brace
and vice versa.
\li An undelimited argument consists of a single token or a sequence of
tokens enclosed in braces, like this:
`|{Here is {the} text.}|'. Despite appearances, the outer braces don't
form a \refterm{group}---\TeX\ uses them only to determine what the
argument is. Any inner braces, such as the ones around `|the|', must be
paired properly. If you make a mistake and put in too many right
braces, \TeX\ will complain about an unexpected right brace. \TeX\ will
also complain if you put in too many left braces, but you'll probably
get \emph{that} complaint long after the place where you intended to
end the argument (see \xref{mismatched}).
\endulist
\noindent
See \conceptcit{macro} for more information
about parameters and arguments. You'll find the precise rules pertaining
to delimited and undelimited arguments in \knuth{pages~203--204}.
\endconcept
\concept{ASCII}
\defterm{\ascii} is the abbreviation of ``American Standard Code for
Information Interchange''. There are $256$ \ascii\
^{characters}, each with its own code number, but
the meanings of only the first~$128$ have been standardized. You can
find these meanings in an \ascii\ ``code table'' such as the one on
\knuth{page~367}. Characters $32$--$126$ are ``printable characters'',
^^{printable characters} such as letters, numbers, and punctuation
marks. The remaining characters are ``^{control characters}'' that are
typically used (in the computer industry, not in \TeX) to control
input\slash output and data communications devices. For instance,
\ascii\ code $84$ corresponds to the letter `T', while \ascii\
code~$12$ corresponds to the ``form feed'' function (interpreted by most
printers as ``start a new page''). Although the \ascii\ standard
specifies meanings for the control characters, many manufacturers of
equipment such as modems and printers have used the control characters
for purposes other than the standard ones.
The meaning of a
character in \TeX\ is usually consistent with its meaning in standard \ascii,
and \refterm{fonts:font} that contain \ascii\
printable characters usually have those characters in the same positions as
their \ascii\ counterparts.
But some fonts, notably those used for math, replace the \ascii\
printable characters by other characters unrelated to the \ascii\ characters.
For instance, the Computer Modern math font
^^{Computer Modern fonts}
|cmsy10| has the math symbol
`{$\forall$}' in place of the \ascii\ digit `8'.
\endconcept
\conceptindex{assignments}
\concept assignment
An \defterm{assignment} is a construct that tells \TeX\ to assign a
value to a register,
^^{registers//assignment to}
to one of its internal
\refterm{parameters:parameter},
^^{parameters//assignments to}
to an entry in one of its internal tables,
or to a \refterm{control sequence}. Some examples of assignments are:
\csdisplay
\tolerance = 2000
\advance\count12 by 17
\lineskip = 4pt plus 2pt
\everycr = {\hskip 3pt \relax}
\catcode\`@ = 11
\let\graf = \par
\font\myfont = cmbx12
|
The first assignment indicates that \TeX\ should assign the numeric value
|2000| to the numeric parameter |\tolerance|, i.e., make the value of
|\tolerance| be $2000$. The other assignments are similar. The `|=|'
and the spaces are optional, so you could also write the first
assignment more tersely as:
\csdisplay
\tolerance2000
|
See \knuth{pages~276--277} for the detailed syntax of assignments.
\endconcept
\concept badness
The \defterm{badness} of a line is a measure of how far the interword
spaces ^^{interword spacing}
in the line deviate from their natural values,
i.e., the values specified in the \refterm{fonts:font} used in the line.
The greater the
deviation, the greater the badness. Similarly, the badness of a page is
a measure of how far the spaces between the boxes that
make up the page deviate from their ideal values. (Ordinarily, most of these
boxes are single lines of paragraphs.)
More precisely, the badness
is a measure of how much the \refterm{glue} associated with these spaces needs
to stretch or shrink to fill the line or page exactly.
\TeX\ computes the badness as approximately $100$
times the cube of the ratio by which it must stretch or shrink the glue
in order to compose a line or a page of the required size.
^^{line breaks//badness for}^^{page breaks//badness for}
For example, stretching the glue by twice its stated stretch yields a ratio of
$2$ and a badness of $800$; stretching it by half its stated stretch yields
a ratio of $.5$ and a badness of $13$.
\TeX\ treats a badness greater than $10000$ as
equal to $10000$.
\TeX\ uses the badness of a line when it's breaking a paragraph into lines
\seeconcept{line break}. It uses this information in two stages:
\olist
\li When \TeX\ is choosing line breaks,
it will eventually accept lines whose badness is less than or equal to
the value of |\tolerance| (\xref \tolerance). If \TeX\ cannot avoid setting
a line whose badness exceeds this
value, it will set it as an underfull or overfull \refterm{hbox}.
\TeX\ will set
an overfull or underfull hbox only as a last resort, i.e., only if there's no
other way to break the paragraph into lines.
\li Assuming that all lines are tolerably bad, \TeX\ uses the badness of lines
in order to evaluate the different ways of breaking the paragraph into lines.
During this evaluation it associates ``demerits'' with each potential line.
The badness increases the number of \refterm{demerits}.
\TeX\ then
breaks the paragraph into lines in a way that minimizes the
total demerits for the paragraph.
Most
often \TeX\ arranges the paragraph in a way that minimizes the badness of the
worst line. See \knuth{pages~97--98} for the details of how \TeX\
breaks a paragraph into lines.
\endolist
\TeX's procedure for assembling a sequence of lines and other vertical
mode material into pages is similar to its procedure for line breaking.
However, assembling pages is
not as complicated because \TeX\ only considers one page at a time
when it looks for page breaks.
Thus the only decision it must make is where to end the current page.
In contrast, when \TeX\ is choosing line breaks it
considers several of them simultaneously.
(Most word processors choose line breaks one at a time,
and thus don't do as good a job at it as \TeX\ does.)
See \knuth{pages~111--113} for the details of how \TeX\ chooses its
page breaks.
\endconcept
\conceptindex{baselines}
\concept baseline
The \defterm{baseline} of a \refterm{box} is an imaginary line that runs
across the box.
^^{boxes//baselines of}
When \TeX\ is
assembling the boxes of a \refterm{horizontal list} into a larger box,
it lines up the boxes in the list so that their baselines coincide.
As an analogy, think of writing on a pad of ruled paper. Each letter
that you write has
an implicit baseline.
In order to line up the letters horizontally,
you place them on the pad so that their baselines
agree with the light guidelines that are printed on the pad.
A box can and often does extend below its baseline.
For instance, the letter `g' extends below the baseline of its box because
it has a descender (the bottom loop of the `g').
\endconcept
\conceptindex{boxes}
\concept box
A \defterm{box} is a rectangle of material to be typeset. A single
\refterm{character} is a box by itself,
and an entire page is also a box.
\TeX\ forms a page as a nest of boxes within boxes within boxes. The
outermost box is the page itself, the innermost boxes are mostly
single characters, and single lines are boxes that are
somewhere in the middle.
\TeX\ carries out most of its box-building activities implicitly as it
constructs paragraphs and pages.
You can construct boxes explicitly
using a number of \TeX\ \refterm{commands}, notably
^|\hbox| \ctsref{\hbox},
^|\vbox| \ctsref{\vbox}, and
^|\vtop| \ctsref{\vtop}.
The ^|\hbox| command
constructs a box by appending smaller boxes horizontally from left to right;
it operates on a \refterm{horizontal list} and yields
an \refterm{hbox} ^^{hboxes} (horizontal box).
^^{horizontal lists}
The ^|\vbox| and |\vtop| commands
construct a box by appending smaller boxes vertically from top to bottom;
^^{vboxes}
they operate on a \refterm{vertical list}
and yield a \refterm{vbox} ^^{vboxes} (vertical box).
^^{vertical lists}
These horizontal and vertical lists can include not just smaller boxes but
several other kinds of entities as well, e.g., \refterm{glue} and
kerns.
^^{kerns//as list items}
A box has \refterm{height}, \refterm{depth}, and \refterm{width},
^^{height} ^^{depth} ^^{width}
like this:
\vdisplay{\offinterlineskip\sevenrm
\halign{#&#&\kern3pt \hfil#\hfil\cr
&\hrulefill\cr
&\vrule
\vtop to .7in{\vss \hbox to .9in{\hss baseline\hss}\vskip4pt}%
\vrule
&\labelledheight{.7in}{height}\cr
%
\vbox to 0pt{
\vss
\hbox{reference point \hbox to 15pt{\rightarrowfill}%
\hskip3pt}%
\kern-4.5pt}&{\box\refpoint}\hrulefill\cr
%
\omit
&\vrule\hfil\vrule
&\labelledheight{.4in}{depth}\cr
%
&\hrulefill\cr
%
\noalign{\vskip3pt}%
&\leftarrowfill { width }\rightarrowfill\cr
}}
^^{baselines}
The \refterm{baseline} is like one of
the light guidelines on a pad of ruled paper.
The boxes for letters such as `g'
extend below the baseline; the boxes for letters such as `h' don't.
The height of a box is the distance that the box extends above its
baseline, while its depth is the distance that it extends below its
baseline. \bix^^{reference point}
The \minref{reference point}
of a box is the place where its baseline intersects its left edge.
{\tighten
\TeX\ builds an hbox $H$ from a horizontal list by assuming
a reference point for $H$ and then appending the items in the list to $H$
one by one from left to right.
Each box in the list is placed so that its baseline coincides with the
baseline of $H$\kern-2pt,
i.e., the component boxes are lined up horizontally.%
\footnote{If a box is moved up or down with ^|\raise| or
^|\lower|, \TeX\ uses its reference point before the move when
placing it.}
The height of $H$ is the
height of the tallest box in the list, and the depth of $H$ is the depth
of the deepest box in the list.
The width of $H$ is the sum of the
widths of all the items in the list.
If any of these items are \refterm{glue} and \TeX\ needs to stretch or shrink
the glue,
the width of $H$ will be larger or smaller accordingly.
See \knuth{page~77} for the~details.
\par}
Similarly, \TeX\ builds a vbox $V$ from a vertical list by assuming a
temporary reference point for $V$ and then appending the items in the
list to $V$ one by one from top to bottom. Each box in the list is
placed so that its reference point is lined up vertically with the
reference point of \Vperiod.\footnote{If a box is moved left or right with
^|\moveleft| or ^|\moveright|, \TeX\ uses its reference point before the
move when placing it.} As each box other than the first one is added to
\Vcomma, \TeX\ puts \minref{interline glue} just above it. (This
^{interline glue} has no analogue for hboxes.) The width of $V$ is the
width of the widest box in the list, and the vertical extent (height
plus depth) of $V$ is the sum of the vertical extents of all the
items in the list.
\bix^^|\vbox|
\bix^^|\vtop|
The difference between |\vbox| and |\vtop| is in how they partition
the vertical extent of $V$ into a height and a depth.
Choosing the reference point of $V$ determines that partition.
\ulist
\li For |\vbox|, \TeX\ places the reference point on a horizontal line
with the reference point of the last component box
or rule of \Vcomma, except
that if the last box (or rule) is followed by glue or a kern, \TeX\ places the
reference point at the very bottom of \Vperiod.%
\footnote{The depth is limited by
the parameter ^|\boxmaxdepth| \ctsref{\boxmaxdepth}.}
\li For |\vtop|, \TeX\ places the reference point on a horizontal line
with the reference point of the first component box or rule of \Vcomma,
except that if the first box (or rule)
is preceded by glue or a kern, \TeX\ places
the reference point at the very top of \Vperiod.
\endulist
\noindent
Roughly speaking, then, |\vbox| puts the reference point near the bottom
of the vbox and |\vtop| puts it near the top.
When you want to align a
row of vboxes so that their tops line up horizontally,
you should usually use |\vtop| rather than |\vbox|.
See \knuth{pages~78 and 80--81} for the
details of how \TeX\ builds vboxes.
\eix^^|\vbox|
\eix^^|\vtop|
\eix^^{reference point}
You have quite a lot of freedom in constructing boxes. The typeset
material in a box can extend beyond the boundaries of the box as it does
for some letters (mostly italic or slanted ones). The component boxes
of a larger box can overlap. A box can have negative width, depth, or
height, though boxes like that are not often needed.
You can save a box in a box \refterm{register} and retrieve it later.
Before using a box register,
^^{box registers}
you should reserve it and give it a name
with the ^|\newbox| command \ctsref{\@newbox}. See
\conceptcit{register} for more information about box
registers.
\endconcept
\conceptindex{category codes}
\concept {category code}
The \defterm{category code} of a \refterm{character} determines that
character's role in \TeX.
^^{characters//category code of}
For instance, \TeX\ assigns a certain role to
letters, another to space characters, and so forth. \TeX\ attaches a
code to each character that it reads. When \TeX\ reads the
letter `|r|', for example, it ordinarily
attaches the category code $11$ (letter)
to it. For simple \TeX\ applications you won't need to worry about
category codes, but they become important when you are trying to achieve
special effects.
Category codes apply only to characters that \TeX\ reads from input
files. Once a character has gotten past \TeX's ^{gullet}
\seeconcept{\anatomy} and been interpreted, its category code no
longer matters. A character that you produce with the ^|\char| command
\ctsref{\char} does not have a category code because |\char|
is an instruction to \TeX\ to produce a certain character in a certain
\refterm{font}. For instance, the ^{\ascii} code for `|\|'
(the usual escape character) is $92$. If
you type `|\char92 grok|', it is \emph{not} equivalent to |\grok|.
Instead it tells \TeX\ to
typeset `$c$\kern.075em grok', where $c$ is the character in position $92$
of the code table for the current font.
You can use the ^|\catcode| command \ctsref{\catcode} to reassign the
category code of any character. By changing category codes you can
change the roles of various characters. For instance, if you type
`|\catcode`\@ = 11|', the category code of the at sign (|@|) will be set
to ``letter''. You then can use `|@|' in the name of a control
sequence.
Here is a list of the category codes defined by \TeX,
(see \xref{twocarets} for an explanation of
the |^^| notation),
together with the characters in each category (as assigned
by \TeX\ and \refterm{\plainTeX}):
\xrdef{catcodes}
\vskip\abovedisplayskip
%k \vskip 0pt plus 2pt % to fix bad page break
{%k \interlinepenalty = 10000
\halign{\indent\hfil\strut#&\qquad#\hfil\cr
\it Code&\it Meaning\cr
\noalign{\vskip\tinyskipamount}
0&Escape character \quad |\| ^^{escape character//category code of}
{\recat!ttidxref[\//category code of]]
\cr
1&Beginning of group \quad |{| ^^{groups}
{\recat!ttidxref[{//category code of]]
\cr
2&End of group \quad |}|
{\recat!ttidxref[}//category code of]]
\cr
3&Math shift \quad |$| ^^{math shift}
{\recat!ttidxref[$//category code of]]
\cr
4&Alignment tab \quad |&| ^^{tabs} ^^{alignments//tab character for}
\ttidxref{&//category code of} \cr
5&End of line \quad |^^M| \tequiv \ascii\ \asciichar{return}
^^{end of line} \ttidxref{^^M//category code of}\cr
6&Macro parameter \quad |#|
^^{macros//parameters of}
^^{parameters//indicated by \b\tt\#\e}
\ttidxref{#//category code of} \cr
7&Superscript \quad |^| and |^^K| ^^{superscripts}
\ttidxref{^^K}
\ttidxref{^//category code of} \cr
8&Subscript \quad |_| and |^^A| ^^{subscripts}
\ttidxref{^^A}
\ttidxref{_//category code of} \cr
9&Ignored character \quad |^^@| \tequiv \ascii\ \asciichar{null}
^^{ignored characters} \indexchar ^^@ \cr
10&Space \quad \visiblespace\ and |^^I| \tequiv \ascii\
\asciichar{horizontal\ tab}
^^{horizontal tab}
^^{space characters//category code of} \indexchar ^^I
{\recat!ttidxref[ ]]
\cr
11&Letter \quad |A| \dots |Z| and |a| \dots |z| ^^{letter}\cr
12&Other character \quad (everything not listed above or below)
^^{other characters}\cr
13&Active character \quad |~| and |^^L| \tequiv\ascii\ \asciichar{form\ feed}
^^{active characters} ^^{form feed} \indexchar ~ \indexchar ^^L \cr
14&Comment character \quad |%| ^^{comments}
{\recat!ttidxref[%//category code of]]
\cr
15&Invalid character \quad |^^?| \tequiv \ascii\ \asciichar{delete}
^^{invalid character} \indexchar ^^? \cr
}}
\vskip\belowdisplayskip
%k \vskip 0pt plus 2pt % to fix bad page break
\noindent Except for categories $11$--$13$,
all the characters in a particular category produce the same effect.
\margin{Misleading material removed.}
For instance, suppose
that you type:
\csdisplay
\catcode`\[ = 1 \catcode`\] = 2
|
Then the left and right bracket characters become
beginning-of-group and end-of-group characters equivalent to
the left and right brace characters. With these definitions `|[a b]|'
is a valid group, and so are \hbox{`|[a b}|'} and~\hbox{`|{a b]|'}.
The characters in categories $11$ (letter) and $12$
(other character) act as \refterm{commands:command}
that mean
``typeset the character with this code from the current font''.
The only distinction between letters and ``other'' characters is
that letters can appear in \refterm{control word}s but
``other'' characters~can't.
A character in category $13$ (active) acts like a control sequence
all by itself. \TeX\ complains if it encounters an active character that
doesn't have a definition associated with it.
^^{active characters}
If \TeX\ encounters an ^{invalid character} (category $15$)
in your input, it will complain about it.
The `|^^K|' and `|^^A|' characters have been included in categories
$8$ (subscript) and $9$ (superscript), even though these meanings
don't follow the standard \refterm{\ascii} interpretation.
That's because some keyboards, notably some at Stanford
University where \TeX\ originated,
have down arrow and up arrow keys that generate these characters.
\ttidxref{^^A}
\ttidxref{^^K}
There's a subtle point about the way \TeX\ assigns category codes that
can trip you up if you're not aware of it. \TeX\ sometimes needs to
look at a character twice as it does its initial scan: first to find the
end of some preceding construct, e.g., a control sequence, and later to
turn that character into a token. \TeX\ doesn't assign the category
code until its \emph{second} look at the character. For example:
\csdisplay
\def\foo{\catcode`\$ = 11 }% Make $ be a letter.
\foo$ % Produces a `$'.
\foo$ % Undefined control sequence `\foo$'.
|
\noindent
This bit of \TeX\ code produces `\$' in the typeset output. When
\TeX\ first sees the `|$|' on the second line,
it's looking for the end of a control sequence name. Since
the `|$|' isn't yet a letter, it marks the end of `|\foo|'. Next,
\TeX\ expands the `|\foo|' macro and changes the category code of `|$|'
to $11$ (letter). Then \TeX\ reads the `|$|' ``for real''. Since
`|$|' is now a letter, \TeX\ produces a box
containing the `|$|' character in the current font.
When \TeX\ sees the third line, it treats `|$|' as a letter and thus
considers it to be part of the control sequence name.
As a result it complains about an undefined control sequence |\foo$|.
\TeX\ behaves this way even when the terminating character is an
end of line. For example, suppose that the macro |\fum| activates the
end-of-line character. Then if |\fum| appears on a line $\ell$ by
itself, \TeX\ will first interpret the end of line of $\ell$ as
the end of the |\fum| control sequence and then will \emph{reinterpret}
the end of line of $\ell$ as an active character.
\endconcept
\conceptindex{characters}
\concept character
{\tighten
\TeX\ works with \defterm{characters} in two contexts:
as input characters, which it reads, and as output characters,
which it typesets.
\TeX\ transforms most input characters
into the output characters that depict them.
For example, it normally
transforms the input letter `|h|' into the letter `h' typeset in the current
font.
That is not the case, however, for an input character such as `|$|' that has a
special meaning.
\par}
\TeX\ gets its input characters by reading them from input files (or from your
terminal) and by expanding \refterm{macros:macro}. These are the
\emph{only} ways that \TeX\ can acquire an input character.
Each input character has a code number corresponding to its position in the
\refterm{\ascii} code table. ^^{\ascii}
For instance, the letter `|T|' has \ascii\ code~$84$.
When \TeX\ reads
a character, it attaches a \refterm{category code}
^^{category codes//attached during input}
to it. The category code affects how \TeX\ interprets the
character once it has been read in. \TeX\ determines
(and remembers) the category codes of the characters in a macro when it
reads the macro's definition. As \TeX\ reads characters with its eyes
\seeconcept{\anatomy} it does some ``filtering'',
such as condensing
sequences of spaces to a single space. See \knuth{pages~46--48} for the
details of this filtering.
The \ascii\
``^{control characters}'' have codes $0$--$31$ and $127$--$255$.
They either don't
show up or cause strange behavior on most terminals if you try to
display them. Nonetheless they are sometimes needed in \TeX\ input,
so \TeX\ has a special notation for them.
\xrdef{twocarets}
If you type `|^^|$c$', where $c$ is any character, you get the character
whose \ascii\ code is either $64$ greater or $64$ less than $c$'s
\ascii\ code. The largest acceptable code value using this notation
is $127$, so the notation is unambiguous.
Three particularly common instances of this
notation are `|^^M|' (the \ascii\ \asciichar{return} character),
`|^^J|' (the \ascii\ \asciichar{line\ feed} character) and `|^^I|'
(the \ascii\ \asciichar{horizontal\ tab} character).
\ttidxref{^^M}\ttidxref{^^J}\ttidxref{^^I}
{\tighten
\TeX\ also has another notation for indicating \ascii\ code values
that works for all character codes from $0$ to $255$.
\xrdef{hexchars}
If you type `|^^|$xy$', where $x$
and $y$ are any of the ^{hexadecimal digit}s `|0123456789abcdef|',
you get the single character with the specified code.
(Lowercase letters are required here.)
\TeX\ opts for the ``hexadecimal digits''
interpretation whenever it has a choice, so you must not follow a character
like `|^^a|' with a lowercase hexadecimal digit---if you do, you'll get the
wrong interpretation.
If you need to use this
notation you'll find it handy to have a table of \ascii\ codes.
\par}
An output character is a character to be typeset.
A command for producing an output character has the meaning
``Typeset
character number $n$ from the current \refterm{font}'',
where $n$ is determined by the command.
\TeX\ produces your typeset document by combining such characters
with
other typographical \hbox{elements} in boxes, and arranging them
on the page.
An input character whose category code is $11$ (^{letter}) or $12$ (other)
^^{other characters}
acts as a command to produce the corresponding output character. In
addition you can get \TeX\ to produce character $n$ by issuing the
command `|\char |$n$' \ctsref{\char}, ^^|\char| where $n$ is a
\refterm{number} between $0$ and $255$. The commands `|h|',
|\char`h|, and |\char104| all have the same effect. ($104$ is the
\ascii\ code for `h'.)
\endconcept
\concept class
The \defterm{class} of a \refterm{character} specifies that character's
role in math formulas. The class of a character is encoded in its
\refterm{mathcode}. ^^{mathcodes//class encoded in} For example, the
equals sign `|=|' has class $3$ (Relation). \TeX\ uses its knowledge
of character classes to decide how much space to put between different
components of a math formula. \margin{clarifying material added} For
example, here's a math formula shown first as \TeX\ normally prints it
and then with the class of each character randomly changed:
$$\strut a+(b-a)=a \qquad
\mathopen{a}\mathord{+}\mathrel{(}\mathclose{b}\mathclose{-}
\mathop{a}\mathopen{)}\mathord{=}\mathopen{a}$$
See \xrefpg\mathord\ of this book for a list of the classes and
\knuth{page~154} for their meanings.
\endconcept
\conceptindex{commands}
\concept command
A \defterm{command} instructs \TeX\ to carry out a certain action.
Every \refterm{token} that reaches \TeX's stomach \seeconcept{\anatomy}
acts as a command, except for those that are parts of arguments to
other commands (see below).
^^{tokens//as commands}
A command can be invoked by a
\refterm{control sequence}, by an \refterm{active character}, or by an
ordinary character. It might seem odd that \TeX\ treats an ordinary
character as a command, but in fact that's what it does:
when \TeX\ sees
an ordinary character
it constructs a \refterm{box} containing that character typeset in
the current font.
A command can have arguments.
The arguments of a command are single tokens or
groups of tokens that complete the description of what
the command is supposed to do.
For example, the command `|\vskip 1in|' tells \TeX\ to skip
$1$ inch vertically. It has an argument `|1in|',
which consists of three tokens.
The description of what |\vskip| is supposed to do would be incomplete
without specifying how far it is supposed to skip.
The tokens in the arguments to a command are not themselves considered
to be commands.
Some examples of different kinds of \TeX\ commands are:
\ulist\compact
\li Ordinary characters, such as `|W|', which instructs \TeX\
to produce a box containing a typeset `W'
\li Font-setting commands,
such as |\bf|, which begins boldface type
\li Accents, such as |\`|, which produces a grave accent as in `\`e'
\li Special symbols and ligatures, such as |\P| (\P) and |\ae| (\ae)
\li Parameters, such as |\parskip|, the amount of glue that
\TeX\ puts between paragraphs
\li Math symbols, such as |\alpha| ($\alpha$) and |\in| ($\in$)
\li Math operators, such as |\over|, which produces a fraction
\endulist
\endconcept
\conceptindex{conditional tests}
\concept {conditional test}
A \defterm{conditional test} is a command that tests whether or not a certain
condition is true and
causes \TeX\ either to expand or to skip some text, depending on
the outcome.
The general form of a conditional test is either:
\display{
{\tt \\if}$\alpha$\<true text>{\tt \\else}\<false text>{\tt \\fi}}
^^|\else|^^|\fi|
\noindent or:\hfil\
\display{
{\tt \\if}$\alpha$\<true text>{\tt \\fi}}
\noindent where $\alpha$ specifies the particular test.
For example, |\ifvmode| tests the condition that \TeX\
is currently in a \refterm{vertical mode}.
If the condition is true, \TeX\ expands \<true text>.
If the condition is false, \TeX\ expands \<false text> (if it's present).
Conditional tests are interpreted in \TeX's gullet
\seeconcept{\anatomy}, so any expandable \minref{token}s in
the interpreted text are expanded after the test has been resolved.
The
various conditional tests are explained in \headcit{Conditional tests}%
{conds}.
\endconcept
\conceptindex{control sequences}
\concept{control sequence}
A \defterm{control sequence} is a name for a \TeX\ \refterm{command}.
A control sequence always starts with an ^{escape character}, usually
a backslash (|\|).
\indexchar \
A control sequence takes one of two forms:
\ulist
\li A \refterm{control word} is a control sequence consisting of an
\refterm{escape character} followed by one or more letters.
^^{control words}
The control
word ends when \TeX\ sees a nonletter. For instance, when \TeX\ reads
`\hbox{|\hfill!visiblespace,!visiblespace!.the|}', it sees six
\refterm{tokens:token}:
the control sequence `|\hfill|', comma, space, `|t|', `|h|', `|e|'. The
space after `|\hfill|' ends the control sequence and
is absorbed by \TeX\ when it scans the control sequence.
(For the text `|\hfill,!visiblespace!.the|', on the other hand,
the comma both ends the control sequence and counts as a character in its
own right.)
\li A \refterm{control symbol}
^^{control symbols}
is a control sequence consisting of an
^{escape character} followed by any character other than a letter---%
even a space or an end of line.
A control symbol is self-delimited, i.e., \TeX\ knows where it ends without
having to look at what character comes after it.
The character after a control symbol is never absorbed by
the control symbol.
\endulist
\noindent See \xrefpg{spaces} for more information about spaces after control
sequences.
\TeX\ provides a great many predefined control sequences. The
\refterm{primitive} control sequences are built into the \TeX\ computer
program and thus are available in all forms of \TeX.
^^{primitive//control sequence}
Other
predefined control sequences are provided by \refterm{\plainTeX}, the
form of \TeX\ described in this book.
You can augment the predefined control sequences with ones of your own,
using commands such as ^|\def| and ^|\let| to define them.
\chapterref{eplain} of this book contains a
collection of control sequence definitions that you may find
useful. In addition, your computing facility may
be able to provide a collection of
locally developed \TeX\ macros.
\endconcept
\conceptindex{control symbols}
\concept{control symbol}
A \defterm{control symbol} is a \refterm{control sequence} that consists
of an \refterm{escape character} followed by any character other than a
letter---even a space or end of line.
^^{escape character}
\endconcept
\conceptindex{control words}
\concept{control word}
A \defterm{control word} is a \refterm{control sequence} that consists
of an \refterm{escape character} followed by one or more
letters.\footnote{A ``letter'' here has the strict meaning of a
character with category code $11$.}
\TeX\
ignores any spaces or ends-of-line that follow a control word, except to
note that they end the control word.
^^{escape character}
\endconcept
\concept {decimal constant}
See \conceptcit{number}.
\endconcept
\conceptindex{delimiters}
\concept delimiter
A \defterm{delimiter} is a character
that is intended to be used as
a visible boundary of a math formula.
The essential property of a delimiter is that \TeX\ can adjust
its size according
to the vertical size (\refterm{height} plus \refterm{depth})
of the subformula.
However, \TeX\ performs the adjustment only if the delimiter
appears in a ``delimiter context'', namely, as an argument to
one of the commands ^|\left|,
^|\right|,
|\over!-with!-delims|,
|\atop!-with!-delims|,
or |\above!-with!-delims|
^^|\overwithdelims|
^^|\atopwithdelims|
^^|abovewithdelims|
\margin{Footnote deleted}
(see \pp\xrefn{\overwithdelims},~\xrefn{\left}).
The delimiter contexts also include any \refterm{argument}
to a \refterm{macro} that uses the argument in a delimiter context.
For example, the left and right
parentheses are delimiters.
If you use ^{parentheses} in a delimiter context
around a formula, \TeX\ makes the parentheses big
enough to enclose the \refterm{box} that contains the formula (as long as the
\refterm{fonts:font} you're using have big enough parentheses).
For example:
\csdisplay
$$ \left( a \over b \right) $$
|
yields:
\centereddisplays $$\left (a \over b \right ) $$
Here \TeX\ has made the parentheses big enough to accommodate the fraction.
But if you write, instead:
\csdisplay
$$({a \over b})$$
|
you'll get:
$$({a \over b})$$
Since the parentheses aren't in a delimiter context,
they are \emph{not} enlarged.
Delimiters come in pairs:
an opening delimiter at the left of the subformula
and a closing delimiter at its right.
You can explicitly choose a larger height for a
delimiter with the commands ^|\bigl|, ^|\bigr|, and their
relatives \ctsref{\bigl}.\footnote
{\PlainTeX\ defines the various |\big| commands by using |\left| and |\right|
to provide a delimiter context. It sets the size by
constructing an empty formula with the desired height.}
For instance, in order to get the
displayed formula:
$$\bigl(f(x) - x \bigr) \bigl(f(y) - y \bigr)$$
\noindent in which the outer parentheses are a little bigger than the inner
ones, you should write:
\csdisplay
$$\bigl( f(x) - x \bigr) \bigl( f(y) - y \bigr)$$
|
The $22$ \plainTeX\ delimiters, shown at their normal size, are:
\display{%
$( \>) \>[ \>] \>\{ \>\}
\>\lfloor \>\rfloor \>\lceil \>\rceil
\>\langle \>\rangle \>/ \>\backslash
\>\vert \>\Vert
\>\uparrow \>\downarrow \>\updownarrow
\>\Uparrow \>\Downarrow \>\Updownarrow$}
^^|)| ^^|)| ^^|[| ^^|]| ^^|\lbrack| ^^|\rbrack|
^^|\{| ^^|\}| ^^|\lbrace| ^^|\rbrace|
^^|\lfloor| ^^|\rfloor| ^^|\lceil| ^^|\rceil|
^^|\langle| ^^|\rangle| ^^|/| ^^|\backslash|
^^|\vert| ^^|\Vert|
^^|\uparrow| ^^|\downarrow| ^^|\updownarrow|
^^|\Uparrow| ^^|\Downarrow| ^^|\Updownarrow|
\noindent
Here they are at the largest size provided explicitly by \plainTeX\
(the |\Biggl|, |\Biggr|, etc., versions):
\nobreak\vskip .5\abovedisplayskip
\display{%
$\Biggl( \>\Biggr) \>\Biggl[ \>\Biggr]
\>\Biggl\{ \>\Biggr\} \>\Biggl\lfloor \>\Biggr\rfloor
\>\Biggl\lceil \>\Biggr\rceil
\>\Biggl\langle \>\Biggr\rangle
\>\Biggm/ \>\Biggm\backslash
\>\Biggm\vert \>\Biggm\Vert
\>\Biggm\uparrow \>\Biggm\downarrow \>\Biggm\updownarrow
\>\Biggm\Uparrow \>\Biggm\Downarrow \>\Biggm\Updownarrow$}
\vskip .5\belowdisplayskip
\noindent
The delimiters (except for `|(|', `|)|', and
`|/|')
are among the symbols listed on
pages~\xrefn{\lbrace}--\xrefn{\Uparrow}.
They are listed in one place on \knuth{page~146}.
A delimiter can belong to any class.
^^{class//of a delimiter}
For a delimiter that you enlarge with
|\bigl|, |\bigr|, etc., the class is determined by the command:
``opener'' for |l|-commands, ``closer'' for |r|-commands,
``relation'' for |m|-commands, and ``ordinary symbol'' for |g|-commands,
e.g., |\Big|.
You can obtain a delimiter in two different ways:
\olist
\li You can make a character be a delimiter by assigning it a
nonnegative delimiter code
\bix^^{delimiter codes}
(see below) with the ^|\delcode| command (\xref\delcode).
Thereafter the character acts as a delimiter whenever you use it in a
delimiter context.\footnote{%
It's possible to use a character with a nonnegative delimiter code in
a context where it isn't a delimiter. In this case \TeX\ doesn't perform the
search; instead it just uses the character in the ordinary way
(see \knuth{page~156}).}
\li You can produce a delimiter explicitly with the ^|\delimiter| command
(\xref\delimiter), in analogy to the way that you can produce an ordinary
character with the |\char| command or a math character with the |\mathchar|
command.
The |\delimiter| command uses the same delimiter codes that are used in a
|\delcode| table entry, but with an extra digit in front to indicate a
class.
It's rare to use |\delimiter| outside of a macro definition.
\endolist
A delimiter code tells
\TeX\ how to search for an appropriate output character to represent
a delimiter.
The rules for this search are rather complicated
(see \knuth{pages~156 and 442}).
A complete understanding of these rules requires knowing
about the organization of font ^{metrics file}s, a topic that is not just beyond
the scope of this book but beyond the scope of \texbook\ as well.
In essence the search works like this. The delimiter code specifies a
``small'' output character and a ``large'' output character by
providing a \refterm{font} position and a font \refterm{family} for each
(see \xref\delcode).
Using this information, \TeX\ can find (or construct)
larger and larger versions of the delimiter. \TeX\ first tries
different sizes (from small to large)
of the ``small'' character in the ``small'' font
and then
different sizes (also from small to large)
of the ``large'' character in the ``large'' font,
seeking one whose height plus depth is sufficiently large.
If none of the characters it finds are large
enough, it uses the largest one that it finds.
It's possible that
the small character, the large character, or both have been left unspecified
(indicated by a zero in the appropriate part of the delimiter code).
If only one character
has been specified, \TeX\ uses that one. If neither has been specified,
it replaces the delimiter by a space of width ^|\nulldelimiterspace|.
\eix^^{delimiter codes}
\endconcept
\concept demerits
\TeX\ uses \refterm{demerits} as a measure of how undesirable a line is
when it's breaking a paragraph into lines \seeconcept{line break}.
^^{line breaks//demerits for}
The demerits of a line are affected both by the \refterm{badness} of the line
and by \refterm{penalties:penalty} associated with the line.
^^{badness}
\TeX's goal in choosing a particular arrangement of lines is to minimize the
total demerits for the paragraph, which it computes by adding up the demerits
for the individual lines.
See \knuth{pages~97--98} for the details of how \TeX\
breaks a paragraph into lines.
\TeX\ does not use demerits when it's choosing page breaks; instead, it uses
a similar measure known as the ``cost'' of a particular page break.
\endconcept
\concept depth
^^{boxes//depth of}
The \defterm{depth} of a \refterm{box} is the distance that the box extends
below its \refterm{baseline}.
\endconcept
\conceptindex{dimensions}
\concept dimension
A \defterm{dimension} specifies a distance, that is, a linear measure of
space. You use dimensions to specify sizes of things, such as the length
of a line. Printers in English-speaking countries traditionally measure
distance in points and picas, while printers in continental Europe
traditionally measure distance in did\^ot points and ciceros. You can
use these units or others, such as inches, that may be more
familiar to you. The font-independent
^{units of measure} that \TeX\ understands are:
\xrdef{dimdefs}
\nobreak\vskip\abovedisplayskip
\halign{\indent\hfil\tt #\qquad&#\hfil\cr
pt&^{point} (72.27 points = 1 inch)\cr
pc&^{pica} (1 pica = 12 points)\cr
bp&big point (72 big points = 1 inch)\cr
in&^{inch}\cr
cm&^{centimeter} (2.54 centimeters = 1 inch)\cr
mm&^{millimeter} (10 millimeters = 1 centimeter)\cr
dd&^{\didotpt} (1157 {\didotpt}s = 1238 points)\cr
cc&^{cicero} (1 cicero = 12 {\didotpt}s)\cr
sp&^{scaled point} (65536 scaled points = 1 point)\cr
}
\vskip\belowdisplayskip
Two additional units of measure are associated with every font: `^|ex|',
a vertical measure usually about the height of the letter `x'
in the font, and `^|em|', a
horizontal measure usually equal to the point size of the font and
about the width of the letter `M' in the font. Finally,
\TeX\ provides three ``infinite'' units of measure: `^|fil|', `^|fill|', and
`^|filll|', in increasing order of~strength.
A dimension is written as a ^{factor}, i.e, a multiplier,
followed by a unit of measure.
^^{units of measure}
The factor can be either a whole \refterm{number} or
a \refterm{decimal constant} containing a decimal point
or decimal comma.
The factor can be preceded by a plus or minus sign, so a dimension
can be positive or negative.
^^{dimensions//negative}
The unit of measure must be there, even if the number is
zero. Spaces between the number and the unit of measure are permitted
but not required. You'll find a precise definition of a
dimension on \knuth{page~270}. Here are some examples of dimensions:
\csdisplay
5.9in 0pt -2,5 pc 2fil
|
The last of these represents a first-order infinite distance.
An infinite distance outweighs any finite distance or any weaker infinite
distance. If you add |10in| to |.001fil|, you get |.001fil|; if you add
|2fil| to |-1fill| you get |-1fill|; and so forth.
\TeX\ accepts infinite distances
only when you are specifying the \refterm{stretch} and \refterm{shrink}
of \refterm{glue}.
\TeX\ multiplies all dimensions in your document by a
\refterm{magnification} factor $f/1000$,
where $f$ is the value of the ^|\mag| parameter.
^^{magnification}
Since the default value of
|\mag| is $1000$, the normal case is that your document is
typeset just as specified. You can specify a dimension as it will be
measured in the final document independent of magnification by putting
`|true|' in front of the unit. For instance, `|\kern 8 true pt|'
produces a kern of $8$ points whatever the magnification.
\endconcept
\concept {display math}
The term \defterm{display math} refers to a math formula that \TeX\
places on a line by itself with extra space above and below
so as to set it off from the surrounding text.
A display math formula is enclosed by `|$$|'s.
\ttidxref{$$}
\TeX\ reads display math in display math \refterm{mode}.
\endconcept
\concept{escape character}
An \defterm{escape character} introduces a control sequence. The escape
character in \refterm{\plainTeX} is the backslash (|\|).
\indexchar \
You can change the escape character from $c_1$ to $c_2$
by reassigning the category codes of $c_1$ and $c_2$
with the ^|\catcode| command \ctsref{\catcode}.
You can also define additional escape characters similarly.
If you want to typeset material containing literal escape characters, you must
either
(a) define a control sequence that stands for the printed escape character or
(b) temporarily
disable the escape character by changing its category code, using the
method shown on \xrefpg{verbatim}. The definition:
\csdisplay
\def\\{$\backslash$}
|
is one way of creating a control sequence that stands for `$\backslash$'
(a backslash typeset in a math font).
You can use the ^|\escapechar| parameter \ctsref{\escapechar} to specify
how the escape character is represented in synthesized control sequences,
e.g., those created by |\string| and |\message|.
\endconcept
\concept family
A \defterm{family} is a group of three related \refterm{fonts:font} used
when \TeX\ is in \refterm{math mode}.
^^{fonts//families of}
Outside of math mode, families
have no effect. The three fonts in a family are used for normal symbols
(\refterm{text size}), subscripts and superscripts (\refterm{script
size}), and sub-subscripts, super-superscripts, etc.\
(\refterm{scriptscript size}).
^^{text size}
^^{script size}
^^{scriptscript size}
For example, the numeral `|2|' set in
these three fonts would give you `$2$', `$\scriptstyle 2$', and
`$\scriptscriptstyle 2$' (in \plainTeX).
Ordinarily you would set up the
three fonts in a family as different point sizes of the same typeface,
but nothing prevents you from using different typefaces for the three
fonts as well or using the same font twice in a family.
{\tighten
\TeX\ provides for up to sixteen families, numbered $0$--$15$. For
example, family $0$ in \refterm{\plainTeX} consists of $10$-point roman
for text, $7$-point roman for script, and $5$-point roman for
scriptscript.
^^{\plainTeX//font families in}
\PlainTeX\ also defines family $1$ to consist of math
italic fonts and reserves families $2$ and $3$ for ^{special symbols} and
^{math extensions} respectively.\footnote{Families $2$ and $3$ are special
in that their font metric files must include parameters for math
spacing.} If you need to define a family for yourself, you should use
the ^|\newfam| command \ctsref{\@newfam} to get the number of a family that
isn't in use, and the ^|\textfont|, ^|\scriptfont|,
and ^|\scriptscriptfont| commands \ctsref{\scriptscriptfont}
to assign fonts to that family.
\par}
\endconcept
\conceptindex{files}
\concept file
A \defterm{file} is a stream of information that \TeX\ interprets or
creates. Files are managed by the ^{operating system} that supervises your
\TeX\ run. \TeX\ deals with files in four different contexts:
\olist
\li A ``^{source file}'' is one that \TeX\ reads with its ``eyes''
\seeconcept{\anatomy} and interprets according to its ordinary rules.
Your primary input file---the one you specify after `|**|' or
on the command line when
you invoke \TeX---is a source file, and so is any file that you call for
with an ^|\input| command \ctsref \input.
\li A ``^{result file}'' is one that contains the results of
running \TeX. A \TeX\ run creates two result files: the
\dvifile\ and the log file.
^^{\dvifile//as a result file}
^^{log file//as a result file}
The \dvifile\ contains the information needed to print your document;
the
log file contains a record of what happened during the run, including any
error messages that \TeX\ generated.
If your primary source file is named
|screed.tex|, your \dvifile\ and log file will be named |screed.dvi|
and |screed.log|.\footnote{This is the usual convention, but
particular implementations of \TeX\ are free to change it.}
\li To read from a file with the ^|\read|
command \ctsref{\read} you need to associate the file with an input stream.
^^{input streams//reading with \b\tt\\read\e}
You can have up to $16$ input streams active
at once, numbered $0$--$15$.
The |\read| command reads a single line and makes it the value of a
designated \refterm{control sequence}, so reading with
|\read| is very different from reading with ^|\input| (which brings in an
entire file).
\TeX\ takes any input stream number not between
$0$ and $15$ to refer to the terminal,
so `|\read16|', say, reads the next line that you type at the terminal.
\li To write to a file with the |\write|
command \ctsref \write\ you need to associate the file
with an output stream.
^^|\write//output stream for|
^^{output streams}
You can have up to $16$ output streams active
at once, numbered $0$--$15$.
Input and output streams are independent.
Anything sent to an output stream with a negative number goes to the log
file; anything sent to an output stream with a number greater than $15$
goes both to the log file and to the terminal.
Thus `|\write16|', say, writes a line on the terminal and also sends
that line
to the log~file.
\endolist
You must open a stream file before you can use it.
An input stream file is opened with an ^|\openin|
command \ctsref \openin\ and an output stream file is opened with an
^|\openout| command \ctsref\openout.
For tidiness
you should close a stream file when you're done with it, although
\TeX\ will do that at the end of the run if you don't.
The two commands for closing a stream file are ^|\closein| \ctsref\closein\
and ^|\closeout| \ctsref\closeout.
An advantage of closing a stream when
you're done with it is that you can then reuse the stream for a different file.
Doing this can be essential when you're reading a long sequence of files.
Although you can assign numbers yourself to input and output streams,
it's better to do it with the ^|\newread| and
^|\newwrite| \ctsref{\@newwrite} commands.
You can have more than one stream associated with a particular file,
but you'll get (probably undiagnosed) garbage unless all of the streams
are input streams. Associating more than one stream with an input file
can be useful when you want to use the same input file for two different
purposes.
\TeX\ ordinarily defers the actions of opening, writing to, or closing
an output stream until it ships out a page with ^|\shipout|
(see \knuth{page~227}
for the details). This behavior applies even to messages written to the
terminal with |\write|. But you can get \TeX\ to perform an action
on an output stream immediately by preceding the action command with
^|\immediate| \ctsref\immediate. For example:
\csdisplay
\immediate\write16{Do not pass GO!! Do not collect $200!!}
|
\endconcept
\conceptindex{file names}
\concept {file name}
A \defterm{file name} names a
\refterm{file} that is known to the ^{operating system}
that in turn
supervises your \TeX\ run. The syntax of a file name does \emph{not}
follow the usual rules of \TeX\ syntax, and in fact it is different
in different implementations of \TeX.
In particular, most \TeX\ implementations consider a file name to be
terminated by a blank or an end of line. Thus \TeX\ is likely to
misinterpret `|{\input chapter2}|'
by taking the right brace as part of the file name.
As a general rule, you should follow a file name by a blank or the
end of the line as in `|{\input chapter2!visiblespace}|'.
\endconcept
\eject
\conceptindex{fonts}
\concept font
A \defterm{font} in \TeX\ is a collection of up to $256$ output
characters, usually having the same typeface design, style (roman,
italic, bold, condensed, etc.),
and point size.\footnote{\PlainTeX\ uses a special
font for constructing ^{math symbols} in which the characters have
different sizes. Other special fonts are often useful for applications
such as typesetting ^{logos}.} The ^{Computer Modern fonts} that
generally come with \TeX\ have only $128$ characters. The colophon on
the last page of this book describes the typefaces that we used to set
this book.
For instance, here is the alphabet in the Palatino Roman $10$ point font:
^^{Palatino fonts}
\vskip\abovedisplayskip{\narrower\tenpal
\noindent ABCDEFGHIJKLMNOPQRSTUVWXYZ\hfil\break
abcdefghijklmnopqrstuvwxyz\par
}\vskip\belowdisplayskip
\noindent
And here it is in the Computer Modern Bold Extended $12$
point font:
^^{Computer Modern fonts}
\vskip\abovedisplayskip{\narrower\font\twelvebf=cmbx12\twelvebf
\noindent ABCDEFGHIJKLMNOPQRSTUVWXYZ\hfil\break
abcdefghijklmnopqrstuvwxyz\par
}\vskip\belowdisplayskip
The characters in a font are numbered.
The numbering usually agrees with the ^{\ascii} numbering
for those characters that exist in the \ascii\ character set.
The code table for each font indicates what the character
with code $n$ looks like in that font.
Some fonts, such as the ones used for mathematical symbols, have no
letters at all in them. You can produce a \refterm{box} containing the
character numbered $n$, typeset in the current font, by writing `|\char |$n$'
\ctsref{\char}.
In order to use a font in your document,
you must first name it with a control sequence and load it. Thereafter you
can select it by typing
that control sequence whenever you want to use it.
\PlainTeX\ provides a number of fonts that are already named and~loaded.
You name and load a font as a single operation, using a
command such as `|\font\twelvebf=cmbx12|'. Here `|\twelvebf|' is the
control sequence that you use to name the font
and `|cmbx12|' identifies the font metrics file
|cmbx12.tfm|
in your computer's file system.
You then can start to use the font by typing
`|\twelvebf|'. After that, the font will be in effect until
either (a)~you select another font or (b)~you terminate the
\refterm{group}, if any, in which you started the
font. For example, the input:
\csdisplay
{\twelvebf white rabbits like carrots}
|
will cause the |cmbx12| font to be in effect just for the
text `|white rabbits like carrots|'.
You can use \TeX\ with fonts other than
Computer Modern (look at the example on \xrefpg{palatino} and
at the page headers).
The files for such fonts need to be
installed in your computer's file system in a place where \TeX\ can find
them. \TeX\ and its companion programs generally need two files for each font:
one to give its metrics (|cmbx12.tfm|,
^^{\tfmfile}
for example) and another to
give the shape of the characters (|cmbx12.pk|, for example).
\TeX\ itself uses only the metrics
file. Another program, the device driver,
^^{device drivers}
converts the \dvifile\
^^{\dvifile//converted by driver}
produced by \TeX\ to a form that your printer
or other output device can handle. The driver
uses the shape file (if it exists).
The font metrics file contains the information that \TeX\ needs in
order to allocate space for each typeset character.
Thus it includes the size of each character, the ligatures and
kerns that pertain to sequences of adjacent characters, and so on.
What the metrics file
\emph{doesn't} include is any information about the shapes
of the characters in the font.
{\tighten
The shape (pixel) file \xrdef{shape}
^^{pixel file}^^{shape file}
may be in any of several
formats. The extension part of the name (the part after the dot)
tells the driver which format the shape file is in. For example,
|cmbx12.pk| ^^{\pkfile} might be the shape file for font |cmbx12| in
packed format, while |cmbx12.gf| ^^{\gffile} might be the shape file
for font |cmbx12| in generic font format.
A shape file may not be needed for a font that's resident in your
output device.
\par}
\endconcept
\conceptindex{footers}
\concept footer
A \defterm{footer} is material that \TeX\ puts at the bottom of every page,
below the text of that page.
The default footer in \plainTeX\ is a centered page number.
Ordinarily a footer consists of a single line, which you can set by
assigning a token list to ^|\footline| \ctsref\footline.
See \xrefpg{bighead} for a method of producing multiline footers.
\endconcept
%k \vskip 0pt plus 2pt % to solve page break problem
\concept {format file}
{\tighten
A \defterm{format file} is a file that contains an image of
\TeX's memory in a form in which it can be reloaded quickly.
A format file can be created with the ^|\dump| command \ctsref\dump.
The image contains a complete record
of the definitions (of \refterm{fonts:font}, \refterm{macros:macro}, etc.)
that were present when the dump took place.
By using ^|virtex|, a special ``virgin'' form of \TeX,
you can then reload the format file at high speed and
continue in the same state that \TeX\ was in at the time of the dump.
The advantage of a format file over an ordinary input
file containing the same information is that \TeX\ can load it much
faster.
\par}
Format files can only be created by ^|initex|, another special
form of \TeX\ intended just for that purpose.
Neither |virtex| nor |initex| has any
facilities other than the primitives built into the
\TeX\ program itself.
A ^{preloaded} form of \TeX\ is one that has a format file already
loaded and is ready to accept user input.
The form of \TeX\ that's called |tex|
often has the \plainTeX\ definitions preloaded.
(\PlainTeX\ is ordinarily available in two other forms as well:
as a format file and as a \TeX\ source file.
In some environments, |tex| is equivalent to calling |virtex|
and then loading |plain|.)
Creating preloaded forms of \TeX\ requires a special program;
it cannot be done using only the facilities of \TeX\ itself.
\endconcept
\concept global
A \defterm{global} definition is effective
until the end of the
document or until it is overridden by another definition,
even when it occurs within a \refterm{group}.
Thus a global definition is unaffected by group boundaries.
You can make any definition global by prefixing it with the |\global|
command \ctsref{\global} unless ^|\globaldefs| \ctsref\globaldefs{}
is negative.
^^|\global|
There's a special way of making a \refterm{macro} definition global.
^^{macros//global}
Normally you define a macro using either the |\def| command
or the |\edef| command \ctsref{\edef}.
^^|\edef//making global|
^^|\def//making global|
If you use |\gdef| or |\xdef|
instead of |\def| and |\edef| respectively, the macro definition will
be global. That is, `^|\gdef|' is equivalent to `|\global\def|' and
`^|\xdef|' is equivalent to `|\global\edef|'.
\endconcept
\concept glue
\bix^^{stretch}
\bix^^{shrink}
\defterm{Glue} is blank space that can stretch or shrink.
Glue gives \TeX\ the flexibility that it needs in order to produce
handsome
documents. Glue comes in two flavors: horizontal glue and vertical glue.
Horizontal glue occurs within \refterm{horizontal lists:horizontal list},
while vertical glue occurs within \refterm{vertical lists:vertical list}.
^^{horizontal lists}
^^{vertical lists}
You
can produce a glue item either implicitly, e.g., with an interword space, or
explicitly, e.g., with the ^|\hskip| command.
^^{spaces//interword}
\TeX\ itself produces many glue
items as it typesets your document.
We'll just describe horizontal glue---vertical glue is analogous.
When \TeX\ assembles a list of boxes and glue into a larger
unit,
^^{boxes//glue with}
it adjusts the size of the glue to meet the space requirements of the
larger unit. For instance, \TeX\ ensures that the ^{right margin} of a page
is uniform by adjusting the horizontal glue within lines.
Similarly, it ensures that different pages have the
same ^{bottom margin}
by adjusting the glue between blocks of text such as paragraphs and
math displays
(where the change is least likely to be conspicuous).
A glue item has a natural space---the size it ``wants to be''. Glue
also has two other attributes: its \refterm{stretch} and its
\refterm{shrink}. You can produce a specific amount of horizontal glue
with the ^|\hskip| \refterm{command} \ctsref{\hskip}. The command
|\hskip 6pt plus 2pt minus 3pt|
produces a horizontal glue item whose natural
size is $6$ points, whose stretch is $2$ points, and whose shrink is
$3$ points. Similarly, you can produce a specific amount of vertical
glue with the ^|\vskip| command \ctsref{\vskip}.
The best way to understand what stretch and shrink are about
is to see an example of glue at work.
Suppose you're constructing an \refterm{hbox} from three boxes and two glue
items, as in this picture:
\gluepicture
29 {\picbox 4 \gluebox 6 4 1 6 \picbox 5 \gluebox 10 8 3 10 \picbox 4 }
\noindent
The units of measurement here could be points, millimeters, or anything else.
If the hbox is allowed to assume its natural width, then each glue item in the
box also assumes its natural width. The total width of the hbox is then the
sum of the widths of its parts, namely, $29$ units.
Next, suppose that the hbox is required to be wider than $29$ units, say
$35$ units. This
could happen, for example, if the hbox is required to occupy an entire
line and the line width is $35$ units.
Since the boxes can't change their width,
\TeX\ produces the necessary extra space by making the glue items wider.
The picture now looks like this:
\gluepicture
35 {\picbox 4 \gluebox 6 4 2 8 \picbox 5 \gluebox 10 8 6 14 \picbox 4 }
The glue items don't become wider equally; they became wider in proportion to
their stretch. Since the second glue item
has twice as much stretch as the first one,
it gets wider by four units while the first glue item gets wider by only
two units.
Glue can be stretched as far as necessary, although \TeX\ is
somewhat reluctant to
stretch it beyond the amount of stretch given in its definition.
Finally, suppose that the hbox is required to be narrower than $29$ units, say
$25$ units. In this case \TeX\ makes the glue items narrower.
The picture looks like this:
\gluepicture
25 {\picbox 4 \gluebox 6 4 2 5 \picbox 5 \gluebox 10 8 6 7 \picbox 4 }
The glue items become narrower in proportion to their shrink.
The first glue item becomes narrower by one unit, while the second glue item
becomes narrower by three units. Glue cannot shrink by a distance
less than the amount of shrink
given in its definition even though the distance it can stretch is
unlimited. In this important sense the shrink and
the stretch behave differently.
A good rule of thumb for glue is to set the natural size to the amount
of space that looks best, the stretch to the largest amount of space
that \TeX\ can add before the document starts to look bad, and the
shrink to the largest amount of space that \TeX\ can take away before
the document starts to look bad. You may need to set the values by
experiment.
You can produce glue that is infinitely stretchable by specifying
its stretch in units of `^|fil|', `^|fill|', or `^|filll|'. Glue measured in
`|fill|' is infinitely more stretchable than glue measured in `|fil|', and
glue measured in `|filll|' is infinitely more stretchable than glue measured
in `|fill|'. You should rarely have any need for `|filll|' glue. Glue whose
stretch is |2fil| has twice as much stretch as glue whose stretch is |1fil|,
and similarly for the other kinds of infinitely stretchable glue.
When \TeX\ is
apportioning extra space among glue items, the infinitely stretchable
ones, if there
are any, get all of it. Infinitely stretchable glue is particularly useful for
setting text flush left, flush right, or centered:
\ulist\compact
\li To set text ^{flush left}, put infinitely stretchable
horizontal glue to the right of it.
That glue will consume all the
extra space that's available on the line.
You can use the ^|\leftline| command \ctsref{\leftline}
or the |\raggedright| command \ctsref{\raggedright} to do~this.
\li To set text ^{flush right}, put infinitely
stretchable horizontal glue to the left of it.
As before, that glue will consume all the extra space on the line.
You can use the ^|\rightline| command \ctsref{\rightline} to do~this.
\li To set ^{centered text}, put identical infinitely stretchable
horizontal glue items
on both sides of it.
These two glue items will divide all the extra space on the line
equally between them.
You can use the ^|\centerline| command \ctsref{\centerline} to do~this.
\endulist
You can also specify infinitely shrinkable glue
^^{glue//infinitely shrinkable}
in a similar way. Infinitely shrinkable glue can act as negative space.
Note that |fil|, etc., can be used only
to specify the stretch and shrink of glue---they can't be used to specify
its natural size.
\eix^^{stretch}
\eix^^{shrink}
\endconcept
\conceptindex{groups}
\concept group
A \defterm{group} is a part of your manuscript that \TeX\ treats as a unit.
You indicate a group by enclosing it in the braces
`|{|' and `|}|' (or any other characters with the appropriate
\refterm{category codes}).
^^|{//starting a group|
^^|}//ending a group|
The most important property of a group is that any nonglobal
definition or assignment that you make inside a group disappears when
the group ends. For instance, if you write:
\csdisplay
Please don't pour {\it any} more tea into my hat.
|
the |\it| \refterm{control sequence} causes \TeX\ to set the word
`|any|' in italic type but does not affect the rest of the text.
As another example, if you use the |\hsize| parameter
\ctsref{\hsize} to change the line length within a group, the line length
reverts to its previous value once \TeX\ has gotten past the group.
Groups are also useful as a way of controlling spacing. For instance, if you
write:
\csdisplay
\TeX for the Impatient and the Outpatient too.
|
\noindent
you'll get:
\display{%
\TeX for the Impatient and the Outpatient too.
}
\noindent
since the control sequence |\TeX| (which produces the \TeX\
logo) absorbs the following space.
What you probably want is:
\display{%
{\TeX} for the Impatient and the Outpatient too.
}
\noindent
One way to get it is to enclose `|\TeX|' in a group:
\csdisplay
{\TeX} for the Impatient and the Outpatient too.
|
The right brace prevents the control sequence from absorbing the space.
\endconcept
\conceptindex{hboxes}
\concept hbox
An \defterm{hbox} (horizontal box) is a \refterm{box} that \TeX\
constructs by placing the items of a \refterm{horizontal list} one after
another, left to right.
^^{horizontal lists//hboxes formed from}
An hbox, taken as a unit, is neither
inherently horizontal nor inherently vertical, i.e., it can appear as an
item of either a horizontal list or a \refterm{vertical list}. You can
construct an hbox with the |\hbox| command \ctsref{\hbox}.
\endconcept
\conceptindex{headers}
\concept header
A \defterm{header} is material that \TeX\ puts at the top of every page,
above the text of that page.
The header for a simple report
might consist of the title on the left side of
the page and the text ``Page $n$'' on the right side of the page.
Ordinarily a header consists of a single line, which you can set by
assigning a token list to ^|\headline| \ctsref\headline.
The default \plainTeX\ header is blank.
It's possible to produce multiline headers too; see \xrefpg{bighead} for
how to do it.
\endconcept
\concept height
The \defterm{height} of a \refterm{box} is the distance that the box
extends above its \refterm{baseline}.
^^{boxes//height of}
\endconcept
\conceptindex{horizontal lists}
\concept{horizontal list}
A \defterm{horizontal list} is a list of items
that \TeX\ has produced while it is
in one of its \refterm{horizontal modes:horizontal mode}, i.e., assembling
either a paragraph or an hbox. See ``horizontal mode'' below.
\endconcept
\concept {horizontal mode}
^^{hboxes//horizontal mode for}
When \TeX\ is assembling a paragraph or an \refterm{hbox}, it is in one
of two \defterm{horizontal modes}: ^{ordinary horizontal
mode} for assembling paragraphs and ^{restricted horizontal mode} for
assembling hboxes. Whenever \TeX\ is in a horizontal mode its stomach
\seeconcept{\anatomy} is constructing a \refterm{horizontal
list} of items (boxes, glue, penalties, etc.).
\TeX\ typesets the items in the list
one after another, left to right.
A horizontal list can't contain any
items produced by inherently vertical commands, e.g., |\vskip|.
^^{horizontal lists//can't contain vertical commands}
\ulist
\li If \TeX\ is assembling a horizontal list in ordinary horizontal mode and
encounters an inherently vertical command, \TeX\ ends the paragraph and
enters \refterm{vertical mode}.
\li If \TeX\ is assembling a horizontal list in restricted horizontal
mode and encounters an inherently vertical command, it complains.
\endulist Two commands that you might at first think are inherently
horizontal are in fact inherently vertical: |\halign| \ctsref{\halign}
and |\hrule| \ctsref{\hrule}.
^^|\hrule//inherently vertical|
^^|\halign//inherently vertical|
See \knuth{page~286} for a list
of the inherently vertical commands.
{\tighten
You should be aware of a subtle but important property of restricted
horizontal mode: \emph{you can't enter ordinary horizontal mode
when you're in restricted horizontal mode}. What this means in practice is that
when \TeX\ is assembling an hbox it
won't handle paragraph-like text, i.e., text for which it does
\refterm{line breaking}. You can get
around this restriction by enclosing the paragraph-like text in a
\refterm{vbox} within the hbox. The same method works if you want to
put, say, a horizontal \refterm{alignment} inside an~hbox.
}% end scope of tighten
\endconcept
\concept{hyphenation}
\TeX\ automatically hyphenates words as it is processing your document.
\TeX\ is not eager to insert hyphens, preferring instead to find good
line breaks by adjusting the spacing between words and moving words
from one line to another.
\TeX\ is clever enough to understand
hyphens that are already in words.
You can control \TeX's hyphenation in several ways:
\ulist
\li You can tell \TeX\ to
allow a hyphen in a particular place by inserting a
discretionary hyphen
^^{discretionary hyphens}
with the ^|\-| command \ctsref{\@minus}.
\li You can tell \TeX\ how to
hyphenate particular words throughout your document with the ^|\hyphenation|
command \ctsref{\hyphenation}.
\li You can enclose a word in an \refterm{hbox}, thus preventing \TeX\
from hyphenating it.
\li You can set the value of penalties such as |\hyphenpenalty|
\ctsref\hyphenpenalty.
\endulist
\noindent If a word contains an explicit or discretionary hyphen,
\TeX\ will never break it elsewhere.
\endconcept
\conceptindex{input streams}
\concept {input stream}
See \conceptcit{file}.
\endconcept
\conceptindex{insertions}
\concept insertion
\looseness = -1
An \defterm{insertion} is a vertical list containing material
to be inserted into
a page when \TeX\ has finished building that page.\footnote
{\tighten
\TeX\ itself doesn't
insert the material---it just makes the material available to
the output routine, which is then responsible for transferring
it to the composed page.
^^{output routine//insertions, treatment of}
The only immediate effect of the ^|\insert| command
\ctsref{\insert} is to change \TeX's page break calculations so that it
will leave room on the page for the inserted material. Later, when
\TeX\ actually breaks the page, it divides the inserted material into
two groups: the material that fits on the current page and the material
that doesn't.
^^{page breaks//insertions at}
The material that fits on the page is placed into box registers,
one per insertion,
and the material that doesn't fit is carried over to the next page.
This procedure allows \TeX\ to do such
things as distributing parts of a long footnote over several consecutive
pages.} Examples of such insertions are footnotes and figures. The
\refterm{\plainTeX} commands for
creating insertions are ^|\footnote|, ^|\topinsert|, |\mid!-insert|,
^^|\midinsert|
and ^|\pageinsert|, as well as the primitive ^|\insert| command
itself (\pp\xrefn\footnote--\xrefn{endofinsert}).
\TeX's mechanism for handling insertions is rather complicated;
see \knuth{pages~122--125} for the details.
\endconcept
\concept {interline glue}
\defterm{Interline glue} is the glue that \TeX\ inserts in front of every
\refterm{box} in a \refterm{vertical list} except for the first one.
The interline glue is ordinarily specified so as to maintain a constant
distance between the baselines of the boxes.
Its value is jointly determined by the ^|\baselineskip|,
^|\lineskip|, and ^|\lineskiplimit| parameters \ctsref{\baselineskip}.
\endconcept
\conceptindex{items}
\concept item
The term \defterm{item} is often used to refer to a component of
a horizontal, vertical, or math list, i.e., a list of items that
\TeX\ is building while it is in a horizontal, vertical, or math mode.
\endconcept
\conceptindex{justification}
\concept {justified text}
\defterm{Justified text} is text that has been typeset so that both
margins are even. Unjustified text, on the other hand, has been typeset
with ``ragged'' margins on one or both sides.
Documents typed on old-fashioned typewriters almost always have
ragged right margins.
Although documents produced by \TeX\ are
justified by default, you can if you wish produce documents (or
sequences of lines) that have ^{ragged right}---or ^{ragged left}---margins.
You can also get \TeX\ to center a sequence of lines, thus making both
margins ragged.
^^{centered text}
You can use the
^|\leftskip|, ^|\rightskip|, and ^|\raggedright| commands
(\pp \xrefn{\leftskip},~\xrefn{\raggedright}) for these purposes.
When \TeX\ is producing justified text, it usually
needs to stretch or shrink the glue within each line to make the margins
come out even. When \TeX\ is producing unjustified text, on the other
hand, it usually leaves the glue within each line at its natural width.
Many typographers prefer unjustified text because its interword
spacing is more uniform.
\endconcept
\conceptindex{kerns}
\concept kern
^^{spacing//adjusting with kerns}
A \defterm{kern} indicates a change to the normal spacing between
the items of a vertical or horizontal list.
A kern can be either positive or negative. By
putting a positive kern between two items, you push them further apart
by the amount of the kern. By putting a negative kern between two
items, you bring them closer together by the amount of the kern. For
instance, this text:
\csdisplay
11\quad 1\kern1pt 1\quad 1\kern-.75pt 1
|
produces letter pairs that look like this:
\display{11\quad 1\kern1pt 1\quad 1\kern-.75pt 1}
You can use kerns in vertical mode to adjust the space between
particular pairs of lines.
A kern of size $d$ is very similar to a \refterm{glue} item that has
size $d$ and no stretch or shrink. Both the kern and the glue insert or
remove space between neighboring items. The essential difference is
that \TeX\ considers two boxes with only kerns between them to be tied
together. That is, \TeX\ won't break a line or a page at a kern unless
the kern is immediately followed by glue. Bear this difference in mind
when you're deciding whether to use a kern or a glue item for a
particular purpose.
\TeX\ automatically inserts kerns between particular pairs of adjacent
letters, thus adjusting the space between those letters and enhancing
the appearance of your typeset document.
For instance, the Computer Modern $10$-point roman font contains a kern
for the pair `To' that brings the left edge of the `o' under the
`T'. Without the kern, you'd get \hbox{``T{o}p''} rather than ``Top''---%
the difference is slight but noticeable.
The metrics file
(^{\tfmfile})
for each \refterm{font} specifies the placement and size of the
kerns that \TeX\ automatically inserts when it is setting text in that~font.
\margin{paragraph deleted to save space; most of the material was
already in this section.}
\endconcept
\concept leaders
You can use \defterm{leaders} to fill a space with copies of
a pattern, e.g.,
to put repeated dots between a title and a page number in a table of contents.
A leader is a single copy of the pattern.
The specification of leaders contains three pieces of information:
\olist\compact
\li what a single leader is
\li how much space needs to be filled
\li how the copies of the pattern should be arranged within the space
\endolist
\bix^^|\leaders|
\bix^^|\cleaders|
\bix^^|\xleaders|
{\tighten
\TeX\ has three commands for specifying leaders:
|\leaders|, \hbox{|\cleaders|}, and |\xleaders| (\xref\leaders). The
\refterm{argument} of each command specifies the leader.
The command must be followed by \refterm{glue}; the size of the glue
specifies how much space is to be filled. The choice of command determines
how the leaders are arranged within the space.}
Here's an example showing how |\leaders| works:
\csdisplay
\def\dotting{\leaders\hbox to 1em{\hfil.\hfil}\hfil}
\line{The Political Process\dotting 18}
\line{Bail Bonds\dotting 26}
|
Here we've put the leaders and their associated glue into a \refterm{macro}
definition so that we can conveniently
use them in two places. This input produces:
\vdisplay{\advance\hsize by -\parindent
\def\dotting{\leaders\hbox to 1em{\hfil{.}\hfil}\hfill}%
\line{The Political Process{\dotting}18}
\line{Bail Bonds{\dotting}26}
}
The \refterm{hbox} following |\leaders| specifies
the leader, namely, an hbox 1\em\ wide containing a dot
at its center.
The space is filled with copies of this box,
effectively filling it
with dots whose centers are 1\em{} apart.
The following |\hfil| (the one at the
end of the macro definition) is glue that
specifies the space to be filled.
In this case it's whatever space is needed to fill out the line.
By choosing |\leaders| rather than |\cleaders| or |\xleaders| we've insured
that the dots on different lines line up with each other.
In general, the space to be filled acts as a window
on the repeated copies of the leader.
\TeX\ inserts as many copies as possible, but some space is
usually left over---either because of where the leaders fall
within the window or because
the width of the window isn't an exact multiple of the width of the
leader.
The difference among the three commands is in how they arrange the leaders
within the window and how they distribute any leftover space:
\ulist
\li For |\leaders|, \TeX\ first produces a row of copies of the leader.
It then aligns the start of this row with the left end of the innermost
box $B$ that is to contain the result of the |\leaders| command.
In the two-line example above, $B$ is a box produced by |\line|.
Those leaders that fit entirely in the window are placed into $B$,
and the leftover space at the left and right ends is left empty.
The picture is like this:
\vdisplay{%
\def\dotting{\leaders\hbox to 1em{\hfil{.}\hfil}\hfill}%
\def\pp{The Political Process}
\line{\dotting}
\line{\hphantom\pp\hfil$\Downarrow$\hfil\hphantom{18}}
\vskip 4pt
\setbox0 = \hbox{\pp}
\setbox1 = \hbox{18}
\dimen0 = \hsize \advance\dimen0 by -\wd0 \advance \dimen0 by -\wd1
\advance\dimen0 by -0.8pt
\hbadness=10000
\line{\pp
\vrule\vbox{\hrule width \dimen0\vskip 2pt
\hbox to \dimen0{\hfil window\strut\hfil}
\vskip 2pt\hrule width \dimen0}%
\vrule 18}
\line{\hphantom\pp\hfil$\Downarrow$\hfil\hphantom{18}}
\vskip 2pt
\line{\pp{\dotting}18}
}
\vskip\medskipamount
{\tighten
\noindent
This procedure ensures that in the two-line example on the previous page,
the dots in the two lines
are vertically aligned (since the \refterm{reference points:reference point}
of the hboxes produced by |\line| are vertically aligned).
\par}
\li For |\cleaders|, \TeX\ centers the leaders within the window
by dividing the leftover space between the two ends of the window.
The leftover space is always less than the width of a single leader.
\li For |\xleaders|, \TeX\ distributes the
leftover space evenly within the window.
In other words, if the leftover space is $w$ and the
leader is repeated $n$ times,
\TeX\ puts space of width $w/(n+1)$ between adjacent leaders and
at the two ends of the leaders.
The effect is usually to spread out the leaders a little bit.
The leftover space for |\xleaders|, like that for |\cleaders|,
is always less than the width of a single leader.
\endulist
So far we've assumed that the leaders consist of hboxes arranged
horizontally. Two variations are possible:
\olist
\li You can use a
rule instead of an hbox for the leader.
\TeX\ makes the rule as wide as necessary to extend
across the glue (and the three commands are equivalent).
\li You
can produce vertical leaders that run down the page by including them in
a \refterm{vertical list} rather than a \refterm{horizontal list}. In
this case you need vertical glue following the leaders.
\endolist
\noindent
See \knuth{pages~223--225} for the precise rules that \TeX\ uses
in typesetting leaders.
\eix^^|\leaders|
\eix^^|\cleaders|
\eix^^|\xleaders|
\endconcept
\conceptindex{ligatures}
\concept ligature
A \defterm{ligature} is a single character that replaces a
particular sequence of adjacent characters in a typeset document.
For example, the word `|office|' is typeset as \hbox{``office''},
not \hbox{``of{f}ice''}, by high-quality typesetting systems.
Knowledge of ligatures is built into the
\refterm{fonts:font} that you use, so there's nothing explicit you need do
in order to get \TeX\ to produce them. (You could defeat the ligature
in ``office'', as we did just above, by writing `|of{f}ice|' in your input.)
\TeX\ is also capable of using its ligature mechanism to typeset the
first or last letter of a word differently than the same letter as it would
appear in the middle of a word.
You can defeat this effect (if you ever encounter it) by using the
^|\noboundary| command (\xref\noboundary).
Sometimes you may need a ligature from a European language.
^^{European languages}
\TeX\ won't
produce these automatically unless you're using a font designed for that
language. A number of these ligatures, e.g., `\AE', are available as
commands (see ``Letters and ligatures for European alphabets'',
\xref{fornlets}).
\endconcept
\conceptindex{line breaks}
\concept{line break}
A \defterm{line break} is a place in your document where \TeX\ ends
a line as it typesets a paragraph.
When \TeX\ processes your document, it collects the contents of each
paragraph in a \refterm{horizontal list}.
When it has collected an entire paragraph,
it analyzes the list to find what it considers to be the best possible
line breaks. \TeX\ associates ``^{demerits}'' with various symptoms of
unattractive line breaks---lines that have too much or too little
space between words, consecutive lines that end in hyphens, and so forth. It
then chooses the line breaks so as to minimize the total number of demerits.
See \knuth{pages~96--101} for a full description of \TeX's line-breaking rules.
You can control \TeX's choice of line breaks in several ways:
\ulist
\li You can insert a \refterm{penalty} (\xref{hpenalty}) somewhere in
the horizontal list that \TeX\ builds as it forms a paragraph.
^^{penalties//in horizontal lists}
A
positive penalty discourages \TeX\ from breaking the line there, while a
negative penalty---a bonus, in other words---encourages \TeX\ to break
the line there. A penalty of $10000$ or more prevents a line break,
while a penalty of $-10000$ or less forces a line break. You can get
the same effects with the ^|\break| and
^|\nobreak| commands (\pp\xrefn{hbreak},~\xrefn{hnobreak}).
\li You can tell \TeX\ to allow a hyphen in a particular place by
inserting a discretionary hyphen
^^{discretionary hyphens}
with the |\-| command \ctsref{\@minus}, or
otherwise control how \TeX\ hyphenates your document \seeconcept
{hyphenation}.
^^|\-//in line breaking|
\li You can tell \TeX\ to allow a line break after a ^{solidus} (/) between
two words by inserting ^|\slash| \ctsref{\slash}
between them, e.g., `|fur!-longs\slash fortnight|'.
\li You can tell \TeX\ not to break a line between two particular words by
inserting a ^{tie} (|~|) between those words.
^^|~//in line breaking|
\li You can adjust the penalties associated with line breaking by
assigning different values to \TeX's line-breaking
\refterm{parameters:parameter}.
\li You can enclose a word or sequence of words in an \refterm{hbox},
thus preventing \TeX\ from breaking the line anywhere within the hbox.
^^{hboxes//controlling line breaks}
\endulist
It's useful to know the places where \TeX\ can break a line:
\ulist
\li at glue, provided that:
\olist
\li the item preceding the glue is one of the following:
a box, a discretionary item (e.g., a discretionary hyphen),
the end of a math formula,
a whatsit,
or vertical material produced by |\mark| or |\vadjust|
or |\insert|
\li the glue is not part of a math formula
\endolist
\noindent
When \TeX\ breaks a line at glue, it makes the break at the left edge
of the glue space and forgets about the rest of the glue.
\li at a kern that's immediately followed by glue,
provided that this kern isn't within a math formula
\li at the end of a math formula that's immediately followed by glue
\li at a penalty, even one within a math formula
\li at a discretionary break
\endulist
When \TeX\ breaks a line, it discards any
sequence of glue, kerns, and penalty items that follows the break point.
If such a sequence is followed by the beginning of a math formula, it
also discards any kern produced by the beginning of the formula.
\endconcept
\conceptindex{lists}
\concept list
A \defterm{list} is a sequence of \refterm{items:item}
(\refterm{boxes:box}, \refterm{glue}, \refterm{kerns:kern}, etc.)
that comprise the contents of an hbox, a vbox,
or a math formula.
See \conceptcit{horizontal list}, \conceptcit{vertical list}.
\endconcept
\concept {log file}
See \conceptcit{file}.
\endconcept
\conceptindex{macros}
\concept macro
{% Use a brace here so that definitions of explanatory macros remain local.
% The closing brace is at the end of the concept.
A \defterm{macro} is a definition that gives a name to a pattern of
\TeX\ input text.\footnote{More precisely, the definition gives a name
to a sequence of tokens.} The name can be either a \refterm{control
sequence} or an \refterm{active character}. The pattern is called the
``replacement text''. The primary command for defining macros is the
|\def| control sequence.
\def\arctheta{\cos \theta + i \sin \theta}
As a simple example, suppose that you have a document in which
the sequence `$\cos \theta + i \sin \theta$' occurs many times.
Instead of writing it out each time, you can define a macro for it:
\csdisplay
\def\arctheta{\cos \theta + i \sin \theta}
|
Now whenever you need this sequence, you can just ``call'' the macro
by writing `|\arctheta|'
and you'll get it. For example, `|$e^{\arctheta}$|' will give you
`$e^{\arctheta}$'.
\bix^^{macros//parameters of}
But the real power of macros lies in the fact that a macro can have
parameters. When you call a macro that has parameters, you provide
arguments that are substituted for those parameters. For example, suppose
you write:
\pix\indexchar #
\def\arc#1{\cos #1 + i \sin #1}
\csdisplay
\def\arc#1{\cos #1 + i \sin #1}
|
The notation |#1| \xrdef{@msharp} indicates the first parameter
of the macro, which in this case has only one parameter. You now can
produce a similar form, such as `$\arc{2t}$', with the macro call `|\arc
{2t}|'.
More generally, a macro can have up to nine parameters, which you
indicate as `|#1|', `|#2|', etc\null. in the macro definition. \TeX\
provides two kinds of parameters: delimited parameters and undelimited
parameters. Briefly, a delimited parameter has an \refterm{argument}
that's delimited, or ended, by a
specified sequence of tokens (the delimiter), while an undelimited
parameter has an argument that doesn't need a delimiter to end it.
First we'll explain how macros work when they have only undelimited
parameters, and then we'll explain how they work when
they have delimited parameters.
^^{parameters//undelimited}
If a macro has only undelimited parameters, those parameters must appear
one after another in the macro definition \emph{with nothing between
them or between the last parameter and the left brace in front of the
replacement text}.
A call on such a macro consists of the macro name followed by
the arguments of the call, one for each parameter. Each argument is
either:
\ulist \compact
\li a single \refterm{token} other than a left or right brace, or
\li a sequence of tokens enclosed between a left brace and
a matching right brace.\footnote{The
argument can have nested pairs of braces within it, and each of these
pairs can indicate either a \refterm{group} or a further macro
argument.}
\endulist
When \TeX\ encounters a macro, it expands the macro in its gullet
\seeconcept{\anatomy}
by substituting each argument for the corresponding
parameter in the replacement text. The resulting text may contain other macro
calls. When \TeX\ encounters such an embedded macro call, it expands
that call immediately without looking at what follows the
call.\footnote{In computer science terminology, the expansion is ``depth
first'' rather than ``breadth first''. Note that you can modify the
order of expansion with commands such as |\expandafter|.} When \TeX's
gullet gets to a \refterm{primitive} \refterm{command} that
cannot be further expanded, \TeX\ passes that command to \TeX's stomach.
The order of expansion is sometimes critical, so in order to help
you understand it we'll give you an example of \TeX\ at work.
Suppose you provide \TeX\ with the following input:
\csdisplay
\def\a#1#2{\b#2#1\kern 2pt #1}
\def\b{bb}
\def\c{\char49 cc}
\def\d{dd}
\a\c{e\d} % Call on \a.
|
Then the argument corresponding to |#1| is |\c|,
and the argument corresponding to |#2| is |e\d|.
\TeX\ expands the macro call in the following steps:
{\vskip\abovedisplayskip\obeylines % ugly
|\b e\d\c\kern 2pt \c|
|bbe\d\c\kern 2pt \c|
|\d\c\kern 2pt \c|\quad(`|b|', `|b|', `|e|' sent to stomach)
|dd\c\kern 2pt \c|
|\c\kern 2pt \c|\quad(`|d|', `|d|' sent to stomach)
|\char49 cc\kern 2pt \c|
|\c|\quad(`|\char|', `|4|', `|9|', `|c|', `|c|', %
`|\kern|', `|2|', `|p|', `|t|' sent to stomach)
|\char49 cc|
(`|\char49|', `|c|', `|c|' sent to stomach)
\vskip\belowdisplayskip}
\noindent Note that the letters `|b|', `|c|', `|d|', and `|e|' and the
control sequences `|\kern|' and `|\char|' are all primitive
commands that cannot be expanded further.
\bix^^{parameters//delimited}
A macro can also have ``delimited parameters'', which can be mixed with
the undelimited ones in any combination. The idea of a delimited
parameter is that \TeX\ finds the corresponding argument by looking for
a certain sequence of tokens that marks the end of the argument---the
delimiter. That is, when \TeX\ is looking for such an argument, it
takes the argument to be all the tokens from \TeX's current position up
to but not including the delimiter.
You indicate a delimited parameter by writing `|#|$n$' ($n$
must be between $0$
and $9$) followed by one or more tokens that act as the delimiter. The
delimiter extends up to the next `|#|' or `|{|'---which makes sense
since `|#|' starts another parameter and `|{|' starts the replacement text.
The delimiter can't be `|#|' or `|{|', so you can tell a delimited
parameter from an undelimited one by looking at what comes after it.
If the character after the parameter is `|#|' or `|{|', you've got an
undelimited parameter; otherwise you've got a delimited one. Note
the difference in arguments for the two kinds of parameters---an
undelimited parameter is matched either by a single token or by
a sequence of tokens enclosed in braces, while a
delimited parameter is matched by any number of tokens, even zero.
An example of a macro that uses two delimited parameters is:
\def\diet#1 #2.{On #1 we eat #2!}
\csdisplay
\def\diet#1 #2.{On #1 we eat #2!!}
|
Here the first parameter is delimited by a single space
and the second parameter is delimited by a period. If you write:
\csdisplay
\diet Tuesday turnips.
|
you'll get the text ``\diet Tuesday turnips.''.
But if the delimiting tokens are enclosed in a group, \TeX\ doesn't consider
them as delimiting. So if you write:
\csdisplay
\diet {Sunday mornings} pancakes.
|
you'll get the text `\diet {Sunday mornings} pancakes.'
even though there's a space between `|Sunday|' and `|morning|'.
When you use a space as a delimiter,
an end-of-line character ordinarily also delimits the argument
since \TeX\ converts the end-of-line to a space before the macro
mechanism ever sees it.
\eix^^{parameters//delimited}
\eix^^{macros//parameters of}
Once in a while you might need to define a macro that has `|#|' as a
meaningful character within it.
You're most likely to need to do this when you're defining a macro
that in turn defines a second macro.
What then do you do about
the parameters of the second macro to avoid getting \TeX\ confused?
The answer is that you write
two `|#|'s for every one that you want
when the first macro is expanded. For example, suppose you
write the macro definition:
\def\first#1{\def\second##1{#1/##1}}
\csdisplay
\def\first#1{\def\second##1{#1/##1}}
|
Then the call `|\first{One}|' defines `|\second|' as:
\csdisplay
\def\second#1{One/#1}
|
and the subsequent call `|\second{Two}|' produces the text
\def\second#1{One/#1}%
`\second {Two}'.
A number of commands provide additional ways of defining macros
(see pp.~\xrefn{mac1}--\xrefn{mac2}).
For the complete rules pertaining to macros, see \knuth{Chapter~20}.
}% close brace at the start of the `macro' concept.
\endconcept
\concept magnification
When \TeX\ typesets your document, it multiplies all dimensions
by a
\refterm{magnification} factor $f/1000$,
where $f$ is the value of the ^|\mag| parameter \ctsref\mag.
Since the default value of |\mag| is $1000$, the normal case is that
your document is typeset just as specified.
Increasing the magnification is often useful when you're typesetting a document
that will later be photoreduced.
You can also apply magnification to a single \refterm{font} so as to get
a smaller or larger version of that font than its ``^{design size}''. You
need to provide the device driver with a ^{shape file}
\seeconcept{font} for
each magnification of a font that you're using---%
unless the fonts are built into your printer and your device driver
knows about them.
When you're defining a font with
the |\font| command \ctsref{\font}, you can specify a magnification with
the word `|scaled|'. For example:
\csdisplay
\font\largerbold = cmbx10 scaled 2000
|
defines `|\largerbold|' as a font that is
twice as big as |cmbx10| (Computer Modern
Bold Extended $10$-point) and has the character shapes
uniformly enlarged by a factor of~$2$.
Many computer centers find it convenient to provide fonts scaled by a ratio
of $1.2$, corresponding to magnification values of $1200$, $1440$, etc.
\TeX\ has special names for these values:
^^|\magstep|
`|\magstep1|' for $1200$,
`|\magstep2|' for $1440$, and so forth up to `|\magstep5|'. The special
value `^|\magstephalf|' corresponds to magnification by $\sqrt{1.2}$, which
is visually halfway between `|\magstep0|' (no magnification) and
`|\magstep1|'. For example:
\csdisplay
\font\bigbold = cmbx10 scaled \magstephalf
|
You can specify a \refterm{dimension} as it will be
measured in the final document independent of magnification by putting
`^|true|' in front of the unit. For instance, `|\kern 8 true pt|'
produces a kern of $8$ points whatever the magnification.
\endconcept
\concept margins
The \refterm{margins}
of a page define a rectangle that normally
contains the printed matter on the page.
You can get \TeX\ to print material outside of this rectangle,
but only by taking some explicit action that moves the material there.
\TeX\ considers headers and footers to lie outside the margins.
The rectangle is defined in terms of its upper-left corner, its width, and
its depth. The location of the upper-left corner is defined by
the ^|\hoffset|
and ^|\voffset| parameters
\ctsref\voffset. The default is to place that corner one inch from the top
and one inch from the left side of the page, corresponding to a value of
zero for both |\hoffset| and |\voffset|.%
\footnote{This seems to us to be an odd convention.
It would have been more natural to have the $(0,0)$
point for |\hoffset| and |\voffset| be at the upper-left corner of the
paper and to have set their default values to one inch.}
The width of the rectangle is given by ^|\hsize| and the depth by ^|\vsize|.
The implications of these conventions are:
\ulist\compact
\li The left margin is given by |\hoffset|\tplus|1in|.
\li The right margin is given by the width of the paper minus
|\hoffset|\tplus|1in|\tplus|\hsize|.
\li The top margin is given by |\voffset|\tplus|1in|.
\li The bottom margin is given by the length of the paper minus
|\voff!-set|\tplus|1in|\tplus|\vsize|.
\endulist
From this information you can see what parameters you need to
change in order to change the margins.
Any changes that you make to |\hoffset|, |\voffset|, or |\vsize| become
effective the next time \TeX\ starts a page. In other words, if you change
them within a page, the change will affect only the \emph{following} pages.
If you change |\hsize|, the change will become effective immediately.
\endconcept
\conceptindex{marks}
\concept mark
A \defterm{mark} is an item that you can insert into a
horizontal, vertical, or math list and later recover from within your
output routine. Marks are useful for purposes such as
keeping track of topics to appear in page headers.
Each mark has a list of tokens---the ``^{mark text}''---associated with it.
The ^|\mark| command \ctsref{\mark} expects such a token list as its argument,
and appends an item containing that token list (after
expansion) to whatever list \TeX\ is
currently building. The ^|\topmark|, ^|\firstmark|, and ^|\botmark| commands
\ctsref{\topmark} can be used to retrieve various marks on a page.
These commands are most often used in page headers and footers.
^^{footers//marks used in}
^^{headers//marks used in}
\margin{This example of {\tt\\mark} replaces the previous explanatory
paragraph.}
Here is a simplified example.
Suppose you define a section heading macro as follows:
\csdisplay
\def\section#1{\medskip{\bf#1}\smallskip\mark{#1}}
% #1 is the name of the section
|
^^|\mark|
This macro, when called, will produce a section heading in boldface and
will also record the name of the section as a mark.
You can now define the header for each printed page
as follows:
\csdisplay
\headline = {\ifodd\pageno \hfil\botmark\quad\folio
\else \folio\quad\firstmark\hfil \fi}
|
Each even (left-hand) page will now have the page number followed by the
name of the first section on that page, while each odd (right-hand) page
will have the page number followed by the name of the last section on
that page. Special cases, e.g., no sections starting on a page, will
generally come out correctly because of how ^|\firstmark|
and ^|\botmark| work.
When you split a page using the |\vsplit| command \ctsref{\vsplit} you can
retrieve the mark texts of the first and last marks of the split-off
portion with the ^|\splitfirstmark| and ^|\splitbotmark| commands
\ctsref{\splitfirstmark}.
See \knuth{pages~258--260} for a more precise explanation of how
to create and retrieve marks.
\endconcept
\concept math mode
{\tighten
A \defterm{math mode} is a \refterm{mode} that \TeX\ is in when it is
building a math formula. \TeX\ has two different math modes: ^{text
math mode} for building a formula to be embedded within a line of text,
and ^{display math mode} for building a formula to appear on a line by
itself. You indicate text math mode by enclosing the formula in
|$|'s, and display math mode by enclosing the formula in
|$$|'s.
%\TeX\ will accept most \refterm{commands:command} in
%math mode. If it encounters a command in math mode that doesn't make
%sense in a formula, it will complain.
An important property of both
math modes is that \emph{input spaces don't count}. See
\knuth{pages~290--293} for details on how \TeX\ responds to different
commands in math mode.
\par}
\endconcept
\conceptindex{mathcodes}
\concept mathcode
A \defterm{mathcode} is a number that \TeX\ uses to identify and
describe a math character,
^^{math characters//described by mathcodes}
i.e., a character that has a
particular role in a math formula. A mathcode conveys three pieces of
information about a character: its \refterm{font} position, its
\refterm{family}, and its \refterm{class}.
Each of the $256$ possible
input characters has a mathcode, which is defined by the \TeX\ program
but can be changed.
^^{family//as part of mathcode}
\TeX\ has sixteen families of fonts, numbered $0$--$15$. Each
family contains three fonts: one for \refterm{text size}, one for
\refterm{script size}, and one for \refterm{scriptscript size}. \TeX\
chooses the size of a particular character, and therefore its font,
according to the context. The class of a character specifies its role
in a formula (see \knuth{page~154}). For example, the equals sign `|=|'
is in class $3$ (Relation). \TeX\ uses its knowledge of character
classes when it is deciding how much space to put between different
components of a math formula.
The best way to understand what mathcodes are all about is to see how
\TeX\ uses them. So we'll show you what \TeX\ does with a
character token $t$ of \refterm{category code}~11 or~12 in a math
formula:
\olist\compact
\li It looks up the character's mathcode.
\li It determines a family $f$ from the mathcode.
\li It determines the size $s$ from the context.
\li It selects a font $F$ by picking the font for size $s$ in family $f$.
\li It determines a character number $n$ from the mathcode.
\li It selects as the character $c$ to be typeset the character
at position $n$ of font $F$.
\li It adjusts the spacing around $c$ according to the class of $t$ and
the surrounding context.
\li It typesets the character $c$.
\endolist
The context dependence in
items (3) and (7) implies that \TeX\ cannot typeset a math character
until it has seen the entire formula containing the
math character. For example, in the formula
`|$a\over b$|', \TeX\ doesn't know what size the `|a|' should be until it
has seen the |\over|.
{\tighten
The mathcode of a character is encoded according to the formula $4096c
+ 256f + n$, where $c$ is the class of the character, $f$ is its
\refterm{family}, and $n$ is its \refterm{\ascii\ character} code within
the family. You can change \TeX's interpretation of an input character
in math mode by assigning a value to the ^|\mathcode|
table entry \ctsref{\mathcode}
for that character. The character must have a
\refterm{category code} of $11$ (letter) or $12$ (other) for \TeX\ to
look at its |\mathcode|.
}\par
^^{family//variable}
You can define a mathematical character to have a ``variable'' family by
giving it a class of $7$. Whenever \TeX\ encounters that character in a
math formula, it takes the family of the character to be the current
value of the |\fam| parameter \ctsref{\fam}. A variable family enables
you to specify the font of ordinary text in a math formula. For
instance, if the roman characters are in family $0$, the assignment
|\fam = 0|
will cause ordinary text in a math formula to be set in roman type
rather than in something else like math italic type. If the value of
|\fam| is not in the range from $0$ to $15$, \TeX\ takes the value to be
$0$, thus making classes $0$ and $7$ equivalent.
\TeX\ sets |\fam| to $-1$ whenever it enters math mode.
\endconcept
\conceptindex{mathematical units}
\concept{mathematical unit}
A \defterm{mathematical unit}, denoted by `|mu|', is a unit of distance
that is used to specify \refterm{glue} in math formulas. See
\conceptcit{muglue}.
\endconcept
\conceptindex{modes}
\concept mode
When \TeX\ is processing your input in its stomach \seeconcept{\anatomy},
it is in one of six \defterm{modes}:
\ulist\compact
\li ^{ordinary horizontal mode} (assembling a paragraph)
\li ^{restricted horizontal mode} (assembling an \refterm{hbox})
\li ^{ordinary vertical mode} (assembling a page)
\li ^{internal vertical mode} (assembling a \refterm{vbox})
\li ^{text math mode} (assembling a formula that appears in text)
\li ^{display math mode}
(assembling a formula that appears on a line by~itself)
^^{horizontal mode}^^{vertical mode}^^{math mode}
\endulist
The mode describes the kind of entity that \TeX\ is putting together.
Because you can embed one kind of entity within another, e.g., a vbox
within a math formula, \TeX\ keeps track not just of one mode but of a
whole list of modes (what computer scientists call a ``stack'').
Suppose that \TeX\ is in mode $M$ and encounters something that
puts it into a new mode \Mprimeperiod. When it finishes its work in
mode \Mprimecomma, it resumes what it was doing in mode \Mperiod.
\endconcept
\concept muglue
\defterm{Muglue} is a kind of \refterm{glue} that you can use only in math
formulas. It is measured in ^|mu| (\refterm{mathematical
units:mathematical unit}).
^^{mathematical units}^^{glue//mathematical}
One |mu| is equal to \frac1/{18} em, where
the size of an em is taken from \refterm{family} 2 of the math fonts.
\TeX\ automatically adjusts the size of muglue according to the context.
For instance, a glue size of |2mu| is normally smaller within a
subscript than it is within ordinary text.
You must use the ^|\mskip| command to produce muglue.
For example, `|\mskip 4mu plus 5mu|' produces mathematical glue with
natural space of four |mu| and \refterm{stretch} of five |mu|.
\endconcept
\conceptindex{numbers}
\concept number
In \TeX, a \defterm{number} is a positive or negative integer.
You can write a number in \TeX\ in four different ways:
\olist\compact
\li as an ordinary decimal integer, e.g., |52|
\li as an octal number, e.g., |'14| ^^{octal numbers}
\li as a hexadecimal number, e.g., |"FF0| ^^{hexadecimal numbers}
\li as the code for an \refterm{\ascii\ character}, e.g., |`)|
or |`\)|
\endolist
\noindent
Any of these forms can be preceded by `|+|' or `|-|'.
An octal number can have only the digits |0|--|7|.
^^{octal numbers}
A hexadecimal number can have digits |0|--|9| and
|A|--|F|, representing
values from $0$ to $15$.
^^{hexadecimal numbers}
You can't, alas, use lowercase letters when you write a hexadecimal number.
If you need an explanation of octal and hexadecimal numbers,
you'll find one on \knuth{pages~43--44}.
A decimal, octal, or hexadecimal number
ends at the first character that can't be part of the number.
Thus a decimal number ends when \TeX\ sees, say, a letter, even though a
letter between `|A|' and `|F|' would not end a hexadecimal number.
You can end a number with one or more spaces and
\TeX\ will ordinarily ignore them.\footnote{
When you're defining a macro that ends in a number, you should always
put a space after that number; otherwise \TeX\ may later combine that
number with something else.}
The fourth form above specifies a number as the
\minref{\ascii} code for a character.
^^{characters//\ascii\ codes for}
\TeX\ ignores spaces after this form of number also.
You can write a number in this form either as |`|$c$ or as |`\|$c$.
The second form, though longer, has the advantage that you can use it
with \emph{any} character, even `|\|', `|%|', or `|^^M|'.
It does have one rather technical disadvantage: when \TeX\ is expanding
a token sequence for a command such as |\edef| or |\write|,
^^|\edef//expansion of {\tt\\'\it c} in|
^^|\write//expansion of {\tt\\'\it c} in|
occurrences of `|\|$c$' within numbers will also be expanded if they can be.
That's rarely the effect you want.
The following are all valid representations of the decimal number
$78$:
\csdisplay
78 +078 "4E '116 `N `\N
|
You can't use a number in text by itself since a number isn't
a command.
However, you can insert the decimal form of a number in text
by putting a ^|\number| command (\xref\number) in front of it
or the roman numeral form by putting a ^|\romannumeral| command
in front of it.
You can also use ^{decimal constant}s, i.e., numbers with a fractional part,
for specifying dimensions \seeconcept{dimension}.
A decimal constant has a ^{decimal point}, which
can be the first character of the constant.
You can use a comma instead of a period to represent the decimal point.
A decimal constant can be preceded by a plus or minus sign.
Thus `|.5in|',
`|-3.22pt|', and `|+1,5\baselineskip|' are valid dimensions.
You can't, however, use decimal constants
in any context \emph{other} than as the ``factor'' part of a dimension,
i.e., its multiplier.
\endconcept
\concept{ordinary mode}
An \defterm{ordinary mode} is a \refterm{mode} that \TeX\ is in when it is
assembling a paragraph into lines or assembling lines
into a page. See \conceptcit{horizontal mode}, \conceptcit{vertical mode}.
\endconcept
\concept outer
\bix^^{macros//outer}
An \defterm{outer} macro is one that you can't use in certain contexts
where \TeX\ is processing tokens at high speed.
The purpose of making a command outer is to enable \TeX\ to catch
errors before it's gone too far.
When you define a macro, you can make it outer with the
^|\outer| command \ctsref\outer.
You cannot use an outer macro in any of the following contexts:
\ulist\compact
\li within an argument to a macro
\li in the parameter text or replacement text of a definition
\li in the preamble to an alignment
\li in the unexecuted part of a conditional test
\endulist
\noindent
An outer context is a context in which you can use an outer macro,
i.e., it's any context other than the ones just listed.
For example, the following input would be a forbidden use of an
outer macro:
\csdisplay
\leftline{\proclaim Assertion 2. That which is not inner
is outer.}
|
The |\proclaim| macro (\xref{\@proclaim}) is defined in \plainTeX\
to be outer, but it's being used here in a macro argument to |\leftline|.
\eix^^{macros//outer}
\endconcept
\concept {output routine}
When \TeX\ has accumulated
at least enough material to fill up a page, it chooses a breakpoint
and places the material before the breakpoint in |\box255|. It then
calls the
current \defterm{output routine}, which processes the material and eventually
sends it to the \dvifile.
^^{\dvifile//material from output routine}
The output routine can perform further
processing, such as inserting headers, footers, and footnotes.
\refterm{\PlainTeX:\plainTeX} provides
a default output routine that inserts a centered page number
at the bottom of each page.
By providing a different output routine you can achieve such
effects as double-column output.
You can think of the output routine as having a single responsibility:
disposing of the material in |\box255| one way or another.
The current output routine is defined by the value of ^|\output|
\ctsref{\output}, which is a list of \refterm{tokens:token}. When \TeX\
is ready to produce a page, it just expands the token list.
You can make some simple changes to the actions of the \plainTeX\
output routine without actually modifying it. For example, by assigning
a list of \refterm{tokens:token} to |\headline| or
|\footline| \ctsref{\footline} you can have \TeX\ produce a different
header or footer than it ordinarily would.
The output routine is also
responsible for collecting any \refterm{insertions:insertion};
combining those insertions and any
``decorations'' such as headers and
footers with the main contents of the page and packaging all
of this material in a box; and
eventually sending that box to the \dvifile\
^^{\dvifile//material from output routine}
with the ^|\shipout|
command \ctsref{\shipout}.
Although this is what an output routine most often does,
a special-purpose output routine might behave differently.
\endconcept
\conceptindex{output streams}
\concept {output stream}
\margin{This concept was out of order.}
See \conceptcit{file}.
\endconcept
\conceptindex{pages}
\concept page
\TeX\ processes a document by assembling \defterm{pages} one at a time
and passing them to the output routine.
As it proceeds through your document, \TeX\ maintains a list of lines
and other
items to be placed on the page. (The lines are actually hboxes.)
This list is called the ``^{main vertical list}''.
Periodically \TeX\ goes through a process called ``exercising the
^{page builder}''.
The items added to the main vertical list between exercises of the
page builder are called ``^{recent contributions}''.
The page builder first examines the main vertical list to see if it's
necessary to ship out a page yet, either because the items on the main
vertical list won't all fit on the page or because of an explicit item,
such as |\eject| \ctsref\eject, that tells \TeX\ to end the page.
If it's not necessary to ship out a page, then the page builder is done
for the time being.
Otherwise the page builder analyzes the main vertical
list to find what it considers to be the best possible page break.
It associates penalties with various kinds of unattractive page
breaks---a break that would leave an
isolated line at the top or bottom of a page, a break just before a
math display, and so forth. It then
chooses the least costly page break,
where the cost of a break is increased by any penalty associated with that
break and by the badness of the page that would result
(see \knuth{page~111} for the cost formula). If it finds several
equally costly page breaks, it chooses the last one.
{\tighten
Once the page builder has chosen a page break,
it places the items on the list that are before that break
into ^|\box255| and leaves the remaining ones for the next page.
It then calls the output routine. |\box255| acts as a mailbox, with the
page builder as the sender and the output routine as the receiver.
Ordinarily the output routine processes |\box255|, adds
other items, such as insertions, headers, and footers, to the page, and
ships out the page to the \dvifile\
^^{\dvifile//material from output routine}
with a |\shipout| command.
(Specialized output routines may behave differently.)
From \TeX's standpoint, it doesn't matter whether or not the output
routine ships out a page;
the only
responsibility of the output routine is to process |\box255| one way or
another.
\par}
{\tighten
It's important to realize that the best place to break a page isn't
necessarily the last possible place to break the page.
Penalties and other considerations may cause the page break
to come earlier.
Furthermore, \TeX\ appends items to the main vertical list in batches,
not just singly.
The lines of a paragraph are an example of such a batch.
For these reasons the page builder usually has items left over when it
breaks a page.
These leftover items then form the beginning of the main vertical list
for the next page (possibly in the middle of a batch).
Because items are carried over from one page to another,
you can't assume that as \TeX\ is processing
input, the current page number accurately reflects the page on which the
corresponding output will appear. See \knuth{pages~110--114} for a full
description of \TeX's page-breaking rules.
\par}
\endconcept
\conceptindex{page breaks}
\concept{page break}
A \defterm{page break} is a place in your document where \TeX\ ends a
page and (except at the end of the document) starts a new one.
See \conceptcit{page} for the process that \TeX\ goes through in choosing
a page break.
You can control \TeX's choice of page breaks in several ways:
\ulist
\li You can insert a penalty (\xref{vpenalty})
^^{penalties//in vertical lists}
between two items in the main vertical list. A positive
penalty discourages \TeX\ from breaking the page
there, while a negative penalty---a bonus, in other words---%
encourages \TeX\ to break the page there. A penalty of $10000$
or more prevents a
page break, while a penalty of $-10000$ or less forces a page break.
You can get the same effects with the |\break| and
|\nobreak| commands \ctsref{vbreak}.
\li You can adjust the penalties associated with page breaking
by assigning different values to \TeX's page-breaking
\refterm{parameters:parameter}.
\li You can enclose a sequence of paragraphs
or other items in the main vertical list within a \refterm{vbox},
thus preventing \TeX\ from breaking the page anywhere within the sequence.
\endulist
Once \TeX\ has chosen a page break, it places the portion of the main vertical
list that precedes the break into |\box255|.
It then calls the current \refterm{output routine}
to process |\box255| and eventually ships its contents to the \dvifile.
^^{\dvifile//material from output routine}
The output routine must
also handle \refterm{insertions}, such as footnotes, that \TeX\ has accumulated
while processing the page.
It's useful to know the places where \TeX\ can break a page:
\ulist
\li At glue, provided that the item preceding the glue is
a box, a whatsit, a mark, or an insertion.
When \TeX\ breaks a page at glue, it makes the break at the top
of the glue space and forgets about the rest of the glue.
\li At a kern that's immediately followed by glue.
\li At a penalty, possibly between the lines of a paragraph.
\endulist
When \TeX\ breaks a page, it discards any
sequence of glue, kerns, and penalty items that follows the break point.
\endconcept
\concept page builder
See \conceptcit{page}.
\endconcept
\concept {page layout}
\bix^^{margins}
\bix^^{headers}
\bix^^{footers}
When you're designing a document, you need to decide on its
\defterm{page layout}: the page size,
the margins on all four sides, the headers and footers, if any,
that appear at the top and bottom of the page,
and the amount of space between the body of the text and the headers or
footers. \TeX\ has defaults for all of these. It assumes an $8 \frac1/2$-%
by-$11$-inch page with margins of approximately one inch
on all four sides, no header,
and a footer consisting of a centered page number.
The margins are determined jointly by the four parameters
^|\hoffset|, ^|\voffset|, ^|\hsize|, and ^|\vsize| (see
``margins'', \xrefpg{margins},
for advice on how to adjust them).
\eix^^{margins}
The header normally consists of a single line that appears at the top of each
page, within the top margin area. You can set it by assigning
a \refterm{token} list to the ^|\headline| parameter (\xref{\headline}).
Similarly,
the footer normally consists of a single line that appears at the bottom
of each
page, within the bottom margin area. You can set it by assigning
a \refterm{token} list to the ^|\footline| parameter (\xref{\footline}).
For example, the input:
\csdisplay
\headline = {Baby's First Document\dotfill Page\folio}
\footline = {\hfil}
|
produces a header line like this on each page:
\vdisplay{
\dimen0 = \hsize
\advance \dimen0 by -\parindent
\hbox to \dimen0{Baby's First Document\dotfill Page 19}}
\noindent
and no footer line.
You can use marks to place the current topic of a section
of text into the header or footer.
^^{marks//with headers or footers}
See \conceptcit{mark} for an explanation of how to do this.
\eix^^{headers}
\eix^^{footers}
\endconcept
\conceptindex{paragraphs}
\concept paragraph
Intuitively, a \defterm{paragraph} is a sequence of input lines that's
ended by a blank line, by a ^|\par| command \ctsref{\@par},
^^|\par//ending a paragraph with|
or by an intrinsically vertical command, such as |\vskip|.
More precisely, a paragraph is a sequence of commands that \TeX\ processes
in ordinary horizontal mode.
When \TeX\ has collected an entire paragraph, it forms it into a sequence of
lines by choosing line breaks \seeconcept{line break}.
The result is a list of hboxes with glue, interline penalties,
and interspersed vertical material between them.
Each hbox is a single line, and the glue is the interline glue.
\eject
\TeX\ starts a paragraph when it's in a vertical mode
and encounters an inherently horizontal command.
In particular, it's in a vertical mode when it's just finished a paragraph,
so the horizontal material on the line after a blank input line starts the
next paragraph in a natural way.
There are many kinds of inherently horizontal commands, but the most common
kind is an ordinary character, e.g., a letter.
\looseness = -1
The ^|\indent| and ^|\noindent| commands
(\pp\xrefn{\indent},~\xrefn{\noindent})
are also inherently horizontal commands that tell
\TeX\ either to indent or not to indent the beginning of a paragraph.
Any other horizontal command in vertical
mode causes \TeX\ to do an implicit |\indent|.
Once \TeX\ has started a paragraph, it's in ordinary horizontal mode.
It first obeys any commands that are in ^|\everypar|.
It then proceeds to collect items for the paragraph until it gets a signal
that the paragraph is ended.
At the end of the paragraph it
resets the paragraph shape parameters ^|\parshape|, |\hang!-indent|,
^^|\hangindent|
and ^|\looseness|.
\TeX\ ordinarily translates a blank line into |\par|.
It also
inserts a |\par| into the input whenever it's in horizontal mode and
sees an intrinsically vertical command.
So ultimately the thing that ends a paragraph is always a |\par| command.
When \TeX\ receives a |\par| command, it first
fills out\footnote{%
More precisely, it executes the commands:
\csdisplay
\unskip \penalty10000 \hskip\parfillskip
|
thus appending items for these commands
to the end of the current horizontal list.}
the paragraph it's working on.
It then breaks the paragraph into lines,
adds the resulting list of items to the enclosing vertical list,
and exercises the page builder
(in the case where the enclosing vertical list is the main vertical list).
If the paragraph was ended by an intrinsically vertical command,
\TeX\ then executes that command.
\endconcept
\conceptindex{parameters}
\concept parameter
The term \defterm{parameter} has two different meanings---it can refer
either to a \TeX\ parameter or to a macro parameter.
A \TeX\ parameter is a \refterm{control sequence} that names
a value.
The value of a parameter can be a \refterm{number}, a \refterm{dimension},
an amount of \refterm{glue} or muglue, or a \refterm{token list}.
For example, the ^|\parindent| parameter
specifies the distance that \TeX\ skips at the start of an
indented paragraph.
You can use the control sequence for a parameter either to retrieve the value
of the parameter or to set that value. \TeX\ interprets the control sequence
as a request for a value if it appears in a context where a value is expected,
and as an \refterm{assignment} otherwise.
^^{assignments}
For example:
\csdisplay
\hskip\parindent
|
produces horizontal \refterm{glue} whose natural size is given by |\parindent|,
while:
\csdisplay
\parindent = 2pc % (or \parindent 2pc)
|
sets |\parindent| to a length of two picas. The assignment:
\csdisplay
\parindent = 1.5\parindent
|
uses |\parindent| in both ways. Its effect is to multiply the value of
|\parindent| by $1.5$.
You can think of a parameter as a built-in \refterm{register}.
^^{registers//parameters as}
You'll find a complete list of the \TeX\ parameters on \knuth{pages~272--275}.
A \refterm{macro} parameter is a placeholder for text that is to be
plugged into the definition of a macro. See \conceptcit{macro}
for more information about this kind of parameter.
\endconcept
\conceptindex{penalties}
\concept penalty
A \defterm{penalty} is an item that you can include in a
horizontal, vertical, or math list
in order to discourage \TeX\ from breaking the list
at that point or encourage \TeX\ to break the list there.
^^{horizontal lists//penalties in}
^^{vertical lists//penalties in}
A positive penalty indicates a bad break point, while
a negative penalty indicates a good break point.
Breaking an
ordinary horizontal
list produces a \refterm{line break}, while breaking an
ordinary vertical list produces
a \refterm{page break}.
(A penalty has no effect in restricted horizontal or
internal vertical \refterm{mode}.)
You can use the
|\penalty| command (\pp\xrefn{hpenalty},~\xrefn{vpenalty})
to insert a penalty explicitly.
A penalty of $10000$ or more prevents a break, while a penalty of
$-10000$ or less forces a break.
\endconcept
\concept{\plainTeX}
\defterm{\PlainTeX} is the form of \TeX\ described in this
book and in \texbook. \PlainTeX\ is part of the standard \TeX\
system, so documents that use only the facilities of \plainTeX\ can
usually be transferred from one installation to another without
difficulty.
\PlainTeX\ consists of the \refterm{primitive} commands together with a
large collection of macros and
other definitions. These additional definitions are given in
\knuth{Appendix~B}. They should also be in the file |plain.tex|
somewhere in your computer system.
\endconcept
\concept{primitive}
A \defterm{primitive} \refterm{command} is one whose definition is built
into the \TeX\ computer program. In contrast, a command that is not
primitive is defined by a \refterm{macro} or some other form of
definition written in \TeX\ itself. The commands in \refterm{\plainTeX}
consist of the primitive commands together with
other commands defined in terms of the
primitive ones.
\endconcept
\concept {reference point}
^^{baselines}
^^{boxes//reference point of}
The \defterm{reference point} of a \refterm{box} is the point where the
left edge of the box intersects its \refterm{baseline}. When \TeX\ is
processing a \refterm{horizontal:horizontal list} or \refterm{vertical
list}, it uses the reference points of the boxes in the list to line up
those boxes horizontally or vertically \seeconcept{box}.
\endconcept
\conceptindex{registers}
\concept register
A \defterm{register} is a named location for storing a value.
It is much like a variable in a programming language.
\TeX\ has five kinds of registers, as shown in the following table:
\vdisplay{\tabskip 10pt\halign{\tt #\hfil &#\hfil\cr
{\it Register type}&{\it Contents}\cr
box&a \refterm{box} \idxref{box registers}\cr
count&a \refterm{number} \idxref{count registers}\cr
dimen&a \refterm{dimension} \idxref{dimension registers}\cr
muskip&\refterm{muglue} \idxref{muglue registers}\cr
skip&\refterm{glue} \idxref{glue registers}\cr
toks&a \refterm{token} list\idxref{token registers}\cr}}
The registers of each type are numbered from $0$ to $255$.
You can access register $n$ of category $c$ by using the form `|\|$cn$',
e.g., |\muskip192|.
You can use a register
anywhere that information of the appropriate type is called for. For
instance, you can use |\count12|
in any context calling for a number or |\skip0|
in any context calling for glue.
You put information into a register by \refterm{assigning:assignment}
something to it:
\csdisplay
\setbox3 = \hbox{lagomorphs are not mesomorphs}
\count255 = -1
|
The first assignment constructs an hbox and assigns it to
box register~$3$.
You can
subsequently use `|\box3|' wherever a box is called for, and you will
get just that hbox.\footnote{But note carefully: using a box register
also empties it so that its contents become void. The other kinds of
registers don't behave that way. You can use the |\copy| command
\ctsref{\copy} to retrieve the contents of a box register without
emptying it.}
The second assignment assigns $-1$ to count register~$255$.
A register of a given type, e.g., a glue register, behaves just like
a parameter of that type.
^^{parameters//like registers}
You retrieve its value or assign to it
just as you would with a \refterm{parameter}.
Some \TeX\ parameters, e.g., |\pageno|,
are implemented as registers, in fact.
\PlainTeX\
uses many registers for its own purposes, so you should not just
pick an arbitrary
register number when you need a register. Instead you should ask
\TeX\ to reserve a register by using one of the commands
^|\newbox|, ^|\newcount|, ^|\newdimen|, ^|\newmuskip|, ^|\newskip|,
or ^|\newtoks|
\ctsref{\@newbox}. These commands are outer, so you can't
use them in a macro definition.
If you could,
you'd use up a register every time the macro was called and probably run out
of registers before long.
Nonetheless you can with some caution use any register temporarily
within a \refterm{group}, even one that \TeX\ is using for something
else.
After \TeX\ finishes executing the commands in a group,
it restores the contents of every register
to what they were before it started executing the group.
When you use an explicitly numbered register inside a group,
you must be sure that the register isn't modified by any
\refterm{macro}
that you might call within the group.
Be especially careful
about using arbitrary registers in a group that calls macros
that you didn't write yourself.
{\tighten
\TeX\ reserves certain registers for special purposes: |\count0| through
|\count9| for page numbering information and
^^{page numbering}
^|\box255| for the contents
of a page just before it is offered to the \refterm{output routine}.
Registers |\dimen0|--|\dimen9|, |\skip0|--|\skip9|,
|\muskip0|--|\mu!-skip9|, |\box0|--|\box9|,
and the |255| registers other than |\box255|
are generally available as ``scratch'' registers.
Thus \plainTeX\ provides only one scratch register, |\count255|, for
counts.
See \knuth{pages~122 and 346} for conventions to follow
in choosing register numbers.
\par}
You can examine the contents of registers during a \TeX\ run with the
^|\showthe| command \ctsref\showthe, e.g., with `|\showthe\dimen0|'.
\endconcept
\concept{restricted mode}
A \defterm{restricted mode} is a \refterm{mode} that \TeX\ is in when it is
assembling an \refterm{hbox} or a \refterm{vbox}.
We follow \texbook\ in using the term ``internal vertical mode''
for what you might expect to be ``restricted vertical mode''.
See \conceptcit{horizontal
mode} and \conceptcit{vertical mode}.\endconcept
\conceptindex{rules}
\concept rule
A \defterm{rule} is a solid black rectangle.
A rule, like a \refterm{box},
has \refterm{width}, \refterm{height}, and \refterm{depth}.
The vertical dimension of the rectangle
is the sum of its height and its depth.
An ordinary horizontal or vertical straight line is a special case of a rule.
\bix^^{horizontal rules}
\bix^^{vertical rules}
\bix^^|\hrule|
\bix^^|\vrule|
A rule can be either horizontal or vertical. The distinction between a
horizontal rule and a vertical one has to do with how you produce the
rule, since a vertical rule can be short and fat (and therefore look
like a horizontal line), while a horizontal rule can be tall and skinny
(and therefore look like a vertical line). \TeX's notion of a rule is
more general than that of typographers, who think of a rule as a line
and would not usually call a square black box a rule.
You can produce a horizontal rule using the
|\hrule| command and a vertical rule using
the |\vrule| command \ctsref{\vrule}.
For example, the control sequence |\hrule| by itself
produces a thin rule that runs across the page, like this:
{\offinterlineskip
\nobreak\medskip
\hrule
\medskip}
The command `|\vrule height .25in|' produces a vertical rule
that runs $.25$~inches down the page like this:
\nobreak\vskip \abovedisplayskip
\leftline{\vrule height .25in}
\vskip \belowdisplayskip
There are two differences between horizontal rules and vertical rules:
\olist
\li For a horizontal rule, \TeX\ defaults the width to the width of the
smallest \refterm{box} or \refterm{alignment} that encloses it. For a
vertical rule, \TeX\ defaults the height and depth in the same way. (The
default is the size that you get if you don't give a size explicitly for that
dimension.)
^^{horizontal lists//rule in}
^^{vertical lists//rule in}
\li
{\tighten
A horizontal rule is an inherently vertical item that cannot participate in
a \refterm{horizontal list},
while a vertical
rule is an inherently horizontal item
that cannot participate in a \refterm{vertical list}. This behavior
may seem strange at first but there is good reason for it:
a horizontal rule ordinarily runs visually from left
to right and thus separates items in a vertical list,
while a vertical rule ordinarily runs visually from top to bottom
and thus separates items in a horizontal list.
%(Look at the rules that are shown above.)
\par}
\endolist
{\tighten
If you construct a rule with three explicit dimensions, it will look the
same whether you make it a horizontal rule or a vertical rule.
For example, the command `|\vrule height1pt depth2pt width3in|' produces this
horizontal-looking rule:
\par}
{\offinterlineskip
\nobreak\medskip\nobreak\vskip3pt
\leftline{\vrule height1pt depth2pt width3in}
\medskip}
You'll find a precise statement of \TeX's treatment of rules on
\knuth{pages~221--222}.
\eix^^{horizontal rules}
\eix^^{vertical rules}
\eix^^|\hrule|
\eix^^|\vrule|
\endconcept
\concept {script size}
\defterm{Script size} describes one of the three related
\refterm{fonts:font} in a family.
^^{family//script size in}
Script size is smaller than \refterm{text size} but larger than
\refterm{scriptscript size}. \TeX\ uses script size for subscripts and
superscripts, as well as for the numerators and denominators of
fractions in text.
\endconcept
\concept {scriptscript size}
\defterm{Scriptscript size} describes the smallest of the three related
\refterm{fonts:font} in a family.
^^{family//scriptscript size in}
\TeX\ uses \refterm{scriptscript size} for second-order subscripts,
superscripts, numerators, and denominators. For example, \TeX\ will use
scriptscript size for a subscript on a subscript or for a superscript on
a scriptsize numerator.
\endconcept
\concept shrink
See \conceptcit{glue}.
\endconcept
\concept space
You can cause \TeX\ to put \defterm{space} between two items in
several~ways:
\olist
^^{end of line}
\li You can write something that \TeX\ treats as a space
\refterm{token}: one or more blank characters, the end of a line (the
end-of-line character acts like a space), or any \refterm{command} that
expands into a space token. \TeX\ generally treats several consecutive
spaces as equivalent to a single one, including the case where the
spaces include a single end-of-line. (An empty line
indicates the end of a paragraph; it
causes \TeX\ to generate a |\par| token.)
^^|\par//from empty line|
\TeX\ adjusts the size of
this kind of space to suit the length required by the context.
^^{glue//creating space with}
\li You can write a skip command that produces the glue
you specify in the command. The glue can
\refterm{stretch} or \refterm{shrink},
producing more or less space. You can have vertical glue as
well as horizontal glue. Glue disappears whenever it is next to a
line or page break.
^^{kerns//creating space with}
\li You can write a \refterm{kern}. A kern produces a fixed amount of
space that does not stretch or shrink and does not disappear at a line
or page break (unless it is immediately followed by glue). The most
common use of a kern is to establish a fixed spatial relationship
between two adjacent \refterm{boxes}.
\endolist
Glue and kerns can have negative values. Negative glue or a negative kern
between adjacent items brings those items closer together.
\endconcept
\concept stretch
See \conceptcit{glue}.
\endconcept
\conceptindex{struts}
\concept strut
{\tighten
A \defterm{strut} is an invisible \refterm{box}
^^{boxes//invisible}
whose width is zero and whose height and depth are slightly more than
those of a ``normal''
line of type in the context. Struts are useful for obtaining
uniform vertical spacing when \TeX's
usual line spacing is disabled, e.g., within a math formula
or within a horizontal alignment where you've specified ^|\offinterlineskip|.
Because a strut is taller and deeper than everything else on its line,
it determines the height and depth of the line.
You can produce a strut with
the ^|\strut| command \ctsref{\strut} or the ^|\mathstrut| command
\ctsref\mathstrut.
You can use |\strut| anywhere, but you can only use |\mathstrut| when
\TeX\ is in math \refterm{mode}. A strut in \plainTeX\ has height 8.5\pt\ and
depth 3.5\pt, while a math strut has the height and depth of a left
parenthesis in the current \refterm{style} (so it's smaller for
subscripts and superscripts).
\par}
Here's an example showing how you might use a strut:
\csdisplay
\vbox{\hsize = 3in \raggedright
\strut Here is the first of two paragraphs that we're
setting in a much narrower line length.\strut}
\vbox{\hsize = 3in \raggedright
\strut Here is the second of two paragraphs that we're
setting in a much narrower line length.\strut}
|
This input yields:
\display{\vbox{
\vbox{\hsize = 3in \raggedright
\strut Here is the first of two paragraphs that we're setting
in a much narrower line length.\strut}
\vbox{\hsize = 3in \raggedright
\strut Here is the second of two paragraphs that we're setting
in a much narrower line length.\strut}
}}
\noindent
Without the struts the \refterm{vboxes:vbox} would be too close
together. Similarly, in the formula:
\csdisplay
$\overline{x\mathstrut} \otimes \overline{t\mathstrut}$
|
the math struts cause both bars to be set at the same height even
though the `$x$' and the `$t$' have different heights:
\display{
$\overline{x\mathstrut} \otimes \overline{t\mathstrut}$
}
\vskip -\belowdisplayskip
\endconcept
\nobreak
\conceptindex{styles}
\concept {style}
Material in a math formula is set in one of eight \defterm{styles},
depending on the context. Knowing about styles can be useful if you want to
set part of a formula in a different size of type than the one
that \TeX\ has chosen according to its usual rules.
\eject
The four primary styles are:
\vdisplay{%
\halign{\refterm{# style}\hfil&\hskip .25in(for #)\hfil\cr
display&formulas displayed on a line by themselves\cr
text&formulas embedded in ordinary text\cr
script&superscripts and subscripts\cr
scriptscript&superscripts on superscripts, etc.\cr
}}
The other four styles are so-called ^{cramped variants}. In these
variants superscripts aren't raised as high as usual, and so the formula
needs less vertical space than it otherwise would. See
\knuth{pages~140--141} for the details of how \TeX\ selects the style.
\TeX\ chooses a size of type according to the style:
\ulist\compact
^^{display style}^^{text style}
\li Display style and text style are set in \refterm{text size}, like
`$\rm this$'.
^^{script style}
\li Script style is set in \refterm{script size}, like `$\scriptstyle
\rm this$'.
^^{scriptscript style}
\li Scriptscript style is set in \refterm{scriptscript size}, like
`$\scriptscriptstyle \rm this$'.
\endulist
See \conceptcit{family} for more information about these three sizes.
\TeX\ doesn't have a ``scriptscriptscript'' style because such a style
would usually have to be set in a size of type too small to read. \TeX\
therefore sets third-order subscripts, superscripts, etc., using the
scriptscript style.
Once in a while you may find that \TeX\ has set a formula in a different style
than the one you'd prefer. You can override \TeX's choice with the
^|\textstyle|, ^|\displaystyle|, ^|\scriptstyle|, and ^|\scriptscriptstyle|
commands \ctsref{\textstyle}.
\endconcept
\concept {\TeXMeX}
(a)~A variant of \TeX\ used for mathematical typesetting in
Central American countries.
(b)~A spicy cuisine favored by the \TeX\-ni\-cians of ^{El Paso}.
\endconcept
\concept {text math}
We use the term \defterm{text math} to refer to a math formula set within a
line of text, i.e., enclosed in |$|'s.
\ttidxref{$}
\TeX\ sets text math in text math \refterm{mode}.
\endconcept
\concept {text size}
\defterm{Text size} describes the largest of the three related
\refterm{fonts:font} in a \refterm{family}.
^^{family//text size in}
\TeX\ uses text size for ordinary symbols appearing in
\refterm{math mode}.
\endconcept
\conceptindex{tokens}
\concept token
A \defterm{token} is either a single character tagged with a
\refterm{category code}, or a \refterm{control sequence}. \TeX\ reads
characters from a file using its eyes \seeconcept{\anatomy}
and groups the characters into tokens using its mouth. When a token
reaches \TeX's stomach, \TeX\ interprets it as a \refterm{command}
unless it's part of an argument of a preceding command.
\endconcept
\conceptindex{units of measure}
\concept {unit of measure}
See \conceptcit{dimension}.
\endconcept
\conceptindex{vboxes}
\concept vbox
^^{vertical lists//vboxes formed from}
A \defterm{vbox} (vertical box) is a \refterm{box} that \TeX\ constructs
by placing the items of a \refterm{vertical list} one after another, top
to bottom. A vbox, taken as a unit, is neither inherently horizontal
nor inherently vertical, i.e., it can appear as an item of either a
vertical list or a \refterm{horizontal list}. You can construct a vbox
with the ^|\vbox| or the ^|\vtop| command
\ctsref{\vtop}. The difference is that for |\vbox|,
the \refterm{reference point}
of the constructed vbox is derived from that of the last (and
usually bottommost) constituent list item, but for |\vtop|, it's that of the
first (and usually topmost) constituent list item.
\endconcept
\conceptindex{vertical lists}
\concept{vertical list}
A \defterm{vertical list} is a list of items
that \TeX\ has produced while it is
in one of its vertical modes, i.e.,
assembling either a
\refterm{vbox} or a page. See ``vertical mode'' below.
\endconcept
\concept{vertical mode}
^^{vboxes//vertical mode for} When \TeX\ is assembling either a
\refterm{vbox} or the main vertical list from which pages are derived,
it is in one of two \defterm{vertical modes}: ^{ordinary
vertical mode} for assembling the main vertical list, and ^{internal
vertical mode} for assembling vboxes. Whenever \TeX\ is in a vertical mode
its stomach \seeconcept{\anatomy} is constructing a \refterm{vertical
list} of items (boxes, glue, penalties, etc.).
\TeX\ typesets the items in the list
one below another, top to bottom.
A vertical list can't contain any items produced by
inherently horizontal commands, e.g.,
^^{vertical lists//can't contain horizontal commands}
|\hskip| or an ordinary (nonspace) character.
\footnote{\TeX\ \emph{ignores} any space characters
that it encounters while it's in a vertical mode.}
\ulist
\li If \TeX\ is assembling a vertical list in ordinary vertical mode and
encounters an inherently horizontal command, it switches to ordinary
\refterm{horizontal mode}.
\li If \TeX\ is assembling a vertical list in internal vertical mode and
encounters an inherently horizontal command, it complains.
\endulist
Two commands that you might at first think are inherently vertical are
in fact inherently horizontal: |\valign| \ctsref{\valign} and |\vrule|
\ctsref{\vrule}.
^^|\valign//inherently horizontal|
^^|\vrule//inherently horizontal|
See \knuth{page~283} for a list of the
inherently horizontal commands.
It's particularly important to be aware that \TeX\ considers an ordinary
character other than a space character to be inherently horizontal. If
\TeX\ suddenly starts a new paragraph when you weren't expecting it,
a likely cause is a
character that \TeX\ encountered while in vertical mode.
You can convince \TeX\
not to treat that character as inherently horizontal by enclosing it in
an \refterm{hbox} since the |\hbox| command, despite its name, is
neither inherently horizontal nor inherently vertical.
\endconcept
\concept whatsit
A \defterm{whatsit} is an item of information that
tells \TeX\ to carry out some action
that doesn't fit into its ordinary scheme of things.
A whatsit can appear in a horizontal or vertical list, just like a box
or a glue item.
\TeX\ typesets a whatsit
as a \refterm{box} having zero width, height, and depth---in other
words, a box that contains nothing and occupies no space.
Three sorts of whatsits are built into \TeX:
\ulist
\li The |\openout|, |\closeout|, and |\write| commands
(\p\xrefn{\openout})
% (2nd) removed \xref to \write, since it's on the same page
produce a whatsit for operating on an output file.
^^|\openout//whatsit produced by|
^^|\write//whatsit produced by|
^^|\closeout//whatsit produced by|
\TeX\ postpones the operation until it next ships out a page
to the {\dvifile}
^^{\dvifile//whatsits in}
(unless the operation is preceded by ^|\immediate|).
\TeX\ uses a whatsit for these commands because they don't have anything
to do with what it's typesetting when it encounters them.
\li The ^|\special| command \ctsref{\special} tells \TeX\ to
insert certain text directly into the \dvifile.
As with the |\write| command, \TeX\ postpones the insertion
until it next ships out a page to the {\dvifile}.
^^{\dvifile//material inserted by \b\tt\\special\e}
A typical use of |\special| would be to
name a graphics file that the device driver should incorporate into
your final output.
\li When you change languages with the ^|\language| or ^|\setlanguage|
commands \ctsref{\language},
\TeX\ inserts a whatsit that instructs it to use a
certain set of hyphenation rules later on when it's breaking a paragraph
into lines.
\endulist
\noindent
A particular implementation of \TeX\ may provide additional whatsits.
\endconcept
\concept width
^^{boxes//width of}
The \defterm{width} of a \refterm{box} is the amount of horizontal space
that it occupies, i.e., the distance from its left edge to its
right edge. The typeset material in a box can be wider than the box itself.
\endconcept
\endconcepts
\endchapter
\byebye
|