summaryrefslogtreecommitdiff
path: root/macros/latex-dev/required/amsmath/amsldoc.tex
blob: 8573682a66dedea7c3ee9e0fd0bf46aa82a7965f (plain)
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
%
% Copyright (C) 1995, 2000, 2013 American Mathematical Society.
% Copyright (C) 2016-2019 LaTeX3 Project and American Mathematical Society.
%
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3c
% of this license or (at your option) any later version.
% The latest version of this license is in
%   https://www.latex-project.org/lppl.txt
% and version 1.3c or later is part of all distributions of LaTeX
% version 2005/12/01 or later.
% 
% This work has the LPPL maintenance status `maintained'.
% 
% The Current Maintainer of this work is the LaTeX3 Project.
%
\documentclass[leqno,titlepage,openany]{amsldoc}[1999/12/13]

\def\MaintainedByLaTeXTeam#1{%
\begin{center}%
\fbox{\fbox{\begin{tabular}{@{}l@{}}%
This file is maintained by the \LaTeX{} Project team.\\%
Bug reports can be opened (category \texttt{#1}) at\\%
\url{https://latex-project.org/bugs/}.\end{tabular}}}\end{center}}

\ifx\UndEfiNed\url
  \ClassError{amsldoc}{%
    This version of amsldoc.tex must be processed\MessageBreak
    with a newer version of amsldoc.cls (2.02 or later).}{}
\fi

\renewcommand\bibname{References}

%    Definitions that should be moved to amsldoc.cls
%    when it is next updated
\makeatletter
\let\cleardouble@page\cleardoublepage
\AtBeginDocument{%
  \ifx\cleardouble@page\cleardoublepage
    \def\cleardoublepage{\clearpage{\pagestyle{empty}\cleardouble@page}}
  \fi
}

% #1 is empty or one of class, environment, option, package
% could use different font in each case
\makeatletter
\def\@category@index#1#2{%
    \autoindex{%
        #2\actualchar\string\index#1font{#2}%
        \ifx\@nil#1\@nil\else\space#1\fi
    }%
}

\let\indexpackagefont\textsf
\let\indexclassfont\textsf
\let\indexoptionfont\texttt
\let\indexenvironmentfont\texttt
\let\indexfont\texttt
\makeatother
%    For a package that won't be indexed, i.e. amsmath
\newcommand{\nipkg}{\textsf}
\def\tikz/{Ti\textit{k}Z}
%    End definitions for amsldoc.cls

\title{User's Guide for the \nipkg{amsmath} Package (Version~2.1)}
\author{American Mathematical Society, \LaTeX3 Project}
\date{1999-12-13\\(revised 2002-02-25, 2016-11-14, 2018-04-05, 2019-10-14)}
\makeatletter
\def\@thanks{\bigskip\MaintainedByLaTeXTeam{amslatex}}
\makeatother

%    Use the amsmath package and amscd package in order to print
%    examples.
\usepackage{amsmath}
\usepackage{amscd}

\usepackage{imakeidx}
%    Need alternate coding for vertical bar to get it into index.
%    Based on \qcbang and \cnbang in amsldoc.cls, refined by David Carlisle.
%    Give it a sort field that will be at the end of the symbols;
%    must avoid " and | which have special meanings.
\DeclareRobustCommand{\qcvert}{\qc\|\index{{z1}@{\ntt\char'174}}}
\DeclareRobustCommand{\cnvert}{%
  \ncn{\|}\index{{z0}@{\ntt\bslchar\char'174}}}
%    Need alternate index sort field for bang to allow & to sort first
\DeclareRobustCommand{\altcnbang}{%
  \ncn{\!}\index{"!b@{\ntt\bslchar\qcbang}}}
\DeclareRobustCommand{\cnamp}{%
  \index{"!a@\texttt{\&}}}

\makeindex[intoc] % generate index data
\providecommand{\see}[2]{\textit{see} #1}

%    The amsldoc class includes a number of features useful for
%    documentation about TeX, including:
%
%    ---Commands \tex/, \amstex/, \latex/, ... for uniform treatment
%    of the various logos and easy handling of following spaces.
%
%    ---Commands for printing various common elements: \cn for command
%    names, \fn for file names (including font-file names), \env for
%    environments, \pkg and \cls for packages and classes, etc.

%    Many of the command names used here are rather long and will
%    contribute to poor linebreaking if we follow the \latex/ practice
%    of not hyphenating anything set in tt font; instead we selectively
%    allow some hyphenation.
\allowtthyphens % defined in amsldoc.cls

\hyphenation{ac-cent-ed-sym-bol add-to-counter add-to-length align-at
  aligned-at allow-dis-play-breaks ams-art ams-cd ams-la-tex amsl-doc
  ams-symb ams-tex ams-text ams-xtra bmatrix bold-sym-bol cen-ter-tags
  eqn-ar-ray idots-int int-lim-its latex med-space neg-med-space
  neg-thick-space neg-thin-space no-int-lim-its no-name-lim-its
  over-left-arrow over-left-right-arrow over-right-arrow pmatrix
  qed-sym-bol set-length side-set small-er tbinom the-equa-tion
  thick-space thin-space un-der-left-arrow un-der-left-right-arrow
  un-der-right-arrow use-pack-age var-inj-lim var-proj-lim vmatrix
  xalign-at xx-align-at}

%    Prepare for illustrating the \vec example
\newcommand{\vect}[1]{\mathbf{#1}}

\newcommand{\booktitle}[1]{\textit{#1}}
\newcommand{\journalname}[1]{\textit{#1}}
\newcommand{\seriesname}[1]{\textit{#1}}

%    Command to insert and index a particular phrase. Doesn't work for
%    certain kinds of special characters in the argument.
\newcommand{\ii}[1]{#1\index{#1}}

\newcommand{\vstrut}[1]{\vrule width0pt height#1\relax}

%    An environment for presenting comprehensive address information:
\newenvironment{infoaddress}{%
  \par\topsep\medskipamount
  \trivlist\centering
  \item[]%
  \begin{minipage}{.7\columnwidth}%
  \raggedright
}{%
  \end{minipage}%
  \endtrivlist
}

\newenvironment{eqxample}{%
  \par\addvspace\medskipamount
  \noindent\begin{minipage}{.5\columnwidth}%
  \def\producing{\end{minipage}\begin{minipage}{.5\columnwidth}%
    \hbox\bgroup\kern-.2pt\vrule width.2pt%
      \vbox\bgroup\parindent0pt\relax
%    The 3pt is to cancel the -\lineskip from \displ@y
    \abovedisplayskip3pt \abovedisplayshortskip\abovedisplayskip
    \belowdisplayskip0pt \belowdisplayshortskip\belowdisplayskip
    \noindent}
}{%
  \par
%    Ensure that a lonely \[\] structure doesn't take up width less than
%    \hsize.
  \hrule height0pt width\hsize
  \egroup\vrule width.2pt\kern-.2pt\egroup
  \end{minipage}%
  \par\addvspace\medskipamount
}

%    Errors in output shouldn't be \texttt, and they may also be longer
%    than one line, but they should be identified by the "errorbullet".
%    (They were formerly labeled as aubsections.)
\newenvironment{erroro}[1]{%
  \par\addvspace\medskipamount
  \noindent\hangindent\parindent
  \hbox to\parindent{\errorbullet\hfil}\ignorespaces
  #1\par\vspace{\smallskipamount}
}{%
  \par\addvspace\medskipamount
}

%    The chapters are so short, perhaps we shouldn't call them by the
%    name `Chapter'. We make \chaptername read an argument in order to
%    remove a following \space or "{} " (both possibilities are present
%    in book.cls).

\renewcommand{\chaptername}[1]{}
\newcommand{\chapnum}[1]{\mdash #1\mdash }
\makeatletter
\def\@makechapterhead#1{%
  \vspace{1.5\baselineskip}%
  {\parindent \z@ \raggedright \reset@font
    \ifnum \c@secnumdepth >\m@ne
      \large\bfseries \chapnum{\thechapter}%
      \par\nobreak
      \vskip.5\baselineskip\relax
    \fi
    #1\par\nobreak
    \vskip\baselineskip
  }}
\makeatother

%    A command for ragged-right parbox in a tabular.
\newcommand{\rp}{\let\PBS\\\raggedright\let\\\PBS}

%    Non-indexed file name
\newcommand{\nfn}[1]{\texttt{#1}}

%    For the examples in the math spacing table.
%%\newcommand{\lspx}{\mbox{\rule{5pt}{.6pt}\rule{.6pt}{6pt}}}
%%\newcommand{\rspx}{\mbox{\rule[-1pt]{.6pt}{7pt}%
%%  \rule[-1pt]{5pt}{.6pt}}}
\newcommand{\lspx}{\mathord{\Rightarrow\mkern-1mu}}
\newcommand{\rspx}{\mathord{\mkern-1mu\Leftarrow}}
\newcommand{\spx}[1]{$\lspx #1\rspx$}

%    For a list of characters representing document input.
\newcommand{\clist}[1]{%
  \mbox{\ntt\spaceskip.2em plus.1em \xspaceskip\spaceskip#1}}

%    Fix weird \latex/ definition of rightmark.
\makeatletter
\def\rightmark{\expandafter\@rightmark\botmark{}{}}
%    Also turn off section marks.
\let\sectionmark\@gobble
\renewcommand{\chaptermark}[1]{%
  \uppercase{\markboth{\rhcn#1}{\rhcn#1}}}
\newcommand{\rhcn}{\thechapter. }
\makeatother

%    Include down to \section but not \subsection, in toc:
\setcounter{tocdepth}{1}

%    Subheadings for the bibliography
\newif\iffirstbibsubhead \firstbibsubheadtrue
\newcommand{\bibsubhead}[1]{%
  \iffirstbibsubhead \firstbibsubheadfalse
  \else \addvspace{\medskipamount}
  \fi
  \item[]\hspace*{-\leftmargin}\textbf{#1}\par
  \vspace{\smallskipamount}
}

\DeclareMathOperator{\ix}{ix}
\DeclareMathOperator{\nul}{nul}
\DeclareMathOperator{\End}{End}
\DeclareMathOperator{\xxx}{xxx}

\usepackage{hyperref}
\hypersetup{pdfborder=0 0 0}
\makeatletter
\let\oldcs\cs
\def\cs#1{\texorpdfstring{\oldcs{#1}}{\@backslashchar\@backslashchar#1}}
\let\cn\cs
\makeatother
\begin{document}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\frontmatter

\maketitle

\pagestyle{headings}
\tableofcontents
\cleardoublepage % for better page number placement

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\mainmatter
\chapter{Introduction}

\index{amsmath@\texttt{amsmath} package|(}

The \nipkg{amsmath} package is a \LaTeX{} package that provides
miscellaneous enhancements for improving the information structure and
printed output of documents that contain mathematical formulas. Readers
unfamiliar with \LaTeX{} should refer to \cite{lamport}. If you have an
up-to-date version of \LaTeX{}, the \nipkg{amsmath} package is normally
provided along with it. Upgrading when a newer version of the
\nipkg{amsmath} package is released can be done via
\url{http://mirror.ctan.org/macros/latex/required/amsmath.zip}.

This documentation describes the features of the \nipkg{amsmath} package
and discusses how they are intended to be used. It also covers some
ancillary packages:
\begin{ctab}{lll}
\pkg{amsbsy}& \pkg{amsopn}& \pkg{amsxtra}\\
\pkg{amscd}& \pkg{amstext}\\
\end{ctab}
These all have something to do with the contents of math formulas. For
information on extra math symbols and math fonts, see \cite{amsfonts}
and \url{https://www.ams.org/tex/amsfonts.html}. For documentation of the
\pkg{amsthm} package or AMS document classes (\cls{amsart},
\cls{amsbook}, etc.\@) see \cite{amsthdoc} or \cite{amshandbk} and
\url{https://www.ams.org/tex/author-info.html}.

If you are a long-time \latex/ user and have lots of mathematics in what
you write, then you may recognize solutions for some familiar problems
in this list of \nipkg{amsmath} features:
\begin{itemize}

\item A convenient way to define new `operator name' commands analogous
to \cn{sin} and \cn{lim}, including proper side spacing and automatic
selection of the correct font style and size (even when used in
sub- or superscripts).

\item Multiple substitutes for the \env{eqnarray} environment to make
various kinds of equation arrangements easier to write.

\item Equation numbers automatically adjust up or down to avoid
overprinting on the equation contents (unlike \env{eqnarray}).

\item Spacing around equals signs matches the normal spacing in the
\env{equation} environment (unlike \env{eqnarray}).

\item A way to produce multiline subscripts as are often used with
summation or product symbols.

\item An easy way to substitute a variant equation number for a given
equation instead of the automatically supplied number.

\item An easy way to produce subordinate equation numbers of the form
(1.3a) (1.3b) (1.3c) for selected groups of equations.

\end{itemize}

The \nipkg{amsmath} package is distributed together with some small
auxiliary packages:
\begin{description}
\item[\nipkg{amsmath}] Primary package, provides various features for
  displayed equations and other mathematical constructs.

\item[\pkg{amstext}] Provides a \cn{text} command for
  typesetting a fragment of text inside a display.

\item[\pkg{amsopn}] Provides \cn{DeclareMathOperator} for defining new
  `operator names' like \cn{sin} and \cn{lim}.

\item[\pkg{amsbsy}] For backward compatibility this package continues
to exist but use of the newer \pkg{bm} package that comes with \LaTeX{}
is recommended instead.

\item[\pkg{amscd}] Provides a \env{CD} environment for simple
  commutative diagrams (no support for diagonal arrows).

\item[\pkg{amsxtra}] Provides certain odds and ends such as
  \cn{fracwithdelims} and \cn{accentedsymbol}, for compatibility with
  documents created using version 1.1.

\end{description}

The \nipkg{amsmath} package incorporates \pkg{amstext}, \pkg{amsopn}, and
\pkg{amsbsy}. The features of \pkg{amscd} and \pkg{amsxtra}, however,
are available only by invoking those packages separately.

The independent \pkg{mathtools} package \cite{mt} provides some
enhancements to \nipkg{amsmath}; \pkg{mathtools} loads \nipkg{amsmath}
automatically, so there is no need to separately load \nipkg{amsmath}
if \pkg{mathtools} is used.  Some \pkg{mathtools} facilities
will be noted below as appropriate.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\chapter{Options for the \nipkg{amsmath} package}\label{options}

The \nipkg{amsmath} package has the following options:
\index{options!amsmath@\texttt{amsmath} package options|(}
\begin{description}

\item[\opt{centertags}] (default) For an equation containing a
\env{split} environment, place equation
numbers\index{equationn@equation numbers!vertical placement}
vertically centered on the total height of the equation.

\item[\opt{tbtags}] `Top-or-bottom tags': For an equation containing
a \env{split} environment, place equation
numbers\index{equationn@equation numbers!vertical placement} level with the last
(resp.\ first) line, if numbers are on the right (resp.\ left).

\item[\opt{sumlimits}] (default) Place the subscripts and
superscripts\index{subscripts and superscripts!placement}\relax
\index{limits|see{subscripts and superscripts}} of summation symbols
above and below, in displayed equations. This option also affects other
symbols of the same type\mdash $\prod$, $\coprod$, $\bigotimes$,
$\bigoplus$, and so forth\mdash but excluding integrals (see below).

\item[\opt{nosumlimits}] Always place the subscripts and superscripts of
summation-type symbols to the side, even in displayed equations.

\item[\opt{intlimits}] Like \opt{sumlimits}, but for
integral\index{integrals!placement of limits} symbols.

\item[\opt{nointlimits}] (default) Opposite of \opt{intlimits}.

\item[\opt{namelimits}] (default) Like \opt{sumlimits}, but for certain
`operator names' such as $\det$, $\inf$, $\lim$, $\max$, $\min$, that
traditionally have subscripts%
\index{subscripts and superscripts!placement} placed underneath when
they occur in a displayed equation.

\item[\opt{nonamelimits}] Opposite of \opt{namelimits}.

\end{description}

\goodbreak

\begin{description}
\item[\opt{alignedleftspaceyes}]
\item[\opt{alignedleftspaceno}]
\item[\opt{alignedleftspaceyesifneg}]
\end{description}

To use one of these package options, put the option name in the optional
argument of the \cn{usepackage} command\mdash e.g.,
\verb"\usepackage[intlimits]{amsmath}".
For AMS document classes and any other classes that preload \nipkg{amsmath}
desired options must be specified with the \cn{documentclass}\mdash
e.g.,\\
\verb+\documentclass[intlimits,tbtags,reqno]{amsart}+.

The \nipkg{amsmath} package also recognizes the following options which
are normally selected (implicitly or explicitly) through the
\cn{documentclass} command, and thus need not be repeated in the option
list of the \cn{usepackage}|{amsmath}| statement.
\begin{description}

\item[\opt{leqno}] Place equation numbers on the left.%
\index{equationn@equation numbers!left or right placement}

\item[\opt{reqno}] Place equation numbers on the right.

\item[\opt{fleqn}] Position equations at a fixed indent from the left
margin rather than centered in the text column.%
\index{displayed equations!centering}

\end{description}

Three options have been added to control the space to the left of
\env{aligned} and \env{gathered} environments. Prior to the 2017 release
a thin space was added to the left but not the right of these constructs.
This appears to have been an accidental feature of the implementation and
was typically corrected by prefixing the environments with \altcnbang.

The new default behavior is aimed to ensure that the environments do
not have a thin space added in most cases, and that existing documents
using |\!\begin{aligned}| continue to work as before.

\begin{description}
\item[\opt{alignedleftspaceyes}] Always add \cn{\,} to the left of \env{aligned} and \env{gathered}.
\item[\opt{alignedleftspaceno}] Never add \cn{\,} to the left of \env{aligned} and \env{gathered}.
\item[\opt{alignedleftspaceyesifneg}] Only add \cn{\,} if the environment is prefixed by negative space. (New default behavior.)
\end{description}

\index{options!amsmath@\texttt{amsmath} package options|)}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\chapter{Displayed equations}

\section{Introduction}
The \nipkg{amsmath} package provides a number of additional displayed
equation structures\index{displayed equations}%
\index{equations|see{displayed equations}} beyond the ones
provided in basic \latex/. The augmented set includes:
\begin{verbatim}
  equation     equation*     align       align*
  gather       gather*       alignat     alignat*
  multline     multline*     flalign     flalign*
  split
\end{verbatim}
(Although the standard \env{eqnarray} environment remains available,
it is better to use \env{align} or \env{equation}+\env{split} instead.
Within \env{eqnarray}, spacing\index{horizontal spacing} around signs
of relation is not the preferred mathematical spacing, and is
inconsistent with that spacing as it appears in other environments.
Long lines in this environment may result in misplaced or overprinted
equation numbers. This environment also does not support the use of
\cn{qed} or \cn{qedhere} as provided by theorem packages.)

Except for \env{split}, each environment has both starred and unstarred
forms, where the unstarred forms have automatic numbering using
\latex/'s \env{equation} counter. You can suppress the number on any
particular line by putting \cn{notag} before the end of that line;
\cn{notag} should not be used outside a display environment as it will
mess up the numbering.  You can also
override\index{equationn@equation numbers!overriding} a number with a tag
of your own using \cn{tag}|{|\<label>|}|, where \<label> means arbitrary
text such as |$*$| or |ii| used to \qq{number} the equation.
A tag can reference a different tagged display by use of
|\tag{\ref{|\<label>|}|\<modifier>|}| where \<modifier> is optional.
If you are using \pkg{hyperref}, use \cn{ref*};
use of the starred form of \cn{ref} prevents a reference to a modified
tag containing a nested link from linking to the original display.

There is also a
\cn{tag*} command that causes the text you supply to be typeset
literally, without adding parentheses around it. \cn{tag} and \cn{tag*}
can also be used within the unnumbered versions of all the \nipkg{amsmath}
alignment structures. Some examples of the use of \cn{tag} may be found
in the sample files \fn{testmath.tex} and \fn{subeqn.tex} provided with
the \nipkg{amsmath} package.

The \env{split} environment is a special subordinate form that is used
only \emph{inside} one of the others. It cannot be used inside
\env{multline}, however. \env{split} supports only one alignment (|&|)
column; if more are needed, \env{aligned} or \env{alignedat} should be
used. The width of a \env{split} structure is the full line width.

In the structures that do alignment (\env{split}, \env{align} and
variants), relation symbols have an |&| before them but not
after\mdash unlike \env{eqnarray}. Putting the |&| after the
relation symbol will interfere with the normal spacing; it has to go
before.

In all multiline environments, lines are divided by \cn{\\}.  The \cn{\\}
should \emph{not} be used to end the last line.  Using it there will
result in unwanted extra vertical space following the display.

In \emph{all} math environments (inline or display), blank lines
(equivalent to \cn{par}) are not permitted, and will result in an error.

\begin{table}[p]
\caption[]{Comparison of displayed equation environments (vertical lines
indicating nominal margins)}\label{displays}
\renewcommand{\theequation}{\arabic{equation}}
\begin{eqxample}
\begin{verbatim}
\begin{equation*}
a=b
\end{equation*}
\end{verbatim}
\producing
\begin{equation*}
a=b
\end{equation*}
\end{eqxample}

\begin{eqxample}
\begin{verbatim}
\begin{equation}
a=b
\end{equation}
\end{verbatim}
\producing
\begin{equation}
a=b
\end{equation}
\end{eqxample}

\begin{eqxample}
\begin{verbatim}
\begin{equation}\label{xx}
\begin{split}
a& =b+c-d\\
 & \quad +e-f\\
 & =g+h\\
 & =i
\end{split}
\end{equation}
\end{verbatim}
\producing
\begin{equation}\label{xx}
\begin{split}
a& =b+c-d\\
 & \quad +e-f\\
 & =g+h\\
 & =i
\end{split}
\end{equation}
\end{eqxample}

\begin{eqxample}
\begin{verbatim}
\begin{multline}
a+b+c+d+e+f\\
+i+j+k+l+m+n
\end{multline}
\end{verbatim}
\producing
\begin{multline}
a+b+c+d+e+f\\
+i+j+k+l+m+n
\end{multline}
\end{eqxample}

\begin{eqxample}
\begin{verbatim}
\begin{gather}
a_1=b_1+c_1\\
a_2=b_2+c_2-d_2+e_2
\end{gather}
\end{verbatim}
\producing
\begin{gather}
a_1=b_1+c_1\\
a_2=b_2+c_2-d_2+e_2
\end{gather}
\end{eqxample}

\begin{eqxample}
\begin{verbatim}
\begin{align}
a_1& =b_1+c_1\\
a_2& =b_2+c_2-d_2+e_2
\end{align}
\end{verbatim}
\producing
\begin{align}
a_1& =b_1+c_1\\
a_2& =b_2+c_2-d_2+e_2
\end{align}
\end{eqxample}

\begin{eqxample}
\begin{verbatim}
\begin{align}
a_{11}& =b_{11}&
  a_{12}& =b_{12}\\
a_{21}& =b_{21}&
  a_{22}& =b_{22}+c_{22}
\end{align}
\end{verbatim}
\producing
\begin{align}
a_{11}& =b_{11}&
  a_{12}& =b_{12}\\
a_{21}& =b_{21}&
  a_{22}& =b_{22}+c_{22}
\end{align}
\end{eqxample}

\begin{eqxample}
\begin{verbatim}
\begin{flalign*}
a_{11} + b_{11}& = c_{11}&
  a_{12}& =b_{12}\\
b_{21}& = c_{21}&
  a_{22}& =b_{22}+c_{22}
\end{flalign*}
\end{verbatim}
\producing
\begin{flalign*}
a_{11} + b_{11}& = c_{11}&
  a_{12}& =b_{12}\\
b_{21}& = c_{21}&
  a_{22}& =b_{22}+c_{22}
\end{flalign*}
\end{eqxample}
\end{table}

%% ------------------------------------------------------------------ %%
\enlargethispage{1\baselineskip}

\section{Single equations}

The \env{equation} environment is for a single equation with an
automatically generated number. The \env{equation*} environment is the
same except for omitting the number.%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\footnote{Basic \latex/ doesn't provide an \env{equation*} environment,
but rather a functionally equivalent environment named
\env{displaymath}.}
The wrapper \verb+\[ ... \]+ is equivalent to \env{equation*}.%
\index{[@\verb+\[ ... \]+}

%% ------------------------------------------------------------------ %%

\section{Split equations without alignment}

The \env{multline} environment is a variation of the \env{equation}
environment used for equations that don't fit on a single line. The
first line of a \env{multline} will be at the left margin and the last
line at the right margin, except for an indention on both sides in the
amount of \cn{multlinegap}. Any additional lines in between will be
centered independently within the display width (unless the \opt{fleqn}
option is in effect).%
\index{options!behavior of particular options}

Like \env{equation}, \env{multline} has only a single equation number
(thus, none of the individual lines should be marked with \cn{notag}).
The equation number is placed on the last line (\opt{reqno} option) or
first line (\opt{leqno} option); vertical centering as for \env{split}
is not supported by \env{multline}.%
\index{options!behavior of particular options}

It's possible to force one of the middle lines to the left or right with
commands \cn{shoveleft}, \cn{shoveright}. These commands take the entire
line as an argument, up to but not including the final \cn{\\}; for
example
\begin{multline}
\framebox[.65\columnwidth]{A}\\
\framebox[.5\columnwidth]{B}\\
\shoveright{\framebox[.55\columnwidth]{C}}\\
\framebox[.65\columnwidth]{D}
\end{multline}
\begin{verbatim}
\begin{multline}
\framebox[.65\columnwidth]{A}\\
\framebox[.5\columnwidth]{B}\\
\shoveright{\framebox[.55\columnwidth]{C}}\\
\framebox[.65\columnwidth]{D}
\end{multline}
\end{verbatim}

The value of \cn{multlinegap} can be changed with the usual \latex/
commands \cn{setlength} or \cn{addtolength}.

%% ------------------------------------------------------------------ %%

\section{Split equations with alignment}

Like \env{multline}, the \env{split} environment is for \emph{single}
equations that are too long to fit on one line and hence must be split
into multiple lines.  Unlike \env{multline}, however, the \env{split}
environment provides for alignment among the split lines, using |&| to
mark alignment points. Unlike the other \nipkg{amsmath} equation
structures, the \env{split} environment provides no numbering, because
it is intended to be used \emph{only inside some other displayed
  equation structure}, usually an \env{equation}, \env{align}, or
\env{gather} environment, which provides the numbering. For example:
\begin{equation}\label{e:barwq}\begin{split}
H_c&=\frac{1}{2n} \sum^n_{l=0}(-1)^{l}(n-{l})^{p-2}
  \sum_{l _1+\dots+ l _p=l}\prod^p_{i=1} \binom{n_i}{l _i}\\
&\quad\cdot[(n-l )-(n_i-l _i)]^{n_i-l _i}\cdot
  \Bigl[(n-l )^2-\sum^p_{j=1}(n_i-l _i)^2\Bigr].
  \kern-2em % adjust equation body to the right [mjd,13-Nov-1994]
\end{split}\end{equation}

\begin{verbatim}
\begin{equation}\label{e:barwq}\begin{split}
H_c&=\frac{1}{2n} \sum^n_{l=0}(-1)^{l}(n-{l})^{p-2}
  \sum_{l _1+\dots+ l _p=l}\prod^p_{i=1} \binom{n_i}{l _i}\\
&\quad\cdot[(n-l )-(n_i-l _i)]^{n_i-l _i}\cdot
  \Bigl[(n-l )^2-\sum^p_{j=1}(n_i-l _i)^2\Bigr].
\end{split}\end{equation}
\end{verbatim}

The \env{split} structure should constitute the entire body of the
enclosing structure, apart from commands like \cn{label} that produce no
visible material.

%% ------------------------------------------------------------------ %%

\section{Equation groups without alignment}

The \env{gather} environment is used for a group of consecutive
equations when there is no alignment desired among them; each one is
centered separately within the text width (see Table~\ref{displays}).
Equations inside \env{gather} are separated by a \cn{\\} command.
Any equation in a \env{gather} may consist of a \verb'\begin{split}'
  \dots\ \verb'\end{split}' structure\mdash for example:
\begin{verbatim}
\begin{gather}
  first equation\\
  \begin{split}
    second & equation\\
           & on two lines
  \end{split}
  \\
  third equation
\end{gather}
\end{verbatim}

%% ------------------------------------------------------------------ %%

\section{Equation groups with mutual alignment}

The \env{align} environment is used for two or more equations when
vertical alignment is desired; usually binary relations such as equal
signs are aligned (see Table~\ref{displays}).

To have several equation columns side-by-side, use extra ampersands
to separate the columns:
\begin{align}
x&=y       & X&=Y       & a&=b+c\\
x'&=y'     & X'&=Y'     & a'&=b\\
x+x'&=y+y' & X+X'&=Y+Y' & a'b&=c'b
\end{align}
%
\begin{verbatim}
\begin{align}
x&=y       & X&=Y       & a&=b+c\\
x'&=y'     & X'&=Y'     & a'&=b\\
x+x'&=y+y' & X+X'&=Y+Y' & a'b&=c'b
\end{align}
\end{verbatim}
Line-by-line annotations on an equation can be done by judicious
application of \cn{text} inside an \env{align} environment:
\begin{align}
x& = y_1-y_2+y_3-y_5+y_8-\dots
                    && \text{by \eqref{eq:C}}\\
 & = y'\circ y^*    && \text{by \eqref{eq:D}}\\
 & = y(0) y'        && \text {by Axiom 1.}
\end{align}
%
\begin{verbatim}
\begin{align}
x& = y_1-y_2+y_3-y_5+y_8-\dots
                    && \text{by \eqref{eq:C}}\\
 & = y'\circ y^*    && \text{by \eqref{eq:D}}\\
 & = y(0) y'        && \text {by Axiom 1.}
\end{align}
\end{verbatim}
A variant environment \env{alignat} allows the horizontal space between
equations to be explicitly specified. This environment takes one argument,
the number of \qq{equation columns} (the number of pairs of right-left
aligned columns; the argument is the number of pairs): count the maximum
number of \verb'&'s in any row, add~1 and divide by~2.
\begin{alignat}{2}
x& = y_1-y_2+y_3-y_5+y_8-\dots
                  &\quad& \text{by \eqref{eq:C}}\\
 & = y'\circ y^*  && \text{by \eqref{eq:D}}\\
 & = y(0) y'      && \text {by Axiom 1.}
\end{alignat}
%
\begin{verbatim}
\begin{alignat}{2}
x& = y_1-y_2+y_3-y_5+y_8-\dots
                  &\quad& \text{by \eqref{eq:C}}\\
 & = y'\circ y^*  && \text{by \eqref{eq:D}}\\
 & = y(0) y'      && \text {by Axiom 1.}
\end{alignat}
\end{verbatim}
The environment \env{flalign} (``full length alignment'') stretches the
space between the equation columns to the maximum possible width, leaving
only enough space at the margin for the equation number, if present.
\begin{flalign}
x&=y       & X&=Y\\
x'&=y'     & X'&=Y'\\
x+x'&=y+y' & X+X'&=Y+Y'
\end{flalign}
%
\begin{verbatim}
\begin{flalign}
x&=y       & X&=Y\\
x'&=y'     & X'&=Y'\\
x+x'&=y+y' & X+X'&=Y+Y'
\end{flalign}
\end{verbatim}
%
\begin{flalign*}
x&=y       & X&=Y\\
x'&=y'     & X'&=Y'\\
x+x'&=y+y' & X+X'&=Y+Y'
\end{flalign*}
%
\begin{verbatim}
\begin{flalign*}
x&=y       & X&=Y\\
x'&=y'     & X'&=Y'\\
x+x'&=y+y' & X+X'&=Y+Y'
\end{flalign*}
\end{verbatim}

%% ------------------------------------------------------------------ %%

\section{Alignment building blocks}

Like \env{equation}, the multi-equation environments \env{gather},
\env{align}, and \env{alignat} are designed to produce a structure
whose width is the full line width. This means, for example, that one
cannot readily add parentheses around the entire structure. But
variants\index{ed env@\texttt{-ed} environments|(}
\env{gathered}, \env{aligned}, and \env{alignedat} are provided whose
total width is the actual width of the contents; thus they can be used
as a component in a containing expression. E.g.,
\begin{equation*}
\left.\begin{aligned}
  B'&=-\partial\times E,\\
  E'&=\partial\times B - 4\pi j,
\end{aligned}
\right\}
\qquad \text{Maxwell's equations}
\end{equation*}
\begin{verbatim}
\begin{equation*}
\left.\begin{aligned}
  B'&=-\partial\times E,\\
  E'&=\partial\times B - 4\pi j,
\end{aligned}
\right\}
\qquad \text{Maxwell's equations}
\end{equation*}
\end{verbatim}
Like the \env{array} environment, these \texttt{-ed} variants also take
an optional\index{options!positioning of \texttt{-ed} environments}
|[t]|\index{t option@\texttt{t} (top) option},
|[b]|\index{b option@\texttt{b} (bottom) option} or the default
|[c]|\index{c option@\texttt{c} (center) option}
argument to specify vertical
positioning.  For maximum interoperability, do not insert a
space\index{options!space before \texttt{[}}
or line break\index{line break} before the option.  See
also the note on page~\pageref{breaknote} regarding page breaking
within the \texttt{-ed} environments.

\qq{Cases} constructions like the following are common in
mathematics:
\begin{equation}\label{eq:C}
P_{r-j}=
  \begin{cases}
    0&  \text{if $r-j$ is odd},\\
    r!\,(-1)^{(r-j)/2}&  \text{if $r-j$ is even}.
  \end{cases}
\end{equation}
and in the \nipkg{amsmath} package there is a \env{cases} environment to
make them easy to write:
\begin{verbatim}
P_{r-j}=\begin{cases}
    0&  \text{if $r-j$ is odd},\\
    r!\,(-1)^{(r-j)/2}&  \text{if $r-j$ is even}.
  \end{cases}
\end{verbatim}
Notice the use of \cn{text} (cf.~\secref{text}) and the nested math
formulas. \env{cases} is set in \cn{textstyle}. If \cn{displaystyle}
is wanted, it must be requested explicitly; \pkg{mathtools} provides
a \env{dcases} environment for this purpose.

The |-ed|\index{ed env@\texttt{-ed} environments|)} and \env{cases}
environments must appear within an enclosing math environment, which can
be either in text, between |$...$|, or in any of the display environments.

%% ------------------------------------------------------------------ %%

\section{Adjusting tag placement}

Placing equation numbers can be a rather complex problem in multiline
displays. The environments of the \nipkg{amsmath} package try hard to
avoid overprinting an equation number on the equation contents, if
necessary moving the number down or up to a separate line. Difficulties
in accurately calculating the profile of an equation can occasionally
result in number movement that doesn't look right.
A \cn{raisetag} command is provided to adjust the vertical position of the
current equation number, if it has been shifted away from its normal
position. To move a particular number up by six points, write
|\raisetag{6pt}|. (At the end of a display, this also shifts up the
text following the display.)
This kind of adjustment is fine tuning like line
breaks and page breaks, and should therefore be left undone until your
document is nearly finalized, or you may end up redoing the fine tuning
several times to keep up with changing document contents.

%% ------------------------------------------------------------------ %%

\section{Vertical spacing and page breaks in multiline displays}

You can use the \cn{\\}|[|\<dimension>|]|%
\index{options!extra vertical space after \cn{\\}}
command to get extra vertical
space between lines in all the \nipkg{amsmath} displayed equation
environments, as is usual in \latex/. Do not type a space between the%
\index{options!space before \texttt{[}}
\cn{\\} and the following |[|; \emph{only} for display environments
defined by \nipkg{amsmath} the space is interpreted to mean that the
bracketed material is part of the document content.

When the \nipkg{amsmath} package is
in use \ii{page breaks} between equation lines are normally disallowed;
the philosophy is that page breaks in such material should receive
individual attention from the author. To get an individual page break
inside a particular displayed equation, a \cn{displaybreak} command is
provided. \cn{displaybreak} is best placed immediately before the
\cn{\\} where it is to take effect.  Like \latex/'s \cn{pagebreak},
\cn{displaybreak} takes an optional argument%
\index{options!behavior of particular options} between 0 and 4 denoting
the desirability of the pagebreak. |\displaybreak[0]| means \qq{it is
  permissible to break here} without encouraging a break;
\cn{displaybreak} with no optional argument is the same as
|\displaybreak[4]| and forces a break.

If you prefer a strategy of letting page breaks fall where they may,
even in the middle of a multiline equation, then you might put
\cn{allowdisplaybreaks}\texttt{[1]} in the preamble of your document. An
optional argument\index{options!behavior of particular options}
1\ndash 4 can be used for finer control: |[1]| means
allow page breaks, but avoid them as much as possible; values of 2,3,4
mean increasing permissiveness. When display breaks are enabled with
\cn{allowdisplaybreaks}, the \cn{\\*} command can be used to prohibit a
pagebreak after a given line, as usual.

\begin{bfseries}
Note:\label{breaknote} Certain equation environments wrap their contents
in an unbreakable box, with the consequence that neither \cn{displaybreak}
nor \cn{allowdisplaybreaks} will have any effect on them. These include
\env{split}, \env{aligned}, \env{gathered}, and \env{alignedat}.
\end{bfseries}

%% ------------------------------------------------------------------ %%

\section{Interrupting a display}

The command \cn{intertext} is used for a short interjection of one or
two lines of text\index{text fragments inside math} in the middle of a
multiple-line display structure (see also the \cn{text} command in
\secref{text}). Its salient feature is preservation of the alignment,
which would not happen if you simply ended the display and then started
it up again afterwards. \cn{intertext} may only appear right after a
\cn{\\} or \cn{\\*} command. Notice the position of the word \qq{and} in
this example.
\begin{align}
  A_1&=N_0(\lambda;\Omega')-\phi(\lambda;\Omega'),\\
  A_2&=\phi(\lambda;\Omega')-\phi(\lambda;\Omega),\\
\intertext{and}
  A_3&=\mathcal{N}(\lambda;\omega).
\end{align}
\begin{verbatim}
\begin{align}
  A_1&=N_0(\lambda;\Omega')-\phi(\lambda;\Omega'),\\
  A_2&=\phi(\lambda;\Omega')-\phi(\lambda;\Omega),\\
\intertext{and}
  A_3&=\mathcal{N}(\lambda;\omega).
\end{align}
\end{verbatim}

The \pkg{mathtools} package provides a command \cn{shortintertext} that
is intended for use when the interjected text is only a few words; it uses
less vertical space than \cn{intertext}. This
is most effective when equation numbers are on the right.%
\index{equationn@equation numbers!left or right placement}

%% ------------------------------------------------------------------ %%

\section{Equation numbering}

\subsection{Numbering hierarchy}
In \latex/ if you wanted to have equations numbered within
sections\mdash that is, have
equation numbers (1.1), (1.2), \dots, (2.1), (2.2),
\dots, in sections 1, 2, and so forth\mdash you could redefine
\cn{theequation} as suggested in the \latex/ manual \cite[\S6.3, \S
C.8.4]{lamport}:
\begin{verbatim}
\renewcommand{\theequation}{\thesection.\arabic{equation}}
\end{verbatim}

This works pretty well, except that the equation counter won't be reset
to zero at the beginning of a new section or chapter, unless you do it
yourself using \cn{setcounter}. To make this a little more convenient,
the \nipkg{amsmath} package provides a 
command\index{equationn@equation numbers!hierarchy} \cn{numberwithin}.
To have equation numbering tied to section numbering, with automatic
reset of the equation counter, write
\begin{verbatim}
\numberwithin{equation}{section}
\end{verbatim}
As its name implies, the \cn{numberwithin} command can be applied to
any counter, not just the \texttt{equation} counter.

\subsection{Cross references to equation numbers}

To make cross-references to equations easier, an \cn{eqref}
command\index{equationn@equation numbers!cross-references} is provided. This
automatically supplies the parentheses around the equation number. I.e.,
if \verb'\ref{abc}' produces 3.2 then \verb'\eqref{abc}' produces
(3.2). The parentheses around an \cn{eqref} equation number will be
set in upright type regardless of type style of the context.

\subsection{Subordinate numbering sequences}

The \nipkg{amsmath} package provides also a wrapper environment,
\env{subequations}\index{equationn@equation numbers!subordinate numbering}, to make it
easy to number equations in a particular \cn{align} or similar group with
a subordinate numbering scheme. For example
\begin{verbatim}
\begin{subequations}
...
\end{subequations}
\end{verbatim}
causes all numbered equations within that part of the document to be
numbered (4.9a) (4.9b) (4.9c) \dots, if the preceding numbered
equation was (4.8). A \cn{label} command immediately after
\verb/\begin{subequations}/ will produce a \cn{ref} of the parent
number 4.9, not 4.9a. The counters used by the subequations
environment are \verb/parentequation/ and \verb/equation/ and
\cn{addtocounter}, \cn{setcounter}, \cn{value}, etc., can be applied
as usual to those counter names. To get anything other than lowercase
letters for the subordinate numbers, use standard \latex/ methods for
changing numbering style \cite[\S6.3, \S C.8.4]{lamport}. For example,
redefining \cn{theequation} as follows will produce roman numerals.
\begin{verbatim}
\begin{subequations}
\renewcommand{\theequation}{\theparentequation \roman{equation}}
...
\end{verbatim}

\subsection{Numbering style}

The default equation number is set in \cn{normalfont}.  This means that
in bold section headings, bold is suppressed; a workaround for this is
to use \verb+(\ref{+\ldots\verb+})+ rather than \verb+\eqref{+\ldots\verb+}+.

If smaller type is specified for a numbered display, the size of the
equation number will also be small.  The default size can be ensured
throughout a document by applying this patch in the preamble:
\begin{verbatim}
\makeatletter
\renewcommand{\maketag@@@}[1]{\hbox{\m@th\normalsize\normalfont#1}}%
\makeatother
\end{verbatim}
(This modification may be included in a future version of
\nipkg{amsmath}.)


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\chapter{Miscellaneous mathematical features}

\section{Matrices}\label{ss:matrix}

The \nipkg{amsmath} package provides some environments for
matrices\index{matrices} beyond the basic \env{array} environment of
\latex/. The \env{pmatrix}, \env{bmatrix}, \env{Bmatrix}, \env{vmatrix}
and \env{Vmatrix} have (respectively) $(\,)$, $[\,]$, $\lbrace\,\rbrace$,
$\lvert\,\rvert$, and $\lVert\,\rVert$ delimiters\index{delimiters}
built in. For naming consistency there is a
\env{matrix} environment sans delimiters. This is not entirely redundant
with the \env{array} environment; the matrix environments all use more
economical horizontal spacing than the rather prodigal spacing of the
\env{array} environment. Also, unlike the \env{array} environment, you
don't have to give column specifications for any of the matrix
environments; by default you can have up to 10 centered columns.%
\footnote{%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
More precisely: The maximum number of columns in a matrix is determined
by the counter |MaxMatrixCols| (normal value = 10), which you can change
if necessary using \latex/'s \cn{setcounter} or \cn{addtocounter}
commands.%
}\space%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
(If you need left or right alignment in a column or other special
formats you may use \env{array}, or the \pkg{mathtools}
package which provides \verb+*+ variants%
\index{matrix@\indexenvironmentfont{matrix} environment!\verb+*+ variants}
of these environments with
an optional argument to specify left or right alignment.)

To produce a small matrix suitable for use in text, there is a
\env{smallmatrix} environment (e.g.,
\begin{math}
\bigl( \begin{smallmatrix}
  a&b\\ c&d
\end{smallmatrix} \bigr)
\end{math})
that comes closer to fitting within a single text line than a normal
matrix. Delimiters\index{delimiters} must be provided. (The
\pkg{mathtools} package provides |p|,|b|,|B|,|v|,|V| versions of
\env{smallmatrix},%
\index{smallmatrix@\indexenvironmentfont{smallmatrix} environment!variant delimiters}
as well as |*| variants%
\index{smallmatrix@\indexenvironmentfont{smallmatrix} environment!\verb+*+ variants}
as described above.)
The above example was produced by
\begin{verbatim}
\bigl( \begin{smallmatrix}
  a&b\\ c&d
\end{smallmatrix} \bigr)
\end{verbatim}

\cn{hdotsfor}|{|\<number>|}| produces a row of dots in a
matrix\index{matrices!ellipsis dots}\index{ellipsis dots!in
matrices}\index{dots|see{ellipsis dots}} spanning the given number of
columns. For example,
\begin{center}
\begin{minipage}{.3\columnwidth}
\noindent$\begin{matrix} a&b&c&d\\
e&\hdotsfor{3} \end{matrix}$
\end{minipage}%
\qquad
\begin{minipage}{.45\columnwidth}
\begin{verbatim}
\begin{matrix} a&b&c&d\\
e&\hdotsfor{3} \end{matrix}
\end{verbatim}
\end{minipage}%
\end{center}

The spacing of the dots can be varied through use of a square-bracket
option,\index{options!behavior of particular options}
for example, |\hdotsfor[1.5]{3}|.  The number in square brackets
will be used as a multiplier (i.e., the normal value is 1.0).
\begin{equation}\label{eq:D}
\begin{pmatrix} D_1t&-a_{12}t_2&\dots&-a_{1n}t_n\\
-a_{21}t_1&D_2t&\dots&-a_{2n}t_n\\
\hdotsfor[2]{4}\\
-a_{n1}t_1&-a_{n2}t_2&\dots&D_nt\end{pmatrix},
\end{equation}
\begin{verbatim}
\begin{pmatrix} D_1t&-a_{12}t_2&\dots&-a_{1n}t_n\\
-a_{21}t_1&D_2t&\dots&-a_{2n}t_n\\
\hdotsfor[2]{4}\\
-a_{n1}t_1&-a_{n2}t_2&\dots&D_nt\end{pmatrix}
\end{verbatim}

%% ------------------------------------------------------------------ %%

\section{Math spacing commands}

The \nipkg{amsmath} package slightly extends the set of math
spacing\index{horizontal spacing} commands, as shown below.
Both the spelled-out and abbreviated forms of these commands are robust,
and they can also be used outside of math.
\begin{ctab}{lll|lll}
Abbrev.& Spelled out& Example & Abbrev.& Spelled out& Example\\
\hline
\vstrut{2.5ex}
& no space& \spx{}& & no space & \spx{}\\
\cn{\,}& \cn{thinspace}& \spx{\,}&
  \altcnbang& \cn{negthinspace}& \spx{\!}\\
\cn{\:}& \cn{medspace}& \spx{\:}&
  & \cn{negmedspace}& \spx{\negmedspace}\\
\cn{\;}& \cn{thickspace}& \spx{\;}&
  & \cn{negthickspace}& \spx{\negthickspace}\\
& \cn{quad}& \spx{\quad}\\
& \cn{qquad}& \spx{\qquad}
\end{ctab}
For the greatest possible control over math spacing, use \cn{mspace}
and `math units'. One math unit, or |mu|, is equal to 1/18 em. Thus to
get a negative \cn{quad} you could write |\mspace{-18.0mu}|.

%% ------------------------------------------------------------------ %%

\section{Dots}

For preferred placement of ellipsis dots (raised or on-line) in various
contexts there is no general consensus. It may therefore be considered a
matter of taste. By using the semantically oriented commands
\begin{itemize}
\item \cn{dotsc} for \qq{dots with commas}
\item \cn{dotsb} for \qq{dots with binary operators/relations}
\item \cn{dotsm} for \qq{multiplication dots}
\item \cn{dotsi} for \qq{dots with integrals}
\item \cn{dotso} for \qq{other dots} (none of the above)
\end{itemize}
instead of \cn{ldots} and \cn{cdots}, you make it possible for your
document to be adapted to different conventions on the fly, in case (for
example) you have to submit it to a publisher who insists on following
house tradition in this respect. The default treatment for the various
kinds follows American Mathematical Society conventions:
\begin{center}
\begin{tabular}{@{}l@{}l@{}}
\begin{minipage}[t]{.54\textwidth}
\begin{verbatim}
Then we have the series $A_1, A_2,
\dotsc$, the regional sum $A_1
+A_2 +\dotsb $, the orthogonal
product $A_1 A_2 \dotsm $, and
the infinite integral
\[\int_{A_1}\int_{A_2}\dotsi\].
\end{verbatim}
\end{minipage}
&
\begin{minipage}[t]{.45\textwidth}
\noindent
Then we have the series $A_1,A_2,\dotsc$,
the regional sum $A_1+A_2+\dotsb$,
the orthogonal product $A_1A_2\dotsm$,
and the infinite integral
\[\int_{A_1}\int_{A_2}\dotsi.\]
\end{minipage}
\end{tabular}
\end{center}
For most situations, the undifferentiated \cn{dots} can be used, and
\nipkg{amsmath} will output the most suitable form based on the
immediate context; if an inappropriate form results, it can be corrected
after examining the output.

%% ------------------------------------------------------------------ %%

\section{Nonbreaking dashes}

A command \cn{nobreakdash} is provided to suppress the possibility of a
line break\index{line break|(} after the following hyphen or dash. For
example, if you write `pages 1\ndash 9' as |pages 1\nobreakdash--9|
then a line break will never occur between the dash and the 9. You can
also use \cn{nobreakdash} to prevent undesirable hyphenations in
combinations like |$p$-adic|. For frequent use, it's advisable to make
abbreviations, e.g.,
\begin{verbatim}
\newcommand{\p}{$p$\nobreakdash}% for "\p-adic"
\newcommand{\Ndash}{\nobreakdash--}% for "pages 1\Ndash 9"
%    For "\n dimensional" ("n-dimensional"):
\newcommand{\n}[1]{$n$\nobreakdash-\hspace{0pt}}
\end{verbatim}
The last example shows how to prohibit a line break\index{line break|)}
after the hyphen but allow normal hyphenation in the following
word. (It suffices to add a zero-width space after the hyphen.)

%% ------------------------------------------------------------------ %%

\section{Accents in math}

In ordinary \LaTeX{} the placement of the second accent in doubled math
accents is often poor. With the \nipkg{amsmath} package you
will get improved placement of the second accent:
$\hat{\hat{A}}$ (\cn{hat}|{\hat{A}}|).

The commands \cn{dddot} and \cn{ddddot} are available to produce triple
and quadruple dot accents in addition to the \cn{dot} and \cn{ddot}
accents already available in \latex/.

To get a superscripted hat or tilde character, load the \pkg{amsxtra}
package and use \cn{sphat} or \cn{sptilde}. Usage is \verb'A\sphat'
(note the absence of the \verb'^' character).


To place an arbitrary symbol in math accent position, or to get under
accents, see the \pkg{accents} package by Javier Bezos. (\nipkg{amsmath}
must be loaded before \pkg{accents}.)

%% ------------------------------------------------------------------ %%

\section{Roots}

In ordinary \latex/ the placement of root indices is sometimes not so
good: $\sqrt[\beta]{k}$ (|\sqrt||[\beta]{k}|).  In the
\nipkg{amsmath} package \cn{leftroot} and \cn{uproot} allow you to adjust
the position of the root:%
\index{options!adjust positioning}
\begin{verbatim}
  \sqrt[\leftroot{-2}\uproot{2}\beta]{k}
\end{verbatim}
will move the beta up and to the right:
$\sqrt[\leftroot{-2}\uproot{2}\beta]{k}$. The negative argument used
with \cn{leftroot} moves the $\beta$ to the right. The units are a small
amount that is a useful size for such adjustments.

%% ------------------------------------------------------------------ %%

\section{Boxed formulas}

The command \cn{boxed} puts a box around its
argument, like \cn{fbox} except that the contents are in math mode:
\begin{equation}
\boxed{\eta \leq C(\delta(\eta) +\Lambda_M(0,\delta))}
\end{equation}
\begin{verbatim}
  \boxed{\eta \leq C(\delta(\eta) +\Lambda_M(0,\delta))}
\end{verbatim}

%% ------------------------------------------------------------------ %%

\section{Over and under arrows}

Basic \latex/ provides \cn{overrightarrow} and \cn{overleftarrow}
commands. Some additional over and under arrow commands are provided
by the \nipkg{amsmath} package to extend the set:

\begin{tabbing}
\qquad\=\ncn{overleftrightarrow}\qquad\=\kill
\> \cn{overleftarrow}    \> \cn{underleftarrow} \+\\
   \cn{overrightarrow}    \> \cn{underrightarrow} \\
   \cn{overleftrightarrow}\> \cn{underleftrightarrow}
\end{tabbing}

%% ------------------------------------------------------------------ %%

\section{Extensible arrows}

\cn{xleftarrow} and \cn{xrightarrow} produce
arrows\index{arrows!extensible} that extend automatically to accommodate
unusually wide subscripts or superscripts. These commands take one
optional argument\index{options!behavior of particular options}
(the subscript) and one mandatory argument (the
superscript, possibly empty):
\begin{equation}
A\xleftarrow{n+\mu-1}B \xrightarrow[T]{n\pm i-1}C
\end{equation}
\begin{verbatim}
  \xleftarrow{n+\mu-1}\quad \xrightarrow[T]{n\pm i-1}
\end{verbatim}

%% ------------------------------------------------------------------ %%

\section{Affixing symbols to other symbols}

\latex/ provides \cn{stackrel} for placing a
superscript\index{subscripts and superscripts} above a binary relation.
In the \nipkg{amsmath} package there are somewhat more general commands,
\cn{overset} and \cn{underset}, that can be used to place one symbol
above or below another symbol, whether it's a relation or something
else. The input |\overset{*}{X}| will place a superscript-size {\small$*$} above
the {\small$X$}: {\small$\smash{\overset{*}{X}}$};
\cn{underset} is the analog for adding a
symbol underneath. The command \cn{overunderset} is a combination of
these, taking three arguments to place superscript sized expressions
above and below the same base.

See also the description of \cn{sideset} in \secref{sideset}.

%% ------------------------------------------------------------------ %%

\section{Fractions and related constructions}

\subsection{The \cn{frac}, \cn{dfrac}, and \cn{tfrac} commands}

The \cn{frac} command, which is in the basic command set of
\latex/,\index{fractions|(} takes two arguments\mdash numerator and
denominator\mdash and typesets them in normal fraction form. The
\nipkg{amsmath} package provides also \cn{dfrac} and \cn{tfrac} as
convenient abbreviations for |{\displaystyle\frac| |...| |}|
and\indexcs{textstyle}\relax
\indexcs{displaystyle} |{\textstyle\frac| |...| |}|.
\begin{equation}
\frac{1}{k}\log_2 c(f)\quad\tfrac{1}{k}\log_2 c(f)\quad
\sqrt{\frac{1}{k}\log_2 c(f)}\quad\sqrt{\dfrac{1}{k}\log_2 c(f)}
\end{equation}
\begin{verbatim}
\begin{equation}
\frac{1}{k}\log_2 c(f)\;\tfrac{1}{k}\log_2 c(f)\;
\sqrt{\frac{1}{k}\log_2 c(f)}\;\sqrt{\dfrac{1}{k}\log_2 c(f)}
\end{equation}
\end{verbatim}

\subsection{The \cn{binom}, \cn{dbinom}, and \cn{tbinom} commands}

For binomial expressions\index{binomials} such as $\binom{n}{k}$
\nipkg{amsmath} has \cn{binom}, \cn{dbinom} and \cn{tbinom}:
\begin{equation}
2^k-\binom{k}{1}2^{k-1}+\binom{k}{2}2^{k-2}
\end{equation}
\begin{verbatim}
2^k-\binom{k}{1}2^{k-1}+\binom{k}{2}2^{k-2}
\end{verbatim}

\subsection{The \cn{genfrac} command}

The capabilities of \cn{frac}, \cn{binom}, and their variants are
subsumed by a generalized fraction command \cn{genfrac} with six
arguments. The last two correspond to \cn{frac}'s numerator and
denominator; the first two are optional delimiters\index{delimiters} (as
seen in \cn{binom}); the third is a line thickness override (\cn{binom}
uses this to set the fraction line thickness to 0\mdash i.e., invisible);
and the fourth argument is a mathstyle override: integer values 0\ndash 3
select respectively \cn{displaystyle}, \cn{textstyle}, \cn{scriptstyle},
and \cn{scriptscriptstyle}. If the third argument is left empty, the line
thickness defaults to `normal'.

\begin{center}\begin{minipage}{.85\columnwidth}
\raggedright \normalfont\ttfamily \exhyphenpenalty10000
\newcommand{\ma}[1]{%
  \string{{\normalfont\itshape#1}\string}\penalty9999 \ignorespaces}
\string\genfrac \ma{left-delim} \ma{right-delim} \ma{thickness}
\ma{mathstyle} \ma{numerator} \ma{denominator}
\end{minipage}\end{center}
To illustrate, here is how \cn{frac}, \cn{tfrac}, and
\cn{binom} might be defined.
\begin{verbatim}
\newcommand{\frac}[2]{\genfrac{}{}{}{}{#1}{#2}}
\newcommand{\tfrac}[2]{\genfrac{}{}{}{1}{#1}{#2}}
\newcommand{\binom}[2]{\genfrac{(}{)}{0pt}{}{#1}{#2}}
\end{verbatim}
If you find yourself repeatedly using \cn{genfrac} throughout a document
for a particular notation, you will do yourself a favor (and your
publisher) if you define a meaningfully-named abbreviation for that
notation, along the lines of \cn{frac} and \cn{binom}.

The primitive generalized fraction commands \cs{over}, \cs{overwithdelims},
\cs{atop}, \cs{atopwithdelims}, \cs{above}, \cs{abovewithdelims} produce
warning  messages if used with the \nipkg{amsmath} package, for reasons
discussed in \fn{technote.tex}.

%% ------------------------------------------------------------------ %%

\section{Continued fractions}

The continued fraction\index{continued fractions}
\begin{equation}
\cfrac{1}{\sqrt{2}+
 \cfrac{1}{\sqrt{2}+
  \cfrac{1}{\sqrt{2}+\cdots
}}}
\end{equation}
can be obtained by typing
{\samepage
\begin{verbatim}
\cfrac{1}{\sqrt{2}+
 \cfrac{1}{\sqrt{2}+
  \cfrac{1}{\sqrt{2}+\dotsb
}}}
\end{verbatim}
}% End of \samepage
This produces better-looking results than straightforward use of
\cn{frac}. Left or right placement of any of the numerators is
accomplished by using \cn{cfrac}|[l]| or \cn{cfrac}|[r]| instead of
\cn{cfrac}.\index{options!adjust positioning}%
\index{fractions|)}

%% ------------------------------------------------------------------ %%

\section{Smash options}

The command \cn{smash} is used to typeset a subformula with an
effective height and depth of zero, which is sometimes
useful in adjusting the subformula's position with respect to adjacent
symbols. With the \nipkg{amsmath} package \cn{smash} has optional
arguments\index{options!behavior of particular options}
|[t]|\index{t option@\texttt{t} (top) option} and
|[b]|\index{b option@\texttt{b} (bottom) option} because occasionally it is
advantageous to be able to \qq{smash} only the top or only the bottom
of something while retaining the natural depth or height. For example,
when adjacent radical symbols are unevenly sized or positioned because
of differences in the height and depth of their contents, \cn{smash}
can be employed to make them more consistent. Compare
$\sqrt{x}+\sqrt{y}+\sqrt{z}$ and $\sqrt{x}+\sqrt{\smash[b]{y}}+\sqrt{z}$,
where the latter was produced by
\verb"$\sqrt{x}" \verb"+"
\verb"\sqrt{"\5\verb"\smash[b]{y}}" \verb"+" \verb"\sqrt{z}$".

%% ------------------------------------------------------------------ %%

\section{Delimiters}

\index{delimiters|(}

\subsection{Delimiter sizes}\label{bigdel}

The automatic delimiter sizing done by \cn{left} and \cn{right} has two
limitations: First, it is applied mechanically to produce delimiters
large enough to encompass the largest contained item, and second, the
range of sizes is not even approximately continuous but has fairly large
quantum jumps. This means that a math fragment that is infinitesimally
too large for a given delimiter size will get the next larger size, a
jump of 3pt or so in normal-sized text. There are two or three
situations where the delimiter size is commonly adjusted, using a set of
commands that have `big' in their names.%
\index{delimiters!fixed size|(}
\begin{ctab}{l|llllll}
Delimiter&
  text& \ncn{left}& \ncn{bigl}& \ncn{Bigl}& \ncn{biggl}& \ncn{Biggl}\\
size&
  size& \ncn{right}& \ncn{bigr}& \ncn{Bigr}& \ncn{biggr}& \ncn{Biggr}\\
\hline
Result\vstrut{5ex}&
  $\displaystyle(b)(\frac{c}{d})$&
  $\displaystyle\left(b\right)\left(\frac{c}{d}\right)$&
  $\displaystyle\bigl(b\bigr)\bigl(\frac{c}{d}\bigr)$&
  $\displaystyle\Bigl(b\Bigr)\Bigl(\frac{c}{d}\Bigr)$&
  $\displaystyle\biggl(b\biggr)\biggl(\frac{c}{d}\biggr)$&
  $\displaystyle\Biggl(b\Biggr)\Biggl(\frac{c}{d}\Biggr)$
\end{ctab}
The first kind of situation is a cumulative operator with limits above
and below. With \cn{left} and \cn{right} the delimiters usually turn out
larger than necessary, and using the |Big| or |bigg|
sizes\index{big@\cn{big}, \cn{Big}, \cn{bigg}, \dots\ delimiters}
instead gives better results:
\begin{equation*}
\left[\sum_i a_i\left\lvert\sum_j x_{ij}\right\rvert^p\right]^{1/p}
\quad\text{versus}\quad
\biggl[\sum_i a_i\Bigl\lvert\sum_j x_{ij}\Bigr\rvert^p\biggr]^{1/p}
\end{equation*}
\begin{verbatim}
\biggl[\sum_i a_i\Bigl\lvert\sum_j x_{ij}\Bigr\rvert^p\biggr]^{1/p}
\end{verbatim}
The second kind of situation is clustered pairs of delimiters where
\cn{left} and \cn{right} make them all the same size (because that is
adequate to cover the encompassed material) but what you really want
is to make some of the delimiters slightly larger to make the nesting
easier to see.
\begin{equation*}
\left((a_1 b_1) - (a_2 b_2)\right)
\left((a_2 b_1) + (a_1 b_2)\right)
\quad\text{versus}\quad
\bigl((a_1 b_1) - (a_2 b_2)\bigr)
\bigl((a_2 b_1) + (a_1 b_2)\bigr)
\end{equation*}
\begin{verbatim}
\left((a_1 b_1) - (a_2 b_2)\right)
\left((a_2 b_1) + (a_1 b_2)\right)
\quad\text{versus}\quad
\bigl((a_1 b_1) - (a_2 b_2)\bigr)
\bigl((a_2 b_1) + (a_1 b_2)\bigr)
\end{verbatim}
The third kind of situation is a slightly oversize object in running
text, such as $\left\lvert\frac{b'}{d'}\right\rvert$ where the
delimiters produced by \cn{left} and \cn{right} cause too much line
spreading. In that case \ncn{bigl} and \ncn{bigr}\index{big@\cn{big},
\cn{Big}, \cn{bigg}, \dots\ delimiters} can be used to produce
delimiters that are slightly larger than the base size but still able to
fit within the normal line spacing:
$\bigl\lvert\frac{b'}{d'}\bigr\rvert$.

In ordinary \latex/ \ncn{big}, \ncn{bigg}, \ncn{Big}, and \ncn{Bigg}
delimiters aren't scaled properly over the full range of \latex/ font
sizes.  With the \nipkg{amsmath} package they are.%
\index{delimiters!fixed size|)}

\subsection{Vertical bar notations}

The \nipkg{amsmath} package provides commands \cn{lvert}, \cn{rvert},
\cn{lVert}, \cn{rVert} (compare \cn{langle}, \cn{rangle}) to address the
%problem of overloading for the vert bar character \qc{\|}. This
problem of overloading for the vert bar character \qcvert. This
character is currently used in \latex/ documents to represent a wide
variety of mathematical objects: the `divides' relation in a
number-theory expression like $p\vert q$, or the absolute-value
operation $\lvert z\rvert$, or the `such that' condition in set
notation, or the `evaluated at' notation $f_\zeta(t)\bigr\rvert_{t=0}$.
The multiplicity of uses in itself is not so bad; what is bad, however,
is that fact that not all of the uses take the same typographical
treatment, and that the complex discriminatory powers of a knowledgeable
reader cannot be replicated in computer processing of mathematical
documents. It is recommended therefore that there should be a one-to-one
correspondence in any given document between the vert bar character
%\qc{\|} and a selected mathematical notation, and similarly for the
\qcvert\ and a selected mathematical notation, and similarly for the
%double-bar command \ncn{\|}\index{"|@\verb"*+"\"|+}. This immediately
double-bar command \cnvert. This immediately
rules out the use of \qc{|}
%and \ncn{\|}\index{"|@\verb"*+"\"|+} for delimiters, because left and right
and \cnvert\ for delimiters, because left and right
delimiters are distinct usages that do not relate in the same way to
adjacent symbols; recommended practice is therefore to define suitable
commands in the document preamble for any paired-delimiter use of vert
bar symbols:
\begin{verbatim}
\providecommand{\abs}[1]{\lvert#1\rvert}
\providecommand{\norm}[1]{\lVert#1\rVert}
\end{verbatim}
whereupon the document would contain |\abs{z}| to produce $\lvert
z\rvert$ and |\norm{v}| to produce $\lVert v\rVert$.
The \pkg{mathools} provides the command \cn{DeclarePairedDelimiter}
for defining |\abs|-like macros with scaling delimiters.
\index{delimiters|)}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\chapter{Operator names}

\section{Defining new operator names}\label{s:opname}

Math functions\index{operator names}\relax \index{function
names|see{operator names}} such as $\log$, $\sin$, and $\lim$ are
traditionally typeset in roman type to make them visually more distinct
from one-letter math variables, which are set in math italic. The more
common ones have predefined names, \cn{log}, \cn{sin}, \cn{lim}, and so
forth, but new ones come up all the time in mathematical papers, so the
\nipkg{amsmath} package provides a general mechanism for defining new
`operator names'. To define a math function \ncn{xxx} to work like
\cn{sin}, you write
\begin{verbatim}
\DeclareMathOperator{\xxx}{xxx}
\end{verbatim}
whereupon ensuing uses of \ncn{xxx} will produce {\upshape xxx} in the
proper font and automatically add proper spacing\index{horizontal
spacing!around operator names} on either side when necessary, so that you
get $A\xxx B$ instead of $A\mathrm{xxx}B$. In the second argument of
\cn{DeclareMathOperator} (the name text), a pseudo-text mode prevails:
the hyphen character \qc{\-} will print as a text hyphen rather than a
minus sign and an asterisk \qc{\*} will print as a raised text asterisk
instead of a centered math star. (Compare
\textit{a}-\textit{b}*\textit{c} and $a-b*c$.) But otherwise the name
text is printed in math mode, so that you can use, e.g., subscripts and
superscripts there.

%%%%xxx%%%\enlargethispage{1\baselineskip}
If the new operator should have subscripts and superscripts placed in
`limits' position above and below as with $\lim$, $\sup$, or $\max$, use
the \qc{\*} form of the \cn{DeclareMathOperator} command:
\begin{verbatim}
\DeclareMathOperator*{\Lim}{Lim}
\end{verbatim}
See also the discussion of subscript placement in
Section~\ref{subplace}.

\goodbreak

The following operator names are predefined:

\vspace{-1\baselineskip}
\begin{ctab}{@{}rlrlrlrl}
\cn{arccos}& $\arccos$ &\cn{deg}& $\deg$ &      \cn{lg}& $\lg$ &        \cn{projlim}& $\projlim$\\
\cn{arcsin}& $\arcsin$ &\cn{det}& $\det$ &      \cn{lim}& $\lim$ &      \cn{sec}& $\sec$\\
\cn{arctan}& $\arctan$ &\cn{dim}& $\dim$ &      \cn{liminf}& $\liminf$ &\cn{sin}& $\sin$\\
\cn{arg}& $\arg$ &      \cn{exp}& $\exp$ &      \cn{limsup}& $\limsup$ &\cn{sinh}& $\sinh$\\
\cn{cos}& $\cos$ &      \cn{gcd}& $\gcd$ &      \cn{ln}& $\ln$ &        \cn{sup}& $\sup$\\
\cn{cosh}& $\cosh$ &    \cn{hom}& $\hom$ &      \cn{log}& $\log$ &      \cn{tan}& $\tan$\\
\cn{cot}& $\cot$ &      \cn{inf}& $\inf$ &      \cn{max}& $\max$ &      \cn{tanh}& $\tanh$\\
\cn{coth}& $\coth$ &    \cn{injlim}& $\injlim$ &\cn{min}& $\min$\\
\cn{csc}& $\csc$ &      \cn{ker}& $\ker$ &      \cn{Pr}& $\Pr$
\end{ctab}
\par\nobreak
\vspace{-1.2\baselineskip}
\begin{ctab}{rlrl}
\cn{varinjlim}&  $\displaystyle\varinjlim$&
\cn{varliminf}&  $\displaystyle\varliminf$\\
\cn{varprojlim}& $\displaystyle\varprojlim$&
\cn{varlimsup}&  $\displaystyle\varlimsup$
\end{ctab}

There is also a command \cn{operatorname} such that using
\begin{verbatim}
\operatorname{abc}
\end{verbatim}
in a math formula is equivalent to a use of \ncn{abc} defined by
\cn{DeclareMathOperator}. This may be occasionally useful for
constructing more complex notation or other purposes. (Use the variant
\cn{operatorname*} to get limits.)

%% ------------------------------------------------------------------ %%

\section{\cn{mod} and its relatives}

Commands \cn{mod}, \cn{bmod}, \cn{pmod}, \cn{pod} are provided to deal
with the special spacing conventions of \qq{mod} notation. \cn{bmod} and
\cn{pmod} are available in \latex/, but with the \nipkg{amsmath} package
the spacing of \cn{pmod} will adjust to a smaller value if it's used in
a non-display-mode formula. \cn{mod} and \cn{pod} are variants of
\cn{pmod} preferred by some authors; \cn{mod} omits the parentheses,
whereas \cn{pod} omits the \qq{mod} and retains the parentheses.
\begin{equation}
\gcd(n,m\bmod n);\quad x\equiv y\pmod b;
\quad x\equiv y\mod c;\quad x\equiv y\pod d
\end{equation}
\begin{verbatim}
\gcd(n,m\bmod n);\quad x\equiv y\pmod b;
\quad x\equiv y\mod c;\quad x\equiv y\pod d
\end{verbatim}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\enlargethispage{1\baselineskip}

\chapter{The \cn{text} command}\label{text}

The main use of the command \cn{text} is for words or
phrases\index{text fragments inside math} in a display. It is very
similar to the \latex/ command \cn{mbox} in its effects, but has a
couple of advantages. If you want a word or phrase of text in a
subscript, you can type |..._{\textrm{word or phrase}}|, which is slightly
easier than the \cn{mbox} equivalent: |..._{\mbox{\rmfamily\scriptsize| |word|
|or| |phrase}}|. Note that the standard \cn{textrm} command will use the
\nipkg{amsmath} \cn{text} definition, but ensure the \verb+\rmfamily+
font is used.
\begin{equation}
f_{[x_{i-1},x_i]} \text{ is monotonic,}
\quad i = 1,\dots,c+1
\end{equation}
\begin{verbatim}
f_{[x_{i-1},x_i]} \text{ is monotonic,}
\quad i = 1,\dots,c+1
\end{verbatim}

The font used for \cn{text} is the same as that of the surrounding
environment; i.e., within a theorem, the contents of \cn{text} will
be set in italic.

If a math expression is included in a \cn{text} string, it must be
explicitly marked as math (|$...$|).
\[
\partial_s f(x) = \frac{\partial}{\partial x_0} f(x)\quad
  \text{for $x= x_0 + I x_1$.}
\]
\begin{verbatim}
\partial_s f(x) = \frac{\partial}{\partial x_0} f(x)\quad
  \text{for $x= x_0 + I x_1$.}
\end{verbatim}

Function names should \emph{not} be entered as \cn{text}.  Instead,
use \cn{mathrm} or \cn{DeclareMathOperator} as appropriate.  These are
fixed entities that should not change depending on outside content
(such as appearing within a theorem that is set in italic), and in the
case of declared operators, proper spacing\index{horizontal
spacing!around operator names} is applied automatically.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\chapter{Integrals and sums}

\section{Multiline subscripts and superscripts}

The \cn{substack} command can be used to produce a multiline subscript
or superscript:\index{subscripts and superscripts!multiline}\relax
\index{superscripts|see{subscripts and superscripts}} for example
\begin{ctab}{ll}
\begin{minipage}[t]{.6\columnwidth}
\begin{verbatim}
\sum_{\substack{
         0\le i\le m\\
         0<j<n}}
  P(i,j)
\end{verbatim}
\end{minipage}
&
$\displaystyle
\sum_{\substack{0\le i\le m\\ 0<j<n}} P(i,j)$
\end{ctab}
A slightly more generalized form is the \env{subarray} environment which
allows you to specify that each line should be left-aligned instead of
centered, as here:
\begin{ctab}{ll}
\begin{minipage}[t]{.6\columnwidth}
\begin{verbatim}
\sum_{\begin{subarray}{l}
        i\in\Lambda\\ 0<j<n
      \end{subarray}}
 P(i,j)
\end{verbatim}
\end{minipage}
&
$\displaystyle
  \sum_{\begin{subarray}{l}
        i\in \Lambda\\ 0<j<n
      \end{subarray}}
 P(i,j)$
\end{ctab}

%% ------------------------------------------------------------------ %%

\section{The \cn{sideset} command}\label{sideset}

There's also a command called \cn{sideset}, for a rather special
purpose: putting symbols at the subscript and
superscript\index{subscripts and superscripts!on sums} corners of a
large operator symbol such as $\sum$ or $\prod$. \emph{Note: this
command is not designed to be applied to anything other than sum-class
symbols.} The prime
example is the case when you want to put a prime on a sum symbol. If
there are no limits above or below the sum, you could just use
\cn{nolimits}: here's
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|\sum\nolimits' E_n| in display mode:
\begin{equation}
\sum\nolimits' E_n
\end{equation}
If, however, you want not only the prime but also something below or
above the sum symbol, it's not so easy\mdash indeed, without
\cn{sideset}, it would be downright difficult. With \cn{sideset}, you
can write
\begin{ctab}{ll}
\begin{minipage}[t]{.6\columnwidth}
\begin{verbatim}
\sideset{}{'}
  \sum_{n<k,\;\text{$n$ odd}} nE_n
\end{verbatim}
\end{minipage}
&$\displaystyle
\sideset{}{'}\sum_{n<k,\;\text{$n$ odd}} nE_n
$
\end{ctab}
The extra pair of empty braces is explained by the fact that
\cn{sideset} has the capability of putting an extra symbol or symbols at
each corner of a large operator; to put an asterisk at each corner of a
product symbol, you would type
\begin{ctab}{ll}
\begin{minipage}[t]{.6\columnwidth}
\begin{verbatim}
\sideset{_*^*}{_*^*}\prod
\end{verbatim}
\end{minipage}
&$\displaystyle
\sideset{_*^*}{_*^*}\prod
$
\end{ctab}

%% ------------------------------------------------------------------ %%

\section{Placement of subscripts and limits}\label{subplace}

The default positioning for subscripts depends on the
base symbol involved. The default for sum-class symbols is
`displaylimits' positioning: When a sum-class symbol appears
in a displayed formula, subscript and superscript are placed in `limits'
position above and below, but in an inline formula, they are placed to
the side, to avoid unsightly and wasteful spreading of the
surrounding text lines.
The default for integral-class symbols is to have sub- and
superscripts always to the side, even in displayed formulas.
(See the discussion of the \opt{intlimits} and related
options\index{options!behavior of particular options} in
Section~\ref{options}.)

Operator names such as $\sin$ or $\lim$ may have either `displaylimits'
or `limits' positioning depending on how they were defined. The standard
operator names are defined according to normal mathematical usage.

The commands \cn{limits} and \cn{nolimits} can be used to override the
normal behavior of a base symbol:
\begin{equation*}
\sum\nolimits_X,\qquad \iint\limits_{A},
\qquad\varliminf\nolimits_{n\to \infty}
\end{equation*}
To define a command whose subscripts follow the
same `displaylimits' behavior as \cn{sum}, put
\cn{displaylimits} at the tail end of the definition. When multiple
instances of \cn{limits}, \cn{nolimits}, or \cn{displaylimits} occur
consecutively, the last one takes precedence.

%% ------------------------------------------------------------------ %%

\section{Multiple integral signs}

\cn{iint}, \cn{iiint}, and \cn{iiiint} give multiple integral
signs\index{integrals!multiple} with the spacing between them nicely
adjusted, in both text and display style. \cn{idotsint} is an extension
of the same idea that gives two integral signs with dots between them.
\begin{gather}
\iint\limits_A f(x,y)\,dx\,dy\qquad\iiint\limits_A
f(x,y,z)\,dx\,dy\,dz\\
\iiiint\limits_A
f(w,x,y,z)\,dw\,dx\,dy\,dz\qquad\idotsint\limits_A f(x_1,\dots,x_k)
\end{gather}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\chapter{Commutative diagrams}\label{s:commdiag}
\index{commutative diagrams}

Some commutative diagram commands like the ones in \amstex/ are
available as a separate package, \pkg{amscd}. For complex commutative
diagrams authors will need to turn to more comprehensive packages like
\tikz/\index{TikZ@\tikz/ package} (in particular, \pkg{tikz-cd})
or \xypic/\index{XY-pic@\xypic/ package},
but for simple diagrams without diagonal
arrows\index{arrows!in commutative diagrams} the \pkg{amscd} commands
may be more convenient. Here is one example.
\begin{equation*}
\begin{CD}
S^{\mathcal{W}_\Lambda}\otimes T   @>j>>   T\\
@VVV                                    @VV{\End P}V\\
(S\otimes T)/I                  @=      (Z\otimes T)/J
\end{CD}
\end{equation*}
\begin{verbatim}
\begin{CD}
S^{\mathcal{W}_\Lambda}\otimes T   @>j>>   T\\
@VVV                                    @VV{\End P}V\\
(S\otimes T)/I                  @=      (Z\otimes T)/J
\end{CD}
\end{verbatim}
In the \env{CD} environment the commands |@>>>|,
|@<<<|, |@VVV|, and |@AAA| give respectively right, left, down, and up
arrows. For the horizontal arrows, material between the first and second
|>| or |<| symbols will be typeset as a superscript, and material
between the second and third will be typeset as a subscript. Similarly,
material between the first and second or second and third |A|s or |V|s
of vertical arrows will be typeset as left or right \qq{sidescripts}.
The commands |@=| and \verb'@|' give horizontal and vertical double lines.
A \qq{null arrow} command |@.| can be used instead of a visible arrow
to fill out an array where needed.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\chapter{Using math fonts}

\section{Introduction}

For more comprehensive information on font use in \latex/, see the
\latex/ font guide (\fn{fntguide.tex}) or \booktitle{The \latex/
Companion} \cite{tlc2}. The basic set of math font commands\index{math
fonts}\relax \index{math symbols|see{math fonts}} in \latex/ includes
\cn{mathbf}, \cn{mathrm}, \cn{mathcal}, \cn{mathsf}, \cn{mathtt},
\cn{mathit}. Additional math alphabet commands such as
\cn{mathbb} for blackboard bold, \cn{mathfrak} for Fraktur, and
\cn{mathscr} for Euler script are available through the packages
\pkg{amsfonts} and \pkg{euscript} (distributed separately).

%% ------------------------------------------------------------------ %%
\enlargethispage{1\baselineskip}

\section{Recommended use of math font commands}

If you find yourself employing math font commands frequently in your
document, you might wish that they had shorter names, such as \ncn{mb}
instead of \cn{mathbf}. Of course, there is nothing to keep you from
providing such abbreviations for yourself by suitable \cn{newcommand}
statements. But for \latex/ to provide shorter names would actually be a
disservice to authors, as that would obscure a much better alternative:
defining custom command names derived from the names of the underlying
mathematical objects, rather than from the names of the fonts used to
distinguish the objects. For example, if you are using bold to indicate
vectors, then you will be better served in the long run if you define a
`vector' command instead of a `math-bold' command:
\begin{verbatim}
  \newcommand{\vect}[1]{\mathbf{#1}}
\end{verbatim}
you can write |\vect{a} + \vect{b}| to produce $\vect{a} +
\vect{b}$.
If you decide several months down the road that you want to use the bold
font for some other purpose, and mark vectors by a small over-arrow
instead, then you can put the change into effect merely by changing the
definition of \ncn{vect}; otherwise you would have to replace all
occurrences of \cn{mathbf} throughout your document, perhaps even
needing to inspect each one to see whether it is indeed
an instance of a vector.

It can also be useful to assign distinct
command names for different letters of a particular font:
\begin{verbatim}
\DeclareSymbolFont{AMSb}{U}{msb}{m}{n}% or use amsfonts package
\DeclareMathSymbol{\C}{\mathalpha}{AMSb}{"43}
\DeclareMathSymbol{\R}{\mathalpha}{AMSb}{"52}
\end{verbatim}
These statements would define the commands \cn{C} and \cn{R} to produce
blackboard-bold letters from the `AMSb' math symbols font. If you refer
often to the\break complex numbers or real numbers in your document, you
might find this method more convenient than (let's say) defining a
\ncn{field} command and writing\break |\field{C}|, |\field{R}|. But for
maximum flexibility and control, define such a \ncn{field} command and
then define \ncn{C} and \ncn{R} in terms of that
command:\indexcs{mathbb}
\begin{verbatim}
\usepackage{amsfonts}% to get the \mathbb alphabet
\newcommand{\field}[1]{\mathbb{#1}}
\newcommand{\C}{\field{C}}
\newcommand{\R}{\field{R}}
\end{verbatim}

%% ------------------------------------------------------------------ %%
\enlargethispage{3\baselineskip}

\section{Bold math symbols}

The \cn{mathbf} command is commonly used to obtain bold Latin letters in
math, but for most other kinds of math symbols it has no effect, or its
effects depend unreliably on the set of math fonts that are in use. For
example, writing
\begin{verbatim}
\Delta \mathbf{\Delta}\mathbf{+}\delta \mathbf{\delta}
\end{verbatim}
produces $\Delta \mathbf{\Delta}\mathbf{+}\delta
\mathbf{\delta}$; the \cn{mathbf} has no effect on the plus
sign or the small delta.
% should be paragraph break; avoid overfull box on next line
The \nipkg{amsmath} package therefore provides two additional commands,
\cn{boldsymbol} and \cn{pmb}, that can be applied to other kinds of math
symbols. \cn{boldsymbol} can be used for a math symbol that remains
unaffected by \cn{mathbf} if (and only if) your current math font set
includes a bold version of that symbol. \cn{pmb} can be used as a last
resort for any math symbols that do not have a true bold version
provided by your set of math fonts; \qq{pmb} stands for \qq{poor man's
bold} and the command works by typesetting multiple copies of the symbol
with slight offsets. The quality of the output is inferior, especially
for symbols that contain any hairline strokes. When the standard default set of
\latex/ math fonts are in use (Computer Modern), the only symbols that
are likely to require \cn{pmb} are large operator symbols like \cn{sum},
extended delimiter\index{delimiters} symbols, or the extra math symbols
provided by the \pkg{amssymb} package \cite{amsfonts}.

The following formula shows some of the results that are possible:
\begin{verbatim}
A_\infty + \pi A_0
\sim \mathbf{A}_{\boldsymbol{\infty}} \boldsymbol{+}
  \boldsymbol{\pi} \mathbf{A}_{\boldsymbol{0}}
\sim\pmb{A}_{\pmb{\infty}} \pmb{+}\pmb{\pi} \pmb{A}_{\pmb{0}}
\end{verbatim}
\begin{equation*}
A_\infty + \pi A_0
\sim \mathbf{A}_{\boldsymbol{\infty}} \boldsymbol{+}
  \boldsymbol{\pi} \mathbf{A}_{\boldsymbol{0}}
\sim\pmb{A}_{\pmb{\infty}} \pmb{+}\pmb{\pi} \pmb{A}_{\pmb{0}}
\end{equation*}
If you want to use only the \cn{boldsymbol} command without loading the
whole \nipkg{amsmath} package, the \pkg{bm} package is recommended (this
is a standard \latex/ package, not an AMS package; you probably have it
already if you have a 1997 or newer version of \latex/).

%% ------------------------------------------------------------------ %%

\section{Italic Greek letters}

For italic versions of the capital Greek letters, the following commands
are provided:
\begin{ctab}{rlrl}
\cn{varGamma}& $\varGamma$& \cn{varSigma}& $\varSigma$\\
\cn{varDelta}& $\varDelta$& \cn{varUpsilon}& $\varUpsilon$\\
\cn{varTheta}& $\varTheta$& \cn{varPhi}& $\varPhi$\\
\cn{varLambda}& $\varLambda$& \cn{varPsi}& $\varPsi$\\
\cn{varXi}& $\varXi$& \cn{varOmega}& $\varOmega$\\
\cn{varPi}& $\varPi$
\end{ctab}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\chapter{Error messages and output problems}

\section{General remarks}

This is a supplement to Chapter~8 of the \latex/ manual \cite{lamport}
(first edition: Chapter~6). Appendix~B of the
\textit{Companion}~\cite{tlc2} lists all \latex/ errors including those
for \nipkg{amsmath} with likely causes for each.  For the reader's
convenience, the set of error messages discussed here overlaps
somewhat with the set in those references,
but please be aware that we don't provide exhaustive coverage here.
The error messages are arranged in alphabetical order, disregarding
unimportant text such as |! LaTeX Error:| at the beginning, and
nonalphabetical characters such as \qc{\\}. Where examples are given, we
show also the help messages that appear on screen when you respond to an
error message prompt by entering |h|.

Remember that the important error message is the first for a given line.
When running in nonstop mode, errors accumulate, and the first error
may create a further error condition from which it is impossible to
recover.  In such a situation processing will stop after 100~errors,
so the reporting of genuine errors may not be complete, and it may be
impossible to determine which reported errors are genuine and which
are not.

A final section discusses some output errors, i.e., instances where
the printed document has something wrong but there was no \latex/
error during typesetting.

%% ------------------------------------------------------------------ %%
%% **********
\enlargethispage{-2\baselineskip}

\section{Error messages}

\begin{error}{\begin{split} won't work here.}
\errexa
\begin{verbatim}
! Package amsmath Error: \begin{split} won't work here.
 ...

l.8 \begin{split}

? h
\Did you forget a preceding \begin{equation}?
If not, perhaps the `aligned' environment is what you want.
?
\end{verbatim}
\errexpl
The \env{split} environment does not construct a stand-alone displayed
equation; it needs to be used within some other environment such as
\env{equation} or \env{gather}.

\end{error}

\begin{error}{Erroneous nesting of equation structures}
\errexa
\begin{verbatim}
! Package amsmath Error: Erroneous nesting of equation structures;
(amsmath)                trying to recover with `aligned'.

See the amsmath package documentation for explanation.
Type  H <return>  for immediate help.
 ...

l.260 \end{alignat*}
                    \end{equation*}
\end{verbatim}
\errexpl
The structures \env{align}, \env{alignat}, etc., are designed
for top-level use and for the most part cannot be nested inside some
other displayed equation structure. The chief exception is that
\env{align} and most of its variants can be used inside the
\env{gather} environment.
\end{error}

\begin{error}{Extra & on this line}
\errexa
\begin{verbatim}
! Package amsmath Error: Extra & on this line.

See the amsmath package documentation for explanation.
Type  H <return>  for immediate help.
 ...

l.9 \end{alignat}

? h
\An extra & here is so disastrous that you should probably exit
 and fix things up.
?
\end{verbatim}
\errexpl
In an \env{alignat} structure the number of alignment points per line
is dictated by the numeric argument given after |\begin{alignat}|.
If you use more alignment points in a line it is assumed that you
accidentally left out a newline command \cn{\\} and the above error is
issued.
\end{error}

%% **********
\enlargethispage{1.5\baselineskip}

\begin{error}{Font OMX/cmex/m/n/7=cmex7 not loadable ...}
\errexa
\begin{verbatim}
! Font OMX/cmex/m/n/7=cmex7 not loadable: Metric (TFM) file not found.
<to be read again>
                   relax
l.8 $a
      b+b^2$
? h
I wasn't able to read the size data for this font,
so I will ignore the font specification.
[Wizards can fix TFM files using TFtoPL/PLtoTF.]
You might try inserting a different font spec;
e.g., type `I\font<same font id>=<substitute font name>'.
?
\end{verbatim}
\errexpl
Certain extra sizes of some Computer Modern fonts that were formerly
available mainly through the AMSFonts\index{amsfont@AMSFonts collection}
distribution are considered part of standard \latex/ (as of June 1994):
\fn{cmex7}\ndash \texttt{9}, \fn{cmmib5}\ndash \texttt{9}, and
\fn{cmbsy5}\ndash \texttt{9}. If these extra sizes are missing on your
system, you should try first to get them from the source where you
obtained \latex/. If that fails, you could try getting the fonts from
CTAN (e.g., in the form of Metafont\index{Metafont source files} source
files, directory \nfn{/tex-archive/fonts/latex/mf}, or in PostScript
Type 1 format, directory
\nfn{/tex-archive/fonts/cm/ps-type1/bakoma}\index{BaKoMa fonts}\relax
\index{PostScript fonts}).

If the font name begins with \fn{cmex}, there is a special option%
\index{options!behavior of particular options}
\opt{cmex10} for the \nipkg{amsmath} package that provides a temporary
workaround. I.e., change the \cn{usepackage} to
\begin{verbatim}
\usepackage[cmex10]{amsmath}
\end{verbatim}
This will force the use of the 10-point size of the \fn{cmex} font in
all cases. Depending on the contents of your document this may be
adequate.
\end{error}

\enlargethispage{1\baselineskip}
\begin{error}{Improper argument for math accent}
\errexa
\begin{verbatim}
! Package amsmath Error: Improper argument for math accent:
(amsmath)                Extra braces must be added to
(amsmath)                prevent wrong output.

See the amsmath package documentation for explanation.
Type  H <return>  for immediate help.
 ...

l.415 \tilde k_{\lambda_j} = P_{\tilde \mathcal
                                               {M}}
?
\end{verbatim}
\errexpl
Non-simple arguments for any \LaTeX{} command should be enclosed in
braces. In this example extra braces are needed as follows:
\begin{verbatim}
... P_{\tilde{\mathcal{M}}}
\end{verbatim}
\end{error}

\begin{error}{Math formula deleted: Insufficient extension fonts}
\errexa
\begin{verbatim}
! Math formula deleted: Insufficient extension fonts.
l.8 $ab+b^2$

?
\end{verbatim}
\errexpl
This usually follows a previous error |Font ... not loadable|; see the
discussion of that error (above) for solutions.
\end{error}

\enlargethispage{1\baselineskip}
\begin{error}{Missing number, treated as zero}
\errexa
\begin{verbatim}
! Missing number, treated as zero.
<to be read again>
                   a
l.100 \end{alignat}

? h
A number should have been here; I inserted `0'.
(If you can't figure out why I needed to see a number,
look up `weird error' in the index to The TeXbook.)

?
\end{verbatim}
\errexpl
There are many possibilities that can lead to this error. However, one
possibility that is relevant for the \nipkg{amsmath} package is that you
forgot to give the number argument of an \env{alignat} environment, as
in:
\begin{verbatim}
\begin{alignat}
 a&  =b&    c& =d\\
a'& =b'&   c'& =d'
\end{alignat}
\end{verbatim}
where the first line should read instead
\begin{verbatim}
\begin{alignat}{2}
\end{verbatim}

Another possibility is that you have a left bracket character |[|
following a line break\index{line break} command \cn{\\} in a multiline
construction such as \env{array}, \env{tabular}, or \env{eqnarray}.
This will be interpreted by \latex/ as the beginning of an `additional
vertical space request \cite[\S C.1.6]{lamport}, even if it occurs on the
following line and is intended to be part of the contents. For example,
\begin{verbatim}
\begin{array}{c}
a+b\\
[f,g]\\
m+n
\end{array}
\end{verbatim}
To prevent the error message in such a case, you can
add braces as discussed in the \latex/ manual \cite[\S C.1.1]{lamport}:
\begin{verbatim}
\begin{array}{c}
a+b\\
{[f,g]}\\
m+n
\end{array}
\end{verbatim}
or precede the bracketed expression by \cn{relax}.
\end{error}

\goodbreak

\begin{error}{Missing \right. inserted}
\errexa
\begin{verbatim}
! Missing \right. inserted.
<inserted text>
                \right .
l.10 \end{multline}

? h
I've inserted something that you may have forgotten.
(See the <inserted text> above.)
With luck, this will get me unwedged. But if you
really didn't forget anything, try typing `2' now; then
my insertion and my current dilemma will both disappear.
\end{verbatim}
\errexpl
This error typically arises when you try to insert a
line break\index{line break} or |&|\cnamp\ between a
\cn{left}-\cn{right} pair of delimiters\index{delimiters} in any
multiline environment, including \env{split}.
\begin{verbatim}
\begin{multline}
AAA\left(BBB\\
  CCC\right)
\end{multline}
\end{verbatim}
There are two possible solutions: (1)~instead of using \cn{left} and
\cn{right}, use `big' delimiters\index{delimiters!fixed size} of fixed
size (\cn{bigl} \cn{bigr} \cn{biggl} \cn{biggr} \dots; see
\secref{bigdel}); or (2)~use null delimiters\index{delimiters!null} to
break up the \cn{left}-\cn{right} pair into parts for each line (or cell):
\begin{verbatim}
AAA\left(BBB\right.\\
  \left.CCC\right)
\end{verbatim}
The latter solution may result in mismatched
delimiter\index{delimiters!mismatched sizes} sizes;
ensuring that they match requires using \cn{vphantom} in the segment
that has the smaller delimiter (or possibly \cn{smash} in the segment
that has the larger delimiter). In the argument of \cn{vphantom} put a
copy of the tallest element that occurs in the other segment, e.g.,
\begin{verbatim}
xxx \left(\int_t yyy\right.\\
  \left.\vphantom{\int_t} zzz ... \right)
\end{verbatim}
\end{error}

\goodbreak

\begingroup
\lccode`M=`M
\lccode`@=`\}
\lowercase{\endgroup
\begin{error}{Missing @ inserted}}

\errexa
\begin{verbatim}
! Missing } inserted.
<inserted text>
                \right .
l.10 \end{multline}

? h
I've inserted something that you may have forgotten.
(See the <inserted text> above.)
With luck, this will get me unwedged. But if you
really didn't forget anything, try typing `2' now; then
my insertion and my current dilemma will both disappear.
\end{verbatim}
\errexpl
This error is often the result of using \verb+$+ within a multiline
display environment.  Remove such \verb+$+ signs (except when they
appear within \verb+\text{...}+).
\end{error}

\begin{error}{Old form `\pmatrix' should be \begin{pmatrix}.}
\errexa
\begin{verbatim}
! Package amsmath Error: Old form `\pmatrix' should be
                         \begin{pmatrix}.

See the amsmath package documentation for explanation.
Type  H <return>  for immediate help.
 ...

\pmatrix ->\left (\matrix@check \pmatrix
                                         \env@matrix
l.16 \pmatrix
             {a&b\cr c&d\cr}
? h
`\pmatrix{...}' is old Plain-TeX syntax whose use is
ill-advised in LaTeX.
?
\end{verbatim}
\errexpl
When the \nipkg{amsmath} package is used, the old forms of \cn{pmatrix},
\cn{matrix}, and \cn{cases} cannot be used any longer because of naming
conflicts. Their syntax did not conform with standard \LaTeX{} syntax
in any case.
\end{error}

\enlargethispage{2\baselineskip}
\begin{error}{Paragraph ended before \xxx was complete}
\errexa
\begin{verbatim}
Runaway argument?

! Paragraph ended before \multline was complete.
<to be read again>
                   \par
l.100

? h
I suspect you've forgotten a `}', causing me to apply this
control sequence to too much text. How can we recover?
My plan is to forget the whole thing and hope for the best.
?
\end{verbatim}
\errexpl
This might be produced by a blank line between the |\begin| and |\end|.
Another possibility is a misspelling in the |\end{multline}| command,
e.g.,
\begin{verbatim}
\begin{multline}
...
\end{multiline}
\end{verbatim}
or by using abbreviations for certain environments, such as |\bal| and
|\eal| for |\begin{align}| and |\end{align}|:
\begin{verbatim}
\bal
...
\eal
\end{verbatim}
For technical reasons that kind of abbreviation does not work with
the more complex displayed equation environments of the \nipkg{amsmath} package
(\env{gather}, \env{align}, \env{split}, etc.; cf.\ \fn{technote.tex}).
\end{error}

\begin{error}{Runaway argument?}
See the discussion for the error message
\texttt{Paragraph ended before \ncn{xxx} was complete}.
\end{error}

\begin{error}{Unknown option `xxx' for package `yyy'}
\errexa
\begin{verbatim}
! LaTeX Error: Unknown option `intlim' for package `amsmath'.
...
? h
The option `intlim' was not declared in package `amsmath', perhaps you
misspelled its name. Try typing  <return>  to proceed.
?
\end{verbatim}
\errexpl
This means that you misspelled the option\index{options!unknown}
name, or the package simply does not have an option that you expected
it to have. Consult the documentation for the given package.
\end{error}

%% ------------------------------------------------------------------ %%

\section{Warning messages}

\begin{error}{Cannot use `split' here}
\errexa
\begin{verbatim}
Package amsmath Warning: Cannot use `split' here;
(amsmath)                trying to recover with `aligned'
\end{verbatim}
\errexpl The \env{split} environment is designed to serve as the entire
body of an equation, or an entire line of an \env{align} or \env{gather}
environment. There cannot be any printed material before or
after it within the same enclosing structure:
\begin{verbatim}
\begin{equation}
\left\{ % <-- Not allowed
\begin{split}
...
\end{split}
\right. % <-- Not allowed
\end{equation}
\end{verbatim}
\end{error}

\begin{error}{Foreign command \over [or \atop or \above]}
\errexa
\begin{verbatim}
Package amsmath Warning: Foreign command \over; \frac or \genfrac
(amsmath)                should be used instead.
\end{verbatim}
\errexpl The primitive generalized fraction commands of \tex/\mdash
\cs{over}, \cs{atop}, \cs{above}\mdash are deprecated when the
\nipkg{amsmath} package is used because their syntax is foreign to \latex/
and \nipkg{amsmath} provides native \latex/ equivalents. See
\fn{technote.tex} for further information.
\end{error}

%% ------------------------------------------------------------------ %%

\section{Wrong output}

\begin{erroro}{Section numbers 0.1, 5.1, 8.1 instead of 1, 2, 3}
%
This most likely means that you have the arguments for \cn{numberwithin}
in reverse order:
\begin{verbatim}
\numberwithin{section}{equation}
\end{verbatim}
That means `print the section number as \textit{equation
number}.\textit{section number} and reset to 1 every time an equation
occurs' when what you probably wanted was the inverse
\begin{verbatim}
\numberwithin{equation}{section}
\end{verbatim}
\end{erroro}

\begin{erroro}{The \cn{numberwithin} command had no effect on equation
  numbers}
%
Are you looking at the first section in your document? Check the section
numbers elsewhere to see if the problem is the one described in the
previous item.
\end{erroro}

\begin{erroro}{Bracketed material disappears at the beginning of
  \env{aligned} or \env{gathered}}
%
For most multiline equation environments, \nipkg{amsmath} disables the
\latex/ convention to recognize a [bracketed] expression as an option%
\index{ed env@\texttt{-ed} environments}%
\index{options!positioning of \texttt{-ed} environments}%
\index{options!space before \texttt{[}}
when it occurs at the beginning of an environment or immediately
following \cn{\\}, provided a space intervenes.  This fails at the
beginning of \env{aligned} and \env{gathered}, and is a bug.  Insert
\cn{relax} before the opening brace to restore the desired result.
\end{erroro}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\chapter{Additional information}

\section{Compatibility with other packages}

Several packages have already been mentioned as providing facilities
lacking in \nipkg{amsmath}.

\begin{itemize}
\item \pkg{bm} is recommended for specifying bold math symbols.
\item \pkg{mathtools} provides enhancements to some \nipkg{amsmath}
  environments as well as additional compatible features, such as
  \env{rcases} (similar to \env{cases} but with the brace on the
  right-hand side), \env{multlined} (a subsidiary environment
  comparable to \env{multline}), and \cn{shortintertext} (more
  compact spacing than \cn{intertext}).  If \pkg{mathtools} is used,
  \nipkg{amsmath} is loaded automatically, so it is not necessary
  to load it separately.
\item \pkg{unicode-math} provides commands for (most?)\ math symbols
  in Unicode.
%\item \pkg{empheq}
\end{itemize}

These packages have known problems when used with \nipkg{amsmath}.
\begin{itemize}
\item \pkg{lineno} may omit numbers before display environments.
\item \pkg{breqn} redefines a number of commands from other packages,
  so is best loaded after \nipkg{amsmath} and other packages with math
  facilities.\\ \pkg{breqn} is not yet totally stable, and a number of
  bugs have been reported via \texttt{tex.stackexchange} \cite{tex-sx}.
\item \pkg{wasysym}, \pkg{mathabx} and perhaps other font packages also
  define multiple integrals\index{integrals!multiple} using the same
  names as \nipkg{amsmath}.
\end{itemize}

%% ------------------------------------------------------------------ %%

\section{Converting existing documents}

\subsection{Converting from plain \LaTeX{}}

A \LaTeX{} document will typically continue to work the same in most
respects if \verb'\usepackage{amsmath}' is added in the document
preamble. By default, however, the \nipkg{amsmath} package suppresses page
breaks inside multiple-line displayed equation structures such as
\env{eqnarray}, \env{align}, and \env{gather}. To continue allowing page
breaks inside \env{eqnarray} after switching to \nipkg{amsmath}, you will
need to add the following line in your document preamble:
\begin{verbatim}
\allowdisplaybreaks[1]
\end{verbatim}
To ensure normal spacing around relation symbols, you might also want to
change \env{eqnarray} to \env{align}, \env{multline}, or
\env{equation}\slash\env{split} as appropriate.

Most of the other differences in \nipkg{amsmath} usage can be considered
optional refinements, e.g., using
\begin{verbatim}
\DeclareMathOperator{\Hom}{Hom}
\end{verbatim}
instead of \verb'\newcommand{\Hom}{\mbox{Hom}}'.

\subsection{Converting from \texorpdfstring{\amslatex/}{amslatex} 1.1}
See \fn{diffs-m.txt}.

%% ------------------------------------------------------------------ %%

\section{Technical notes}
The file \fn{technote.tex} contains some remarks on miscellaneous
technical questions that are less likely to be of general interest.

%% ------------------------------------------------------------------ %%

\section{Getting help}

The \nipkg{amsmath} collection of packages is maintained by the \latex/
team \cite{ltx-team}.  Bugs should be reported using the instructions
at \url{https://www.latex-project.org/bugs/}.
Please be careful not to confuse \nipkg{amsmath} with the AMS document
classes (\cls{amsart}, \cls{amsbook}, and \cls{amsproc}), which
automatically incorporate \nipkg{amsmath}; bugs in the classes should
be reported directly to AMS, by email to \mail{tech-support@ams.org}.

%Questions or comments regarding \nipkg{amsmath} and related packages
%should be sent to:
%\begin{infoaddress}
%American Mathematical Society\\
%Technical Support\\
%Electronic Products and Services\\
%P. O. Box 6248\\
%Providence, RI 02940\\[3pt]
%Phone: 800-321-4AMS (321-4267) \quad or \quad 401-455-4080\\
%Internet: \mail{tech-support@ams.org}
%\end{infoaddress}
%If you are reporting a problem you should include
%the following information to make proper investigation possible:
%\begin{enumerate}
%\item The source file where the problem occurred, preferably reduced
%  to minimum size by removing any material that can be removed without
%  affecting the observed problem.
%\item A \latex/ log file showing the error message (if applicable) and
%  the version numbers of the document class and option files being used.
%\end{enumerate}

The online forum\index{online Q\,\&\,A forum} \texttt{tex.stackexchange}
\cite{tex-sx} is a good source of answers to common questions on usage.
Look first in the archive to see if your question has already been asked
and answered; if it has not, post your own question.

There is an online discussion group called \fn{comp.text.tex} \cite{ctt}
that is a fairly good source of information about \latex/ and \tex/ in
general. This group, formerly a Unix newsgroup, predates
\texttt{tex.stackexchange} by decades, and the archives can be a useful
resource for historical investigation.

%% ------------------------------------------------------------------ %%

\section{Of possible interest}\label{a:possible-interest}
Information about obtaining AMSFonts or other \tex/-related
software from the AMS web server at \fn{www.ams.org}
can be obtained by sending an email request to
\mail{tech-support@ams.org}.  This software is also posted on
CTAN\index{CTAN (Comprehensive \TeX\ Archive Network)} and included
in distributions based on \TeX\,Live\index{TEX Live@\TeX\,Live}.

The \tex/ Users Group\index{TeX Users@\tex/ Users Group} is a nonprofit
organization that publishes a journal
(\journalname{TUGboat}\index{TUGboat@\journalname{TUGboat}}), holds
meetings, and serves as a clearinghouse for general information about
\tex/ and \tex/-related software.
\begin{infoaddress}
\tex/ Users Group\\
PO Box 2311\\
Portland, OR 97208-2311\\
USA\\[3pt]
Phone: +1-503-223-9994\\
Email: \mail{office@tug.org}
\end{infoaddress}
Membership in the \tex/ Users Group is a good way to support continued
development of free \tex/-related software. There are also many local
\tex/ user groups in other countries; information about contacting a
local user group can be gotten from the \tex/ Users Group.

\index{amsmath@\texttt{amsmath} package|)}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newpage

\begin{thebibliography}{10}
\addcontentsline{toc}{chapter}{\bibname}

\raggedright

\bibsubhead{References in print}

\bibitem{mil} George Gr\"atzer, \booktitle{More Math into \latex/}, fifth ed.,
Springer, New York, 2016.
% Deal with a line breaking problem
%\begin{raggedright}
%\bibitem{mil} G. Gr\"{a}tzer,
%\emph{Math into \LaTeX{}: An Introduction to \LaTeX{} and AMS-\LaTeX{}}
%  \url{https://www.ams.org/cgi-bin/bookstore/bookpromo?fn=91&arg1=bookvideo&itmc=MLTEX},
%Birkh\"{a}user, Boston, 1995.\par
%\end{raggedright}

\bibitem{kn} Donald E. Knuth, \booktitle{The \tex/book},
Addison-Wesley, Reading, MA, 1984.

\bibitem{lamport} Leslie Lamport, \booktitle{\latex/: A document preparation
system}, 2nd revised ed., Addison-Wesley, Reading, MA, 1994.

\bibitem{tlc2} Frank Mittelbach, Michel Goossens, et al.,
\booktitle{The \latex/ companion}, second ed., Addison-Wesley, Reading,
MA, 2004.  This is now also available as an ebook, in both English and
German; see \url{https://www.latex-project.org/help/books/}.
The front matter, including the full Table of Contents, can be viewed
online, from a link on the same page.
%Michel Goossens, Frank Mittelbach, and Alexander Samarin,
%\booktitle{The \latex/ companion}, Addison-Wesley, Reading, MA, 1994.
%  [\emph{Note: The 1994 edition is not a reliable guide for the
%    \nipkg{amsmath} package unless you refer to the errata for Chapter
%    8\mdash file \fn{compan.err}, distributed with \LaTeX{}.}]

\bibitem{msf} Frank Mittelbach and Rainer Sch\"opf,
\textit{The new font family selection\mdash user
interface to standard \latex/}, \journalname{TUGboat} \textbf{11},
no.~2 (June 1990), pp.~297\ndash 305.

\bibitem{jt} Michael Spivak, \booktitle{The joy of \tex/}, 2nd revised ed.,
Amer. Math. Soc., Providence, RI, 1990.

\bibsubhead{Package documentation}

\bibitem{amshandbk}\booktitle{AMS author handbook}, separate versions
for journal articles, monographs and proceedings articles, Amer. Math.
Soc., Providence, RI, 2017;
\url{https://www.ams.org/publications/authors/tex/author-handbook}.

\bibitem{amsfonts}\booktitle{AMSFonts version \textup{2.2d}\mdash user's guide},
Amer. Math. Soc., Providence, RI, 2002; distributed
with the AMSFonts package
\url{http://mirror.ctan.org/tex-archive/fonts/amsfonts/doc/amsfndoc.pdf}.

\bibitem{amsthdoc}\booktitle{Using the \pkg{amsthm} Package}, version 2.20.3,
Amer. Math. Soc., Providence, RI, 2017;
\url{http://mirror.ctan.org/tex-archive/macros/latex/required/amscls/doc/amsthdoc.pdf}.

\bibitem{mt} Morten H{\o}gholm, Lars Madsen, \booktitle{The \pkg{mathtools}
package}, 2018;
\url{http://mirror.ctan.org/tex-archive/macros/latex/contrib/mathtools/mathtools.pdf}.

\bibsubhead{Online resources}

\bibitem{ltx-team} The \latex/ Project, \url{https://www.latex-project.org}.

\bibitem{ctt} Online discussion group \texttt{comp.text.tex},
\url{https://groups.google.com/forum/\#!forum/comp.text.tex}.

\bibitem{tex-sx} Online question and answer forum \texttt{tex.stackexchange},
\url{https://tex.stackexchange.com}.

\end{thebibliography}

\printindex

\end{document}