summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/caption/caption.dtx
blob: 14392efea805c1fdea4dbfe78a6d65cd3b40e48f (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
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083
4084
4085
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105
4106
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116
4117
4118
4119
4120
4121
4122
4123
4124
4125
4126
4127
4128
4129
4130
4131
4132
4133
4134
4135
4136
4137
4138
4139
4140
4141
4142
4143
4144
4145
4146
4147
4148
4149
4150
4151
4152
4153
4154
4155
4156
4157
4158
4159
4160
4161
4162
4163
4164
4165
4166
4167
4168
4169
4170
4171
4172
4173
4174
4175
4176
4177
4178
4179
4180
4181
4182
4183
4184
4185
4186
4187
4188
4189
4190
4191
4192
4193
4194
4195
4196
4197
4198
4199
4200
4201
4202
4203
4204
4205
4206
4207
4208
4209
4210
4211
4212
4213
4214
4215
4216
4217
4218
4219
4220
4221
4222
4223
4224
4225
4226
4227
4228
4229
4230
4231
4232
4233
4234
4235
4236
4237
4238
4239
4240
4241
4242
4243
4244
4245
4246
4247
4248
4249
4250
4251
4252
4253
4254
4255
4256
4257
4258
4259
4260
4261
4262
4263
4264
4265
4266
4267
4268
4269
4270
4271
4272
4273
4274
4275
4276
4277
4278
4279
4280
4281
4282
4283
4284
4285
4286
4287
4288
4289
4290
4291
4292
4293
4294
4295
4296
4297
4298
4299
4300
4301
4302
4303
4304
4305
4306
4307
4308
4309
4310
4311
4312
4313
4314
4315
4316
4317
4318
4319
4320
4321
4322
4323
4324
4325
4326
4327
4328
4329
4330
4331
4332
4333
4334
4335
4336
4337
4338
4339
4340
4341
4342
4343
4344
4345
4346
4347
4348
4349
4350
4351
4352
4353
4354
4355
4356
4357
4358
4359
4360
4361
4362
4363
4364
4365
4366
4367
4368
4369
4370
4371
4372
4373
4374
4375
4376
4377
4378
4379
4380
4381
4382
4383
4384
4385
4386
4387
4388
4389
4390
4391
4392
4393
4394
4395
4396
4397
4398
4399
4400
4401
4402
4403
4404
4405
4406
4407
4408
4409
4410
4411
4412
4413
4414
4415
4416
4417
4418
4419
4420
4421
4422
4423
4424
4425
4426
4427
4428
4429
4430
4431
4432
4433
4434
4435
4436
4437
4438
4439
4440
4441
4442
4443
4444
4445
4446
4447
4448
4449
4450
4451
4452
4453
4454
4455
4456
4457
4458
4459
4460
4461
4462
4463
4464
4465
4466
4467
4468
4469
4470
4471
4472
4473
4474
4475
4476
4477
4478
4479
4480
4481
4482
4483
4484
4485
4486
4487
4488
4489
4490
4491
4492
4493
4494
4495
4496
4497
4498
4499
4500
4501
4502
4503
4504
4505
4506
4507
4508
4509
4510
4511
4512
4513
4514
4515
4516
4517
4518
4519
4520
4521
4522
4523
4524
4525
4526
4527
4528
4529
4530
4531
4532
4533
4534
4535
4536
4537
4538
4539
4540
4541
4542
4543
4544
4545
4546
4547
4548
4549
4550
4551
4552
4553
4554
4555
4556
4557
4558
4559
4560
4561
4562
4563
4564
4565
4566
4567
4568
4569
4570
4571
4572
4573
4574
4575
4576
4577
4578
4579
4580
4581
4582
4583
4584
4585
4586
4587
4588
4589
4590
4591
4592
4593
4594
4595
4596
4597
4598
4599
4600
4601
4602
4603
4604
4605
4606
4607
4608
4609
4610
4611
4612
4613
4614
4615
4616
4617
4618
4619
4620
4621
4622
4623
4624
4625
4626
4627
4628
4629
4630
4631
4632
4633
4634
4635
4636
4637
4638
4639
4640
4641
4642
4643
4644
4645
4646
4647
4648
4649
4650
4651
4652
4653
4654
4655
4656
4657
4658
4659
4660
4661
4662
4663
4664
4665
4666
4667
4668
4669
4670
4671
4672
4673
4674
4675
4676
4677
4678
4679
4680
4681
4682
4683
4684
4685
4686
4687
4688
4689
4690
4691
4692
4693
4694
4695
4696
4697
4698
4699
4700
4701
4702
4703
4704
4705
4706
4707
4708
4709
4710
4711
4712
4713
4714
4715
4716
4717
4718
4719
4720
4721
4722
4723
4724
4725
4726
4727
4728
4729
4730
4731
4732
4733
4734
4735
4736
4737
4738
4739
4740
4741
4742
4743
4744
4745
4746
4747
4748
4749
4750
4751
4752
4753
4754
4755
4756
4757
4758
4759
4760
4761
4762
4763
4764
4765
4766
4767
4768
4769
4770
4771
4772
4773
4774
4775
4776
4777
4778
4779
4780
4781
4782
4783
4784
4785
4786
4787
4788
4789
4790
4791
4792
4793
4794
4795
4796
4797
4798
4799
4800
4801
4802
4803
4804
4805
4806
4807
4808
4809
4810
4811
4812
4813
4814
4815
4816
4817
4818
4819
4820
4821
4822
4823
4824
4825
4826
4827
4828
4829
4830
4831
4832
4833
4834
4835
4836
4837
4838
4839
4840
4841
4842
4843
4844
4845
4846
4847
4848
4849
4850
4851
4852
4853
4854
4855
4856
4857
4858
4859
4860
4861
4862
4863
4864
4865
4866
4867
4868
4869
4870
4871
4872
4873
4874
4875
4876
4877
4878
4879
4880
4881
4882
4883
4884
4885
4886
4887
4888
4889
4890
4891
4892
4893
4894
4895
4896
4897
4898
4899
4900
4901
4902
4903
4904
4905
4906
4907
4908
4909
4910
4911
4912
4913
4914
4915
4916
4917
4918
4919
4920
4921
4922
4923
4924
4925
4926
4927
4928
4929
4930
4931
4932
4933
4934
4935
4936
4937
4938
4939
4940
4941
4942
4943
4944
4945
4946
4947
4948
4949
4950
4951
4952
4953
4954
4955
4956
4957
4958
4959
4960
4961
4962
4963
4964
4965
4966
4967
4968
4969
4970
4971
4972
4973
4974
4975
4976
4977
4978
4979
4980
4981
4982
4983
4984
4985
4986
4987
4988
4989
4990
4991
4992
4993
4994
4995
4996
4997
4998
4999
5000
5001
5002
5003
5004
5005
5006
5007
5008
5009
5010
5011
5012
5013
5014
5015
5016
5017
5018
5019
5020
5021
5022
5023
5024
5025
5026
5027
5028
5029
5030
5031
5032
5033
5034
5035
5036
5037
5038
5039
5040
5041
5042
5043
5044
5045
5046
5047
5048
5049
5050
5051
5052
5053
5054
5055
5056
5057
5058
5059
5060
5061
5062
5063
5064
5065
5066
5067
5068
5069
5070
5071
5072
5073
5074
5075
5076
5077
5078
5079
5080
5081
5082
5083
5084
5085
5086
5087
5088
5089
5090
5091
5092
5093
5094
5095
5096
5097
5098
5099
5100
5101
5102
5103
5104
5105
5106
5107
5108
5109
5110
5111
5112
5113
5114
5115
5116
5117
5118
5119
5120
5121
5122
5123
5124
5125
5126
5127
5128
5129
5130
5131
5132
5133
5134
5135
5136
5137
5138
5139
5140
5141
5142
5143
5144
5145
5146
5147
5148
5149
5150
5151
5152
5153
5154
5155
5156
5157
5158
5159
5160
5161
5162
5163
5164
5165
5166
5167
5168
5169
5170
5171
5172
5173
5174
5175
5176
5177
5178
5179
5180
5181
5182
5183
5184
5185
5186
5187
5188
5189
5190
5191
5192
5193
5194
5195
5196
5197
5198
5199
5200
5201
5202
5203
5204
5205
5206
5207
5208
5209
5210
5211
5212
5213
5214
5215
5216
5217
5218
5219
5220
5221
5222
5223
5224
5225
5226
5227
5228
5229
5230
5231
5232
5233
5234
5235
5236
5237
5238
5239
5240
5241
5242
5243
5244
5245
5246
5247
5248
5249
5250
5251
5252
5253
5254
5255
5256
5257
5258
5259
5260
5261
5262
5263
5264
5265
5266
5267
5268
5269
5270
5271
5272
5273
5274
5275
5276
5277
5278
5279
5280
5281
5282
5283
5284
5285
5286
5287
5288
5289
5290
5291
5292
5293
5294
5295
5296
5297
5298
5299
5300
5301
5302
5303
5304
5305
5306
5307
5308
5309
5310
5311
5312
5313
5314
5315
5316
5317
5318
5319
5320
5321
5322
5323
5324
5325
5326
5327
5328
5329
5330
5331
5332
5333
5334
5335
5336
5337
5338
5339
5340
5341
5342
5343
5344
5345
5346
5347
5348
5349
5350
5351
5352
5353
5354
5355
5356
5357
5358
5359
5360
5361
5362
5363
5364
5365
5366
5367
5368
5369
5370
5371
5372
5373
5374
5375
5376
5377
5378
5379
5380
5381
5382
5383
5384
5385
5386
5387
5388
5389
5390
5391
5392
5393
5394
5395
5396
5397
5398
5399
5400
5401
5402
5403
5404
5405
5406
5407
5408
5409
5410
5411
5412
5413
5414
5415
5416
5417
5418
5419
5420
5421
5422
5423
5424
5425
5426
5427
5428
5429
5430
5431
5432
5433
5434
5435
5436
5437
5438
5439
5440
5441
5442
5443
5444
5445
5446
5447
5448
5449
5450
5451
5452
5453
5454
5455
5456
5457
5458
5459
5460
5461
5462
5463
5464
5465
5466
5467
5468
5469
5470
5471
5472
5473
5474
5475
5476
5477
5478
5479
5480
5481
5482
5483
5484
5485
5486
5487
5488
5489
5490
5491
5492
5493
5494
5495
5496
5497
5498
5499
5500
5501
5502
5503
5504
5505
5506
5507
5508
5509
5510
5511
5512
5513
5514
5515
5516
5517
5518
5519
5520
5521
5522
5523
5524
5525
5526
5527
5528
5529
5530
5531
5532
5533
5534
5535
5536
5537
5538
5539
5540
5541
5542
5543
5544
5545
5546
5547
5548
5549
5550
5551
5552
5553
5554
5555
5556
5557
5558
5559
5560
5561
5562
5563
5564
5565
5566
5567
5568
5569
5570
5571
5572
5573
5574
5575
5576
5577
5578
5579
5580
5581
5582
5583
5584
5585
5586
5587
5588
5589
5590
5591
5592
5593
5594
5595
5596
5597
5598
5599
5600
5601
5602
5603
5604
5605
5606
5607
5608
5609
5610
5611
5612
5613
5614
5615
5616
5617
5618
5619
5620
5621
5622
5623
5624
5625
5626
5627
5628
5629
5630
5631
5632
5633
5634
5635
5636
5637
5638
5639
5640
5641
5642
5643
5644
5645
5646
5647
5648
5649
5650
5651
5652
5653
5654
5655
5656
5657
5658
5659
5660
5661
5662
5663
5664
5665
5666
5667
5668
5669
5670
5671
5672
5673
5674
5675
5676
5677
5678
5679
5680
5681
5682
5683
5684
5685
5686
5687
5688
5689
5690
5691
5692
5693
5694
5695
5696
5697
5698
5699
5700
5701
5702
5703
5704
5705
5706
5707
5708
5709
5710
5711
5712
5713
5714
5715
5716
5717
5718
5719
5720
5721
5722
5723
5724
5725
5726
5727
5728
5729
5730
5731
5732
5733
5734
5735
5736
5737
5738
5739
5740
5741
5742
5743
5744
5745
5746
5747
5748
5749
5750
5751
5752
5753
5754
5755
5756
5757
5758
5759
5760
5761
5762
5763
5764
5765
5766
5767
5768
5769
5770
5771
5772
5773
5774
5775
5776
5777
5778
5779
5780
5781
5782
5783
5784
5785
5786
5787
5788
5789
5790
5791
5792
5793
5794
5795
5796
5797
5798
5799
5800
5801
5802
5803
5804
5805
5806
5807
5808
5809
5810
5811
5812
5813
5814
5815
5816
5817
5818
5819
5820
5821
5822
5823
5824
5825
5826
5827
5828
5829
5830
5831
5832
5833
5834
5835
5836
5837
5838
5839
5840
5841
5842
5843
5844
5845
5846
5847
5848
5849
5850
5851
5852
5853
5854
5855
5856
5857
5858
5859
5860
5861
5862
5863
5864
5865
5866
5867
5868
5869
5870
5871
5872
5873
5874
5875
5876
5877
5878
5879
5880
5881
5882
5883
5884
5885
5886
5887
5888
5889
5890
5891
5892
5893
5894
5895
5896
5897
5898
5899
5900
5901
5902
5903
5904
5905
5906
5907
5908
5909
5910
5911
5912
5913
5914
5915
5916
5917
5918
5919
5920
5921
5922
5923
5924
5925
5926
5927
5928
5929
5930
5931
5932
5933
5934
5935
5936
5937
5938
5939
5940
5941
5942
5943
5944
5945
5946
5947
5948
5949
5950
5951
5952
5953
5954
5955
5956
5957
5958
5959
5960
5961
5962
5963
5964
5965
5966
5967
5968
5969
5970
5971
5972
5973
5974
5975
5976
5977
5978
5979
5980
5981
5982
5983
5984
5985
5986
5987
5988
5989
5990
5991
5992
5993
5994
5995
5996
5997
5998
5999
6000
6001
6002
6003
6004
6005
6006
6007
6008
6009
6010
6011
6012
6013
6014
6015
6016
6017
6018
6019
6020
6021
6022
6023
6024
6025
6026
6027
6028
6029
6030
6031
6032
6033
6034
6035
6036
6037
6038
6039
6040
6041
6042
6043
6044
6045
6046
6047
6048
6049
6050
6051
6052
6053
6054
6055
6056
6057
6058
6059
6060
6061
6062
6063
6064
6065
6066
6067
6068
6069
6070
6071
6072
6073
6074
6075
6076
6077
6078
6079
6080
6081
6082
6083
6084
6085
6086
6087
6088
6089
6090
6091
6092
6093
6094
6095
6096
6097
6098
6099
6100
6101
6102
6103
6104
6105
6106
6107
6108
6109
6110
6111
6112
6113
6114
6115
6116
6117
6118
6119
6120
6121
6122
6123
6124
6125
6126
6127
6128
6129
6130
6131
6132
6133
6134
6135
6136
6137
6138
6139
6140
6141
6142
6143
6144
6145
6146
6147
6148
6149
6150
6151
6152
6153
6154
6155
6156
6157
6158
6159
6160
6161
6162
6163
6164
6165
6166
6167
6168
6169
6170
6171
6172
6173
6174
6175
6176
6177
6178
6179
6180
6181
6182
6183
6184
6185
6186
6187
6188
6189
6190
6191
6192
6193
6194
6195
6196
6197
6198
6199
6200
6201
6202
6203
6204
6205
6206
6207
6208
6209
6210
6211
6212
6213
6214
6215
6216
6217
6218
6219
6220
6221
6222
6223
6224
6225
6226
6227
6228
6229
6230
6231
6232
6233
6234
6235
6236
6237
6238
6239
6240
6241
6242
6243
6244
6245
6246
6247
6248
6249
6250
6251
6252
6253
6254
6255
6256
6257
6258
6259
6260
6261
6262
6263
6264
6265
6266
6267
6268
6269
6270
6271
6272
6273
6274
6275
6276
6277
6278
6279
6280
6281
6282
6283
6284
6285
6286
6287
6288
6289
6290
6291
6292
6293
6294
6295
6296
6297
6298
6299
6300
6301
6302
6303
6304
6305
6306
6307
6308
6309
6310
6311
6312
6313
6314
6315
6316
6317
6318
6319
6320
6321
6322
6323
6324
6325
6326
6327
6328
6329
6330
6331
6332
6333
6334
6335
6336
6337
6338
6339
6340
6341
6342
6343
6344
6345
6346
6347
6348
6349
6350
6351
6352
6353
6354
6355
6356
6357
6358
6359
6360
6361
6362
6363
6364
6365
6366
6367
6368
6369
6370
6371
6372
6373
6374
6375
6376
6377
6378
6379
6380
6381
6382
6383
6384
6385
6386
6387
6388
6389
6390
6391
6392
6393
6394
6395
6396
6397
6398
6399
6400
6401
6402
6403
6404
6405
6406
6407
6408
6409
6410
6411
6412
6413
6414
6415
6416
6417
6418
6419
6420
6421
6422
6423
6424
6425
6426
6427
6428
6429
6430
6431
6432
6433
6434
6435
6436
6437
6438
6439
6440
6441
6442
6443
6444
6445
6446
6447
6448
6449
6450
6451
6452
6453
6454
6455
6456
6457
6458
6459
6460
6461
6462
6463
6464
6465
6466
6467
6468
6469
6470
6471
6472
6473
6474
6475
6476
6477
6478
6479
6480
6481
6482
6483
6484
6485
6486
6487
6488
6489
6490
6491
6492
6493
6494
6495
6496
6497
6498
6499
6500
6501
6502
6503
6504
6505
6506
6507
6508
6509
6510
6511
6512
6513
6514
6515
6516
6517
6518
6519
6520
6521
6522
6523
6524
6525
6526
6527
6528
6529
6530
6531
6532
6533
6534
6535
6536
6537
6538
6539
6540
6541
6542
6543
6544
6545
6546
6547
6548
6549
6550
6551
6552
6553
6554
6555
6556
6557
6558
6559
6560
6561
6562
6563
6564
6565
6566
6567
6568
6569
6570
6571
6572
6573
6574
6575
6576
6577
6578
6579
6580
6581
6582
6583
6584
6585
6586
6587
6588
6589
6590
6591
6592
6593
6594
6595
6596
6597
6598
6599
6600
6601
6602
6603
6604
6605
6606
6607
6608
6609
6610
6611
6612
6613
6614
6615
6616
6617
6618
6619
6620
6621
6622
6623
6624
6625
6626
6627
6628
6629
6630
6631
6632
6633
6634
6635
6636
6637
6638
6639
6640
6641
6642
6643
6644
6645
6646
6647
6648
6649
6650
6651
6652
6653
6654
6655
6656
6657
6658
6659
6660
6661
6662
6663
6664
6665
6666
6667
6668
6669
6670
6671
6672
6673
6674
6675
6676
6677
6678
6679
6680
6681
6682
6683
6684
6685
6686
6687
6688
6689
6690
6691
6692
6693
6694
6695
6696
6697
6698
6699
6700
6701
6702
6703
6704
6705
6706
6707
6708
6709
6710
6711
6712
6713
6714
6715
6716
6717
6718
6719
6720
6721
6722
6723
6724
6725
6726
6727
6728
6729
6730
6731
6732
6733
6734
6735
6736
6737
6738
6739
6740
6741
6742
6743
6744
6745
6746
6747
6748
6749
6750
6751
6752
6753
6754
6755
6756
6757
6758
6759
6760
6761
6762
6763
6764
6765
6766
6767
6768
6769
6770
6771
6772
6773
6774
6775
6776
6777
6778
6779
6780
6781
6782
6783
6784
6785
6786
6787
6788
6789
6790
6791
6792
6793
6794
6795
6796
6797
6798
6799
6800
6801
6802
6803
6804
6805
6806
6807
6808
6809
6810
6811
6812
6813
6814
6815
6816
6817
6818
6819
6820
6821
6822
6823
6824
6825
6826
6827
6828
6829
6830
6831
6832
6833
6834
6835
6836
6837
6838
6839
6840
6841
6842
6843
6844
6845
6846
6847
6848
6849
6850
6851
6852
6853
6854
6855
6856
6857
6858
6859
6860
6861
6862
6863
6864
6865
6866
6867
6868
6869
6870
6871
6872
6873
6874
6875
6876
6877
6878
6879
6880
6881
6882
6883
6884
6885
6886
6887
6888
6889
6890
6891
6892
6893
6894
6895
6896
6897
6898
6899
6900
6901
6902
6903
6904
6905
6906
6907
6908
6909
6910
6911
6912
6913
6914
6915
6916
6917
6918
6919
6920
6921
6922
6923
6924
6925
6926
6927
6928
6929
6930
6931
6932
6933
6934
6935
6936
6937
6938
6939
6940
6941
6942
6943
6944
6945
6946
6947
6948
6949
6950
6951
6952
6953
6954
6955
6956
6957
6958
6959
6960
6961
6962
6963
6964
6965
6966
6967
6968
6969
6970
6971
6972
6973
6974
6975
6976
6977
6978
6979
6980
6981
6982
6983
6984
6985
6986
6987
6988
6989
6990
6991
6992
6993
6994
6995
6996
6997
6998
6999
7000
7001
7002
7003
7004
7005
7006
7007
7008
7009
7010
7011
7012
7013
7014
7015
7016
7017
7018
7019
7020
7021
7022
7023
7024
7025
7026
7027
7028
7029
7030
7031
7032
7033
7034
7035
7036
7037
7038
7039
7040
7041
7042
7043
7044
7045
7046
7047
7048
7049
7050
7051
7052
7053
7054
7055
7056
7057
7058
7059
7060
7061
7062
7063
7064
7065
7066
7067
7068
7069
7070
7071
7072
7073
7074
7075
7076
7077
7078
7079
7080
7081
7082
7083
7084
7085
7086
7087
7088
7089
7090
7091
7092
7093
7094
7095
7096
7097
7098
7099
7100
7101
7102
7103
7104
7105
7106
7107
7108
7109
7110
7111
7112
7113
7114
7115
7116
7117
7118
7119
7120
7121
7122
7123
7124
7125
7126
7127
7128
7129
7130
7131
7132
7133
7134
7135
7136
7137
7138
7139
7140
7141
7142
7143
7144
7145
7146
7147
7148
7149
7150
7151
7152
7153
7154
7155
7156
7157
7158
7159
7160
7161
7162
7163
7164
7165
7166
7167
7168
7169
7170
7171
7172
7173
7174
7175
7176
7177
7178
7179
7180
7181
7182
7183
7184
7185
7186
7187
7188
7189
7190
7191
7192
7193
7194
7195
7196
7197
7198
7199
7200
7201
7202
7203
7204
7205
7206
7207
7208
7209
7210
7211
7212
7213
7214
7215
7216
7217
7218
7219
7220
7221
7222
7223
7224
7225
7226
7227
7228
7229
7230
7231
7232
7233
7234
7235
7236
7237
7238
7239
7240
7241
7242
7243
7244
7245
7246
7247
7248
7249
7250
7251
7252
7253
7254
7255
7256
7257
7258
7259
7260
7261
7262
7263
7264
7265
7266
7267
7268
7269
7270
7271
7272
7273
7274
7275
7276
7277
7278
7279
7280
7281
7282
7283
7284
7285
7286
7287
7288
7289
7290
7291
7292
7293
7294
7295
7296
7297
7298
7299
7300
7301
7302
7303
7304
7305
7306
7307
7308
7309
7310
7311
7312
7313
7314
7315
7316
7317
7318
7319
7320
7321
7322
7323
7324
7325
7326
7327
7328
7329
7330
7331
7332
7333
7334
7335
7336
7337
7338
7339
7340
7341
7342
7343
7344
7345
7346
7347
7348
7349
7350
7351
7352
7353
7354
7355
7356
7357
7358
7359
7360
7361
7362
7363
7364
7365
7366
7367
7368
7369
7370
7371
7372
7373
7374
7375
7376
7377
7378
7379
7380
7381
7382
7383
7384
7385
7386
7387
7388
7389
7390
7391
7392
7393
7394
7395
7396
7397
7398
7399
7400
7401
7402
7403
7404
7405
7406
7407
7408
7409
7410
7411
7412
7413
7414
7415
7416
7417
7418
7419
7420
7421
7422
7423
7424
7425
7426
7427
7428
7429
7430
7431
7432
7433
7434
7435
7436
7437
7438
7439
7440
7441
7442
7443
7444
7445
7446
7447
7448
7449
7450
7451
7452
7453
7454
7455
7456
7457
7458
7459
7460
7461
7462
7463
7464
7465
7466
7467
7468
7469
7470
7471
7472
7473
7474
7475
7476
7477
7478
7479
7480
7481
7482
7483
7484
7485
7486
7487
7488
7489
7490
7491
7492
7493
7494
7495
7496
7497
7498
7499
7500
7501
7502
7503
7504
7505
7506
7507
7508
7509
7510
7511
7512
7513
7514
7515
7516
7517
7518
7519
7520
7521
7522
7523
7524
7525
7526
7527
7528
7529
7530
7531
7532
7533
7534
7535
7536
7537
7538
7539
7540
7541
7542
7543
7544
7545
7546
7547
7548
7549
7550
7551
7552
7553
7554
7555
7556
7557
7558
7559
7560
7561
7562
7563
7564
7565
7566
7567
7568
7569
7570
7571
7572
7573
7574
7575
7576
7577
7578
7579
7580
7581
7582
7583
7584
7585
7586
7587
7588
7589
7590
7591
7592
7593
7594
7595
7596
7597
7598
7599
7600
7601
7602
7603
7604
7605
7606
7607
7608
7609
7610
7611
7612
7613
7614
7615
7616
7617
7618
7619
7620
7621
7622
7623
7624
7625
7626
7627
7628
7629
7630
7631
7632
7633
7634
7635
7636
7637
7638
7639
7640
7641
7642
7643
7644
7645
7646
7647
7648
7649
7650
7651
7652
7653
7654
7655
7656
7657
7658
7659
7660
7661
7662
7663
7664
7665
7666
7667
7668
7669
7670
7671
7672
7673
7674
7675
7676
7677
7678
7679
7680
7681
7682
7683
7684
7685
7686
7687
7688
7689
7690
7691
7692
7693
7694
7695
7696
7697
7698
7699
7700
7701
7702
7703
7704
7705
7706
7707
7708
7709
7710
7711
7712
7713
7714
7715
7716
7717
7718
7719
7720
7721
7722
7723
7724
7725
7726
7727
7728
7729
7730
7731
7732
7733
7734
7735
7736
7737
7738
7739
7740
7741
7742
7743
7744
7745
7746
7747
7748
7749
7750
7751
7752
7753
7754
7755
7756
7757
7758
7759
7760
7761
7762
7763
7764
7765
7766
7767
7768
7769
7770
7771
7772
7773
7774
7775
7776
7777
7778
7779
7780
7781
7782
7783
7784
7785
7786
7787
7788
7789
7790
7791
7792
7793
7794
7795
7796
7797
7798
7799
7800
7801
7802
7803
7804
7805
7806
7807
7808
7809
7810
7811
7812
7813
7814
7815
7816
7817
7818
7819
7820
7821
7822
7823
7824
7825
7826
7827
7828
7829
7830
7831
7832
7833
7834
7835
7836
7837
7838
7839
7840
7841
7842
7843
7844
7845
7846
7847
7848
7849
7850
7851
7852
7853
7854
7855
7856
7857
7858
7859
7860
7861
7862
7863
7864
7865
7866
7867
7868
7869
7870
7871
7872
7873
7874
7875
7876
7877
7878
7879
7880
7881
7882
7883
7884
7885
7886
7887
7888
7889
7890
7891
7892
7893
7894
7895
7896
7897
7898
7899
7900
7901
7902
7903
7904
7905
7906
7907
7908
7909
7910
7911
7912
7913
7914
7915
7916
7917
7918
7919
7920
7921
7922
7923
7924
7925
7926
7927
7928
7929
7930
7931
7932
7933
7934
7935
7936
7937
7938
7939
7940
7941
7942
7943
7944
7945
7946
7947
7948
7949
7950
7951
7952
7953
7954
7955
7956
7957
7958
7959
7960
7961
7962
7963
7964
7965
7966
7967
7968
7969
7970
7971
7972
7973
7974
7975
7976
7977
7978
7979
7980
7981
7982
7983
7984
7985
7986
7987
7988
7989
7990
7991
7992
7993
7994
7995
7996
7997
7998
7999
8000
8001
8002
8003
8004
8005
8006
8007
8008
8009
8010
8011
8012
8013
8014
8015
8016
8017
8018
8019
8020
8021
8022
8023
8024
8025
8026
8027
8028
8029
8030
8031
8032
8033
8034
8035
8036
8037
8038
8039
8040
8041
8042
8043
8044
8045
8046
8047
8048
8049
8050
8051
8052
8053
8054
8055
8056
8057
8058
8059
8060
8061
8062
8063
8064
8065
8066
8067
8068
8069
8070
8071
8072
8073
8074
8075
8076
8077
8078
8079
8080
8081
8082
8083
8084
8085
8086
8087
8088
8089
8090
8091
8092
8093
8094
8095
8096
8097
8098
8099
8100
8101
8102
8103
8104
8105
8106
8107
8108
8109
8110
8111
8112
8113
8114
8115
8116
8117
8118
8119
8120
8121
8122
8123
8124
8125
8126
8127
8128
8129
8130
8131
8132
8133
8134
8135
8136
8137
8138
8139
8140
8141
8142
8143
8144
8145
8146
8147
8148
8149
8150
8151
8152
8153
8154
8155
8156
8157
8158
8159
8160
8161
8162
8163
8164
8165
8166
8167
8168
8169
8170
8171
8172
8173
8174
8175
8176
8177
8178
8179
8180
8181
8182
8183
8184
8185
8186
8187
8188
8189
8190
8191
8192
8193
8194
8195
8196
8197
8198
8199
8200
8201
8202
8203
8204
8205
8206
8207
8208
8209
8210
8211
8212
8213
8214
8215
8216
8217
8218
8219
8220
8221
8222
8223
8224
8225
8226
8227
8228
8229
8230
8231
8232
8233
8234
8235
8236
8237
8238
8239
8240
8241
8242
8243
8244
8245
8246
8247
8248
8249
8250
8251
8252
8253
8254
8255
8256
8257
8258
8259
8260
8261
8262
8263
8264
8265
8266
8267
8268
8269
8270
8271
8272
8273
8274
8275
8276
8277
8278
8279
8280
8281
8282
8283
8284
8285
8286
8287
8288
8289
8290
8291
8292
8293
8294
8295
8296
8297
8298
8299
8300
8301
8302
8303
8304
8305
8306
8307
8308
8309
8310
8311
8312
8313
8314
8315
8316
8317
8318
8319
8320
8321
8322
8323
8324
8325
8326
8327
8328
8329
8330
8331
8332
8333
8334
8335
8336
8337
8338
8339
8340
8341
8342
8343
8344
8345
8346
8347
8348
8349
8350
8351
8352
8353
8354
8355
8356
8357
8358
8359
8360
8361
8362
8363
8364
8365
8366
8367
8368
8369
8370
8371
8372
8373
8374
8375
8376
8377
8378
8379
8380
8381
8382
8383
8384
8385
8386
8387
8388
8389
8390
8391
8392
8393
8394
8395
8396
8397
8398
8399
8400
8401
8402
8403
8404
8405
8406
8407
8408
8409
8410
8411
8412
8413
8414
8415
8416
8417
8418
8419
8420
8421
8422
8423
8424
8425
8426
8427
8428
8429
8430
8431
8432
8433
8434
8435
8436
8437
8438
8439
8440
8441
8442
8443
8444
8445
8446
8447
8448
8449
8450
8451
8452
8453
8454
8455
8456
8457
8458
8459
8460
8461
8462
8463
8464
8465
8466
8467
8468
8469
8470
8471
8472
8473
8474
8475
8476
8477
8478
8479
8480
8481
8482
8483
8484
8485
8486
8487
8488
8489
8490
8491
8492
8493
8494
8495
8496
8497
8498
8499
8500
8501
8502
8503
8504
8505
8506
8507
8508
8509
8510
8511
8512
8513
8514
8515
8516
8517
8518
8519
8520
8521
8522
8523
8524
8525
8526
8527
8528
8529
8530
8531
8532
8533
8534
8535
8536
8537
8538
8539
8540
8541
8542
8543
8544
8545
8546
8547
8548
8549
8550
8551
8552
8553
8554
8555
8556
8557
8558
8559
8560
8561
8562
8563
8564
8565
8566
8567
8568
8569
8570
8571
8572
8573
8574
8575
8576
8577
8578
8579
8580
8581
8582
8583
8584
8585
8586
8587
8588
8589
8590
8591
8592
8593
8594
8595
8596
8597
8598
8599
8600
8601
8602
8603
8604
8605
8606
8607
8608
8609
8610
8611
8612
8613
8614
8615
8616
8617
8618
8619
8620
8621
8622
8623
8624
8625
8626
8627
8628
8629
8630
8631
8632
8633
8634
8635
8636
8637
8638
8639
8640
8641
8642
8643
8644
8645
8646
8647
8648
8649
8650
8651
8652
8653
8654
8655
8656
8657
8658
8659
8660
8661
8662
8663
8664
8665
8666
8667
8668
8669
8670
8671
8672
8673
8674
8675
8676
8677
8678
8679
8680
8681
8682
8683
8684
8685
8686
8687
8688
8689
8690
8691
8692
8693
8694
8695
8696
8697
8698
8699
8700
8701
8702
8703
8704
8705
8706
8707
8708
8709
8710
8711
8712
8713
8714
8715
8716
8717
8718
8719
8720
8721
8722
8723
8724
8725
8726
8727
8728
8729
8730
8731
8732
8733
8734
8735
8736
8737
8738
8739
8740
8741
8742
8743
8744
8745
8746
8747
8748
8749
8750
8751
8752
8753
8754
8755
8756
8757
8758
8759
8760
8761
8762
8763
8764
8765
8766
8767
8768
8769
8770
8771
8772
8773
8774
8775
8776
8777
8778
8779
8780
8781
8782
8783
8784
8785
8786
8787
8788
8789
8790
8791
8792
8793
8794
8795
% \iffalse meta-comment
% 
% This is file `caption.dtx'.
% 
% Copyright (C) 1994-2022 Axel Sommerfeldt (axel.sommerfeldt@f-m.fm)
% 
% --------------------------------------------------------------------------
% 
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3
% of this license or (at your option) any later version.
% The latest version of this license is in
%   http://www.latex-project.org/lppl.txt
% and version 1.3 or later is part of all distributions of LaTeX
% version 2003/12/01 or later.
% 
% This work has the LPPL maintenance status "maintained".
% 
% This Current Maintainer of this work is Axel Sommerfeldt.
% 
% This work consists of the files
%   caption.ins, caption.dtx, caption-light.dtx, caption2.dtx, caption3.dtx,
%   caption-ams-smf.dtx, caption-beamer.dtx, caption-elsarticle.dtx,
%   caption-koma.dtx, caption-memoir.dtx, caption-ntg.dtx,
%   caption-thesis.dtx, bicaption.dtx, ltcaption.dtx, subcaption.dtx,
% the derived files
%   caption.sty, caption-light.sty, caption2.sty, caption3.sty,
%   caption-ams-smf.sto, caption-beamer.sto, caption-elsarticle.sto,
%   caption-koma.sto, caption-memoir.sto, caption-ntg.sto,
%   caption-thesis.sto, bicaption.sty, ltcaption.sty, subcaption.sty.
% 
% \fi
%
% \CheckSum{2836}
%
% \iffalse
%<*driver>
\NeedsTeXFormat{LaTeX2e}[1994/12/01]
\ProvidesFile{caption.drv}[2022/02/20 v3.6 Implementation of the caption package]
\hbadness=9999 \newcount\hbadness \hfuzz=100pt % Make TeX shut up.
%\errorcontextlines=3
%
\documentclass{ltxdoc}
\setlength\parindent{0pt}
\setlength\parskip{\smallskipamount}
\setlength\leftmargini{2em}% default = 2.5em
%\makeatletter\g@addto@macro\MacroFont{\normalcolor}\makeatother
%
\makeatletter % make room for subsections like 2.16.14 in the TOC
%\newcommand*\l@subsection{\@dottedtocline{2}{1.5em}{2.3em}}
\renewcommand*\l@subsection{\@dottedtocline{2}{1.5em}{2.7em}}
\makeatother
%
\newcommand\LineBreak{\linebreak[3]}
\newcommand\PageBreak{\pagebreak[3]}
%
\usepackage{ifpdf}
\ifpdf
  \usepackage{mathptmx,courier}
  \usepackage[scaled=0.90]{helvet}
  \addtolength\marginparwidth{15pt}
\fi
%
\usepackage[bottom]{footmisc}
\usepackage{graphicx,longtable,setspace}
%
\usepackage{hypdoc}
\ifpdf\usepackage{hypdestopt}\fi
\hypersetup{pdfkeywords={LaTeX, package, caption},pdfstartpage={},pdfstartview={}}
\hypersetup{breaklinks=true}
\AtBeginDocument{%
  \let\subsectionautorefname\sectionautorefname
  \let\subsubsectionautorefname\sectionautorefname}
%
\usepackage[listof=false,hypcap=false]{caption}[2022/01/06]
%
\DeclareRobustCommand*\eTeX{\texorpdfstring
  {\leavevmode\hbox{$\varepsilon$}-\TeX}%
  {e-TeX}}
\DeclareRobustCommand*\AmS{\texorpdfstring
  {{\protect\usefont{OMS}{cmsy}{m}{n}A\kern-.1667em\lower.5ex\hbox{M}\kern-.125emS}}%
  {AMS}}
\DeclareRobustCommand*\KOMAScript{\texorpdfstring
  {\textsf{K\kern.05em O\kern.05em M\kern.05em A\kern.1em-\kern.1em Script}}%
  {KOMA-Script}}
\DeclareRobustCommand*\NTG{NTG}
\DeclareRobustCommand*\SmF{SMF}
%
\usepackage{marvosym}
\makeatletter
\newcommand*\INFO{\@ifstar{\@INFO{}}{\@INFO{\vbox to \ht\strutbox}}}
\newcommand*\@INFO[1]{\MARGINSYM{#1{\LARGE\Info}}}
\makeatother

\makeatletter
\newcommand*\MARGINSYM[1]{\hskip 1sp \marginpar{\raggedleft\textcolor{blue}{{#1}}}}
\newcommand*\NEW[1]{\@ifstar{\@NEW{#1}{\vskip2pt}}{\@NEW{#1}{}}}
\newcommand*\@NEW[3]{\MARGINSYM{#2\footnotesize#1\\#3}}
\makeatother

% \ContinuedFloat
\DeclareCaptionLabelFormat{continued1}{Continued #1~#2}
\DeclareCaptionLabelFormat{continued2}{#1~#2\alph{ContinuedFloat}}
% \DeclareCaptionLabelFormat
\DeclareCaptionLabelFormat{bf-parens}{(\textbf{#2})}
% \DeclareCaptionStyle
\DeclareCaptionStyle{mystyle}[margin=5mm,justification=centering]%
                    {font=footnotesize,labelfont=sc,margin={10mm,0mm}}
% Example 1
\DeclareCaptionFormat{myformat1}{#1#2\\#3}
\newlength\myindention
\DeclareCaptionFormat{myformat2}{#1#2\\\hspace*\myindention#3}
\DeclareCaptionOption{myindention}{\setlength\myindention{#1}}
% Example 2
\DeclareCaptionFormat{reverse}{#3#2#1}
\DeclareCaptionLabelFormat{fullparens}{(\bothIfFirst{#1}{~}#2)}
\DeclareCaptionLabelSeparator{fill}{\hfill}
% Example 3
\DeclareCaptionFormat{llap}{\llap{#1#2}#3\par}
\DeclareCaptionFormat{llapx}{\llap{\makebox[5em][l]{#1}}#3\par}
% Example 4
\DeclareCaptionLabelFormat{andtable}{#1~#2 \& \tablename~\thetable}

\newcommand*\purerm[1]{\texorpdfstring{{\upshape\mdseries\rmfamily #1}}{#1}}
\newcommand*\puresf[1]{\texorpdfstring{{\upshape\mdseries\sffamily #1}}{#1}}
\newcommand*\purett[1]{\texorpdfstring{{\upshape\mdseries\ttfamily #1}}{#1}}
\let\class\puresf \let\package\puresf % obsolete
\let\cls\puresf \let\pkg\puresf
\let\env\purett \let\opt\purett

\newcommand*\csmarg[1]{\texttt{\char`\{#1\char`\}}}
\newcommand*\csoarg[1]{\texttt{\char`\[#1\char`\]}}
\newcommand*\version[2][]{v$#2$}
\newcommand*\issue[1]{GitLab~\##1}
\newcommand*\x{\discretionary{}{}{}}

\newenvironment{Annotation}%
  {\ifvmode\else\unskip\par\fi\pagebreak[2]%
   \smallskip
   \small(\ignorespaces}{\unskip)\par}
\newenvironment{Annotation*}%
  {\ifvmode\else\unskip\par\fi\pagebreak[2]%
   \small(\ignorespaces}{\unskip)\par}

\newenvironment{Example}%
  {\ifvmode\else\unskip\par\fi\pagebreak[2]%
   \minipage{\linewidth}\smallskip}%
  {\smallskip\endminipage\par}

\makeatletter
\newcommand\example{\@ifstar
  {\@example{belowskip=\abovecaptionskip}}%
  {\@example{}}}
\def\@example#1{%
  \@testopt{\@@example{#1}}{figure}}
\long\def\@@example#1[#2]#3#4{%
  \begingroup
    \captionsetup{#1,size=small,margin={\leftmargini,10pt},#3}%
    \captionof{#2}[]{#4}%
  \endgroup}
\makeatother

\newenvironment{Expert}%
  {\ifvmode\else\unskip\par\fi\pagebreak[3]%
   \smallskip
   \footnotesize\ignorespaces}{\par}
\newenvironment{Expert*}%
  {\ifvmode\else\unskip\par\fi\pagebreak[3]%
   \footnotesize\ignorespaces}{\par}

\newenvironment{Note}[1][\DefaultNoteText]%
  {\ifvmode\else\unskip\par\fi
   \smallskip
   \small\emph{#1:}~\ignorespaces}{\par}
\newenvironment{Note*}[1][\DefaultNoteText]%
  {\ifvmode\else\unskip\par\fi
   \small\emph{#1:}~\ignorespaces}{\par}

\newenvironment{Options}[1]%
  {\list{}{\renewcommand\makelabel[1]{\texttt{##1}\hfil}%
   \settowidth\labelwidth{\texttt{#1\space}}%
   \setlength\leftmargin{10pt}%
   \addtolength\leftmargin{\labelwidth}%
   \addtolength\leftmargin{\labelsep}}}%
  {\endlist}

\makeatletter
\def\Ref{\@ifstar{\@Ref\ref}{\@Ref\autoref}}
\def\@Ref#1#2{#1{#2}: \textit{\nameref{#2}}}
\newcommand*\SEE[3][]{\nopagebreak{#1(#2 #3)}}
\newcommand*\SeeUserDefined[1][]{\See{\Ref{declare}#1}}
\makeatother
%
\begin{document}
  \DocInput{caption.dtx}
\end{document}
%</driver>
% \fi
%
%
% \def\thispackage{the \package{caption} package}
% \def\Thispackage{The \package{caption} package}
%
% \newcommand*\DefaultNoteText{Note}
% \newcommand*\NEWfeature{\NEW{New feature}}
% \newcommand*\NEWdescription{\NEW{New description}}
% \makeatletter
% \newcommand*\See{\@ifstar{\SEE{See}}{\SEE[\small]{See}}}
% \newcommand*\see{\@ifstar{\SEE{see}}{\SEE[\small]{see}}}
% \makeatother
%
% \GetFileInfo{caption.drv}
% \let\docdate\filedate
% \let\docversion\fileversion
% \GetFileInfo{caption.sty}
%
% \title{Customizing captions of floating environments%^^A
%         \texorpdfstring{\thanks{%^^A
%          This package has version number \docversion.}}%^^A
%        {}}
% \author{Axel Sommerfeldt\\
%         \url{https://gitlab.com/axelsommerfeldt/caption}}
% \date{\docdate}
% \maketitle
%
% \begin{abstract}
% \Thispackage\ offers customization of captions
% in floating environments such |figure| and |table| and cooperates with
% many other packages.
% \par\smallskip
% \textit{Please note:} Many document classes already have build-in options and
% commands for customizing captions.
% If these possibilities are sufficient for you, there is usually no need for
% you to use the \package{caption} package at all.
% And if you are only interested in using the command \cs{captionof}, loading of
% the very small \package{capt-of} package is usually sufficient.
% \end{abstract}
%
% \newcommand\shortexampletext{%
%   White sand beaches. The pink smoothness of the conch shell. A sea abundant
%   with possibilities. Duty-free shops filled with Europe's finest gifts and
%   perfumes.}
% \newcommand\exampletext{\shortexampletext\space
%   Play your favorite game of golf amidst the tropical greens on one
%   of the many championship courses.}
%
% \iffalse
% --------------------------------------------------------------------------- %
% \fi
%
% \section*{Introduction}
%
% Within the standard \LaTeX\ document classes captions haven't received the
% attention they deserve. Simply typeset as an ordinary paragraph there is no
% remarkable visual difference from the rest of the text, like here:
%
% \example*{size=normalsize,margin=0pt}{\shortexampletext}
%
% There should be possibilities to change this; for example, it would be nice
% to make the text of the caption a little bit smaller as the normal
% text, add an extra margin, typeset the caption label with the same font
% family and shape as your headings etc. Just like this one:
%
% \example*{size=small,margin=10pt,labelfont=bf,labelsep=endash}{\shortexampletext}
%
% You can do this easily with this package as there are many ready-to-use
% caption formatting options, but you are free to define your very own stuff, too.
%
% \bigskip
%
% \INFO\begin{minipage}[t]{\textwidth}
% \small
% Please note that \thispackage\ is only controlling the look \& feel of the
% captions. It does \emph{not} control the placement of the captions.
% (But you could do so by using other packages like the \package{floatrow}
%  package\cite{floatrow}.)
% \end{minipage}
%
% \medskip
%
% \INFO\begin{minipage}[t]{\textwidth}
% \small
% This documentation is outdated and is currently under revision.
% Progress could be tracked here:
% \url{https://gitlab.com/axelsommerfeldt/caption/-/commits/doc/caption}
% \end{minipage}
%
% \iffalse
% --------------------------------------------------------------------------- %
% \fi
%
% \clearpage
% \tableofcontents
%
% \iffalse
% --------------------------------------------------------------------------- %
% \fi
%
% \clearpage
% \section{Using this package}
% \label{usage}
%
% Insert
% \begin{quote}
%   |\usepackage|\oarg{options}|{caption}[|\texttt{\filedate}|]|
% \end{quote}
% into the preamble of your document, i.e.~the part of your document
% between |\document|\-|class| and |\begin{doc|\-|u|\-|ment}|.
% The options control how your captions will look like; e.g.,
% \begin{quote}
%   |\usepackage[margin=10pt,font=small,labelfont=bf,|\\
%   |            labelsep=endash]{caption}|%
%   %|[|\texttt{\filedate}|]|
% \end{quote}
% would result in captions looking like the second one in the introduction.
%
% \DescribeMacro{\captionsetup}
% For a later change of options \thispackage\ provides the command
% \begin{quote}
%   |\captionsetup|\oarg{float type}\marg{options}\quad.
% \end{quote}
% So
% \begin{quote}
%   |\usepackage[margin=10pt,font=small,labelfont=bf]{caption}|
% \end{quote}
% and
% \begin{quote}
%   |\usepackage{caption}|\\
%   |\captionsetup{margin=10pt,font=small,labelfont=bf}|
% \end{quote}
% are equal in their results.
%
% It's good to know that |\caption|\-|setup| has an effect on the current
% environment only. So if you want to change settings for the
% current |figure| or |table| only, just place the |\caption|\-|setup| command
% inside the |figure| or |table| right before the |\caption| command.
% For example
% \begin{quote}
%   |\begin{figure}|\\
%   |  |\ldots\\
%   |  \captionsetup{singlelinecheck=off}|\\
%   |  \caption{|\ldots|}|\\
%   |\end{figure}|
% \end{quote}
% switches the single-line-check off, but only for this |figure|,
% so all the other captions remain untouched.
%
% \begin{Annotation}
% For a detailed description of |\caption|\-|setup| see \Ref{captionsetup}.
% \end{Annotation}
%
% \iffalse
% --------------------------------------------------------------------------- %
% \fi
%
% \clearpage
% \section{Options}
% \label{options}
%
% \def\OptionLabel{RaggedRight}
% \def\UserDefined{\ldots}
%
% \iffalse
% --------------------------------------------------------------------------- %
% \fi
%
% \subsection{Formatting}
% \label{formats}
%
% \DescribeMacro{format=}
% A figure or table caption mainly consists of three parts: the caption label,
% which says if this object is a `Figure' or `Table' and what number is
% associated with it, the caption text itself, which is normally a short
% description of contents, and the caption separator which separates the text
% from the label.
%
% The \textit{caption format} determines how this information will be presented;
% it is specified with the option
% \begin{quote}
%   |format=|\meta{format name}\quad,
% \end{quote}
% having the name of the caption format as its argument.
%
% There are two standard caption formats:
% \begin{Options}{\OptionLabel}
%   \item[plain]%\NEWdescription{v3.0h}
%   Typesets the captions as a normal paragraph.
%
%   \item[hang]
%   Indents the caption text, so it will `hang' under the first line of the text.
%
%   \item[\UserDefined]
%   Own formats can be defined using |\Declare|\-|Caption|\-|Format|.\LineBreak
%   \SeeUserDefined
% \end{Options}
%
% \begin{Example}
%   An example: Specifying the option
%   \begin{quote}
%     |format=hang|
%   \end{quote}
%   yields captions like this:
%   \example{format=hang}{\exampletext}
% \end{Example}
%
% \pagebreak[3]
% \DescribeMacro{indention=}
% For both formats (\texttt{plain} and \texttt{hang}) you can setup an extra
% indention starting at the second line of the caption. You do this with the
% option
% \begin{quote}
%   |indention=|\meta{amount}\quad.
% \end{quote}
%
% Two examples:
%
% \begin{Example}
%   \begin{quote}
%     |format=plain,indention=.5cm|
%   \end{quote}
%   \captionsetup{skip=0pt}
%   \example{format=plain,indention=.5cm}{\exampletext}
% \end{Example}
%
% \begin{Example}
%   \begin{quote}
%     |format=hang,indention=-0.5cm|
%   \end{quote}
%   \captionsetup{skip=0pt}
%   \example{format=hang,indention=-0.5cm}{\exampletext}
% \end{Example}
%
% \bigskip
%
% \pagebreak[3]
% \DescribeMacro{labelformat=}
% With the option
% \nopagebreak[3]
% \begin{quote}
%   |labelformat=|\meta{label format name}
% \end{quote}
% \nopagebreak[3]
% you specify how the caption label will be typeset.
% There are five standard caption label formats:
%
% \begin{Options}{\OptionLabel}
%   \item[original]
%   The caption label will be typeset as specified by the document class,
%   usually this means the name and the number (like \texttt{simple}).
%
%   Until \version{3.4} of \thispackage\ this label format was called `default'.
%   Since \version{3.5} it is called `original' and usually is the default label
%   format, so |label|\-|format=|\-|default| will still select this label format,
%   unless the default was changed by either a document class or babel language package.
%
%   \item[empty]
%   The caption label will be empty.
% \iffalse
%   (This option makes sense when used together with other options like
%    \texttt{labelsep=none}.)
% \fi
%
%   \item[simple]
%   The caption label will be typeset as a name and a number.
%
%   \item[brace]\NEWfeature{v3.1f}
%   The caption label will be closed with a single (right) brace.
%
%   \item[parens]
%   The number of the caption label will be typeset in parentheses.
%
%   \item[\UserDefined]
%   Own label formats can be defined using |\Declare|\-|Caption|\-|Label|\-|Format|.
%   \SeeUserDefined
% \end{Options}
%
% \begin{Example}
%   An example: Using the options
%   \begin{quote}
%     |format=plain,labelformat=parens,labelsep=quad|
%   \end{quote}
%   gives captions like this one:
%   \example{format=plain,labelformat=parens,labelsep=quad}{\exampletext}
% \end{Example}
%
% \medskip
%
% \begin{Note*}
% Some environments, e.g.~the |algorithm| environment offered by the
% \package{algorithm2e} package, might react allergic to a change of the
% caption label format.
% \end{Note*}
%
% \bigskip
%
% \pagebreak[3]
% \DescribeMacro{labelsep=}
% With the option
% \begin{quote}
%   |labelsep=|\meta{label separator name}
% \end{quote}
% you specify what caption separator will be used.\footnote{%
%   If the caption label or the caption text is empty,
%   no separator will be used.}
% You can choose one of the following:
%
% \begin{Options}{\OptionLabel}
%   \item[none]
%   There is no caption separator.
% \iffalse
%   (This option makes sense when used together with other options like
%    \texttt{labelformat=empty}.)
% \fi
%
%   \item[colon]
%   The caption label and text will be separated by a colon and a space.
%
%   \item[period]
%   The caption label and text will be separated by a period and a space.
%
%   \item[space]
%   The caption label and text will be separated by a single space.
%
%   \item[quad]
%   The caption label and text will be separated by a |\quad|.
%
%   \item[newline]
%   The caption label and text will be separated by a line break (|\\|).
%   Please note that this separator does not work with all caption
%   formats (e.g.~|format=|\x|hang|), and you'll get an error message
%   trying such combination of options.
%
%   \item[endash]\NEWfeature{v3.0h}
%   The caption label and text will be separated by an en-dash,
%   surrounded by spaces (\verb*| -- |).
%
%   \item[\UserDefined]
%   Own separators can be defined using |\Declare|\-|Caption|\-|Label|\-|Sep|\-|a|\-|ra|\-|tor|.
%   \SeeUserDefined
% \end{Options}
%
% Three examples:
% \begin{Example}
%   \begin{quote}
%     |format=plain,labelsep=period|
%   \end{quote}
%   \captionsetup{skip=0pt}
%   \example{format=plain,labelsep=period}{\exampletext}
% \end{Example}
%
% \begin{Example}
%   \begin{quote}
%     |format=plain,labelsep=newline,singlelinecheck=false|
%   \end{quote}
%   \captionsetup{skip=0pt}
%   \example{format=plain,labelsep=newline,singlelinecheck=false}{\exampletext}
% \end{Example}
%
% \begin{Example}
%   \begin{quote}
%     |format=plain,labelsep=endash|
%   \end{quote}
%   \captionsetup{skip=0pt}
%   \example{format=plain,labelsep=endash}{\exampletext}
% \end{Example}
%
% \bigskip
%
% \pagebreak[3]
% \DescribeMacro{textformat=}
% \NEWfeature*{v3.1}
% With the option
% \nopagebreak[3]
% \begin{quote}
%   |textformat=|\meta{text format name}
% \end{quote}
% \nopagebreak[3]
% you specify how the caption text will be typeset.
% There are two standard caption text formats:
%
% \begin{Options}{\OptionLabel}
%   \item[empty]
%   The caption text will be suppressed.
%
%   \item[simple]
%   The caption text will be typeset as it is.
%
%   \item[period]
%   The caption text will be followed by a period.
%
%   \item[\UserDefined]
%   Own text formats can be defined using |\Declare|\-|Caption|\-|Text|\-|Format|.
%   \SeeUserDefined
% \end{Options}
%
% \iffalse
% --------------------------------------------------------------------------- %
% \fi
%
% \PageBreak
% \subsection{Justification}
% \label{justification}
%
% \DescribeMacro{justification=}
% As addition to the caption format you could also specify a
% \emph{caption justification}; it is specified with the option
% \begin{quote}
%   |justification=|\meta{justification name}\quad.
% \end{quote}
%
% You can choose one of the following:
%
% \begin{Options}{\OptionLabel}
%   \item[justified]
%   Typesets the caption as a normal paragraph.
%
%   \item[centering]
%   Each line of the caption will be centered.
%
% \iffalse
%  \item[Centering]
% \fi
%
%   \item[centerlast]
%   The last line of each paragraph of the caption text will be centered.
%
%   \item[centerfirst]
%   Only the first line of the caption will be centered.
%
%   \item[raggedright]
%   Each line of the caption will be moved to the left margin.
%
% \iffalse
%   \item[RaggedRight]
%   Each line of the caption will be moved to the left margin using
%   the command |\RaggedRight| from the \package{ragged2e} package.
% \else
%   \item[RaggedRight]
%   Each line of the caption will be moved to the left margin, too.
%   But this time the command |\RaggedRight| of the \package{ragged2e}
%   package will be used to achieve this.
%   The main difference to |raggedright| is that the word breaking
%   algorithm of \TeX\ will work inside captions.\footnote{%
%     The need for the \package{ragged2e} package will be detected at
%     run-time, therefore you maybe need a second \LaTeX\ run if this
%     option is used for the first time.}
% \fi
%
%   \item[raggedleft]
%   Each line of the caption will be moved to the right margin.
%
% \iffalse
%  \item[RaggedLeft]
%  Each line of the caption will be moved to the right margin using
%  the command |\RaggedLeft| from the \package{ragged2e} package.
% \fi
%
%   \item[\UserDefined]
%   Own justifications can be defined using |\Declare|\-|Caption|\-|Jus|\-|ti|\-|fi|\-|ca|\-|tion|.
%   \SeeUserDefined
% \end{Options}
%
% Three examples:
% \begin{Example}
%   \begin{quote}
%     |format=hang,justification=raggedright|
%   \end{quote}
%   \captionsetup{skip=0pt}
%   \example{format=hang,justification=raggedright}{\exampletext}
% \end{Example}
%
% \begin{Example}
%   \begin{quote}
%     |format=hang,justification=centerlast|
%   \end{quote}
%   \captionsetup{skip=0pt}
%   \example{format=hang,justification=centerlast}{\exampletext}
% \end{Example}
%
% \begin{Example}
%   \begin{quote}
%     |format=plain,labelsep=newline,justification=centering|
%   \end{quote}
%   \captionsetup{skip=0pt}
%   \example*{format=plain,labelsep=newline,justification=centering}{\exampletext}
% \end{Example}
%
% \smallskip
%
% \PageBreak
% \DescribeMacro{singlelinecheck=}
% The standard \LaTeX\ document classes (\class{article}, \class{report}, and
% \class{book}) automatically center a caption if it fits in one single line:
%
% \example*{}{A short caption.}
%
% \INFO
% \Thispackage\ adapts this behavior and therefore usually ignores the
% justification \& indention you have set with |justification=| \&
% |indention=| in such case.
% But you can switch this special treatment of such short captions off
% with the option
% \begin{quote}
%   |singlelinecheck=|\meta{bool}\quad.
% \end{quote}
% Using |false|, |no|, |off| or |0| for \meta{bool} switches the
% extra centering off:
% \begin{quote}
%   |singlelinecheck=false|
% \end{quote}
% Doing so the above short caption would look like
%
% \begingroup
%   \captionsetup{type=figure}
%   \ContinuedFloat
%   \example*{singlelinecheck=false}{A short caption.}
% \endgroup
%
% You switch the extra centering on again by using |true|, |yes|, |on| or |1|
% for \meta{bool}. (The default is on.)
%
% \iffalse
% --------------------------------------------------------------------------- %
% \fi
%
% \subsection{Fonts}
% \label{fonts}
%
% \DescribeMacro{font=}
% \DescribeMacro{labelfont=}
% \DescribeMacro{textfont=}
% There are three font options which affects different parts of the caption:
% One affecting the whole caption (|font|), one which only affects the caption
% label and separator (|label|\-|font|) and at least one which only affects the
% caption text (|text|\-|font|).
% You set them up using the options
% \begin{quote}\begin{tabular}{@{}r@{}ll}
%   |font=|      & \marg{font options} & ,\\
%   |labelfont=| & \marg{font options} & , and\\
%   |textfont=|  & \marg{font options} & ,\\
% \end{tabular}\end{quote}
% where \meta{font options} is a list of comma separated font options.
%
% And these are the available font options:
%
% \begin{Options}{stretch=\meta{amount}}
%   \item[scriptsize]   {\scriptsize Very small size}
%   \item[footnotesize] {\footnotesize The size usually used for footnotes}
%   \item[small]        {\small Small size}
%   \item[normalsize]   {\normalsize Normal size}
%   \item[large]        {\large Large size}
%   \item[Large]        {\Large Even larger size}
% \end{Options}
% \vspace{0pt}\pagebreak[3]
% \begin{Options}{stretch=\meta{amount}}
%   \item[normalfont]   {\normalfont Normal shape \& series \& family}
%
%   \item[up]           {\upshape Upright shape}
%   \item[it]           {\itshape Italic shape}
%   \item[sl]           {\slshape Slanted shape}
%   \item[sc]           {\scshape Small Caps shape}
%
%   \item[md]           {\mdseries Medium series}
%   \item[bf]           {\bfseries Bold series}
%
%   \item[rm]           {\rmfamily Roman family}
%   \item[sf]           {\sffamily Sans Serif family}
%   \item[tt]           {\ttfamily Typewriter family}
% \end{Options}
% \vspace{0pt}\pagebreak[3]
% \begin{Options}{stretch=\meta{amount}}
%   \item[singlespacing]  Single spacing \See{\Ref{setspace}}
%   \item[onehalfspacing] One-and-a-half spacing \See{\Ref{setspace}}
%   \item[doublespacing]  Double spacing \See{\Ref{setspace}}
%   \item[stretch=\meta{amount}] |\setstretch|\marg{amount} \See{\Ref{setspace}}
% \end{Options}
% \vspace{0pt}\pagebreak[3]
% \begin{Options}{stretch=\meta{amount}}
%   \item[normalcolor]          |\normalcolor|
%   \item[color=\meta{colour}]  |\color|\marg{colour}
%        {\small(If the \package{color} or \package{xcolor} package is loaded,
%         see \Ref{declare} for an example)}
% \end{Options}
% \vspace{0pt}\pagebreak[3]
% \begin{Options}{stretch=\meta{amount}}
%   \item[normal] The combination of the options |normal|\-|color|,
%                 |normal|\-|font|, |normal|\-|size|, and |single|\-|spacing|
%
%   \item[\UserDefined]
%   Own font options can be defined using |\Declare|\-|Caption|\-|Font|.
%   \SeeUserDefined
% \end{Options}
%
% If you use only one of these options you can omit the braces;
% e.g., the options
%   |font={small}|
% and
%   |font=small|
% will give the same result.
%
% Three examples:
% \begin{Example}
%   \begin{quote}
%     |font=it,labelfont=bf|
%   \end{quote}
%   \captionsetup{skip=0pt}
%   \example{font=it,labelfont=bf}{\exampletext}
% \end{Example}
%
% \begin{Example}
%   \begin{quote}
%     |labelfont=sc,textfont=it|
%   \end{quote}
%   \captionsetup{skip=0pt}
%   \example{labelfont=sc,textfont=it}{\exampletext}
% \end{Example}
%
% \begin{Example}
%   \begin{quote}
%     |font={small,stretch=0.80}|
%   \end{quote}
%   \captionsetup{skip=0pt}
%   \example{font={small,stretch=0.80}}{\exampletext}
% \end{Example}
%
% \medskip
%
% \pagebreak[3]
% \DescribeMacro{font+=}
% \DescribeMacro{labelfont+=}
% \DescribeMacro{textfont+=}
% \NEWfeature*{v3.1}
% You can also add font options to the current ones, so for example
% \begin{quote}
%   |\captionsetup{font=small}|\\
%   |\captionsetup{font+=it}|
% \end{quote}
% is identical to
% \begin{quote}
%   |\captionsetup{font={small,it}}|
% \end{quote}
%
% \iffalse
% --------------------------------------------------------------------------- %
% \fi
%
% \subsection{Margins and further paragraph options}
% \label{margins}
%
% \DescribeMacro{margin=}
% \DescribeMacro{width=}
% For all captions you can specify \emph{either} an extra margin \emph{or}
% a fixed width:~\footnote{Only fixed widths are supported here; if you are
% looking for a way to limit the width of the caption to the width of the
% figure or table, please take a look at the \package{floatrow}\cite{floatrow}
% or \package{threeparttable}\cite{threeparttable} package.}
% \begin{quote}\begin{tabular}{@{}r@{}ll}
%   |margin=| & \meta{amount} & \emph{--or--}\\
%   |margin=| & |{|\meta{left amount}|,|\meta{right amount}|}| & \emph{--or--}\\
%   |width=|  & \meta{amount} & \\
% \end{tabular}\end{quote}
% \NEWfeature{v3.1}
% If you specify just one \meta{amount} for the margin, it will be used for
% both, the left and right margin, e.g.~|margin=|\x|10pt| is equivalent to
% |margin=|\x|{10pt,10pt}|.
% In two-side documents the left and right margin will be swapped on even pages.
% \DescribeMacro{oneside}
% \DescribeMacro{twoside}
% To prevent this you can specify the option |oneside| additionally,
% e.g.~|\caption|\-|setup{margin=|\x|{0pt,10pt},|\x|oneside}|.\par
% But if you are specifying a width, then both, the left and the right margin,
% will have the same amount.
%
% Three examples will illustrating this:
% \begin{Example}
%   \begin{quote}
%     |margin=10pt|
%   \end{quote}
%   \captionsetup{skip=0pt}
%   \example{margin=10pt}{\exampletext}
% \end{Example}
%
% \begin{Example}
%   \begin{quote}
%     |margin={1cm,0cm}|
%   \end{quote}
%   \captionsetup{skip=0pt}
%   \example{margin={1cm,0cm}}{\exampletext}
% \end{Example}
%
% \begin{Example}
%   \begin{quote}
%     |width=.75\textwidth|
%   \end{quote}
%   \captionsetup{skip=0pt}
%   \example{width=.75\textwidth}{\exampletext}
% \end{Example}
%
% \begin{Note}
% When the caption is placed beside the contents (for example in a |SC|\-|figure|
% environment offered by the \package{sidecap} package\cite{sidecap}) or the
% figure is an in-text figure (for example in a |wrap|\-|figure| environment
% offered by the \package{wrapfig} package\cite{wrapfig}), the margin setting
% will be automatically reset to |0pt| at the very beginning of the environment.
% But if you really want to setup an extra margin for these environments, you can
% do so by setting this margin either inside the environment itself, of by
% specifying a margin for this particular environment,
% e.g.~|\caption|\-|setup[SC|\-|figure]{margin=|\x|10pt}|.
% \end{Note}
%
% \begin{Expert}
% \DescribeMacro{margin*=}
% \NEWfeature*{v3.1}
% There is also a starred variant of the |margin=| option, |margin*=|, which only
% changes the margin if no width was set.
% \end{Expert}
%
% \begin{Expert}
% \DescribeMacro{minmargin=}
% \DescribeMacro{maxmargin=}
% \NEWfeature*{v3.1}
% You can also set a minimum or maximum margin amount. This can be useful for
% limiting the margin amount in smaller environments, e.g.~|minipage|s.
% For example the \SmF\ document classes limit the margin amount to
% |maxmargin=|\x|0.1\linewidth|. (See \Ref{SMF})
% \end{Expert}
%
% \medskip
%
% \pagebreak[3]
% \DescribeMacro{parskip=}
% This option is useful for captions containing more than one paragraph.
% It specifies the extra vertical space inserted between them:
% \begin{quote}
%   |parskip=|\meta{amount}
% \end{quote}
% One example:
% \begin{Example}
%   \begin{quote}
%     |margin=10pt,parskip=5pt|
%   \end{quote}
%   \captionsetup{skip=0pt}
%   \example{margin=10pt,parskip=5pt}{%
%     First paragraph of the caption. This one contains some test, just to
%     show how these options affect the layout of the caption.\par
%     Second paragraph of the caption. This one contains some text, too, to
%     show how these options affect the layout of the caption.}
% \end{Example}
%
% \pagebreak[3]
% \DescribeMacro{hangindent=}
% The option
% \begin{quote}
%   |hangindent=|\meta{amount}
% \end{quote}
% is for setting up a hanging indention starting from the second line of each
% paragraph. If the caption contains just a single paragraph, using this option
% leads to the same result as the option |indention=|\meta{amount} you already
% know about.
% But if the caption contains multiple paragraphs you will notice the difference:
%
% \begin{Example}
%   \begin{quote}
%     |format=hang,indention=-.5cm|
%   \end{quote}
%   \captionsetup{skip=0pt}
%   \example{format=hang,indention=-.5cm}{%
%     First paragraph of the caption. This one contains some test, just to
%     show how these options affect the layout of the caption.\par
%     Second paragraph of the caption. This one contains some text, too, to
%     show how these options affect the layout of the caption.}
% \end{Example}
%
% \begin{Example}
%   \begin{quote}
%     |format=hang,hangindent=-.5cm|
%   \end{quote}
%   \captionsetup{skip=0pt}
%   \example{format=hang,hangindent=-.5cm}{%
%     First paragraph of the caption. This one contains some test, just to
%     show how these options affect the layout of the caption.\par
%     Second paragraph of the caption. This one contains some text, too, to
%     show how these options affect the layout of the caption.}
% \end{Example}
%
% \begin{Note}
% If your caption contains more than one paragraph, you have
% to specify an alternative caption for the list-of-figures using the
% optional argument of |\caption| or |\caption|\-|of|, otherwise you will
% get an error message.
% \end{Note}
%
% \iffalse
% --------------------------------------------------------------------------- %
% \fi
%
% \PageBreak
% \subsection{Styles}
% \label{style}
%
% \DescribeMacro{style=}
% A suitable combination of caption options is called \emph{caption style}.
% You can compare them more or less to page styles which you set up with
% |\page|\-|style|;
% the caption style provides all settings for a whole caption layout.
%
% You switch to an already defined caption style with the option
% \begin{quote}
%   |style=|\meta{style name}\quad.
% \end{quote}
% \Thispackage\ pre-defines two styles: |base| and |default|.
%
% \NEWfeature{v3.1}
% The |base| style puts all options you already know about to values reflecting
% the look of the captions when using one of the base \LaTeX\ document classes
% \class{article}, \class{report}, and \class{book}.
% This means that specifying the option
% \begin{quote}
%   |style=base|
% \end{quote}
% has the same effect as specifying all these options:
% \begin{quote}
%   |format=plain,labelformat=default,labelsep=colon,|\\
%   |justification=justified,font={},labelfont={},|\\
%   |textfont={},margin=0pt,indention=0pt|\\
%   |parindent=0pt,hangindent=0pt,singlelinecheck=true|
% \end{quote}
% \begin{Annotation*}
% But |justification=centering,indention=0pt| will be set if
% the caption fits into a single line.
% \end{Annotation*}
%
% In contrast the |default| style follows the default values, reflecting
% the look of the captions given by the document class you actually use.
% This style is selected by default and represents these options:
% \begin{quote}
%   |format=default,labelformat=default,labelsep=default,|\\
%   |justification=default,font=default,labelfont=default,|\\
%   |textfont=default,margin=0pt,indention=0pt|\\
%   |parindent=0pt,hangindent=0pt,singlelinecheck=true|
% \end{quote}
% \begin{Annotation*}
% But again |justification=centering,indention=0pt| will be set if
% the caption fits into a single line.
% \end{Annotation*}
%
% So if you use one of the base \LaTeX\ document classes \class{article},
% \class{report}, or \class{book}, both caption styles, |base| and |default|,
% point to (nearly) the same settings.
%
% \begin{Note}
% Own caption styles can be defined using |\Declare|\-|Caption|\-|Style|.\LineBreak
% \SeeUserDefined
% \end{Note}
%
% \iffalse
% --------------------------------------------------------------------------- %
% \fi
%
% \subsection{Skips}
% \label{skips}
%
% \DescribeMacro{skip=}
% The vertical space between the caption and the figure or table contents is
% controlled by the option
% \begin{quote}
%   |skip=|\meta{amount}\quad.
% \end{quote}
% The standard \LaTeX\ document classes \class{article}, \class{report} and
% \class{book} preset it to |skip=|\x|10pt|, but other document classes may
% use a different amount.
%
% \bigskip
%
% \pagebreak[3]
% \DescribeMacro{position=}
% The |\caption| command offered by \LaTeX{} has a design flaw:
% The command does not know if it stands on the beginning of the figure or
% table, or at the end. Therefore it does not know where to put the space
% separating the caption from the content of the figure or table.
% While the standard implementation always puts the space above the caption
% in floating environments (and inconsistently below the caption in
% |long|\-|table|s), the implementation offered by this package is more
% flexible:
% By giving the option
% \begin{quote}
%   |position=top|\quad or\quad |position=above|
% \end{quote}
% it's assumed that the caption is standing at the \emph{top} of the
% environment and therefore the space setup with |skip=|\x\meta{amount}
% is placed below the caption.
% (Please note that |position=|\x|top| does \emph{NOT} mean that the
% caption is actually placed at the top of the figure or table.
% Instead the caption is usually placed where you place the |\caption|
% command.)
% But with
% \begin{quote}
%   |position=bottom|\quad or\quad |position=below|
% \end{quote}
% it's assumed that the caption is standing at the \emph{bottom} of the
% environment and therefore the space is placed above the caption.
% And finally with
% \begin{quote}
%   |position=auto|\quad {\small(which is the default setting)}
% \end{quote}
% \thispackage\ tries its best to determine the actual position of
% the caption on its own. Please note that while this is successfully in
% most cases, it could give wrong results under rare circumstances.
%
% \medskip
%
% \pagebreak[3]
% \DescribeMacro{figureposition=}
% \DescribeMacro{tableposition=}
% The |position| option is especially useful when used together with the
% optional argument of the |\caption|\-|setup| command.
% \See{also \Ref{captionsetup}}\par
% For example
% \begin{quote}
%   |\captionsetup[table]{position=above}|
% \end{quote}
% causes all captions within tables to be treated as captions \emph{above}
% the table (regarding spacing around it).
% Because this is a very common setting, \thispackage\ offers
% the abbreviating options |figure|\-|position=|\x\meta{pos} and
% |table|\-|position=|\x\meta{pos}, e.g.
% \begin{quote}
%   |\usepackage[|\ldots|,tableposition=top]{caption}|
% \end{quote}
% is equivalent to
% \begin{quote}
%   |\usepackage[|\ldots|]{caption}|\\
%   |\captionsetup[table]{position=top}|
% \end{quote}
%
% \medskip
%
% \INFO
% Please note that the options |skip=|, |position=|, |figure|\-|position=|,
% and |table|\-|position=| do not always have an effect.
% Since it's a matter of the document class to supply the environments
% |figure| and |table|, it could use its very own spacing, and could
% decide for itself if the caption will be typeset as ``top'' or ``bottom''
% caption.
% For example the \KOMAScript\ document classes support the |skip=|
% setting, but will always typeset |figure| captions as ``bottom'' captions,
% and |table| captions are dependent on the global option
% |table|\-|captions|\-|above| resp.\ |table|\-|captions|\-|below|.
% \See{\Ref{KOMA}}
%
% Furthermore some packages control the behavior of the spacing above and
% below the caption for themself, e.g.~the \package{float}, the
% \package{floatrow}, and the \package{supertabular} package.
%
% \bigskip
%
% \begin{Expert*}
% Internally the skip between caption and contents is represented by
% |\above|\-|caption|\-|skip| (which is always set above the caption in
% \LaTeX{}s implementation).
% But there is a second value |\below|\-|caption|\-|skip| (usually set to
% |0pt| by default) which is set below the caption in \LaTeX{}s implementation,
% but on the other side than |\above|\-|caption|\-|skip| by this package.
% So technically speaking, this package swaps the meaning of these two skips
% when |position=|\x|top| is set.
% Please note that there are several packages around which do the same trick
% (like the \package{ftcap}, the \package{nonfloat}, and the \package{topcap}
% package), so the usage of the \package{caption} option |position=| is not
% supported if one of these packages will be used, too.
% \end{Expert*}
%
% \iffalse
% --------------------------------------------------------------------------- %
% \fi
%
% \subsection{Lists}
% \label{lists}
%
% \DescribeMacro{list=}
% \NEWfeature*{v3.1}
% The |\caption| command usually places an entry in the List of Figures
% resp.~List of Tables. You can either suppress that individually by giving an
% empty optional argument to |\caption| {\small(see \Ref{caption})}, or
% programmatically by saying
% \begin{quote}
%   |list=no|\quad(or any other boolean value instead of |no|)\quad.~\footnote{%
%   Please note that the \package{subfig} package\cite{subfig} is not supporting
%   this option, it uses the counters \texttt{lofdepth} \& \texttt{lotdepth} for
%   this purpose instead.}
% \end{quote}
%
% \pagebreak[3]
% \DescribeMacro{listformat=}
% \NEWfeature*{v3.1}
% With the option
% \nopagebreak[3]
% \begin{quote}
%   |listformat=|\meta{list format name}
% \end{quote}
% \nopagebreak[3]
% you can specify how the |figure| or |table| number will be typeset within
% the List of Figures resp.~List of Tables.
% There are five standard caption list formats:
%
% \begin{Options}{\OptionLabel}
%   \item[empty]
%   No number will be typeset.
%
%   \item[simple]
%   The number will be typeset with label prefix.
%
%   \item[parens]
%   The number will be typeset in parentheses, with label prefix.
%
%   \item[subsimple]
%   Same as |simple|, but without label prefix. (default)
%
%   \item[subparens]
%   Same as |parens|, but without label prefix.
%
%   \item[\UserDefined]
%   Own list formats can be defined using |\Declare|\-|Caption|\-|List|\-|Format|.
%   \SeeUserDefined
% \end{Options}
%
% The prefix ($=$|\p@figure| resp.~|\p@table|), which runs ahead of the
% number ($=$|\the|\-|figure| resp.~|\the|\-|table|) in lists (e.g.~List of
% Figure/Table) and references, is usually empty,
% so the list formats |simple| and |subsimple| gives equal results;
% same with |parens| and |subparens|.
% But this can be different for sub-figures or sub-tables listed in the List of
% Figures resp.~List of Tables, or when the label prefix is redefined for a
% different purpose.\footnote{%
%   Sub-figures and sub-tables can be typeset using the \package{subcaption}
%   or \package{subfig} package.}
%
% \iffalse
% --------------------------------------------------------------------------- %
% \fi
%
% \subsection{Names}
% \label{names}
%
% \DescribeMacro{name=}
% \NEWfeature*{v3.1}
% The option
% \begin{quote}
%   |name=|\meta{name}
% \end{quote}
% changes the name of the \emph{current} environment.
% This could be useful in conjunction with the optional argument of
% |\caption|\-|setup|, e.g.
% \begin{quote}
%   |\captionsetup[wrapfigure]{name=Fig.}|
% \end{quote}
% changes the name to ``Fig.'' for all |wrap|\-|figure|s (while all the other
% figure captions will still have ``Figure'' as name).
%
% \iffalse
% --------------------------------------------------------------------------- %
% \fi
%
% \subsection{Types}
% \label{types}
%
% \DescribeMacro{type=}
% The |\caption| command can typeset captions for different types,
% e.g.~|figure| and |table|. If you try to use the |\caption| command outside
% these environments you will get an error message, because it does not know what
% kind of caption do you want to have here. But in such situations you can set
% the caption type manually with
% \begin{quote}
%   |type=|\meta{float type}
% \end{quote}
% prior to the usage of the |\caption| command (and other commands like
% |\Continued|\-|Float|, or |\sub|\-|caption|\-|box| offered by the
% \package{subcaption} package, or |\sub|\-|float| offered by the
% \package{subfig} package\cite{subfig}),
% for example within an non-floating environment like |minipage|:
% \begin{quote}
%   |\noindent\begin{minipage}{\textwidth}|\\
%   |  \captionsetup{type=figure}|\\
%   |  \subfloat{|\ldots|}|\\
%   |  |\ldots\\
%   |  \caption{|\ldots|}|\\
%   |\end{minipage}|
% \end{quote}
%
% \begin{Expert}
% There is also a starred variant of this option, |type*=|\meta{float type},
% which behaves different than |type=|\meta{float type} if the
% \package{hyperref} package\cite{hyperref} is loaded: While |type=| sets an
% hyperlink anchor (if |hypcap=|\x|true| is set), |type*=| does not.
% (See also \Ref{hyperref}\,)
% \end{Expert}
% \begin{Expert}
% \emph{\DefaultNoteText:} Please don't re-define the internal macro |\@captype|
% for yourself, like suggested by some documentations, always use
% |\caption|\-|setup{type=|\x\ldots|}| instead.
% \end{Expert}
%
% \medskip
%
% Own float types can be defined with
%  |\Declare|\-|Floating|\-|Environment| offered by the \package{newfloat} package,
%  |\new|\-|float| offered by the \package{float} package\cite{float}, or
%  |\Declare|\-|New|\-|Float|\-|Type| offered by the \package{floatrow} package\cite{float}.
%
% \medskip
%
% \INFO % \NEWdescription{v3.1}
% Please note that you should use the option |type=| only
% \emph{inside} boxes or environments (like |\par|\-|box| or |mini|\-|page|),
% at best one where no page break could happen between contents and caption.
% Furthermore some visual side-effects (e.g.~mixed-up figure and table settings
% regarding captions) could occur without using a box or environment,
% therefore a warning message will be issued if you try to do so.\footnote{%
% You only get this warning message if you use \eTeX\ as underlying \TeX\ engine.}
%
% \iffalse
% --------------------------------------------------------------------------- %
% \fi
%
% \clearpage
% \section{Commands}
%
% \subsection{Typesetting captions}
% \label{caption}
% \label{captionlistentry}
%
% \DescribeMacro{\caption}
% The command
% \begin{quote}
%   |\caption|\oarg{list entry}\marg{heading}
% \end{quote}
% typesets the caption inside a floating environment like |figure| or |table|.
% Well, you already know this, but \thispackage\ offers an extension:
% If you leave the argument \meta{list entry} empty, no entry in the list of
% figures or tables will be made. For example:
% \begin{quote}
%   |\caption[]{A figure without list entry.}|
% \end{quote}
%
% \begin{Expert}
% Please remember that the \meta{heading} is a so-called \emph{moving} argument,
% if no \meta{list entry} has been given. But if a \meta{list entry} is given,
% this argument is moving instead.
% ``\emph{Moving} argument'' means that the argument will be written to the
% list-of file, make it appearing in the ``List of Figures'' resp.
% ``List of Tables'', too.
% \emph{Moving} arguments are not allowed to contain \emph{fragile} commands,
% everything must be \emph{robust}, otherwise the argument could get
% \emph{broken}, resulting in strange errors at the next \LaTeX\ run.
% Some \emph{fragile} commands could be \emph{protected} by a leading |\protect|,
% own definitions could get defined with |\Declare|\-|Robust|\-|Command| instead of
% |\new|\-|command| to make them \emph{robust}.
%
% An example: |\caption{${}^{137}_{\phantom{1}55}$Cs}| will cause errors since
% |\phantom| is \emph{fragile}.
% So we have either have to use the optional argument \meta{list entry}
% (e.g.~|\caption[${}^|\x|{137}_|\x|{55}$|\x|Cs]|\x|{${}^|\x|{137}_|\x|{\phantom{1}55}$|\x|Cs}|)
% or add |\protect| to prevent the |\phantom| command from getting \emph{broken}:
% |\caption{${}^|\x|{137}_|\x|{|\textcolor{blue}{\cs{protect}}|\phantom{1}55}$|\x|Cs}|.
%
% But sometimes even this is not sufficient. The reason behind is the so-called
% single-line-check: It puts the \meta{heading} into a horizontal box to determine
% the width of the caption, and this could cause error messages, too.
% An example:
% |\caption{A| |scheme.| |\[V_{C}| |\sim| |\left| |\{| |\begin{array}{cc}|
% |E_{g}| |&| |\textrm{p-n}| |\\| |e\phi_{B}| |&| |\textrm{M-S}| |\end{array}|
% |\right.| |\]}|.
% Using |\caption[A| |scheme]{|\ldots|}| is not sufficient here, it's still
% leading to errors. (``\texttt{Missing \$ inserted.}'')
% So we have to put a |\caption|\-|setup{single|\-|line|\-|check=|\x|off}|
% just in front of the |\caption| command additionally.
%
% For more information about \emph{moving} arguments and \emph{fragile} \&
% \emph{robust} commands, take a closer look at your \LaTeX\ manual or visit
% \url{http://www-h.eng.cam.ac.uk/help/tpl/textprocessing/teTeX/latex/latex2e-html/fragile.html}.
% \end{Expert}
%
% \medskip
%
% \pagebreak[3]
% \DescribeMacro{\caption*}
% The \package{longtable} package defines the command |\caption*| which
% typesets the caption without label and without entry in the list of tables.
% An example:
% \begin{quote}
%   |\begin{longtable}{|\ldots|}|\\
%   |  \caption*{A table}\\|\\
%   |  |\ldots\\
%   |\end{longtable}|
% \end{quote}
% looks like
% \DeleteShortVerb{\|}
% \vskip\intextsep
% \begin{minipage}{\linewidth}
%   \captionsetup{type=table,position=t}
%   \caption*{A table}
%   \centering
%   \begin{tabular}{r|rr}
%       & x & y \\\hline
%     a & 1 & 2 \\
%     b & 3 & 4 \\
%   \end{tabular}
% \end{minipage}
% \vskip\intextsep
% \MakeShortVerb{\|}
% \Thispackage\ offers this feature, too, so you can use this command now within
% every floating environment like |figure| or |table|, like:
% \begin{quote}
%   |\begin{table}|\\
%   |  \caption*{A table}|\\
%   |  |\ldots\\
%   |\end{table}|
% \end{quote}
%
% \pagebreak[3]
% \DescribeMacro{\captionof}
% \DescribeMacro{\captionof*}
% Sometimes you want to typeset a caption \emph{outside} a floating environment,
% putting a figure within a non-floating |mini|\-|page| for instance.
% For this purpose \thispackage\ offers the command
% \begin{quote}
%   |\captionof|\marg{float type}\oarg{list entry}\marg{heading}\quad.
% \end{quote}
% Note that the first argument, the \meta{float type}, is mandatory here, because
% the |\captionof| command needs to know which name to put into the caption label
% (e.g. ``Figure'' or ``Table'') and in which list to put the contents entry.
% An example:
% \begin{quote}
%   |\captionof{table}{A table}|
% \end{quote}
% typesets captions like this:
% \begin{Example}
%   \captionsetup{position=top}
%   \captionof{table}{A table}
% \end{Example}
%
% The star variant |\caption|\-|of*| has the same behavior as the |\caption*|
% command:
% It typesets the caption without label and without entry to the list of figures
% or tables.
%
% \INFO % \NEWdescription{v3.1}
% Since |\caption|\-|of| uses the option |type| internally, the same
% restrictions as for the |type| option apply here, so you should use both
% |\caption|\-|of| and |\caption|\-|of*| only \emph{inside} boxes or
% environments, too.
% \See{\Ref{types}}
%
% \bigskip
%
% \pagebreak[3]
% \DescribeMacro{\captionlistentry}
% \NEWfeature*{v3.1}
% Under certain circumstances it could be useful to make a list-of-figure
% (or table) entry on its own.
% This could be achieved with
% \begin{quote}
%   |\captionlistentry|\oarg{float type}\marg{list entry}\quad.
% \end{quote}
%
% One example: It's quite easy to have a |long|\-|table| with captions above the
% contents and a single list entry which points to the first page of the table:
% \begin{quote}
%   |\begin{longtable}{|\ldots|}|\\
%   |  \caption{|\ldots|}\\|\\
%   |\endfirsthead|\\
%   |  \caption[]{|\ldots|}\\|\\
%   |\endhead|\\
%   |  |\ldots
% \end{quote}
% But since the \package{longtable} package does not offer an
% |\end|\-|first|\-|foot| command, you cannot easily have captions \emph{below}
% the table contents and a single list entry which points to the first page of
% the table.
% Here is were the |\caption|\-|list|\-|entry| command could be used:
% \begin{quote}
%   |\begin{longtable}{|\ldots|}|\\
%   |  \caption[]{|\ldots|}\\|\\
%   |\endfoot|\\
%   |  \captionlistentry{|\ldots|}|\\
%   |  |\ldots
% \end{quote}
%
% \begin{Annotation*}
% Another example can be found in \Ref{examples}.
% \end{Annotation*}
%
% \begin{Expert}
% There is also a starred variant, |\caption|\-|list|\-|entry*|, which does not
% increment the \meta{float type} counter.
% (Note that inside |long|\-|table| environments |\caption|\-|list|\-|entry|
% never increments the |table| counter. See also \Ref{longtable}.)
% \end{Expert}
%
% \begin{Expert}
% Please note that \meta{list entry} is a \emph{moving} argument, so everything
% it contains must be \emph{robust}. (See also explanation of |\caption|)
% \end{Expert}
%
% \subsection{Setting options}
% \label{captionsetup}
%
% \DescribeMacro{\captionsetup}
% We already know the |\caption|\-|setup| command (see \Ref{usage}),
% but this time we get enlighten about its optional argument
% \meta{float type}.
%
% Remember, the syntax of this command is
% \begin{quote}
%   |\captionsetup|\oarg{float type}\marg{options}\quad.
% \end{quote}
% If a \meta{float type} gets specified, all the \meta{options} don't
% change anything at this time. Instead they only get marked for a later use,
% when a caption inside of a floating environment of the particular type
% \meta{float type} gets typeset.
% For example
% \begin{quote}
%   |\captionsetup[figure]|\marg{options}
% \end{quote}
% forces captions within a |figure| environment to use the given \meta{options}.
%
% Here comes an example to illustrate this:
% \begin{quote}
%   |\captionsetup{font=small}|\\
%   |\captionsetup[figure]{labelfont=bf,textfont=it}|
% \end{quote}
% gives captions like this:
% \begin{Example}
%   \captionsetup{font=small}
%   \captionsetup[figure]{labelfont=bf,textfont=it}
%   \begingroup
%     \captionof{figure}{A figure}
%   \endgroup
%   \captionsetup{position=top}
%   \begingroup
%     \captionof{table}{A table}
%   \endgroup
% \end{Example}
% As you see the command |\caption|\-|setup[figure]{|\ldots|}| only changes
% the look of the |figure| caption labels, not touching the other ones.
%
% As \meta{float type} you can usually give one of these two only:
% |figure| or |table|.
% But as we will see later some \LaTeX\ packages (like the \package{floatrow},
% \package{longtable}, and \package{sidecap} package for example) and also
% this package offer additional environments with captions and these two
% commands can also be used with them.
% \See{\Ref{declare} and \Ref{packages}}
%
% \begin{Expert}
% \NEWfeature{v3.1}
% There is also a starred variant of |\caption|\-|setup|:
% \begin{quote}
%   |\captionsetup*|\oarg{float type}\marg{options}
% \end{quote}
% While the non-starred variant can give you warnings---for example if the
% \meta{options} are actually not used throughout the document
% (e.g.~a |\caption|\-|setup[table]{font=|\x|sf}| without a |table|)---the
% starred variant will not.
% \iffalse
% This can get quite useful when setting generic options which are independent
% of a specific document.
% \fi
% \end{Expert}
%
% \medskip
%
% \pagebreak[3]
% \DescribeMacro{\clearcaptionsetup}
% If you want to get rid of these parameters marked for an automatic use within
% a particular environment you can use the command
% \begin{quote}
%   |\clearcaptionsetup|\oarg{option}\marg{float type}\quad.
% \end{quote}
%
% For example |\clearcaptionsetup{figure}| would clear all the extra handling
% for figures in the example above:
% \begin{quote}
%   |\captionsetup{font=small}|\\
%   |\captionsetup[figure]{labelfont=bf,textfont=it}|\\
%   \ldots\\
%   |  \caption{A figure}|\\
%   \ldots\\
%   |\clearcaptionsetup{figure}|\\
%   \ldots\\
%   |  \caption{A figure}|\\
%   \ldots
% \end{quote}
% \begin{Example}
%   \captionsetup{font=small}
%   \captionsetup[figure]{labelfont=bf,textfont=it}
%   \begingroup
%     \captionof{figure}{A figure}
%   \endgroup
%   \captionsetup{position=top}
%   \clearcaptionsetup{figure}
%   \begingroup
%     \captionof{figure}{A figure}
%   \endgroup
% \end{Example}
%
% \pagebreak[3]
% \NEWfeature{v3.1}
% If an optional argument \meta{option} is given, only the settings regarding
% this particular \meta{option} are cleared.\footnote{You can only specify
% \emph{one} option here, not a list of options.
% If you want to clean more than one option, you need to use more than one
% \cs{clear}\-\texttt{caption}\-\texttt{setup}.}
% While the example above not only clears the options
% |labelfont=bf,|\x|textfont=it|
% for figures (but all options for figures instead),
% this one would only clear the |labelfont=bf| setting, leaving all other
% settings for figures intact:
% \begin{quote}
%   |\captionsetup{font=small}|\\
%   |\captionsetup[figure]{labelfont=bf,textfont=it}|\\
%   \ldots\\
%   |  \caption{A figure}|\\
%   \ldots\\
%   |\clearcaptionsetup[labelfont]{figure}|\\
%   \ldots\\
%   |  \caption{A figure}|\\
%   \ldots
% \end{quote}
% \begin{Example}
%   \captionsetup{font=small}
%   \captionsetup[figure]{labelfont=bf,textfont=it}
%   \begingroup
%     \captionof{figure}{A figure}
%   \endgroup
%   \captionsetup{position=top}
%   \clearcaptionsetup[labelfont]{figure}
%   \begingroup
%     \captionof{figure}{A figure}
%   \endgroup
% \end{Example}
% \begin{Expert}
% Analogous to |\caption|\-|setup*| there is also a starred form
% |\clear|\-|caption|\-|setup*| which suppresses warnings if the given
% \meta{option} was not setup for the specified \meta{float type}.
% \end{Expert}
%
% \medskip
%
% \pagebreak[3]
% \DescribeMacro{\showcaptionsetup}
% For debugging purposes the command
% \nopagebreak[3]
% \begin{quote}
%   |\showcaptionsetup|\marg{float type}
% \end{quote}
% \nopagebreak[3]
% is offered. It generates a log file entry, showing the given options
% for the specified \meta{float type}. For example
% \begin{quote}
%   |\captionsetup[figure]{labelfont=bf,textfont=it}|\\
%   |\showcaptionsetup{figure}|
% \end{quote}
% gives the info:
% \begin{quote}\small
%   |Caption Info: Option list on `figure'|\\
%   |Caption Data: {labelfont=bf,textfont=it} on input line 5.|
% \end{quote}
%
% \pagebreak[3]
% \subsection{Continued floats}
% \label{ContinuedFloat}
%
% \DescribeMacro{\ContinuedFloat}
% Sometimes you want to split figures or tables without giving them
% their own reference number. This is what the command
% \begin{quote}
%   |\ContinuedFloat|
% \end{quote}
% is for; it should be used as first command inside the floating environment.
% It prevents the incrementation of the relevant counter (usually done by
% |\caption|), so a figure or table containing a |\Continued|\-|Float| inside
% gets the same reference number as the figure or table before.
% An example:
% \begin{quote}
%   |\begin{table}|\\
%   |  \caption{A table}|\\
%   |  |\ldots\\
%   |\end{table}|\\
%   \ldots\\
%   |\begin{table}\ContinuedFloat|\\
%   |  \caption{A table (cont.)}|\\
%   |  |\ldots\\
%   |\end{table}|
% \end{quote}
% gives the following result:
% \begin{Example}
%   \captionsetup{type=table,position=b,skip=0pt}
%   \caption{A table}
%   \centerline{\ldots}
% \end{Example}
% \begin{Example}
%   \captionsetup{type=table,position=b,skip=0pt}
%   \ContinuedFloat
%   \caption{A table (cont.)}
%   \centerline{\ldots}
% \end{Example}
%
% \bigskip
%
% \NEWfeature{v3.1}
% Furthermore the |\Continued|\-|Float| command executes options associated with
% the type name ``|Continued|\-|Float|''. For example this can be used to switch
% to a different label format for continued figures or tables, as shown here:
% \begin{quote}
%   |\DeclareCaptionLabelFormat{continued}{Continued #1~#2}|\\
%   |\captionsetup[ContinuedFloat]{labelformat=continued}|\\
%   \ldots\\
%   |\begin{table}\ContinuedFloat|\\
%   |  \caption{A table}|\\
%   |  |\ldots\\
%   |\end{table}|
% \end{quote}
% \begin{Example}
%   \captionsetup{type=table,position=b,skip=0pt}
%   \captionsetup[ContinuedFloat]{labelformat=continued1}
%   \ContinuedFloat
%   \caption{A table}\label{continued1}
%   \centerline{\ldots}
% \end{Example}
% \smallskip
% \See{\Ref{declare} for an explanation of
%      \cs{Declare}\-\texttt{Caption}\-\texttt{Label}\-\texttt{Format}.}
%
% \medskip
%
% There is also a \LaTeX\ counter called |Continued|\-|Float| which could be
% used for own purposes.
% For ordinary (floating) environments it's set to zero, to one for the first
% continued float, to two inside the second one, and so on.
% So every |\Continued|\-|Float| increments this counter and a floating
% environment without |\Continued|\-|Float| command resets this counter to zero.
% An example:
% \begin{quote}
%   |\DeclareCaptionLabelFormat{cont}{#1~#2\alph{ContinuedFloat}}|\\
%   |\captionsetup[ContinuedFloat]{labelformat=cont}|\\
%   \ldots\\
%   |\begin{table}\ContinuedFloat|\\
%   |  \caption{A table}|\\
%   |  |\ldots\\
%   |\end{table}|
% \end{quote}
% \begin{Example}
%   \captionsetup{type=table,position=b,skip=0pt}
%   \captionsetup[ContinuedFloat]{labelformat=continued2}
%   \ContinuedFloat
%   \caption{A table}\label{continued2}
%   \centerline{\ldots}
% \end{Example}
% \medskip
% A reference to this table would still result in the output
% ``\autoref{continued2}'' since only the caption label format was changed.
% If you would like to use the |Continued|\-|Float| counter for the references,
% too, you could redefine the command |\the|\-|Continued|\-|Float| instead,
% which will be appended to the figure or table counter automatically in
% continued floats and is preset to be empty.
% \begin{quote}
%   |\renewcommand\theContinuedFloat{\alph{ContinuedFloat}}|\\
%   \ldots\\
%   |\begin{table}\ContinuedFloat|\\
%   |  \caption{A table}|\\
%   |  |\ldots\\
%   |\end{table}|
% \end{quote}
% \begin{Example}
%   \captionsetup{type=table,position=b,skip=0pt}
%   \renewcommand\theContinuedFloat{\alph{ContinuedFloat}}
%   \ContinuedFloat
%   \caption{A table}\label{continued3}
%   \centerline{\ldots}
% \end{Example}
% \medskip
% A reference to that table would result in the output ``\autoref{continued3}''.
%
% \pagebreak[3]
% \DescribeMacro{\ContinuedFloat*}
% Suppose you want to start the first figure or table of such a series with a
% kind of ``Figure 7a'' and not with ``Figure 7'' (and the second one with
% ``Figure 7b'' instead of ``Figure 7a'').
% This is possible, too, by using the starred variant |\Continued|\-|Float*|
% which---just like |\Continued|\-|Float|---executes options associated with the
% type name ``|Continued|\-|Float|'' and increments the \LaTeX\ counter
% |Continued|\-|Float|, \emph{but} marks the first figure or table of a series
% instead:
% \begin{quote}
%   |\renewcommand\theContinuedFloat{\alph{ContinuedFloat}}|\\
%   \ldots\\
%   |\begin{figure}\ContinuedFloat*|\\
%   |  |\ldots\\
%   |  \caption{First figure of a series}|\\
%   |\end{figure}|\\
%   \ldots\\
%   |\begin{figure}\ContinuedFloat|\\
%   |  |\ldots\\
%   |  \caption{Second figure of a series}|\\
%   |\end{figure}|\\
%   \ldots\\
%   |\begin{figure}\ContinuedFloat|\\
%   |  |\ldots\\
%   |  \caption{Third figure of a series}|\\
%   |\end{figure}|
% \end{quote}
% \begin{Example}
%   \captionsetup{type=figure,position=b,skip=0pt}
%   \renewcommand\theContinuedFloat{\alph{ContinuedFloat}}
%   \begingroup
%     \ContinuedFloat*
%     \centerline{\ldots}
%     \caption{First figure of a series}
%   \endgroup
%   \begingroup
%     \ContinuedFloat
%     \centerline{\ldots}
%     \caption{Second figure of a series}
%   \endgroup
%   \begingroup
%     \ContinuedFloat
%     \centerline{\ldots}
%     \caption{Third figure of a series}
%   \endgroup
% \end{Example}
%
% \begin{Note}
%   Unfortunately \cs{ContinuedFloat*} is not available if the
%   \package{subfig} package\cite{subfig} is loaded.
% \end{Note}
%
% \pagebreak[3]
% \subsubsection*{A note about longtables}
% If you want to have a different caption label in |long|\-|table|s (offered
% by the \package{longtable} package\cite{longtable}) after a page break,
% this can \emph{not} be archived by using |\Continued|\-|Float|,
% but instead you could write something like:
% \begin{quote}
%   |\DeclareCaptionLabelFormat{continued}{Continued #1~#2}|\\
%   \ldots\\
%   |\begin{longtable}{|\ldots|}|\\
%   |  \caption{A longtable}\\|\\
%   |\endfirsthead|\\
%   |  \captionsetup{labelformat=continued}|\\
%   |  \caption[]{A longtable}\\|\\
%   |\endhead|\\
%   |  |\ldots\\
%   |\end{longtable}|
% \end{quote}
%
% \iffalse
% --------------------------------------------------------------------------- %
% \fi
%
% \clearpage
% \section{Own enhancements}
% \label{declare}
%
% A family of commands is provided to allow users to define their own formats
% etc.
% This enables information on separators, justification, fonts, and styles to
% be associated with a name and kept in one place.
% (These commands need to appear in the document preamble,
% this is the part between |\document|\-|class| and |\begin{document}|.)
%
% \pagebreak[3]
% \DescribeMacro{\DeclareCaption-\\Format}
% You can define your own caption formats using the command
% \begin{quote}
%   |\DeclareCaptionFormat|\marg{name}\marg{code using \#1, \#2 and \#3}\mbox{\quad.}
% \end{quote}
% At usage the system replaces \#1 with the caption label, \#2 with the
% separator and \#3 with the text. So the standard format |plain| is
% pre-defined by \thispackage\ as
% \begin{quote}
%   |\DeclareCaptionFormat{plain}{#1#2#3\par}|\quad.
% \end{quote}
% \begin{Expert}
% There is also a starred variant, |\Declare|\-|Caption|\-|Format*|,
% which causes the code being typeset in \TeX s vertical (instead of
% horizontal) mode, but does not support the |indention=| option.
% \end{Expert}
%
% \pagebreak[3]
% \DescribeMacro{\DeclareCaption-\\LabelFormat}
% Likewise you can define your own caption label formats:
% \begin{quote}
%   |\DeclareCaptionLabelFormat|\marg{name}\marg{code using \#1 and \#2}
% \end{quote}
% At usage \#1 gets replaced with the name (e.g. ``figure'') and \#2
% gets replaced with the reference number (e.g. ``12'').
% An example:
% \begin{quote}
%   |\DeclareCaptionLabelFormat{bf-parens}{(\textbf{#2})}|\\
%   |\captionsetup{labelformat=bf-parens,labelsep=quad}|
% \end{quote}
% \example*{labelformat=bf-parens,labelsep=quad}{\exampletext}
%
% \pagebreak[3]
% \DescribeMacro{\bothIfFirst}
% \DescribeMacro{\bothIfSecond}
% If you define your own caption label formats and use the
% \package{subcaption} or \package{subfig}\cite{subfig} package,
% you should take care of empty caption label names.
% For this purpose the commands
% \begin{quote}
%   |\bothIfFirst|\marg{first arg}\marg{second arg}\quad and\\
%   |\bothIfSecond|\marg{first arg}\marg{second arg}
% \end{quote}
% are offered. |\bothIfFirst| tests if the first argument exists (means: is
% not empty), |\bothIfSecond| tests if the second argument exists. If yes,
% both arguments get typeset, otherwise none of them.
%
% \smallskip
%
% \pagebreak[3]
% For example the standard label format |simple| is \emph{not} defined as
% \begin{quote}
%   |\DeclareCaptionLabelFormat{simple}{#1~#2}|\mbox{\quad,}
% \end{quote}
% because this could cause an extra space if \#1 is empty. Instead |simple|
% is defined as
% \begin{quote}
%   |\DeclareCaptionLabelFormat{simple}%|\\
%   |                  {\bothIfFirst{#1}{~}#2}|\mbox{\quad,}
% \end{quote}
% causing the space to appear only if the label name is present.
%
% \smallskip
%
% \pagebreak[3]
% \DescribeMacro{\DeclareCaption-\\TextFormat}
% \NEWfeature*{v3.1}
% Likewise you can define your own caption text formats:
% \begin{quote}
%   |\DeclareCaptionTextFormat|\marg{name}\marg{code using \#1}
% \end{quote}
% At usage \#1 gets replaced with the caption text.
%
% \bigskip
%
% \pagebreak[3]
% \DescribeMacro{\DeclareCaption-\\LabelSeparator}
% You can define your own caption label separators with
% \begin{quote}
%   |\DeclareCaptionLabelSeparator|\marg{name}\marg{code}\mbox{\quad.}
% \end{quote}
% Again an easy example taken from \thispackage\ itself:
% \begin{quote}
%   |\DeclareCaptionLabelSeparator{colon}{: }|
% \end{quote}
% \begin{Expert}
% There is also a starred variant, |\Declare|\-|Caption|\-|Label|\-|Separator*|,
% which causes the code being typeset without using the |label|\-|font=| setting.
% So for example the label separators |quad|, |new|\-|line|, and |en|\-|dash|
% are defined in this way.
% \end{Expert}
%
% \bigskip
%
% \pagebreak[3]
% \DescribeMacro{\DeclareCaption-\\Justification}
% You can define your own caption justifications with
% \begin{quote}
%   |\DeclareCaptionJustification|\marg{name}\marg{code}\mbox{\quad.}
% \end{quote}
% The \meta{code} simply gets typeset just before the caption.
% E.g.~using the justification |raggedright|, which is defined as
% \begin{quote}
%   |\DeclareCaptionJustification{raggedright}{\raggedright}|\mbox{\quad,}
% \end{quote}
% typesets captions with all lines moved to the left margin.
%
% \bigskip
%
% \pagebreak[3]
% \DescribeMacro{\DeclareCaption-\\Font}
% You can define your own caption fonts with
% \begin{quote}
%   |\DeclareCaptionFont|\marg{name}\marg{code}\quad.
% \end{quote}
% For example this package defines the options |small| and |bf| as
% \begin{quote}
%   |\DeclareCaptionFont{small}{\small}|\quad and\\
%   |\DeclareCaptionFont{bf}{\bfseries}|\quad.
% \end{quote}
% \iffalse
% The line spacing could be customized using the \package{setspace} package,
% for example:%\NEWdescription{v3.0h}
% \begin{quote}
%   |\usepackage{setspace}|\\
%   |\DeclareCaptionFont{singlespacing}{\setstretch{1}}|~\footnote{%
%   \emph{\DefaultNoteText:} Using \cs{singlespacing} does not work here since
%   it contains a \cs{vskip} command.}\\
%   |\DeclareCaptionFont{onehalfspacing}{\onehalfspacing}|\\
%   |\DeclareCaptionFont{doublespacing}{\doublespacing}|\\
%   |\captionsetup{font={onehalfspacing,small},labelfont=bf}|
% \end{quote}
% \example{font={onehalfspacing,small},labelfont=bf,singlelinecheck=off}{\exampletext}
% \fi
% An example which brings color into life:
% \begin{quote}
%   |\usepackage{color}|\\
%   |\DeclareCaptionFont{red}{\color{red}}|\\
%   |\DeclareCaptionFont{green}{\color{green}}|\\
%   |\DeclareCaptionFont{blue}{\color{blue}}|\\
%   |\captionsetup{labelfont={blue,bf},textfont=green}|
% \end{quote}
% \example*{labelfont={color=blue,bf},textfont={color=green},singlelinecheck=off}{\exampletext}
% But since \thispackage\ already includes the tricky definition
% \begin{quote}
%   |\DeclareCaptionFont{color}{\color{#1}}|
% \end{quote}
% you can get the same result simply with
% \begin{quote}
%   |\usepackage{color}|\\
%   |\captionsetup{labelfont={color=blue,bf},|\\
%   |               textfont={color=green}}|\quad.
% \end{quote}
%
% \medskip
%
% \pagebreak[3]
% \DescribeMacro{\DeclareCaption-\\Style}
% You can define your own caption styles with
% \begin{quote}
%   |\DeclareCaptionStyle|\marg{name}\oarg{additional options}\marg{options}\mbox{\quad.}
% \end{quote}
% Remember, caption styles are just a collection of suitable options, saved
% under a given name. You can wake up these options at any time with the
% option |style=|\meta{style name}.
%
% All caption styles are based on the |base| set of options. (See \Ref{style}
% for a complete list.) So you only need to specify options which are different
% to them.
%
% If you specify \meta{additional options} they get used in addition when
% the caption fits into a single line and this check was not disabled with
% the option |single|\-|line|\-|check=off|.
%
% Again a very easy example taken from the core of this package: The
% caption style |base| is pre-defined as
% \begin{quote}
%   |\DeclareCaptionStyle{base}%|\\
%   |        [justification=centering,indention=0pt]{}|\quad.
% \end{quote}
%
% Something more exciting:
% \begin{quote}
%   |\DeclareCaptionStyle{mystyle}%|\\
%   |        [margin=5mm,justification=centering]%|\\
%   |        {font=footnotesize,labelfont=sc,margin={10mm,0mm}}|\\
%   |\captionsetup{style=mystyle}|
% \end{quote}
% gives you caption like these ones:
% \begin{Example}
%   \captionsetup{type=figure,style=mystyle,position=b}
%   \caption{A short caption.}
%   \caption{A long long long long long long long long long
%              long long long long long long long long long
%              long long long long long long long long long caption.}
% \end{Example}
%
% \bigskip
%
% \pagebreak[3]
% \DescribeMacro{\DeclareCaption-\\ListFormat}
% \NEWfeature*{v3.1}
% You can define your own caption list formats with
% \begin{quote}
%   |\DeclareCaptionListFormat|\marg{name}\marg{code using \#1 and \#2}\mbox{\quad.}
% \end{quote}
% At usage \#1 gets replaced with the label prefix (e.g.~|\p@figure|),
% and \#2 gets replaced with the reference number (e.g.~|\thefigure|).
%
% \iffalse
% --------------------------------------------------------------------------- %
% \fi
%
% \subsection{Further examples}
% \label{examples}
%
% \subsubsection*{Example 1}
%
% If you would like to have a line break between caption label and text
% you could define it this way:
% \begin{quote}
%   |\DeclareCaptionFormat{myformat}{#1#2\\#3}|
% \end{quote}
% If you select this format with |\caption|\-|setup{format=|\x|myformat}|
% you get captions like this:
%   \example{format=myformat1,labelfont=bf}{\exampletext}
% You could even use an indention with this caption format:
% \begin{quote}
%   |\captionsetup{format=myformat,indention=1cm}|
% \end{quote}
% This would look like this:
%   \example{format=myformat1,indention=1cm,labelfont=bf}{\exampletext}
% Instead, you would like to have an indention only of the first line of
% the caption text? No problem, e.g.
% \begin{quote}
%   |\newlength\myindention|\\
%   |\DeclareCaptionFormat{myformat}%|\\
%   |               {#1#2\\\hspace*{\myindention}#3}|\\
%   \ldots\\
%   |\setlength\myindention{1cm}|\\
%   |\captionsetup{format=myformat}|
% \end{quote}
% would give you captions like
%   \example{format=myformat2,myindention=1cm,labelfont=bf}{\exampletext}
% But you want to have an caption option for this indention, so you can use
% it for example with
% |\caption|\-|setup|\x|[figure]|\x|{my|\-|indention=|\x\ldots|}|?
% This could be done, too:
% \begin{quote}
%   |\newlength\myindention|\\
%   |\DeclareCaptionOption{myindention}%|\\
%   |               {\setlength\myindention{#1}}|\\
%   |\DeclareCaptionFormat{myformat}%|\\
%   |               {#1#2\\\hspace*{\myindention} #3}|\\
%   \ldots\\
%   |\captionsetup{format=myformat,myindention=1cm}|
% \end{quote}
% would give the same result as the example above.
%
% \subsubsection*{Example 2}
%
% You want captions to look like this:
%   \example{format=reverse,labelformat=fullparens,labelsep=fill,labelfont=it}{\exampletext}
%
% \pagebreak[2]
% You could do it this way:
% \nopagebreak[3]
% \begin{quote}
%   |\DeclareCaptionFormat{reverse}{#3#2#1}|\\
%   |\DeclareCaptionLabelFormat{fullparens}%|\\
%   |               {(\bothIfFirst{#1}{~}#2)}|\\
%   |\DeclareCaptionLabelSeparator{fill}{\hfill}|\\
%   |\captionsetup{format=reverse,labelformat=fullparens,|\\
%   |              labelsep=fill,font=small,labelfont=it}|
% \end{quote}
%
% \subsubsection*{Example 3}
%
% The caption text should go into the left margin? A possible solution would be:
% \begin{quote}
%   |\DeclareCaptionFormat{llap}{\llap{#1#2}#3\par}|\\
%   |\captionsetup{format=llap,labelsep=quad,singlelinecheck=no}|
% \end{quote}
% As a result you would get captions like this:
% \example{format=llap,labelsep=quad,singlelinecheck=no,margin=0pt}{\exampletext}
%
% \medskip
%
% If the indention into the margin shall be fixed, you could use a combination
% of |\llap| and |\makebox|, for example:
% \begin{quote}
%   |\DeclareCaptionFormat{llapx}%|\\
%   |               {\llap{\makebox[5em][l]{#1}}#3\par}|\\
%   |\captionsetup{format=llapx,singlelinecheck=off}|
% \end{quote}
% \example{format=llapx,singlelinecheck=off,skip=0pt,margin=0pt}{\exampletext}
%
% \subsubsection*{Example 4}
%
% This example puts a figure aside a table, but uses only one common caption for both.
% This will be achieved by a combination of
% |\Declare|\-|Caption|\-|Label|\-|Format| and |\caption|\-|list|\-|entry|:
% \begin{quote}
%   |\DeclareCaptionLabelFormat{andtable}%|\\
%   |               {#1~#2 \& \tablename~\thetable}|\\
%   \ldots\\
%   |\begin{figure}|\\
%   |  \centering|\\
%   |  \includegraphics{|\ldots|}%|\\
%   |  \qquad|\\
%   |  \begin{tabular}[b]{\ldots}|\\
%   |    |\ldots\\
%   |  \end{tabular}|\\
%   |  \captionlistentry[table]{|\ldots|}|\\
%   |  \captionsetup{labelformat=andtable}|\\
%   |  \caption{|\ldots|}|\\
%   |\end{figure}|
% \end{quote}
% \DeleteShortVerb{\|}%
% \noindent\begin{minipage}{\linewidth}
%   \captionsetup{type=figure}
%   \centering
%   \includegraphics[width=30pt]{cat}%
%   \qquad
%   \begin{tabular}[b]{r|rr}
%       & x & y \\\hline
%     a & 1 & 2 \\
%     b & 3 & 4 \\
%   \end{tabular}
%   \captionlistentry[table]{A figure and a table with a common caption}
%   \captionsetup{labelformat=andtable}
%   \caption{A figure and a table with a common caption~\footnotemark}
% \end{minipage}
% \footnotetext{The picture was taken with permission from the
%   \LaTeX\ Companion\cite{TLC2} examples.}
% \MakeShortVerb{\|}
%
% (Please remember that |\caption|\-|list|\-|entry| increments the figure
%  resp.~table counter.)
%
% \iffalse
% --------------------------------------------------------------------------- %
% \fi
%
% \clearpage
% \section{Supported document classes}
% \label{classes}
%
% This section will give you an overview of the document classes the
% \package{caption} supports, what do they already offer regarding captions,
% what side effects will occur when using the \package{caption} package with
% them, and what are the `default' settings for them.
%
% \NEWfeature{v3.1}
% The `default' settings depend on the document class you use; they represent
% how the class author wanted the captions to look like. So for example
% setting |format=|\x|default| can give you different visual designs when used
% with different document classes.
%
% \begingroup\setlength\leftmargini{0.3em}% default = 2.5em
% \INFO
% If you don't find the document class you use in this section, you usually
% don't have to worry: Many document classes (e.g.~the \class{octavo} class)
% are derived from one of the standard document classes \class{article},
% \class{report}, or \class{book}, and behave the same regarding captions.
% \Thispackage\ automatically does a compatibility check against the document
% class used and will give you the clear warning
% \begin{quote}\footnotesize
%   |Package caption Warning: Unsupported document class (or package) detected,|\\
%   |(caption)                usage of the caption package is not recommended.|\\
%   |See the caption package documentation for explanation.|
% \end{quote}
% if such an incompatibility was detected.
% If you don't get such warning everything is fine, but if you get it the
% usage of \thispackage\ is not recommended and especially not supported.
% \endgroup
%
% \begin{Expert}
% If you get such a compatibility warning but decide to use \thispackage{}
% anyway, you should watch carefully what side-effects occur, usually the
% look and feel of your captions will change by just including \thispackage{}
% without options, meaning they do not look like as intended by the author
% of the document class.
% If this is fine for you, you should first specify the option |style=|\x|base|
% via |\use|\-|package[style=|\x|base]{caption}| or
% |\caption|\-|setup{style=|\x|base}| to set \thispackage\ into a well-defined
% state.
% Afterwards you can start setting your own options additionally and
% keep your fingers crossed.
% \end{Expert}
%
% \newcommand*\Option{Option}
% \newcommand*\defaultvalue{\texttt{default} value}
% \newcommand*\uses{\textit{uses}}
% \newcommand*\settings{\textit{settings}}
% \newcommand*\nofont{\textit{none}}
%
% \subsection{Standard \LaTeX: article, report, and book}
%
% \begin{tabular}{ll}
% \Option          & \defaultvalue \\\hline
% |format=|        & |plain| \\
% |labelformat=|   & |simple| \\
% |labelsep=|      & |colon| \\
% |justification=| & |justified| \\
% |font=|          & \nofont \\
% |labelfont=|     & \nofont \\
% |textfont=|      & \nofont \\
% \end{tabular}
%
% \begin{Annotation}
% This also applies to document classes derived from them.
% \end{Annotation}
%
% \subsection{\AmS: amsart, amsproc, and amsbook}
% \label{AMS}
%
% \begin{tabular}{ll}
% \Option          & \defaultvalue \\\hline
% |format=|        & |plain| \\
% |labelformat=|   & |simple| \\
% |labelsep=|      & |.\enspace| \\
% |justification=| & |justified| \\
% |font=|          & |\@captionfont| \\
% |labelfont=|     & |\@captionheadfont| \\
% |textfont=|      & |\@captionfont\upshape| \\
% \end{tabular}
%
% \begin{Annotation*}
% |\@caption|\-|font| will be set to |\normal|\-|font|, and
% |\@caption|\-|head|\-|font| to |\sc|\-|shape| by the \AmS\ document classes.
% \end{Annotation*}
%
% Furthermore the margin will be set to |\caption|\-|indent| for
% more-than-one-line captions (which will be set to |3pc| by the \AmS\ classes),
% the margin for single-line captions will be set to the half of it instead.
% If you want to use a common margin for both, insert
% |\clear|\-|caption|\-|setup[margin*]{single|\-|line}|
% into the preamble of your document, after loading \thispackage.
%
% Additionally the options |figure|\-|position=b,|\x|table|\-|position=t|
% will be set. You can override these settings by specifying other values for
% |figure|\-|position=| or |table|\-|position=| in the option list while
% loading \thispackage.
%
% \subsection{beamer}
% \label{beamer}
%
% \begin{tabular}{ll}
% \Option          & \defaultvalue \\\hline
% |format=|        & |plain| \\
% |labelformat=|   & \textit{not numbered} \\
% |labelsep=|      & |colon| \\
% |justification=| & |raggedright| \\
% |font=|          & \class{beamer} ``|caption|'' \settings \\
% |labelfont=|     & \class{beamer} ``|caption name|'' \settings \\
% |textfont=|      & \nofont \\
% \end{tabular}
%
% \subsubsection*{Build-in features, and side-effects}
% You can setup font and color settings with
% |\set|\-|beamer|\-|font{caption}|\marg{options} and
% |\set|\-|beamer|\-|font{caption name}|\marg{options}.
% This will still work, unless you set a different font with
% |\caption|\-|setup{font=|\x\meta{options}|}| or
% |\caption|\-|setup{label|\-|font=|\x\meta{options}|}|.\par
% Furthermore the \class{beamer} classes offer different caption templates
% which can be chosen with
% |\set|\-|beamer|\-|template|\x|{caption}|\x|[|\meta{template}|]|.
% Since \thispackage\ replaces this caption template mechanism,
% |\def|\-|beamer|\-|template*|\x|{caption}|\x\marg{template code}
% and
% |\set|\-|beamer|\-|template|\x|{caption}|\x|[|\meta{template}|]|
% will have no effect when \thispackage\ is used.
% (Exception: Selecting the template |default|, |num|\-|bered|, or
% |caption| |name| |own| |line| will be recognized by \thispackage and be mapped
% to corresponding options.)
%
% \subsection{\KOMAScript: scrartcl, scrreprt, and scrbook}
% \label{KOMA}
%
% \begin{tabular}{ll}
% \Option          & \defaultvalue \\\hline
% |format=|        & \uses\ |\setcapindent| \textit{\&} |\setcaphanging| \settings \\
% |labelformat=|   & \textit{like \purett{simple}, but with support of ``autodot''}\\
% |labelsep=|      & |\captionformat| \\
% |justification=| & |justified| \\
% |font=|          & |\setkomafont{caption}| \settings \\
% |labelfont=|     & |\setkomafont{captionlabel}| \settings \\
% |textfont=|      & \nofont \\
% \end{tabular}
%
% \subsubsection*{Build-in features}
% The \KOMAScript\ document classes offer many ways to customize the look and
% feel of the captions. For an overview and a full description please take a
% look at the \KOMAScript\ documentation, section `Tables and Figures'.
%
% \subsubsection*{Side effects}
% The optional argument of |\set|\-|cap|\-|width| is not supported and
% will be ignored if used in conjunction with the \package{caption} package.
% Furthermore the \KOMAScript\ options |table|\-|caption|\-|above| \&
% |table|\-|caption|\-|below| and the commands |\caption|\-|above| \&
% |\caption|\-|below| are stronger than the |position=| setting offered by
% the \package{caption} package.
%
% \subsection{\NTG: artikel, rapport, and boek}
% \label{NTG}
%
% \begin{tabular}{ll}
% \Option          & \defaultvalue \\\hline
% |format=|        & |plain| \\
% |labelformat=|   & |simple| \\
% |labelsep=|      & |colon| \\
% |justification=| & |justified| \\
% |font=|          & \nofont \\
% |labelfont=|     & |\CaptionLabelFont| \\
% |textfont=|      & |\CaptionTextFont| \\
% \end{tabular}
%
% \subsubsection*{Build-in features, and side-effects}
% |\Caption|\-|Label|\-|Font| and |\Caption|\-|Text|\-|Font| can be set either
% directly or by using |\Caption|\-|Fonts|.
% Both is still supported unless you use one of the two options
% |label|\-|font=| or |text|\-|font=| offered by \thispackage.
%
% \subsection{\SmF: smfart and smfbook}
% \label{SMF}
%
% Since the \SmF\ document classes are derived from the \AmS\ document classes
% the same default values are valid here.
%
% Additionally the margin is limited up to the tenth of the |\line|\-|width|.
% If you don't like this limitation, you can switch it off with the option
% |max|\-|margin=|\x|off| or |max|\-|margin=|\x|false|
% (which both means the same).
%
% \subsection{thesis}
% \label{thesis}
%
% \begin{tabular}{ll}
% \Option          & \defaultvalue \\\hline
% |format=|        & |hang| \\
% |labelformat=|   & \textit{like \purett{simple}, but with short name}\\
% |labelsep=|      & |colon| \\
% |justification=| & |justified| \\
% |font=|          & \nofont \\
% |labelfont=|     & |\captionheaderfont| \\
% |textfont=|      & |\captionbodyfont| \\
% \end{tabular}
%
% \subsubsection*{Build-in features, and side-effects}
% The caption label font can be set with |\caption|\-|header|\-|font|,
% the caption text font with |\caption|\-|body|\-|font|.
% Both is still supported unless you use one of the two options
% |label|\-|font=| or |text|\-|font=| offered by \thispackage.
%
% \iffalse
% --------------------------------------------------------------------------- %
% \fi
%
% \clearpage
% \section{Supported babel package options}
% \label{babel}
%
% \NEWfeature{v3.5}
% Since version \version{3.5} of the \package{caption} package the support
% is independent on the load order of \package{caption} and \package{babel}.
%
% \subsection{french babel option}
% \label{french}
%
% If you use the \package{french} option of the \package{babel} package
% with one of the three standard \LaTeX{} classes (or a one derived from them)
% the default |label|\-|sep=| will be set to |\Caption|\-|Sep|\-|a|\-|ra|\-|tor|
% (offered by \package{french}), overriding the default value set by the
% document class.
% So redefining |\Caption|\-|Sep|\-|a|\-|ra|\-|tor| will still work, unless you
% don't select a different |label|\-|sep=| than the default one.
%
% \iffalse
% --------------------------------------------------------------------------- %
% \fi
%
% \clearpage
% \section{Supported packages}
% \label{packages}
% \label{compatibility}
%
% \Thispackage\ was adapted to the following packages which deals with
% captions, too:
% \begin{quote}
%   \package{float}, \package{floatflt}, \package{fltpage},
%   \package{hyperref}, \package{hypcap}, \package{listings},
%   \package{longtable}, \package{picinpar}, \package{picins},
%   \package{rotating}, \package{setspace}, \package{sidecap},
%   \package{subfigure}, \package{supertabular}, \package{threeparttable},
%   \package{wrapfig}, and \package{xtab}
% \end{quote}
%
% Furthermore the \package{floatrow} package\cite{floatrow}, the
% \package{subcaption} package (which is part of the \package{caption} package
% bundle), and the \package{subfig} package\cite{subfig} support \thispackage{}
% and use its |\caption|\-|setup| interface.
%
% \bigskip
%
% \begingroup\setlength\leftmargini{0.3em}% default = 2.5em
% \INFO
% If a package (or document class) unknown to \thispackage\ redefines
% the |\caption| command as well, this redefinition will be preferred
% over the one this package offers, providing maximum compatibility and
% avoiding conflicts.
% If such a potential incompatibility is detected, you will see this
% warning message:~\footnote{%
%   You can suppress this warning by specifying the option
%   \texttt{compatibility=true} when loading \thispackage.}
% \begin{quote}\footnotesize
%   |Package caption Warning: \caption will not be redefined since it's already|\\
%   |(caption)                redefined by a document class or package which is|\\
%   |(caption)                unknown to the caption package.|\\
%   |See the caption package documentation for explanation.|
% \end{quote}
% \endgroup
%
% As a result, the following features offered by \thispackage\ will not be available:
% \begin{itemize}
%   \item the options |labelformat=|, |position=auto|, |list=|, and |listformat=|
%   \item |\caption*| (to produce a caption without label)
%   \item |\caption[]{|\ldots|}| (to produce no entry in the List of Figures or Tables)
%   \item |\caption{}| (to produce an empty caption without label separator)
%   \item |\ContinuedFloat|
%   \item correctly justified captions in environments like \texttt{wide} and
%         \texttt{addmargin} which add extra margins
%   \item the \textsf{hypcap} feature \See{\Ref{hyperref}\,}
%   \item the sub-caption feature \See{\package{subcaption} package documentation}
% \end{itemize}
%
% \DescribeMacro{compatibility=}
% You can override this compatibility mode by specifying the option
% \begin{quote}
%   |compatibility=false|
% \end{quote}
% when loading \thispackage.
% But please note that using this option is neither recommended nor supported
% since unwanted side-effects or even errors could occur afterwards.
% (For that reason you will get a warning about this.)
%
% \newcommand\packagedescription[1]{%
%   \ifvmode\else\par\fi
%   \nopagebreak
%   \parbox[b]{\linewidth}{\footnotesize\leftskip=10pt\rightskip=10pt\relax#1}\par
%   \nopagebreak\smallskip\nopagebreak}
%
% \PageBreak
% \subsection{algorithms}
% \label{algorithms}
% \packagedescription{%
% The \package{algorithms} package bundle\cite{algorithms} provides two
% environments: The \texttt{algorithmic} environment provides a possibility
% for describing algorithms, and the \texttt{algorithm} environment provides
% a ``float'' wrapper for algorithms.}
%
% Since the \texttt{algorithm} environment is implemented via |\new|\-|float|
% provided by the \package{float} package\cite{float}, please see \Ref{float}.
%
% \iffalse
% \pagebreak[3]
% \subsection{algorithm2e}
% \label{algorithm2e}
% \packagedescription{%
% The \package{algorithm2e} package\cite{algorithm2e} offers an environment for
% writing algorithms in LaTeX2e.}
%
% Since the \package{algorithm2e} package does not use some kind of standard
% interface for defining its floating environment (e.g.~|\newfloat| of the
% \package{float} package) and typesetting its caption,
% the \package{algorithm2e} package is \emph{not} supported by \thispackage.
%
% So if you want to customize the captions using \thispackage,
% you have to build a new environment which uses a supported interface regarding
% floats (e.g. using the \package{float} or \package{floatrow} package),
% and combine this environment with the internal \package{algorithm2e} code.
%
% As first step you could define a non-floating environment \texttt{algorithmic},
% for example:
% \begin{quote}
%   |\usepackage{algorithm2e}|\\
%   |% save the "algorithm" environment from the algorithm2e package|\\
%   |\let\ORIGalgorithm\algorithm|\\
%   |\let\ORIGendalgorithm\endalgorithm|\\
%   |% define the algorithmic environment|\\ % , based on the saved environment
%   |\newenvironment{algorithmic}%|\\
%   |  {\renewenvironment{algocf}[1][h]{}{}% pass over floating stuff|\\
%   |   \ORIGalgorithm}%|\\
%   |  {\ORIGendalgorithm}|\\
%   \ldots
% \end{quote}
% Having defined this non-floating environment, you could define your own new
% floating environment with |\newfloat| of the \package{float} package
% (or |\DeclareNewFloatType| of the \package{floatrow} package),
% and use the combination of this floating environment and \texttt{algorithmic}
% in its body, just like you would do when you use the
% \package{algorithm}/\package{algorithmic} package tandem.
%
% You could even use the \package{algorithm} package for this purpose, for example:
% \begin{quote}
%   \ldots\\
%   |% load the algorithm package to re-define the|\\
%   |% floating environment "algorithm" and \listofalgorithms|\\
%   |\let\listofalgorithms\undefined|\\
%   |\usepackage{algorithm}|\\
%   \ldots\\
%   |% Example usage:|\\
%   |\begin{algorithm}|\\
%   |\caption{An algorithm}|\\
%   |\begin{algorithmic}|\\
%   |  \SetVline|\\
%   |  \eIf{cond1}{|\\
%   |    a line\;|\\
%   |  }{|\\
%   |    another line\;|\\
%   |  }|\\
%   |\end{algorithmic}|
% \end{quote}
% Now you are finally able to customize the float and caption layout like every
% other floating environment defined with the \package{float} package\cite{float},
% please see \Ref{float}.
%
% \begin{Annotation}
% An alternative would be using the \package{algorithmicx} package.
% \end{Annotation}
% \fi
%
% \pagebreak[3]
% \subsection{float}
% \label{float}
% \packagedescription{%
% The \package{float} package\cite{float} introduces the commands
% \cs{restylefloat} to give existing floating environments a new look \& feel
% and \cs{newfloat} to define new floating environments.
% It also provides the ``\texttt{H}'' float placement option which places
% the environments ``here'' instead of letting them floating around.}
%
% For floating environments defined with \cs{newfloat} or \cs{restylefloat} the
% |po|\-|si|\-|tion| option has no effect on the main caption anymore, since its
% placement and spacing will be controlled by the selected float style instead.
%
% A caption style and options defined with the name of the float style will be
% executed additionally to the regular ones.
% Using this mechanism \thispackage\ emulates the default look \& feel of the
% |ruled| captions: It defines the caption style
% \begin{quote}
%   |\DeclareCaptionStyle{ruled}%|\\
%   |       {labelfont=bf,labelsep=space,strut=off}|\mbox{\quad.}
% \end{quote}
% So to change this you need either define your own caption style called
% |ruled| or use |\caption|\-|setup[ruled]|\marg{options} to specify additional
% options.
%
% Also by using this mechanism the skip between a |boxed| float and its caption
% is specified, overriding its global value:
% \begin{quote}
%   |\captionsetup[boxed]{skip=2pt}|
% \end{quote}
% For changing this, just use |\caption|\-|setup[boxed]{skip=|\x\meta{value}|}|
% with an appropriate value. Or if you want to use the global |skip| setting
% instead, you can remove the usage of the local setting for these floats with
% |\clear|\-|caption|\-|setup[skip]{boxed}|.
%
% \begin{Note}
% Only one single caption can be typeset inside environments defined with
% |\new|\-|float| or |\re|\-|style|\-|float|, furthermore these environments
% are not behaving exactly like the pre-defined floats |figure| and |table|.
% As a consequence many packages do not cooperate well with these.
% Furthermore the \package{float} package has some caveats \& limitations,
% so if you just want to define a new simple floating environment---behaving
% like |figure| or |table|---I recommend using |\Declare|\-|Floating|\-|Environment|
% offered by the \package{newfloat} package instead.
% And for defining non-simple floating environments and customization I
% recommend using |\Declare|\-|New|\-|Float|\-|Type| offered by the
% \package{floatrow} package\cite{floatrow}.
% \end{Note}
%
% \iffalse
% Please also note that you \emph{don't} need a |\restyle|\-|float| for using
% the ``|H|'' float placement specifier. Some docs say so, but they are
% wrong.
% And |\restyle|\-|float{table}| is a very good method to shoot yourself
% in the foot, since many packages using |table| internally are not working
% correctly afterwards.
% \fi
%
% \pagebreak[3]
% \subsection{floatflt}
% \label{floatflt}
% \packagedescription{%
% The \package{floatflt} package\cite{floatflt} offers figures and tables
% which do not span the full width of a page and are float around by text.}
%
% \NEWfeature{v3.1}
% If you want to setup special options for the |float|\-|ing|\-|figure| and
% |float|\-|ing|\-|table| environments you can use
% \begin{quote}
%   |\captionsetup[floatingfigure]|\marg{options}\quad\emph{and}\\
%   |\captionsetup[floatingtable]|\marg{options}\quad.
% \end{quote}
% These options will be executed additionally to the regular ones for
% |figure| resp.~|table|.
%
% \begin{Note}
% The |margin| resp.~|width| setting will not be used for these figures resp.~tables,
% unless you set it explicit with |\caption|\-|setup[floating|\-|figure]{|\ldots|}|
% resp.~|\caption|\-|setup[floating|\-|table]{|\ldots|}|.
% \end{Note}
%
% \pagebreak[3]
% \subsection{fltpage}
% \label{fltpage}
% \packagedescription{%
% The \package{fltpage} package\cite{fltpage} offers the outhouse of the
% caption for |figure|s or |table|s which needs the whole page
% for its contents. This will be done by placing the caption on the bottom
% of the previous or next page.}
%
% \iffalse
% \NEWfeature{v3.1}
% Two options control the links to the environments |FPfigure| and |FPtable|:
% \begin{description}
% \item{\texttt{FPlist=caption} or \texttt{FPlist=figure}}\\[\smallskipamount]
% If set to |caption|, the list entry will link to the caption; if set to
% |figure|, it will link to the figure contents.
% (The default setting is |FP|\-|list=|\x|caption|.)
% \item{\texttt{FPref=caption} or \texttt{FPref=figure}}\\[\smallskipamount]
% If set to |caption|, a \cs{ref}, \cs{pageref}, \cs{autoref}, or \cs{nameref}
% will link to the caption; if set to |figure|, it will link to the figure contents.
% (The default setting is |FP|\-|ref=|\x|figure|.)
% \end{description}
% \fi
%
% If you want to setup special options for the |FPfigure| and |FPtable|
% environments you can use
% \begin{quote}
%   |\captionsetup[FPfigure]|\marg{options}\quad\emph{and}\\
%   |\captionsetup[FPtable]|\marg{options}\quad.
% \end{quote}
% These options will be executed additionally to the regular ones for
% |figure| or |table|.
%
% \pagebreak[3]
% \subsection{frenchle and frenchpro packages}
% \label{frenchpro}
%
% If you use the \package{frenchle} or \package{frenchpro} package,
% the default |label|\-|sep=| will be set to |\caption|\-|sep|\-|a|\-|ra|\-|tor|
% (offered by \package{frenchle/pro}) plus \cs{space}, overriding the default
% value set by the document class.
% So redefining |\caption|\-|sep|\-|a|\-|ra|\-|tor| will still work, unless you
% don't select a different |label|\-|sep=| than the default one.
%
% Furthermore the default |text|\-|font=| will be set to |text|\-|font=|\x|it|,
% since this emulates the default setting of |\caption|\-|font| defined by the
% \package{frenchle} or \package{frenchpro} package.
% Please note that the command |\caption|\-|font| is used by the
% \package{caption} package internally for a different purpose,
% so you should not change it (anymore).
%
% The command |\un|\-|numbered|\-|captions|\marg{figure \emph{or} table} will
% still work, but only unless you don't select a different |label|\-|format=|
% than the default one.
%
% \NEWfeature{v3.5}
% Since version \version{3.5} of the \package{caption} package the support
% is independent on the load order of \package{caption} and \package{frenchle}
% resp~.\package{frenchpro}.
%
% \pagebreak[3]
% \subsection{hyperref}
% \label{hyperref}
% \packagedescription{%
% The \package{hyperref} package\cite{hyperref} is used to handle cross
% referencing commands in LaTeX to produce hypertext links in the document.}
%
% \NEWfeature{v3.1}
% There are two options available to control the placement of hyperlink
% anchors:~\footnote{These options are named after the \package{hypcap} package
% which they supersede.}
% \begin{description}
% \item{\texttt{hypcap=true} or \texttt{hypcap=false}}\\[\smallskipamount]
% If set to |true| all hyperlink anchors -- where entries in the
% List of Figures, |\ref|, and |\auto|\-|ref| will link to -- are placed at
% the beginning of the (floating) environment.\par
% If set to |false| the hyperlink anchor is (usually) placed at the caption.\par
% (The default setting is |hypcap=|\x|true|.)
% \item{\texttt{hypcapspace=}\meta{amount}}\\[\smallskipamount]
% Because it looks poor if the hyperlink points exactly at the top of
% the figure or table, you can specify a vertical distance between
% the hyperlink anchor and the (floating) environment itself,
% e.g.~|hyp|\-|cap|\-|space=|\x|0pt| removes this distance.\par
% (The default setting is |hyp|\-|cap|\-|space=|\x|0.5\base|\-|line|\-|skip|.)
% \end{description}
%
% Both settings have no effect in |lst|\-|listing|s (provided by the
% \package{listings} package), |long|\-|table|s (provided by the
% \package{longtable} package), |super|\-|tabular|s (provided by the
% \package{supertabular} package), and |x|\-|tabular|s (provided by the
% \package{xtab} package), within these environments hyperlink
% anchors will always be placed as if |hyp|\-|cap=|\x|true| and
% |hyp|\-|cap|\-|space=|\x|0pt| would be set.
%
% \pagebreak[3]Please note:\nopagebreak
% \begin{description}
% \item{\cs{captionof}\marg{type}\csmarg{\purerm\ldots}
%   vs.~\cs{captionsetup}\csmarg{type=\textrm{\meta{type}}}$+$\cs{caption}\csmarg{\purerm\ldots}}%
% \\[\smallskipamount]
% Without \package{hyperref} loaded, both will give you identical results.
% But with \package{hyperref} loaded, and with |hyp|\-|cap=|\x|true| requested,
% the hyperlink anchor will be placed different.
% For example:
% \begin{quote}
% |\begin{minipage}{\linewidth}|\\
% |  |\ldots\\
% |  \captionof{figure}{A figure}|\\
% |\end{minipage}|
% \end{quote}
% will place the hyperlink anchor at the caption.
% (And if |hyp|\-|cap=|\x|true| is set, you will get a warning about this.)
% But
% \begin{quote}
% |\begin{minipage}{\linewidth}|\\
% |  \captionsetup{type=figure}|\\
% |  |\ldots\\
% |  \caption{A figure}|\\
% |\end{minipage}|
% \end{quote}
% will place the hyperlink anchor at the beginning of the |mini|\-|page|,
% since |\caption|\-|setup{type=|\x|figure}| does not only set the caption type
% to ``figure'' but does place a hyperlink anchor, too.
%
% \item{\cs{caption}\csoarg{}\csmarg{\purerm\ldots}
%   vs.~\cs{captionsetup}\csmarg{list=false}$+$\cs{caption}\csmarg{\purerm\ldots}}\\[\smallskipamount]
% Again, without \package{hyperref} loaded, both will give you identical results.
% But with \package{hyperref} loaded, the difference is in the nuances.
% So for example the optional argument of |\caption| will also be written to
% the |aux| file, and will be used by the |\name|\-|ref| command.
% So if you choose to use |\caption| with empty optional argument,
% |\name|\-|ref| will also give you an empty result.
% So it's better to use |\caption|\-|setup{list=|\x|false}| if you don't
% want an entry in the List of Figures or List of Tables.
% \end{description}
%
% \pagebreak[3]
% \subsection{hypcap}
% \label{hypcap}
% \packagedescription{%
% The \package{hyp\-cap} package\cite{hypcap} offers a solution to the problem
% that links to a float using \package{hyper\-ref} may anchors to the caption
% rather than the beginning of the float.
% Since \thispackage\ \version{3.1} already solves this problem for itself,
% the \package{hypcap} package is usually not needed.}
%
% If the \package{hyp\-cap} package is loaded additionally to the
% \package{hyper\-ref} package, it takes over the control of the hyperlink
% anchor placement from \thispackage, overriding the options |hyp|\-|cap=|
% and |hyp|\-|cap|\-|space=|.
%
% So for a manual placement of hyperlink anchors
% |\caption|\-|setup{type=|\x\meta{type}|}| is not sufficient anymore,
% instead you need to use |\cap|\-|start| (provided by the \package{hyp\-cap}
% package) for this.
%
% Regarding the automatically placement the \package{hypcap} package offers good
% placement of hyperlink anchors for the floating environments |figure| and
% |table| only. In contrast the |hypcap=|\x|true| option of \thispackage\ also
% offers good placements of hyperlink anchors for
% |floating|\-|figure|s (provided by the \package{float\-flt} package),
% |FP|\-|figure|s \& |FPtable|s (provided by the \package{flt\-page} package),
% |fig|\-|window|s (provided by the \package{pic\-in\-par} package),
% |par|\-|pic|s (provided by the \package{pic\-ins} package),
% |SC|\-|figure|s (provided by the \package{side\-cap} package),
% |three|\-|part|\-|table|s (provided by the \package{three\-part\-table} package),
% and |wrapfigure|s (provided by the \package{wrap\-fig} package).
%
% \pagebreak[3]
% \subsection{listings}
% \label{listings}
% \packagedescription{%
% The \package{listings} package\cite{listings} typesets programming code.}
%
% If you want to setup special options for the |lst|\-|listing| environment
% you can use
% \begin{quote}
%   |\captionsetup[lstlisting]|\marg{options}\quad.
% \end{quote}
%
% Please note that the \package{listings} package has its very own options
% for controlling the position and the skips of the caption:
% |caption|\-|pos=|, |above|\-|caption|\-|skip=|, and |below|\-|caption|\-|skip=|.
% \See{\package{listings} documentation for details.}
% These \package{listings} options override the \package{caption}'s ones, but
% can be again overwritten by |\caption|\-|setup[lst|\-|listing]{|\ldots|}|,
% e.g.%~
% \begin{quote}|\caption|\-|setup[lst|\-|listing]{skip=|\x|10pt}|\quad.\end{quote}
%
% \pagebreak[3]
% \subsection{longtable}
% \label{longtable}
% \packagedescription{%
% The \package{longtable} package\cite{longtable} offers an environment
% which behaves similar to the \texttt{tabular} environment, but the table
% itself can span multiple pages.}
%
% If you want to setup special options for the |long|\-|table| environment
% you can use
% \begin{quote}
%   |\captionsetup[longtable]|\marg{options}\quad.
% \end{quote}
% These options will be executed additionally to the regular ones for
% |table|.
%
% The |margin| and |width| settings usually override |\LT|\-|cap|\-|width|,
% so you get an equal look \& feel of the captions in |table|s and
% |long|\-|table|s.
% But if you set |\LT|\-|cap|\-|width| to a value different than its default
% $=$ |4in|, \thispackage\ will follow that.
% (But |\LT|\-|cap|\-|width| will be overwritten by
% |\caption|\-|setup[long|\-|table]{width=|\x\meta{value}|}|,
% even if it is set to a value different than |4in|.)
%
% \begin{Note}
% |\caption|\-|of| and |\Continued|\-|Float| do \emph{not} work for |long|\-|table|s.
% Furthermore neither |\caption| nor |\caption|\-|list|\-|entry| will increment
% the |table| counter here; it's incremented by the |long|\-|table| environment
% instead.
% \NEWfeature{v3.1}
% If you need a |long|\-|table| which does not increment the |table| counter
% please use the |long|\-|table*| environment (offered by the
% \package{ltcaption} package which is part of \thispackage\ bundle and will be
% loaded automatically).
% \end{Note}
%
% \pagebreak[3]
% \subsection{picinpar}
% \label{picinpar}
% \packagedescription{%
% Similar to the \package{floatflt} package the \package{picinpar}
% package\cite{picinpar} offers figures and tables which do not span the full
% width of a page and are float around by text.
% For a detailed discussion about the differences between these packages
% please take a look at The \LaTeX\ Companion\cite{TLC2}.}
%
% \NEWfeature{v3.1}
% If you want to setup special options for the |fig|\-|window| and
% |tab|\-|window| environments you can use
% \begin{quote}
%   |\captionsetup[figwindow]|\marg{options}\quad\emph{and}\\
%   |\captionsetup[tabwindow]|\marg{options}\quad.
% \end{quote}
% These options will be executed additionally to the regular ones for
% |figure| or |table|.
%
% \begin{Note}
% The |margin| resp.~|width| setting will not be used for these figures and tables,
% unless you set it explicit with |\caption|\-|setup[fig|\-|window]{|\ldots|}| or
% |\caption|\-|setup[fig|\-|table]{|\ldots|}|.
% \end{Note}
%
% \pagebreak[3]
% \subsection{picins}
% \label{picins}
% \packagedescription{%
% Similar to the \package{floatflt} and \package{picinpar} package the
% \package{picins} package\cite{picins} offers figures and tables which do not
% span the full width of a page and are float around by text.
% For a detailed discussion about the differences between these packages
% please take a look at The \LaTeX\ Companion\cite{TLC2}.}
%
% \NEWfeature{v3.1}
% If you want to setup special options for the |par|\-|pic| environment you can use
% \begin{quote}
%   |\captionsetup[parpic]|\marg{options}\quad.
% \end{quote}
% These options will be executed additionally to the regular ones for
% |figure| or |table|.
%
% Furthermore |\pic|\-|caption[]{|\ldots|}| produce no entry in the List of Figures,
% and |\pic|\-|caption*{|\ldots|}| gives an unlabeled \& unnumbered caption.
%
% \begin{Note}
% The |margin| resp.~|width| setting will not be used for these figures and tables.
% \iffalse
% if |pic|\-|caption|\-|side| or |pic|\-|caption|\-|top|\-|side| is used.
% The |width| setting will not be used (but the |margin| setting will) if
% |pic|\-|caption|\-|out|\-|side| or |pic|\-|caption|\-|in|\-|side| is used.
% \fi
% But you can override this by setting it explicit with
% |\caption|\-|setup[par|\-|pic]{|\ldots|}|.
% \end{Note}
%
% If you want to have a |\pic|\-|caption| of another type as |figure|, please
% do \emph{not} re-define |\@cap|\-|type| as suggested by the \package{picins}
% documentation. Please use the |\pic|\-|caption|\-|type|\marg{type} command
% which is offered by \thispackage\ instead, e.g.:
% \begin{quote}
%   |\piccaptiontype{table}|\\
%   |\piccaption{An example table}|\\
%   |\parpic(50mm,10mm)[s]{|\ldots|}|
% \end{quote}
%
% \pagebreak[3]
% \subsection{rotating}
% \label{rotating}
% \packagedescription{%
% The \package{rotating} package\cite{rotating} offers the floating
% environments \texttt{side\-ways\-figure} and \texttt{side\-ways\-table} which
% are just like normal figures and tables but rotated by 90 resp.~270 degree.
% Furthermore a command \cs{rot\-caption} is offered for rotated captions only.}
%
% \iffalse % No, we don't do that
% If you want to setup special options for the |side|\-|ways|\-|figure| and
% |side|\-|ways|\-|table| environments you can use
% \begin{quote}
%   |\captionsetup[sidewaysfigure]|\marg{options}\\
%   |\captionsetup[sidewaystable]|\marg{options}\quad.
% \end{quote}
% These options will be executed additionally to the regular ones for
% |figure| or |table|.
% \fi
%
% The command |\rot|\-|caption| will be extended by \thispackage, so
% |\rot|\-|caption*| and |\rot|\-|caption|\-|of| can be used analogous to
% |\caption*| and |\caption|\-|of|.
%
% \pagebreak[3]
% \subsection{setspace}
% \label{setspace}
% \packagedescription{%
% The \package{setspace} package\cite{setspace} offers options and commands
% to change the spacing,
% e.g.\ \cs{usepackage}\x\csoarg{one\-half\-spacing}\x\csmarg{set\-space}
% causes the document to be typeset in one-and-a-half spacing.}
%
% If the \package{setspace} package is used in conjunction with \thispackage,
% the caption will be typeset with single spacing as default. This can be changed
% by specifying either |font=|\x|one|\-|half|\-|spacing|,
% |font=|\x|double|\-|spacing|, or |font={stretch=|\x\meta{amount}|}|.
% \See{also \Ref{fonts}}
%
% \pagebreak[3]
% \subsection{sidecap}
% \label{sidecap}
% \packagedescription{%
% The \package{sidecap} package\cite{sidecap} offers the floating environments
% \texttt{SC\-figure} and \texttt{SC\-table} which are like usual figures
% and tables but the caption will be put \emph{beside} the contents.}
%
% If you want to setup special options for the |SCfigure| and |SCtable|
% environments you can use
% \begin{quote}
%   |\captionsetup[SCfigure]|\marg{options}\quad\emph{and}\\
%   |\captionsetup[SCtable]|\marg{options}\quad.
% \end{quote}
% These options will be executed additionally to the regular ones for
% |figure| or |table|.
%
% \pagebreak[3]
% \begin{Note}
% The \package{sidecap} package offers its own options for justification.
% If set, they will override the one specified with the caption option
% |jus|\-|ti|\-|fi|\-|ca|\-|tion=| for captions beside their contents.
% \end{Note}
%
% \begin{Note}
% The |margin| resp.~|width| setting will not be used for these figures and tables,
% unless you set it explicit with |\caption|\-|setup[SC|\-|figure]{|\ldots|}|
% or |\caption|\-|setup[SC|\-|table]{|\ldots|}|.
% \end{Note}
%
% \medskip
%
% \begin{Annotation*}
% Instead of using the \package{sidecap} package you can also use the more
% powerful and flexible \package{floatrow} package\cite{floatrow} for typesetting
% captions beside the contents.
% \end{Annotation*}
%
% \pagebreak[3]
% \subsubsection*{Undocumented features}
% The \package{sidecap} package \version{1.6} has some undocumented package
% options and commands which allow further customization of the side-captions:
%
% \pagebreak[3]
% \DescribeMacro{margincaption}
% The package option
% \begin{quote}
%   |margincaption|\qquad{\small(e.g.~|\usepackage[margincaption]{sidecap}|)}
% \end{quote}
% causes all side-captions to be placed into the margin.
%
% \pagebreak[3]
% \DescribeMacro{\sidecaptionvpos}
% The command
% \begin{quote}
%   |\sidecaptionvpos|\marg{float type}\marg{pos}
% \end{quote}
% sets the vertical position of the side-caption. \meta{pos} can be either `|t|'
% (for top alignment), `|b|' (for bottom alignment), or `|c|' (for center alignment).
% The default setting for |table| is `|t|', for |figure| and all other ones
% defined with |\Declare|\-|Floating|\-|Environment| it's `|b|'.
%
% \pagebreak[3]
% \subsection{subfigure}
% \label{subfigure}
% \packagedescription{%
% The \package{subfigure} package\cite{subfigure} provides support for small or
% `sub' figures and tables within a single figure or table environment.
% This package is obsolete, new users should use \package{subfig} instead.}
%
% Since the \package{subfigure} package is obsolete it will only be supported in
% a way that old documents (which have used \thispackage\ \version{1.x} during
% development) should still compile as expected.
%
% Please use the \package{subfig} or \package{subcaption} package instead which both supports \thispackage\
% \version{3.x}.
%
% \See{the \package{subfig} package\cite{subfig} documentation for details.}
%
% \pagebreak[3]
% \subsection{supertabular and xtab}
% \label{supertabular}
% \packagedescription{%
% The \package{supertabular}\cite{supertabular} and \package{xtab}\cite{xtab}
% packages offer an environment which can span multiple pages and is quite
% similar to the \texttt{long\-table} environment provided by the
% \package{longtable} package\cite{longtable}.
% For a detailed discussion about the differences between these powerful
% packages please take a look at The \LaTeX\ Companion\cite{TLC2}.}
%
% If you want to setup special options for the |super|\-|tabular|
% resp.~|x|\-|tabular| environment you can use
% \begin{quote}
%   |\captionsetup[supertabular]|\marg{options}\quad\emph{resp.}\\
%   |\captionsetup[xtabular]|\marg{options}\quad.
% \end{quote}
% These options will be executed additionally to the regular ones for
% |table|.
%
% \begin{Note}
% |\Continued|\-|Float| does not work for |super|\-|tabular|s and |x|\-|tabular|s.
% \end{Note}
%
% \pagebreak[3]
% \subsection{threeparttable}
% \label{threeparttable}
% \packagedescription{%
% The \package{threeparttable} package\cite{threeparttable} provides a scheme
% for tables that have a structured note section after the table contents and
% the caption.
% This scheme provides an answer to the old problem of putting footnotes in
% tables---by making footnotes entirely unnecessary.}
%
% \NEWfeature{v3.1}
% If you want to setup special options for the |three|\-|part|\-|table| and
% |measured|\-|figure| environments you can use
% \begin{quote}
%   |\captionsetup[threeparttable]|\marg{options}\quad\emph{and}\\
%   |\captionsetup[measuredfigure]|\marg{options}\quad.
% \end{quote}
% These options will be executed additionally to the regular ones for
% |table| or |figure|.
%
% \begin{Note}
% Since the caption will have the same width as the contents here,
% the |margin| resp.~|width| setting will not be used for these figures and tables,
% at least unless you set it explicit with
% |\caption|\-|setup[three|\-|part|\-|table]{|\ldots|}| or
% |\caption|\-|setup[measured|\-|figure]{|\ldots|}|.
% \end{Note}
%
% \medskip
%
% \begin{Annotation*}
% Instead of using the \package{threeparttable} package you can
% also use the \package{floatrow} package\cite{floatrow} for this purpose.
% \end{Annotation*}
%
% \pagebreak[3]
% \subsection{wrapfig}
% \label{wrapfig}
% \packagedescription{%
% Similar to the \package{floatflt}, the \package{picinpar}, and the
% \package{picins} package the \package{wrapfig} package\cite{wrapfig} offers
% figures and tables which do not span the full width of a page and are float
% around by text.
% For a detailed discussion about the differences between these packages
% please take a look at The \LaTeX\ Companion\cite{TLC2}.}
%
% \NEWfeature{v3.1}
% If you want to setup special options for the |wrap|\-|figure| and
% |wrap|\-|table| environments you can use
% \begin{quote}
%   |\captionsetup[wrapfigure]|\marg{options}\quad\emph{and}\\
%   |\captionsetup[wraptable]|\marg{options}\quad.
% \end{quote}
% These options will be executed additionally to the regular ones for
% |figure| or |table|.
%
% \begin{Note}
% The |margin| resp.~|width| setting will not be used for these figures and
% tables, unless you set it explicit with
% |\caption|\-|setup[wrap|\-|figure]{|\ldots|}|
% or |\caption|\-|setup[wrap|\-|table]{|\ldots|}|.
% \end{Note}
%
% \iffalse
% --------------------------------------------------------------------------- %
% \fi
%
% \clearpage
% \section{Further reading}
%
% I recommend the following documents for further reading:
%
% \begin{itemize}
% \item
%   The \TeX\ FAQ -- Frequently asked questions about \TeX\ and \LaTeX:
%   \begin{quote}\url{http://faq.tug.org/}\end{quote}
%
% \item
%   A French FAQ can be found at
%   \begin{quote}\url{http://www.grappa.univ-lille3.fr/FAQ-LaTeX/}\end{quote}
%
% \item
%   ``What is a minimal working example?'' from Christian Faulhammer and Ulrich Schwarz:
%   \begin{quote}\url{http://www.minimalbeispiel.de/mini-en.html}\end{quote}
%
% \item
%   \textsf{epslatex} from Keith Reckdahl contains many tips around
%   including graphics in \LaTeXe\ documents.
%   You will find this document in the directory
%   \begin{quote}\url{http://mirror.ctan.org/info/epslatex/}\end{quote}
% \end{itemize}
%
% \iffalse
% --------------------------------------------------------------------------- %
% \fi
%
% \pagebreak[3]
% \section{Thanks}
%
% I would like to thank Katja Melzner,
% Steven D. Cochran, Frank Mittelbach, Olga Lapko,
% David Carlisle, Carsten Heinz, Keith Reckdahl, Markus Kohm,
% Heiko Oberdiek, and Herbert Vo\ss.
% Thanks a lot for all your help, ideas, patience, spirit, and support!
%
% Also I would like to thank
% Harald Harders,
% Peter L\"offler,
% Peng Yu,
% Alexander Zimmermann,
% Matthias Pospiech,
% J\"urgen Wieferink,
% Christoph Bartoschek,
% Uwe St\"ohr,
% Ralf Stubner,
% Geoff Vallis,
% Florian Keiler,
% J\"urgen G\"obel,
% Uwe Siart,
% Sang-Heon Shim,
% Henrik Lundell,
% David Byers,
% William Asquith,
% Prof.~Dr.~Dirk Hoffmann,
% Frank Martini,
% Danie Els,
% Philipp Woock,
% Fadi Semmo,
% Matthias Stevens, and
% Leo Liu
% who all helped to make this package a better one.
%
% \iffalse
% --------------------------------------------------------------------------- %
% \fi
%
% \clearpage\appendix
% \section{Alphabetical Reference}
%
% \makeatletter
% \newenvironment{Warnings}{%
%   \newif\ifMessage
%   \def\Message{%
%     \ifMessage\end{minipage}\par\vspace\itemsep\pagebreak[3]\fi
%     \begin{minipage}{\linewidth}%
%     \setlength\parindent{0pt}%
%     \setlength\parskip{\smallskipamount}%
%     \setlength\leftskip{0pt}%
%     \color{blue}%
%     \Messagetrue}%
%   \def\Description{%
%     \par\color{black}\leftskip=1.5em}%
%   \def\Or{\@testopt\@Or{or}}%
%   \def\@Or[##1]{%
%     \\{\small\color{black}\hspace{1.5em}\textit{-- ##1 --}}\\}%
% }{%
%   \ifMessage\end{minipage}\par\fi
% }
% \makeatother
%
% \subsection{Options}
% \newcommand\preambleoption{~%
%   \begingroup\def\thefootnote{\fnsymbol{footnote}}%
%     \footnotemark[2]%
%   \endgroup}
% \newcommand\preambleoptiontext{%
%   \begingroup\def\thefootnote{\fnsymbol{footnote}}%
%     \footnotetext[2]{These options are only available in the preamble of the document.}%
%   \endgroup}
%
% \begin{longtable*}{lll}
% Option           & Short description & Section \\
% \hline
% \endhead
% |aboveskip|       & sets the skip above caption & \ref{skips} \\
% |belowskip|       & sets the skip below caption & \ref{skips} \\
% |compatibility|\preambleoption & force (non-)compatibility & \ref{compatibility} \\
% |figureposition|\preambleoption & gives a hint about the figure caption position & \ref{skips} \\
% |font|(|+|)       & sets the font & \ref{fonts} \\
% |format|          & sets the format & \ref{formats} \\
% \iffalse
% |FPlist|          & To where the list entry of a FPfigure should link? & \ref{fltpage} \\
% |FPref|           & To where a |\ref| to a FPfigure should link? & \ref{fltpage} \\
% \fi
% |hangindent|      & sets the hang indention & \ref{margins} \\
% |hypcap|          & selects `hypcap' feature & \ref{hyperref} \\
% |hypcapspace|     & sets the distance between hyperlink and contents & \ref{hyperref} \\
% |indention|       & sets the indention & \ref{margins} \\
% |justification|   & sets the justification & \ref{justification} \\
% |labelfont|(|+|)  & sets the font of the caption label & \ref{fonts} \\
% |labelformat|     & sets the format of the caption label & \ref{formats} \\
% |labelsep|        & sets the label separator & \ref{formats} \\
% |labelseparator|  & --same as |labelsep|-- & \ref{formats} \\
% |list|            & switches the entries in the List on or off & \ref{lists} \\
% |listformat|      & sets the `List of Figure/Table' entry format & \ref{lists} \\
% |margin|          & sets the margin & \ref{margins} \\
% |margin*|         & sets the margin, but only if no width is set & \ref{margins} \\
% |maxmargin|       & sets the max. margin & \ref{margins} \\
% |minmargin|       & sets the min. margin & \ref{margins} \\
% |name|            & sets the name of the current environment & \ref{names} \\
% |oneside|         & selects the one-side mode & \ref{margins} \\
% |options|         & executes the given option list & \\
% |parindent|       & sets the paragraph indention & \ref{margins} \\
% |parskip|         & sets the skip between paragraphs & \ref{margins} \\
% |position|        & gives a hint about the caption position & \ref{skips} \\
% |singlelinecheck| & switches the single-line-check on or off & \ref{justification} \\
% |skip|            & sets the skip between content and caption & \ref{skips} \\
% |strut|           & switches the usage of |\strut|s on or off & \ref{formats} \\
% |style|           & sets the caption style & \ref{style} \\
% |subtype|         & sets the sub-caption type & \phantom{t}--~\footnotemark \\
% |tableposition|\preambleoption & gives a hint about the table caption position & \ref{skips} \\
% |textfont|(|+|)   & sets the font of the caption text & \ref{fonts} \\
% |textformat|      & sets the format of the caption text & \ref{formats} \\
% |twoside|         & selects the two-side mode & \ref{margins} \\
% |type|            & sets the caption type \& places a hyperlink anchor & \ref{types} \\
% |type*|           & sets the caption type only & \ref{types} \\
% |width|           & sets a fixed caption width & \ref{margins} \\
% \end{longtable*}
% \preambleoptiontext
% \footnotetext{The option \texttt{subtype} is explained in the
%   \package{subcaption} package documentation.}
%
% \nopagebreak\parbox[t]{\linewidth}{% prevent from page break
% \begin{Note*}
%   Obsolete options are not listed here. See
%   \Ref{caption1} and
%   \Ref{caption2} for a list of these options.
% \end{Note*}}
%
% \pagebreak[3]
% \subsection{Commands}
%
% \begin{longtable*}{lll}
% Command                          & & Section \\
% \hline
% \endhead
% |\abovecaptionskip|              & & \ref{skips} \\
% |\belowcaptionskip|              & & \ref{skips} \\
% |\caption|                       & & \ref{caption} \\
% |\caption*|                      & & \ref{caption} \\
% |\captionlistentry|              & & \ref{captionlistentry} \\
% |\captionof|                     & & \ref{caption} \\
% |\captionof*|                    & & \ref{caption} \\
% |\captionsetup|                  & & \ref{captionsetup} \\
% |\captionsetup*|                 & & \ref{captionsetup} \\
% |\centerfirst|                   & & \ref{justification} \\
% |\centerlast|                    & & \ref{justification} \\
% |\clearcaptionsetup|             & & \ref{captionsetup} \\
% |\clearcaptionsetup*|            & & \ref{captionsetup} \\
% |\ContinuedFloat|                & & \ref{ContinuedFloat} \\
% |\DeclareCaptionFont|            & & \ref{declare} \\
% |\DeclareCaptionFormat|          & & \ref{declare} \\
% |\DeclareCaptionFormat*|         & & \ref{declare} \\
% |\DeclareCaptionJustification|   & & \ref{declare} \\
% |\DeclareCaptionLabelFormat|     & & \ref{declare} \\
% |\DeclareCaptionLabelSeparator|  & & \ref{declare} \\
% |\DeclareCaptionLabelSeparator*| & & \ref{declare} \\
% |\DeclareCaptionListFormat|      & & \ref{declare} \\
% |\DeclareCaptionOption|          & & \ref{declare} \\
% |\DeclareCaptionStyle|           & & \ref{declare} \\
% |\DeclareCaptionSubType|         & & --~\footnotemark \\
% |\DeclareCaptionTextFormat|      & & \ref{declare} \\
% |\showcaptionsetup|              & & \ref{captionsetup} \\
% \end{longtable*}
% \footnotetext{\cs{DeclareCaptionSubType} is explained in the
%   \package{subcaption} package documentation.}
%
% \clearpage
% \subsection{Warnings}
%
% \begin{Warnings}
%
% \Message
%   |\caption outside box or environment.|
% \Or
%   |\captionsetup{type=...} outside box or environment.|
% \Or
%   |\captionsetup{type*=...} or \captionof outside box|\\
%   | or environment.|
% \Description
%   You have placed a |\caption|, |\caption|\-|of|, or
%   |\caption|\-|setup{type=|\x\meta{type}|}| command outside an box, group,
%   or environment.
%   You should not do this since it could cause some bad side-effects.
%   \par\See{\Ref{types} and \Ref{caption}}
%
% \Message
%   |\caption will not be redefined since it's already|\\
%   |redefined by a document class or package which is|\\
%   |unknown to the caption package.|
% \Description
%   If \thispackage\ detects that some (unknown) document class or
%   package has enhanced |\caption|, it will not redefine
%   |\caption|, too, since this would simply kill the enhancement.
%   As a result some features, like |\caption*|, |\Continued|\-|Float|,
%   using the optional argument of |\caption|\-|setup|,
%   or the options |list=| and |hypcap=| will not be available.\par
%   If you don't care about the original enhancements but would
%   like to use the full range of features of \thispackage\ instead
%   you can give the unsupported(!) option |compatibility=|\x|false|
%   a try and keep your fingers crossed.
%   (But you will get the next warning instead.)
%   \par\See{\Ref{classes} and \Ref{compatibility}}
%
% \Message
%   |Forced redefinition of \caption since the|\\
%   |unsupported(!) package option `compatibility=false'|\\
%   |was given.|
% \Description
%   Since you were so keen to specify the option |compatibility=|\x|false|
%   \thispackage\ will try to do its best to fulfill your wishes.
%   But depending on the document class or other packages you use that
%   can end in non-functional features or even errors. So keep your
%   fingers crossed!
%   \par\See{\Ref{compatibility}}
%
% \Message
%   |Hyperref support is turned off because hyperref has|\\
%   |stopped early.|
% \Description
%   If the \package{hyperref} package stops early during loading
%   (because of what-ever reason), the \package{hyperref} support of
%   \thispackage\ will not be available. As a result you could get
%   \package{hyperref} warnings and non-functional hyperlinks to figures
%   or tables.
%   \par\See{\Ref{hyperref}\,}
%
% \Message
%   |Ignoring optional argument [|\meta{pos}|] of \setcapwidth.|
% \Description
%   \Thispackage\ tries to emulate the \KOMAScript\ commands regarding
%   captions as best as it can. But the optional argument of the
%   \KOMAScript\ command |\setcapwidth| is not (yet) working if you use
%   this package, so if you try to use it anyway, you will get this warning.
%   \par\See{\Ref{KOMA}}
%
% \Message
%   |Internal Warning: |\meta{warning message}|.|
% \Description
%   You should never see this warning, either you use a package which redefines
%   |figure| or |table| and which is unknown to \thispackage, or this is a bug
%   in \thispackage.
%   Please send me an e-mail reporting this issue.
%
% \Message
%   |\label without proper \caption|
% \Description
%   Regarding |\label| the floating environments behave differently than its
%   non-floating counterparts: The internal reference will not be generated
%   at the beginning of the environment, but at |\caption| instead.
%   So you have to place the |\label| command either just \emph{after} or
%   \emph{inside} the caption text (mandatory argument of |\caption|).
%
% \Message
%   |Option `|\meta{option}|' was not in list `|\meta{option list}|'.|
% \Description
%   If you try to remove a specific option of an option list,
%   for example with |\clear|\-|caption|\-|setup[po|\-|si|\-|tion]{table}|,
%   and this option can not be found inside the option list, you will
%   get this warning. If this is not because of a typo and you would like
%   to suppress this warning, use |\clear|\-|caption|\-|setup*| instead of
%   |\clear|\-|caption|\-|setup|.
%   \par\See{\Ref{captionsetup}}
%
% \Message
%   |Option list `|\meta{option list}|' undefined.|
% \Description
%   If you try to remove a specific option of an option list,
%   for example with |\clear|\-|caption|\-|setup[for|\-|mat]{figure}|,
%   and this option list is not defined (yet), you will
%   get this warning. If this is not because of a typo and you would like
%   to suppress this warning, use |\clear|\-|caption|\-|setup*| instead of
%   |\clear|\-|caption|\-|setup|.
%   \par\See{\Ref{captionsetup}}
%
% \Message
%   |Obsolete option `ignoreLTcapwidth' ignored.|
% \Description
%   The \package{caption2} package option |ignoreLTcapwidth| will not be
%   emulated by this version of \thispackage, usually you can simply wipe it
%   away.
%   \par\See{\Ref{caption2} and \Ref{longtable}}
%
% \Message
%   |`ragged2e' support has been changed. Rerun to get|\\
%   |captions right.|
% \Description
%   The \package{ragged2e} package will only be loaded by \thispackage\ if it
%   is actually needed.
%   At least two \LaTeX\ runs are needed for that, so on the first run you could
%   get this warning.
%   Just compile your document again and this warning should go away.
%   \par\See{\Ref{justification}}
%
% \Message
%   |Reference on page |\meta{page no.}| undefined.|
% \Description
%   If you use a |twoside| page layout, \thispackage\ needs to track the
%   page numbers to get the margins right.
%   At least two \LaTeX\ runs are needed for that, on the first run you could get
%   this warning.
%   Just compile your document again and this warning should go away.
%   \par\See{\Ref{margins}}
%
% \Message
%   |The caption type was already set to `|\meta{type}|'.|
% \Description
%   This warning informs you about mixed caption options. For example if
%   you use a |\caption|\-|setup{type=|\x|table}| or
%   |\caption|\-|of{table}{|\ldots|}| inside a |figure| environment,
%   this would result in using both option sets for that specific caption,
%   the one for |figure| (specified with |\caption|\-|setup[figure]{|\ldots|}|)
%   and the one for |table| (specified with |\caption|\-|setup[table]{|\ldots|}|)
%   as well.\par
%   {\small(You can suppress this warning by using the starred form
%   |\caption|\-|setup*{type=|\x\ldots|}|.)\par}
%   \par\See{\Ref{captionsetup}}
%
% \Message
%   |The option `hypcap=true' will be ignored for this|\\
%   |particular \caption.|
% \Description
%   \Thispackage\ hasn't found a proper hyperlink anchor for this particular
%   caption, so it decides to ignore the setting |hypcap=|\x|true| (which is set by
%   default). As a result a link to this caption (e.g.~in the List of Figures,
%   or set by |\ref| or |\auto|\-|ref|) will link you to the caption of the figure
%   or table, not to the figure or table itself.\par
%   This can happen if you use |\caption|\-|of| inside a non-floating environment,
%   but also if you use some package which redefines |figure| or |table|, and
%   which is unknown to \thispackage.\par
%   If this is ok for you but you want to suppress this warning, simply place a
%   |\caption|\-|setup{hyp|\-|cap=|\x|false}| just before the |\caption| or
%   |\caption|\-|of| command which is causing the warning.
%   If this is not ok for you, you can set a hyperlink anchor with
%   |\caption|\-|setup{type=|\x\meta{float type}|}| for yourself.
%   \par\See{\Ref{hyperref}\,}
%
% \Message
%   |Unsupported document class (or package) detected,|\\
%   |usage of the caption package is not recommended.|
% \Description
%   Either the document class you use is unknown to \thispackage, or you
%   have included a package in your document which redefines |\@make|\-|caption|
%   (which is responsible for typesetting the caption internally) as well.
%   This means \thispackage\ will either change the design of captions in an
%   unwanted way, or it even refuses to work correctly at all.
%   \par\See{\Ref{classes} and \Ref{compatibility}}
%
% \Message
%   |Unused \captionsetup[|\meta{type}|].|
% \Description
%   You have specified options with |\caption|\-|setup[|\meta{type}|]| which are
%   not used later on.
%   This can be because of a typo in \meta{type},
%   or because you use a package which redefines |figure| or |table| and
%   which is unknown to \thispackage, or simply because you don't have any usage
%   of the environment \meta{type} after this line.
%   (If you want to suppress this warning you can use |\caption|\-|setup*|
%    instead of |\caption|\-|setup|.)
%   \par\See{\Ref{captionsetup}}
%
% \Message
%   |Usage of the |\meta{package}| package together with the|\\
%   |caption package is strongly not recommended.|\\
%   |Instead of loading the |\meta{package}| package you should|\\
%   |use the caption package option `tableposition=top'.|
% \Description
%   The package \meta{package} is dealing with caption skips as well.
%   Please decide which one do you actually want to use, \thispackage\ or the
%   other one, using both can lead to wrong skips above or below the caption.
%   \par\See{\Ref{skips}}
%
% \end{Warnings}
%
% \pagebreak[3]
% \subsection{Errors}
%
% \begin{Warnings}
%
% \Message
%   |Argument of \@caption has an extra }.|
% \Or
%   |Paragraph ended before \@caption was complete.|
% \Description
%   If you want to typeset something special (like a tabular) as caption,
%   you need to give an optional argument to |\caption| resp.~|\caption|\-|of|
%   for the List of Figures resp.~List of Tables, too, even if you don't
%   use such list.
%   \par\See{\Ref{caption}, \Ref{lists}, and \Ref{hyperref}\,}
%
% \Message
%   |\caption outside float.|
% \Description
%   You have placed a |\caption| command outside a floating environment, or
%   a |long|\-|table| or |wrap|\-|figure|.
%   If this is what you want to, please use either
%   |\caption|\-|setup{type=|\x\meta{type}|}| $+$ |\caption| or
%   |\caption|\-|of|.
%   \par\See{\Ref{caption}}
%
% \Message
%   |\ContinuedFloat outside float.|
% \Description
%   You have placed a |\Continued|\-|Float| command outside a floating
%   environment. % or |long|\-|table|.
%   If this is what you want to, please use the combination
%   |\caption|\-|setup{type=|\x\meta{type}|}| $+$ |\Continued|\-|Float|.\par
%   Please note that |\Continued|\-|Float| inside a |long|\-|table| is not
%   working, but maybe using the |long|\-|table*| environment, which
%   typesets a |long|\-|table| without incrementing the |table| counter,
%   if sufficient for you.
%   \par\See{\Ref{ContinuedFloat} and \Ref{longtable}}
%
% \Message
%   |Continued `|\meta{type}|' after `|\meta{type}|'.|
% \Description
%   Continued figures or tables are not allowed to be interrupted by a floating
%   environment (or |long|\-|table|) of another type,
%   e.g.~a table between a figure and a continued figure.
%   \par\See{\Ref{ContinuedFloat}}
%
% \Message
%   |For a successful cooperation we need at least version|\\
%   |`|\meta{date}|' of package |\meta{package}|, but only version|\\
%   |`|\meta{old-date}|' is available.|
% \Description
%   \Thispackage\ does not work with such an outdated package, please update it
%   to a more recent version, at least to the one requested.
%
% \Message
%   |Internal Error: |\meta{error message}|.|
% \Description
%   You should never see this error.
%   Please send me an e-mail reporting this issue.
%
% \Message
%   |No float type '|\meta{type}|' defined.|
% \Description
%   The \meta{type} you have specified in |\caption|\-|setup{type=|\x\meta{type}|}|,
%   |\caption|\-|of|\marg{type}, or |\Declare|\-|Caption|\-|Sub|\-|Type| is
%   not defined.
%   \meta{type} should be either `\texttt{figure}' or `\texttt{table}', or
%   any other floating environment defined with
%   |\Declare|\-|Floating|\-|Environment| offered by the \package{newfloat} package,
%   |\new|\-|float| offered by the \package{float} package\cite{float}, or
%   |\Declare|\-|New|\-|Float|\-|Type| offered by the \package{floatrow} package\cite{floatrow}.
%
% \Message
%   |Not allowed in longtable* environment.|
% \Description
%   The usage of |\caption| is not allowed inside the |long|\-|table*| environment.
%   Please use either |\caption*| for a caption without label or use the regular
%   |long|\-|table| environment instead.
%
% \Message
%   |Not available in compatibility mode.|
% \Description
%   The feature required is not supported in compatibility mode.
%   `compatibility mode' means that \thispackage\ has detected either an
%   incompatible document class or an incompatible package which also
%   extents the |\caption| command. Leaving the original extension intact,
%   some features of \thispackage\ are not supported.
%   \par\See{\Ref{compatibility}}
%
% \Message
%   |Only one \caption can be placed in this environment.|
% \Description
%   Inside the environments offered by the \package{fltpage} and \package{sidecap}
%   package only \emph{one} caption can be placed. (This is due implementation design.)
%
% \Message
%   |Option clash for package caption.|
% \Or[but sometimes also]
%   |Missing \begin{document}.|
% \Description
%   \Thispackage\ has already been loaded by some other \LaTeX\ package,
%   so you can't do that again specifying different options.
%   A candidate causing this could be the \package{subfig} package; if this is
%   the case, please load \thispackage\ \emph{before} the \package{subfig}
%   package or specify the option |caption=|\x|false| while loading the
%   \package{subfig} package.
%   \par\See{the \package{subfig} package\cite{subfig} documentation}
%
% \Message
%   |Paragraph ended before \caption@makecurrent was complete.|
% \Or
%   |Paragraph ended before \caption@prepareanchor was complete.|
% \Description
%   If you want to typeset multi-paragraph captions, you need to give an
%   optional argument to |\caption| resp.~|\caption|\-|of| for the List of
%   Figures resp.~List of Tables, too, even if you don't use such list.
%   \par\See{\Ref{caption}, \Ref{lists}, and \Ref{hyperref}\,}
%
% \Message
%   |Something's wrong--perhaps a missing \caption|\\
%   |in the last figure or table.|
% \Description
%   It seems that you have used a |\sub|\-|caption| command (or a different one
%   which has typeset a sub-caption) without a corresponding |\caption| command.
%   This is not supported.
%
% \Message
%   |The option `labelsep=|\meta{name}|' does not work|\\
%   |with `format=hang'.|
% \Or
%   |The option `labelsep=|\meta{name}|' does not work|\\
%   |with \setcaphanging (which is set by default).|
% \Description
%   A caption label separator which contains a |\\| command (like
%   |labelsep=|\x|newline|) can not be combined with a hanging caption format
%   (like |format=|\x|hang|).
%   Please select either another caption label separator
%   (e.g.~|labelsep=|\x|colon|) or another caption format
%   (e.g.~|format=|\x|plain|).
%   \par\See{\Ref{formats} resp.~\Ref{KOMA}}
%
% \Message
%   |The package option `caption=false' is obsolete.|\\
%   |Please pass this option to the subfig package instead|\\
%   |and do *not* load the caption package anymore.|
% \Description
%   You have specified the option |caption=|\x|false|. This used to be a workaround
%   for not using the whole \package{caption} package (leaving the caption stuff
%   offered by the document class or other packages intact), but keeping the
%   \package{subfig} package working. This mechanism is obsolete and not offered
%   anymore, please pass this option to the \package{subfig} package instead and
%   do not load \thispackage\ anymore.
%   \par\See{the \package{subfig} package\cite{subfig} documentation}
%
% \Message
%   |Undefined boolean value `|\meta{value}|'.|
% \Description
%   You tried to set a boolean option (like |singlelinecheck=| or |hypcap=|)
%   with an improper value. Only |false|, |no|, |off|, |0| or |true|, |yes|,
%   |on|, |1| is allowed here.
%
% \Message
%   |Undefined format `|\meta{name}|'.|
% \Description
%   You tried to set a caption format which does not exists.
%   Maybe a typo!?
%   \par\See{\Ref{formats}}
%
% \Message
%   |Undefined label format `|\meta{name}|'.|
% \Description
%   You tried to set a caption label format which does not exists.
%   Maybe a typo!?
%   \par\See{\Ref{formats}}
%
% \Message
%   |Undefined label separator `|\meta{name}|'.|
% \Description
%   You tried to set a caption label separator which does not exists.
%   Maybe a typo!?
%   \par\See{\Ref{formats}}
%
% \Message
%   |Undefined list format `|\meta{name}|'.|
% \Description
%   You tried to set a caption list-of format which does not exists.
%   Maybe a typo!?
%   \par\See{\Ref{lists}}
%
% \Message
%   |Undefined position `|\meta{name}|'.|
% \Description
%   You tried to set a caption position with an improper value.
%   Maybe a typo!?
%   \par\See{\Ref{skips}}
%
% \Message
%   |Undefined style `|\meta{name}|'.|
% \Description
%   You tried to set a caption style which does not exists.
%   Maybe a typo!?
%   \par\See{\Ref{style}}
%
% \Message
%   |Usage of the `position' option is incompatible|\\
%   |to the `|\meta{package}|' package.|
% \Description
%   The given package is dealing with caption skips as well.
%   Please decide which one do you actually want to use: The |position=| option
%   of \thispackage\ or the mechanism of the other one; using both this way
%   would lead to wrong skips above or below the caption and is therefore
%   not supported.
%   \par\See{\Ref{skips}}
%
% \Message
%   |Undefined text format `|\meta{name}|'.|
% \Description
%   You tried to set a caption text format which does not exists.
%   Maybe a typo!?
%   \par\See{\Ref{formats}}
%
% \Message
%   |You can't use both, the (obsolete) caption2 *and*|\\
%   |the (current) caption package.|
% \Description
%   This error message says it all, you simply can't do that.
%   Please use only \thispackage.
%   \par\See{\Ref{caption2}}
%
% \end{Warnings}
%
% \iffalse
% --------------------------------------------------------------------------- %
% \fi
%
% \clearpage
% \section{Version history}
% \label{history}
%
% The version $1.0$ was written in 1994 and was offering a handful of options
% to customize the look \& feel of the captions.
% Furthermore this version already supported the \package{rotating} and
% \package{subfigure} packages.
% Version $1.1$ introduced the |center|\-|last| option;
% version $1.2$ added the support of the \package{float} package.
% Version $1,3$ offered a better support of the \package{subfigure} package,
% while version $1.4$ came with the new option |nooneline|.
%
% The \package{caption2} package $2.0$ was an experimental side-version of
% the regular \package{caption} package. It was made public as beta test version
% without proper documentation in 1995 because of the strong demand for new
% features and adaptations to additional packages like the \package{longtable}
% package.
% Furthermore it offered a revised support of the \package{subfigure} package.
% (An improved version $2.1$ was offered in 2002.)
%
% In 2003 I finally found some time, so a new regular release $3.0$
% of the \package{caption} package could be build in cooperation with
% Frank Mittelbach and Steven Cochran.
% It was released in December 2003 and superseded the neglected
% \package{caption2} package.
% Main parts were re-written and it provided a complete re-work of
% the user interface.
% Furthermore it supported the \package{hyperref}, \package{hypcap},
% \package{listings}, \package{sidecap}, and \package{supertabular} packages
% additionally.
%
% While all the previous versions were designed for usage with the standard
% \LaTeX\ document classes \class{article}, \class{report}, and \class{book},
% the current version $3.1$ released in 2007 also supports the \AmS,
% \KOMAScript, \NTG, and \SmF\ document classes, and the \class{beamer} class
% as well.
% Furthermore it was adapted to the \package{french} Babel option,
% the \package{frenchle} \& \package{frenchpro} packages,
% and the \package{floatflt}, \package{fltpage}, \package{picinpar},
% \package{picins}, \package{setspace}, \package{threeparttable},
% and \package{wrapfig} packages.
% New options and commands were introduced as well, among other things
% |font+|, |figure|\-|within| \& |table|\-|within|,
% |list| \& |list|\-|format|, |max|\-|margin| \& |min|\-|margin|,
% |\caption|\-|list|\-|entry|, |\Declare|\-|Caption|\-|List|\-|Format|.
% Further benefits are the new compatibility check \see*{\Ref{compatibility}},
% the new ``hypcap'' feature \see*{\Ref{hyperref}\,}, and the sub-caption
% feature \see*{\package{subcaption} package documentation}.
%
% \iffalse
% --------------------------------------------------------------------------- %
% \fi
%
% \clearpage
% \section{Compatibility to older versions}
%
% \subsection{caption v\texorpdfstring{$1.x$}{1.x}}
% \label{caption1}
%
% This version of \thispackage\ still supports the old options
% and commands provided by the version $1.0$ to $1.4$ of this package.
% So there shouldn't occur any problems compiling old documents, but please
% don't mix old options and commands with the new ones. This isn't supported
% and can cause ugly side effects.
%
% Here comes a short oversight of the obsolete options and how
% they have been replaced within this version of \thispackage:
%
% \begin{center}\small
% \begin{tabular}{ll}
% \package{caption} \version{1.x} & \package{caption} \version{3.x}\\
% \hline
% |normal|        & |format=plain|\\
% |hang|          & |format=hang|\\
% |isu|           & |format=hang|\\
% |center|        & |justification=centering|\\
% |centerlast|    & |justification=centerlast|\\
% |nooneline|     & |singlelinecheck=off|\\
% |scriptsize|    & |font=scriptsize|\\
% |footnotesize|  & |font=footnotesize|\\
% |small|         & |font=small|\\
% |normalsize|    & |font=normalsize|\\
% |large|         & |font=large|\\
% |Large|         & |font=Large|\\
% |up|            & |labelfont=up|\\
% |it|            & |labelfont=it|\\
% |sl|            & |labelfont=sl|\\
% |sc|            & |labelfont=sc|\\
% |md|            & |labelfont=md|\\
% |bf|            & |labelfont=bf|\\
% |rm|            & |labelfont=rm|\\
% |sf|            & |labelfont=sf|\\
% |tt|            & |labelfont=tt|\\
% \end{tabular}
% \end{center}
%
% Beside the options for setting up the desired font there were also
% the commands |\caption|\-|size| resp.~|\caption|\-|font| and
% |\caption|\-|label|\-|font| who could be redefined with
% |\re|\-|new|\-|command| and allowed an alternate and more flexible way to
% change the font used for captions.
% This mechanism was replaced by the commands
% \begin{quote}
%   |\DeclareCaptionFont{|\ldots|}{|\ldots|}|\qquad and\\
%   |\captionsetup{font=|\ldots|,labelfont=|\ldots|}|\qquad.
% \end{quote}
% \SeeUserDefined
%
% Setting the margin for captions was done in \version{1.x} with
% \begin{quote}
%   |\setlength{\captionmargin}{|\ldots|}|\quad.
% \end{quote}
% This was replaced by
% \begin{quote}
%   |\captionsetup{margin=|\ldots|}|\qquad.
% \end{quote}
% \See{\Ref{margins}}
%
% For example the old-style code
% \begin{quote}
%   |\usepackage[hang,bf]{caption}|\\
%   |\renewcommand\captionfont{\small\sffamily}|\\
%   |\setlength\captionmargin{10pt}|
% \end{quote}
% will still work fine, but should be written today as
% \begin{quote}
%   |\usepackage[format=hang,labelfont=bf,font={small,sf},|\\
%   |            margin=10pt]{caption}|
% \end{quote}
% or
% \begin{quote}
%   |\usepackage{caption}|\\
%   |\captionsetup{format=hang,labelfont=bf,font={small,sf},|\\
%   |              margin=10pt}|\qquad.
% \end{quote}
%
% The quite exotic option |ruled| which allowed a partial usage of
% the caption settings for |ruled| floats defined with the
% \package{float} package will be emulated by this version of the
% caption package, too.
% But using this option is not recommended anymore since this
% version of \thispackage\ offers a more flexible way
% for changing the captions of these floating environments:
% \begin{quote}
%   |\DeclareCaptionStyle{ruled}{|\ldots|}|
% \end{quote}
% resp.
% \begin{quote}
%   |\captionsetup[ruled]{|\ldots|}|\qquad.
% \end{quote}
% \SeeUserDefined[, \Ref{captionsetup}, and \Ref{float}]
%
% \subsection{caption2 v\texorpdfstring{$2.x$}{2.x}}
% \label{caption2}
%
% Although they do very similar stuff, the packages \package{caption} and
% its experimental and now obsolete variant \package{caption2} have a
% very different implementation design.
% Therefore a full compatibility could not be offered.
% For that reason you will still find a file called |caption2.sty| in
% this package distribution, so old documents using the \package{caption2}
% package will still compile fine.
%
% Newly created documents should use the actual version of
% \thispackage\ instead. In most cases it's sufficient to replace the command
% \begin{quote}
%   |\usepackage[...]{caption2}|
% \end{quote}
% by
% \begin{quote}
%   |\usepackage[...]{caption}|\qquad.
% \end{quote}
% But some options and commands will not be emulated, so you can get
% error messages afterwards. This section will hopefully help you removing
% these errors. If you have problems migrating from \package{caption2}
% to \package{caption} please don't hesitate to send me an e-mail asking
% for help.
%
% In addition to the obsolete options shown in the last section
% these ones will be emulated, too:
%
% \begin{center}\small
% \begin{tabular}{ll}
% \package{caption2} \version{2.x} & \package{caption} \version{3.x}\\
% \hline
% |flushleft|   & |justification=raggedright|\\
% |flushright|  & |justification=raggedleft|\\
% |oneline|     & |singlelinecheck=on|\\
% \end{tabular}
% \end{center}
%
% Setting the margin for captions was done in \version{2.x} with
% \begin{quote}\leavevmode\hbox{%
%   |\setcaptionmargin{|\ldots|}| resp.
%   |\setcaptionwidth{|\ldots|}|\quad.
% }\end{quote}
% This was replaced by
% \begin{quote}\leavevmode\hbox{%
%   |\captionsetup{margin=|\ldots|}| resp.
%   |\captionsetup{width=|\ldots|}|\quad.
% }\end{quote}
% \See{\Ref{margins}}
%
% Setting an indention was done in \version{2.x} with
% \begin{quote}
%   |\captionstyle{indent}|\\
%   |\setlength\captionindent{|\ldots|}|\quad.
% \end{quote}
% \pagebreak[3]
% This is now done with
% \nopagebreak[3]
% \begin{quote}
%   |\captionsetup{format=plain,indention=|\ldots|}|\quad.
% \end{quote}
%
% The so-called single-line-check was controlled by the commands
% |\oneline|\-|captions|\-|false| (for switching the check off) and
% |\oneline|\-|captions|\-|true| (for switching the check on).
% This was replaced by
% |\caption|\-|setup{single|\-|line|\-|check=|\x|off}|
% resp.
% |\caption|\-|setup{single|\-|line|\-|check=|\x|on}|\quad.
% \See{\Ref{justification}}
%
% The commands
% \begin{quote}
%   |\captionlabeldelim|, |\captionlabelsep|, |\captionstyle|,\\
%   |\defcaptionstyle|, |\newcaptionstyle|, and |\renewcaptionstyle|
% \end{quote}
% do not have a simple replacement and therefore will not be emulated
% by this version of \thispackage. (So using them will
% cause error messages.) Rewriting such code is not always easy and
% straight-ahead, but by conscientious reading of this manual you should
% be able to find appropriate options and commands instead.
%
% \iffalse
% ... (some examples)
% \fi
%
% The \version{2.x} option |ignore|\-|LT|\-|cap|\-|width| do not have a
% replacement, too.
% But in most cases you can simply drop using that option because
% in this version of \thispackage\ the value of |\LT|\-|cap|\-|width|
% will be ignored anyway (unless you set it to a different value than the
% default one which is |4in|).
% \See{\Ref{longtable}}
%
% \subsection{caption v\texorpdfstring{$3.0$}{3.0}}
% \label{caption3}
%
% \Thispackage\ \version{3.0} did not support any document classes
% other than the standard \LaTeX\ ones: \class{article}, \class{report},
% and \class{book}.
% Therefore the default settings used to be fixed, but now \thispackage{}
% supports more classes, therefore they are now set in dependence on the
% document class used.
%
% For example: While in \version{3.0} the default caption
% |jus|\-|ti|\-|fi|\-|ca|\-|tion| used to be always |jus|\-|ti|\-|fied|,
% it's now still |jus|\-|ti|\-|fied| when using one of the standard document
% classes, but |ragged|\-|right| will be used as default format when used
% with the \class{beamer} document class.
%
% An easy way to select the `old' defaults is using the option
% |style=base| when loading \thispackage\ (or later on using |\caption|\-|setup|).
%
% \medskip
%
% Another new feature is the automatic check for compatibility; if an
% incompatibility will be found, a warning message will be issued and if a strong
% incompatibility was found some features of \thispackage\ will be disabled.
% Please note that only this check was added to \thispackage, so if you get
% such warning message, the previous versions of \thispackage\ were incompatible
% as well, but did not issued such warning, they were ``only'' having
% side-effects or causing problems.
% So these warnings only say that some bad side effects or problems could
% happen, but not that they actually will happen.
% Anyway, if you use \thispackage\ in such circumstances,
% you should use it with care.
%
% \bigskip
%
% \begin{Note*}
% \Thispackage\ \version{3.0} offered the option |caption=|\x|false|,
% which used to be a workaround for not using the whole \package{caption} package
% (leaving the caption stuff offered by the document class or other packages
% intact), but keeping the \package{subfig} package\cite{subfig} working.
% This mechanism is obsolete and not offered anymore, please pass this option
% to the \package{subfig} package instead and do not load \thispackage\ anymore.
% \end{Note*}
%
% \iffalse
% --------------------------------------------------------------------------- %
% \fi
%
% \clearpage
% \section{Commands for document class authors}
%
% A document class could simply load the \package{caption} package instead
% of defining an own variant of |\@make|\-|caption|. However if the author decides
% not to do this -- for whatever reason -- there is a second option:
%
% \NEWfeature{v3.5}
% If a document class defines |\caption@document|\-|class|, an adaption to the
% \package{caption} package will be loaded as |caption-|\meta{documentclass}|.sto|
% if the \package{caption} kernel is loaded.
% The goal of this adaption file is changing the default settings of the
% \package{caption} package so simply loading it (without any package options)
% will not make any harm to the look at feel of the captions.
% This gives end-users the opportunity to fine-tune certain aspects of the
% appearance of captions by adding package options, without unwanted
% side-effects on other aspects of the appearance.
%
% In both cases the command |\Set|\-|Caption|\-|Default|
% could be used to adapt the \package{caption} package default values:
%
% \DescribeMacro{\SetCaptionDefault}
% The command
% \begin{quote}
%   |\SetCaptionDefault*|\marg{option}\marg{default value}
% \end{quote}
% changes the default value for the option \meta{option}, for example:
% \begin{quote}
%   |\SetCaptionDefault{format}{hang}|\\
%   |\SetCaptionDefault{justification}{raggedright}|\\
%   |\DeclareCaptionLabelSeparator{silly}{ +++ }|\\
%   |\SetCaptionDefault{labelseparator}{silly}|
% \end{quote}
% This command is available for the options
%   |box|,
%   |font|,
%   |format|,
%   |justification|,
%   |label|\-|font|,
%   |label|\-|format|,
%   |label|\-|separator|,
%   |list|\-|format|,
%   |margin|,
%   |parbox|,
%   |position|,
%   |single|\-|line|\-|check|,
%   |text|\-|font|,
%   |text|\-|format|, and
%   |width|.
%
% The starred variant only makes a difference when setting the default length
% of either |margin| or |width|, in this case it will use |\def| internally
% instead of |\edef| to store the value so the actual margin will be calculated
% when used (and not when set).
%
% \DescribeMacro{\SetCaptionFallback}
% The command
% \begin{quote}
%   |\SetCaptionFallback|\marg{option}\marg{fallback value}
% \end{quote}
% changes the fallback value for the option \meta{option}, for example:
% \begin{quote}
%   |\SetCaptionFallback{labelformat}{simple}|
% \end{quote}
% Currently only the pre-defined label format `original' uses a fallback
% value when |\fnum@|\meta{environment} is not defined for the current (floating)
% environment.
%
% \DescribeMacro{\AtCaptionPackage}
% The adaption file will be loaded when the \package{caption} kernel |caption3.sty|
% will be loaded so the given adaptions will be done for the \package{floatrow}
% and \package{subfig} packages even if the \package{caption} package isn't loaded.
%
% But some adaptions have to be done for the \package{caption} package,
% and for this reason the hook
% \begin{quote}|\AtCaptionPackage|\marg{code}\end{quote}
% is offered to authors of adaption files.
% The \meta{code} inside the hook will be executed right before the given package
% options will be evaluated.
%
% For example the adaption file for the \KOMAScript\ document classes
% uses |\At|\-|Begin|\-|Caption| to re-define the \package{caption} package
% options |figure|\-|position| and |table|\-|position| to issue a warning
% that using these options have little effect here.
%
% \DescribeMacro{\AfterCaptionPackage}
% The additional hook
% \begin{quote}|\AfterCaptionPackage|\marg{code}\end{quote}
% is offered to authors of adaption files as well.
% The \meta{code} inside the hook will be executed at the very end of the
% \package{caption} package.
%
% \iffalse
% --------------------------------------------------------------------------- %
% \fi
%
% \clearpage
% \section{Commands for babel language package authors}
%
% \NEWfeature{v3.5}
% \DescribeMacro{\caption@switchdefault}
% If the \package{caption3} kernel package is loaded, the command
% \begin{quote}|\caption@switchdefault|\marg{option}\marg{code with \#1}\marg{new value}\end{quote}
% is available which saves the old default value of the given option using
% \meta{code} and sets the new default value afterwards.
%
% \DescribeMacro{\caption@restoredefault}
% The command
% \begin{quote}|\caption@restoredefault|\marg{option}\marg{old value}\end{quote}
% restores the old default value which was stored in \meta{old value} before.
%
% Example:
% \begin{quote}
%   |\DeclareCaptionLabelSeparator{french}{|\ldots|}|\\
%   |\addto\extrasfrench{%|\\
%   |  \caption@switchdefault{labelseparator}{\babel@save #1}{french}}|\\
%   |% Note: \caption@restoredefault isn't needed here|
% \end{quote}
%
% Another example:
% \begin{quote}
%   |\caption@switchdefault{font}{\let\original@captionfont#1}{it}%|\\
%   \ldots\\
%   |\caption@restoredefault{font}{\original@captionfont}%|\\
% \end{quote}
%
% Since boths commands are defined with |\def| inside the \package{caption3}
% kernel, they could be pre-defined with
% \begin{quote}
%   |\providecommand\caption@switchdefault[3]{}|\\
%   |\providecommand\caption@restoredefault[2]{}|
% \end{quote}
% inside the babel language package so their existence doesn't need to be tested
% prior use.
%
% Additionally babel language packages should not re-define |\@make|\-|caption|
% if the \package{caption} package is loaded, i.e.~if |\caption@makecaption| is
% defined. (Unfortunately one cannot use the \LaTeX{} kernel command
% |\@if|\-|package|\-|loaded{caption}| here since it's only available in the
% document preamble.)
%
% Please note that code like
% \begin{quote}
%   |\addto\extraswhatever{%|\\
%   |  \@ifundefined{caption@makecaption}{%|\\
%   |    \babel@save\@makecaption|\\
%   |    \let\@makecaption\my@makecaption|\\
%   |  }{%|\\
%   |    \caption@switchdefault{|\ldots|}{\babel@save #1}{|\ldots|}%|\\
%   |  }}|
% \end{quote}
% would be wrong since it mixes up the presence of the \package{caption3} kernel
% and the \package{caption} package.
% If the \package{caption3} kernel is loaded this does not mean that the
% \package{caption} package is loaded, too, and the latter one re-defines
% |\caption|, |\@caption|, and |\@make|\-|caption| while the \package{caption3}
% kernel does not re-define any of them, instead it only provides (default) values
% for the \package{caption}, \package{floatrow}, and \package{subfig} package.
%
% Currently there is build-in support for the following babel language options:
% |arabic|, |farsi|, |french|, |hungarian|, |latvian|, and |magyar|.
% This support could be deactivated by defining
% \begin{quote}
%   |\def\caption@ifbabel@|\meta{package}|{false}|
% \end{quote}
% where \meta{package} is either |arabi|, |french|, |frenchle|, |hungarian|,
% or |latvian|.
%
% \iffalse
% --------------------------------------------------------------------------- %
% \fi
%
% \pagebreak[4]
% \section*{Internal commands}
%
% These internal commands are save to use by other packages as well
% since their interface will not change in future releases:
% \begin{quote}\begin{tabular}{ll}
%   Internal command                  & Currently used by  \\
% \hline
%   |\caption@kernel@addcontentsline| & \package{floatrow} \\
%   |\caption@settype|                & \package{newfloat} \\
%   |\caption@setsubtype|             & \package{floatrow} \\
%   |\caption@xlabel|                 & \package{cleveref} \\
% \end{tabular}\end{quote}
%
% If your package wants to use any other internal command of the \package{caption} package,
% please write me an e-mail so we can define a proper interface together.
%
% The \package{lwarp} package uses a lot of internal commands as well,
% but we are working on it on the Git branch \texttt{feature/lwarp}:
% \url{https://gitlab.com/axelsommerfeldt/caption/-/tree/feature/lwarp}
%
% \iffalse
% --------------------------------------------------------------------------- %
% \fi
%
% \StopEventually{%^^A
% \begin{thebibliography}{99}
%
%   \bibitem{TLC2}
%   Frank Mittelbach and Michel Goossens:\\
%   \newblock {\em The {\LaTeX} Companion (2nd.~Ed.)},\\
%   \newblock Addison-Wesley, 2004.
%
%   \bibitem{beamer}
%   Till Tantau:\\
%   \href{http://www.ctan.org/pkg/beamer}%
%        {\emph{User Guide to the Beamer Class, Version 3.07}},\\
%   March 11, 2007
%
%   \bibitem{KOMAScript}
%   Markus Kohm \& Jens-Uwe-Morawski:\\
%   \href{http://www.ctan.org/pkg/koma-script}%
%        {\emph{KOMA-Script -- a versatile \LaTeXe\ bundle}},\\
%   2007-01-09
%
%   \bibitem{NTG}
%   Victor Eijkhout:\\
%   \href{http://www.ctan.org/pkg/ntgclass}%
%        {\emph{An introduction to the Dutch \LaTeX\ document classes}},\\
%   3 September 1989
%
%   \bibitem{algorithms}
%   Rog\'erio Brito:\\
%   \href{http://www.ctan.org/pkg/algorithms}%
%        {\emph{Algorithms}},\\
%   June 2, 2006
%
%   \bibitem{float}
%   Anselm Lingnau:\\
%   \href{http://www.ctan.org/pkg/float}%
%        {\emph{An Improved Environment for Floats}},\\
%   2001/11/08
%
%   \bibitem{floatflt}
%   Mats Dahlgren:\\
%   \href{http://www.ctan.org/pkg/floatflt}%
%        {\emph{Welcome to the floatflt package}},\\
%   1998/06/05
%
%   \bibitem{floatrow}
%   Olga Lapko:\\
%   \href{http://www.ctan.org/pkg/floatrow}%
%        {\emph{The floatrow package documentation}},\\
%   2009/08/02
%
%   \bibitem{fltpage}
%   Sebastian Gross:\\
%   \href{http://www.ctan.org/pkg/fltpage}%
%        {\emph{Welcome to the beta test of fltpage package!}},\\
%   1998/11/13
%
%   \bibitem{hyperref}
%   Sebastian Rahtz \& Heiko Oberdiek:\\
%   \href{http://www.ctan.org/pkg/hyperref}%
%        {\emph{Hypertext marks in \LaTeX: a manual for hyperref}},\\
%   November 2012
%
%   \bibitem{hypcap}
%   Heiko Oberdiek:\\
%   \href{http://www.ctan.org/pkg/oberdiek}%
%        {\emph{The hypcap package -- Adjusting anchors of captions}},\\
%   2011/02/16
%
%   \bibitem{listings}
%   Carsten Heinz \& Brooks Moses:\\
%   \href{http://www.ctan.org/pkg/listings}%
%        {\emph{The Listings Package}},\\
%   2007/02/22
%
%   \bibitem{longtable}
%   David Carlisle:\\
%   \href{http://www.ctan.org/pkg/longtable}%
%        {\emph{The longtable package}},\\
%   2004/02/01
%
%   \bibitem{picinpar}
%   Friedhelm Sowa:\\
%   \href{http://www.ctan.org/pkg/picinpar}%
%        {\emph{Pictures in Paragraphs}},\\
%   July 13, 1993
%
%   \bibitem{picins}
%   Joachim Bleser and Edmund Lang:\\
%   \href{http://www.ctan.org/pkg/picins}%
%        {\emph{PicIns-Benutzerhandbuch Version 3.0}},\\
%   September~1992
%
%   \bibitem{rotating}
%   Sebastian Rahtz and Leonor Barroca:\\
%   \href{http://www.ctan.org/pkg/rotating}%
%        {\emph{A style option for rotated objects in \LaTeX}},\\
%   1997/09/26
%
%   \bibitem{setspace}
%   Erica M. S. Harris \& Geoffrey Tobin:\\
%   \href{http://www.ctan.org/pkg/setspace}%
%        {\emph{LaTeX Document Package ``setspace''}},\\
%   1 December 2000
%
%   \bibitem{sidecap}
%   Rolf Niepraschk \& Hubert G\"a\ss lein:\\
%   \href{http://www.ctan.org/pkg/sidecap}%
%        {\emph{The sidecap package}},\\
%   2003/06/06
%
%   \bibitem{subfigure}
%   Steven D. Cochran:\\
%   \href{http://www.ctan.org/pkg/subfigure}%
%        {\emph{The subfigure package}},\\
%   2005/03/15
%
%   \bibitem{subfig}
%   Steven D. Cochran:\\
%   \href{http://www.ctan.org/pkg/subfig}%
%        {\emph{The subfig package}},\\
%   2005/07/05
%
%   \bibitem{supertabular}
%   Johannes Braams and Theo Jurriens:\\
%   \href{http://www.ctan.org/pkg/supertabular}%
%        {\emph{The supertabular environment}},\\
%   2004/02/20
%
%   \bibitem{threeparttable}
%   Donald Arseneau:\\
%   \href{http://www.ctan.org/pkg/threeparttable}%
%        {\emph{Three part tables: title, tabular environment, notes}},\\
%   March 5, 2010
%
%   \bibitem{wrapfig}
%   Donald Arseneau:\\
%   \href{http://www.ctan.org/pkg/wrapfig}%
%        {\emph{WRAPFIG.STY ver 3.6}},\\
%   Jan 31, 2003
%
%   \bibitem{xtab}
%   Peter Wilson:\\
%   \href{http://www.ctan.org/pkg/xtab}%
%        {\emph{The xtab package}},\\
%   2011/07/31
%
% \end{thebibliography}
% }
%
% \iffalse
% --------------------------------------------------------------------------- %
% \fi
%
% \DoNotIndex{\\,\_,\ ,\@@par}
% \DoNotIndex{\@bsphack}
% \DoNotIndex{\@car,\@cdr,\@classoptionslist,\@cons,\@currext,\@currname}
% \DoNotIndex{\@ehc,\@ehd,\@empty,\@esphack,\@expandtwoargs}
% \DoNotIndex{\@for,\@firstofone,\@firstoftwo}
% \DoNotIndex{\@gobble,\@gobblefour,\@gobbletwo,\@hangfrom}
% \DoNotIndex{\if@minipage,\@ifnextchar,\@ifpackagelater,\@ifpackageloaded}
% \DoNotIndex{\@ifstar,\@ifundefined,\@latex@error,\@minipagefalse,\@minipagetrue}
% \DoNotIndex{\@namedef,\@nameuse}
% \DoNotIndex{\@onlypreamble,\@parboxrestore,\@plus,\@ptionlist}
% \DoNotIndex{\@removeelement,\@restorepar,\@secondoftwo,\@setminipage,\@setpar}
% \DoNotIndex{\@tempa,\@tempboxa,\@tempdima,\@tempdimb,\@tempdimc,\@tempb,\@tempc}
% \DoNotIndex{\@testopt}
% \DoNotIndex{\@undefined,\@unprocessedoptions,\@unusedoptionlist}
% \DoNotIndex{\p@,\z@}
% \DoNotIndex{\active,\addtocounter,\addtolength,\advance,\aftergroup}
% \DoNotIndex{\baselineskip,\begin,\begingroup,\bfseries,\box}
% \DoNotIndex{\catcode,\centering,\changes,\csname,\def,\divide,\do,\downarrow}
% \DoNotIndex{\edef,\else,\empty,\end,\endcsname,\endgraf,\endgroup,\expandafter}
% \DoNotIndex{\fi,\footnotesize,\global}
% \DoNotIndex{\hangindent,\hbox,\hfil,\hsize,\hskip,\hspace,\hss}
% \DoNotIndex{\ifcase,\ifdim,\ifnum,\ifodd,\ifvoid,\ifvmode}
% \DoNotIndex{\ifx,\ignorespaces,\itshape}
% \DoNotIndex{\kernel@ifnextchar}
% \DoNotIndex{\Large,\large,\leavevmode,\leftmargini,\leftskip,\let,\linewidth}
% \DoNotIndex{\llap,\long,\m@ne,\margin,\mdseries,\message}
% \DoNotIndex{\newcommand,\newdimen,\newlength,\newline,\newif,\newsavebox}
% \DoNotIndex{\next,\nobreak,\nobreakspace,\noexpand,\noindent,\numberline}
% \DoNotIndex{\normalcolor,\normalfont,\normalsize,\or,\par,\parbox,\parfillskip}
% \DoNotIndex{\parindent,\parskip,\prevdepth,\protect,\protected@edef,\protected@write}
% \DoNotIndex{\providecommand,\quad}
% \DoNotIndex{\raggedleft,\raggedright,\relax,\renewcommand,\RequirePackage}
% \DoNotIndex{\rightskip,\rmfamily}
% \DoNotIndex{\sbox,\scriptsize,\scshape,\setbox,\setlength,\sffamily,\slshape}
% \DoNotIndex{\small,\string,\space,\strut}
% \DoNotIndex{\textheight,\the,\toks@,\typeout,\ttfamily}
% \DoNotIndex{\unvbox,\uparrow,\upshape,\usebox,\usepackage}
% \DoNotIndex{\value,\vbox,\vsize,\vskip,\wd,\width,\z@skip}
% \DoNotIndex{\AtBeginDocument,\AtEndOfPackage,\CurrentOption,\DeclareOption}
% \DoNotIndex{\ExecuteOptions,\GenericWarning,\IfFileExists,\InputIfFileExists}
% \DoNotIndex{\NeedsTeXFormat,\MessageBreak}
% \DoNotIndex{\PackageError,\PackageInfo,\PackageWarning,\PackageWarningNoLine}
% \DoNotIndex{\PassOptionsToPackage,\ProcessOptions,\ProvidesPackage}
%
% \iffalse
% --------------------------------------------------------------------------- %
% \fi
%
% \setlength{\parskip}{0pt plus 1pt}
% \renewcommand*\Note[2][Note]{\par{\small\emph{#1:} #2}\par}
% \let\endNote\undefined
%
% \changes{v1.0}{1994/10/27}{First release}
% \changes{v1.1}{1994/11/03}{New option \texttt{centerlast}}
% \changes{v1.2}{1994/11/28}{Support of the \package{float} package}
% \changes{v1.3}{1995/01/09}{Support of \cs{captionlabelfont} in subcaptions}
% \changes{v1.4}{1995/01/30}{New option \texttt{nooneline}}
% \changes{v1.4b}{1995/04/05}{Bugfix release}
% \changes{v3.0}{2003/12/20}{Rewritten; many new commands and features}
% \changes{v3.0d}{2004/11/28}{Split into two packages: \package{caption} \& \package{caption3}}
%
% \iffalse
% --------------------------------------------------------------------------- %
% \fi
%
% \clearpage
% \section{The implementation}
%
% \iffalse
%<*package>
% \fi
%
% \subsection{Introduction}
%
% \Thispackage\ consists of two parts -- the kernel
% (|caption3.sty|) and the main package (|caption.sty|).
%
% \Thispackage\ redefines the \LaTeX\ commands
% |\caption|, |\@caption|, and |\@makecaption| and maps the latter one to
% |\caption@@make|, giving the user the possibility to control the look \& feel
% of the captions from floating environments like |figure| and |table|.
% Furthermore it does similar to the caption stuff coming from other packages
% (like the \package{longtable} or \package{supertabular} package):
% Mapping the appropriate internal commands (like |\LT@makecaption| or
% |\ST@caption|) to the ones offered by the \package{caption3} kernel.
% So you can think of \thispackage\ as a layer package, it
% simply provides adaptation layers between the caption stuff coming from
% \LaTeXe\ or packages, and the caption stuff offered by the
% \package{caption3} kernel.
%
% \subsection{Identification}
%
% We need at least \LaTeX2e\ version 1994/12/01.
%    \begin{macrocode}
\NeedsTeXFormat{LaTeX2e}[1994/12/01]
%    \end{macrocode}
%
% Bypass the release declarations in case the \LaTeX\ kernel doesn’t know how to deal with them
% (as suggested by \url{https://www.latex-project.org/publications/2018-FMi-TUB-tb122mitt-version-rollback.pdf}).
%    \begin{macrocode}
\providecommand\DeclareRelease[3]{}
\providecommand\DeclareCurrentRelease[2]{}
%    \end{macrocode}
%
% Declare all supported releases.
%    \begin{macrocode}
\DeclareRelease{v1}{1994-10-27}{caption_1995-04-05.sty}
\DeclareRelease{v3.0}{2003-12-20}{caption_2007-04-16.sty}
\DeclareRelease{v3.1}{2007-09-01}{caption_2010-01-09.sty}
\DeclareRelease{v3.2}{2011-08-06}{caption_2011-11-10.sty}
\DeclareRelease{v3.3}{2013-01-10}{caption_2019-09-01.sty}
\DeclareRelease{v3.4}{2019-11-24}{caption_2020-07-29.sty}
\DeclareRelease{v3.5}{2020-08-30}{caption_2020-10-26.sty}
\DeclareCurrentRelease{v3.6}{2022-02-20}
%    \end{macrocode}
%
% Identify the current version of the package.
%    \begin{macrocode}
\ProvidesPackage{caption}[2022/03/01 v3.6b Customizing captions (AR)]
%    \end{macrocode}
%
% \subsection{Loading the kernel}
%
% Load a matching version of the \package{caption} kernel.
%    \begin{macrocode}
\RequirePackage{caption3}[2022/01/07] % needs v2.3 or newer
%    \end{macrocode}
%
% \subsection{Check against unknown document classes}
%
%    \begin{macrocode}
\caption@ifbool{documentclass}{}{%
  \caption@WarningNoLine{%
    Unknown document class (or package),\MessageBreak
    standard defaults will be used}}
%    \end{macrocode}
%
% \subsection{Check against incompatible packages}
%
% \changes{v3.0p}{2007/04/06}{Check against obsolete \package{caption2} package added}
%    \begin{macrocode}
\@ifpackageloaded{caption2}{%
  \caption@Error{%
    You can't use both, the (obsolete) caption2 *and*\MessageBreak
    the (current) caption package}%
  \endinput
}{}
%    \end{macrocode}
%
% Check against incompatible packages which used to work fine with \version{1} of the `caption' package.
% \changes{v3.1}{2007/06/15}{Check against incompatible \package{ftcap} package added}
% \changes{v3.1}{2007/06/15}{Check against incompatible \package{nonfloat} package added}
% \changes{v3.1}{2007/06/18}{Check against incompatible \package{topcapt} package added}
% \changes{v3.6}{2021/01/02}{Check against incompatible packages \package{ftcap}, \package{nonfloat}, and \package{topcapt} revised}
%    \begin{macrocode}
\caption@AtBeginDocument{%
  \caption@setincompatible{\@ifpackageloaded{captcont}}{captcont package}%
  \caption@setincompatible{\@ifpackageloaded{ftcap}}{ftcap package}%
  \caption@setincompatible{\@ifpackageloaded{nonfloat}}{nonfloat package}%
  \caption@setincompatible{\@ifpackageloaded{topcapt}}{topcapt package}}
%    \end{macrocode}
%
% \begin{macro}{\caption@setincompatible}
% \changes{v3.4}{2019/09/09}{This macro added}
% \changes{v3.6}{2020/12/22}{Adapted to fallback concept}
% |\caption@setincompatible|\marg{condition}\marg{message text}
%    \begin{macrocode}
\newcommand*\caption@setincompatible[2]{%
  #1{%
    \caption@Error{%
      The #2 is incompatible to the\MessageBreak
      current version of the `caption' package,\MessageBreak
      so try \string\usepackage{caption}[=v1] instead}%
  }{}}
\@onlypreamble\caption@setincompatible
%    \end{macrocode}
% \end{macro}
%
% \subsection{Positioning}
%
%    \begin{macrocode}
\DeclareCaptionPosition{auto}{#2}{%
  \caption@ifsubcaption@above{#2}{%
    \ifvmode
      \caption@autoposition{#1}{#2}%
    \else
      #2%
    \fi}}
%    \end{macrocode}
%
% \subsection{Declaration of options}
%
% \subsubsection{Miscellaneous options}
%
%    \begin{macrocode}
\DeclareCaptionOption*{config}[caption]{%
   \InputIfFileExists{#1.cfg}%
     {\typeout{*** Local configuration file #1.cfg used ***}}%
     {\caption@Warning{Configuration file #1.cfg not found}}}
%    \end{macrocode}
%
% \begin{macro}{\caption@selectlistentry}
% \changes{v3.2}{2010/11/07}{This macro added}
%  |\caption@selectlistentry|\marg{\purett{heading} or \purett{entry}}
%    \begin{macrocode}
\newcommand*\caption@selectlistentry[1]{%
  \caption@ifinlist{#1}{heading}{%
    \let\caption@iflistheading\@firstoftwo
  }{\caption@ifinlist{#1}{default,list-entry,entry}{%
    \let\caption@iflistheading\@secondoftwo
  }{%
    \caption@Error{Undefined list-entry selection `#1'}%
  }}}
%    \end{macrocode}
% \end{macro}
%
% \changes{v3.3}{2012-03-25}{Option \opt{list-entry} added}
%    \begin{macrocode}
\DeclareCaptionOption{list-entry}{\caption@selectlistentry{#1}}
\captionsetup{list-entry=default}
%    \end{macrocode}
%
% \changes{v3.2}{2010/11/07}{Option \opt{parboxrestore} added}
% \changes{v3.6}{2021/01/07}{(Undocumented) Option \opt{parboxrestore} removed}
%
% \changes{v3.1f}{2007/11/28}{Option \opt{@minipage=} added}
%    \begin{macrocode}
\DeclareCaptionOption{@minipage}{%
  \caption@ifinlist{#1}{auto,default}%
    {\let\caption@if@minipage\@gobbletwo}%
    {\caption@set@bool\caption@if@minipage{#1}}}
\captionsetup{@minipage=default}
%    \end{macrocode}
%
% \changes{v3.1}{2007/07/21}{Option `compatibility' added}
% \changes{v3.1}{2007/09/01}{caption v1.x compatibility options revised}
% \changes{v3.1d}{2007/10/24}{Bugfix 07-10-24 in caption v1.x$ compatibility options}
% \changes{v3.5a}{2020/09/02}{caption v1.x compatibility options fixed}
% \changes{v3.6}{2020/12/22}{Option `compatibility' adapted to fallback concept}
%
% We only support boolean values for the |compatibility=| option
% since these were the only one which were documented in the past.
%
%    \begin{macrocode}
\DeclareCaptionOption{compatibility}[1]{%
  \caption@ifinlist{#1}{1,true,yes,on}{%
    \caption@Error{%
      Obsolete compatibility value `#1',\MessageBreak
      please use either \string\usepackage{caption}[=v1]\MessageBreak
      or \string\usepackage{caption-light} instead}%
  }{\caption@ifinlist{#1}{0,false,no,off}{%
    % nothing to do
  }{%
    \caption@Error{Undefined compatibility value `#1'}%
  }}}
%    \end{macrocode}
%
% \subsubsection{caption v1.x compatibility options}
%
%    \begin{macrocode}
\DeclareCaptionOptionNoValue*{normal}{%
  \caption@setup{format=plain,justification=justified}}
\DeclareCaptionOptionNoValue*{isu}{%
  \caption@setup{format=hang,justification=justified}}
\DeclareCaptionOptionNoValue*{hang}{%
  \caption@setup{format=hang,justification=justified}}
\DeclareCaptionOptionNoValue*{center}{%
  \caption@setup{format=plain,justification=centering}}
\DeclareCaptionOptionNoValue*{centerlast}{%
  \caption@setup{format=plain,justification=centerlast}}
%    \end{macrocode}
%
%    \begin{macrocode}
\DeclareCaptionOptionNoValue*{scriptsize}{\def\captionfont{\scriptsize}}
\DeclareCaptionOptionNoValue*{footnotesize}{\def\captionfont{\footnotesize}}
\DeclareCaptionOptionNoValue*{small}{\def\captionfont{\small}}
\DeclareCaptionOptionNoValue*{normalsize}{\def\captionfont{\normalsize}}
\DeclareCaptionOptionNoValue*{large}{\def\captionfont{\large}}
\DeclareCaptionOptionNoValue*{Large}{\def\captionfont{\Large}}
%    \end{macrocode}
%
%    \begin{macrocode}
\DeclareCaptionOptionNoValue*{up}{\caption@setup{labelfont+=up}}
\DeclareCaptionOptionNoValue*{it}{\caption@setup{labelfont+=it}}
\DeclareCaptionOptionNoValue*{sl}{\caption@setup{labelfont+=sl}}
\DeclareCaptionOptionNoValue*{sc}{\caption@setup{labelfont+=sc}}
\DeclareCaptionOptionNoValue*{md}{\caption@setup{labelfont+=md}}
\DeclareCaptionOptionNoValue*{bf}{\caption@setup{labelfont+=bf}}
\DeclareCaptionOptionNoValue*{rm}{\caption@setup{labelfont+=rm}}
\DeclareCaptionOptionNoValue*{sf}{\caption@setup{labelfont+=sf}}
\DeclareCaptionOptionNoValue*{tt}{\caption@setup{labelfont+=tt}}
%    \end{macrocode}
%
%    \begin{macrocode}
\DeclareCaptionOptionNoValue*{nooneline}{\caption@setup{slc=0}}
%    \end{macrocode}
%
%    \begin{macrocode}
\caption@setbool{ruled}{0}
\DeclareCaptionOptionNoValue*{ruled}{\caption@setbool{ruled}{1}}
%    \end{macrocode}
%
% \subsubsection{caption2 v2.x compatibility options}
% \changes{v3.0h}{2005/07/08}{caption2 \version{2.x} compatibility options added}
% \changes{v3.1}{2007/09/01}{caption2 v2.x compatibility options revised}
% \changes{v3.1d}{2007/10/24}{Bugfix 07-10-24 in caption v2.x$ compatibility options}
% \changes{v3.5a}{2020/09/02}{caption v2.x compatibility options fixed}
%
%    \begin{macrocode}
\DeclareCaptionOptionNoValue*{flushleft}{%
  \caption@setup{format=plain,justification=raggedright}}
\DeclareCaptionOptionNoValue*{flushright}{%
  \caption@setup{format=plain,justification=raggedleft}}
%    \end{macrocode}
%    \begin{macrocode}
\DeclareCaptionOptionNoValue*{oneline}{\caption@setup{slc=1}}
%    \end{macrocode}
%    \begin{macrocode}
\DeclareCaptionOptionNoValue*{ignoreLTcapwidth}{%
  \caption@WarningNoLine{Obsolete option `ignoreLTcapwidth' ignored}}
%    \end{macrocode}
%
% \subsubsection{Obsolete caption v3.0 options}
% \changes{v3.1}{2007/05/07}{Package option \opt{caption} marked as obsolete,
%        gives error now}
%
%    \begin{macrocode}
\DeclareCaptionOption*{caption}{%
  \caption@setbool{temp}{#1}%
  \caption@ifbool{temp}{}{%
    \caption@Error{%
      The package option `caption=#1' is obsolete.\MessageBreak
      Please pass this option to the subfig package instead\MessageBreak
      and do *not* load the caption package anymore}}}
%    \end{macrocode}
%
% \subsubsection{fltpage package support options}
%
% \changes{v3.1}{2007/09/01}{Options `FPlist' \& `FPref' added}
% With these options is controlled where the list-of entry and |\ref| resp.
% |\pageref| or |\autoref| will link to.
% Defaults are |FPlist=caption| and |FPref=figure| which is inconsistent,
% but compatible to the usual behaviour of the \package{fltpage} package.
%    \begin{macrocode}
\DeclareCaptionOption{FPlist}[1]{\caption@setFPoption{list}{#1}}
\DeclareCaptionOption{FPref}[1]{\caption@setFPoption{ref}{#1}}
\@onlypreamble@key{caption}{FPlist}
\@onlypreamble@key{caption}{FPref}
%    \end{macrocode}
%    \begin{macrocode}
\newcommand*\caption@setFPoption[2]{%
  \edef\caption@tempa{\@car#2\@nil}%
  \caption@setbool{FP#1cap}{\if c\caption@tempa 1\else 0\fi}}
\@onlypreamble\caption@setFPoption
%    \end{macrocode}
%    \begin{macrocode}
\captionsetup{FPlist=caption,FPref=figure}
%    \end{macrocode}
%
% \subsubsection{hyperref package support options}
%
% \changes{v3.1}{2007/06/21}{Options `hypcap' \& `hypcapspace' added}
% With |hypcap=off| one can turn the \package{hypcap} support off
% (default is |on|).
%    \begin{macrocode}
\DeclareCaptionOption{hypcap}[1]{\caption@setbool{hypcap}{#1}}
\DeclareCaptionOption{hypcapspace}{\def\caption@hypcapspace{#1}}
%    \end{macrocode}
%    \begin{macrocode}
\captionsetup{hypcap=1,hypcapspace=.5\baselineskip}
%    \end{macrocode}
%
% \subsection{Document class support}
%
% Execute the code declared with |\At|\-|Caption|\-|Package|.
% We do this right before processing the options so stuff done with
% |\At|\-|Caption|\-|Package| could be overwritten by user options.
%
%    \begin{macrocode}
\caption@documentclass@code
\let\caption@documentclass@code\@undefined
\let\AtCaptionPackage\@firstofone
%    \end{macrocode}
%
% \subsection{Processing of options}
%
% \changes{v3.0m}{2007/03/04}{Verbose option added}
% \changes{v3.1}{2007/07/02}{Verbose option removed from package}
% \changes{v3.1}{2007/03/17}{We do not process global options anymore}
%
%    \begin{macrocode}
\caption@SetupOptions{caption}{\caption@setkeys{#1}{#2}}
\caption@ProcessOptions*{caption}
%    \end{macrocode}
%
% \subsection{\cs{caption}, \cs{@caption}, and \cs{@makecaption}}
%
% \begin{macro}{\caption@flags}
% \changes{v3.3}{2018/08/08}{This counter and associated macros added}
% Since we support continued floats and sub-figures it's not an easy task
% to manage the figure (and table) counter, especially since previous versions
% of the caption package have proven that correcting a counter locally is not a good idea,
% and to make it dependent on the |position=| setting (like the \package{subfig} package does)
% is not a good idea, either.
%
% In the past three boolean switches were used to store the flags, but since some
% packages (like the \package{floatrow} and \package{tabu} package) try hard to keep
% \LaTeX{} counter changes locally under certain circumstances, it seems a good idea to make
% these flags a \LaTeX{} counter value.
%
% See also:
% \url{https://gitlab.com/axelsommerfeldt/caption/-/issues/27} and
% \url{https://tex.stackexchange.com/questions/444942/subcaptionbox-in-tabu-wrong-numbering-of-subfigures}
%
%    \begin{macrocode}
\newcounter{caption@flags}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\caption@clrflags}
% \changes{v3.3}{2018/08/08}{This macro added}
% |\caption@clrflags| clears all flags.
% Note that we have to use |\set|\-|counter| here (instead of using \TeX{} primitives)
% since some packages re-define |\set|\-|counter| to keep counter changes local.
%    \begin{macrocode}
\newcommand*\caption@clrflags{%
  \setcounter{caption@flags}{0}}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\caption@ifflags}
% \changes{v3.6}{2020/12/28}{This macro added}
% |\caption@ifflags|\marg{yes-code}\marg{no-code}\\
% tests if any of the flags is set.
%    \begin{macrocode}
\newcommand*\caption@ifflags{%
  \ifcase\c@caption@flags
    \expandafter\@secondoftwo
  \else
    \expandafter\@firstoftwo
  \fi}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\caption@setflag}
% \changes{v3.3}{2013/04/14}{This macro added}
% \changes{v3.3}{2018/08/08}{Rewritten so a counter is used instead of a switch}
% |\caption@setflag|\marg{number}\\
% sets the flag with the given number (where \meta{number} is one of 1, 2, 4, 8, 16, \ldots).
% Note that we have to use |\add|\-|to|\-|counter| here (instead of |\advance|)
% since some packages re-define |\add|\-|to|\-|counter| to keep counter changes local.
%    \begin{macrocode}
\newcommand*\caption@setflag[1]{%
  \caption@ifflag{#1}{}{\addtocounter{caption@flags}{#1}}}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\caption@ifflag}
% \changes{v3.3}{2011/12/28}{This switch added}
% \changes{v3.3}{2018/08/08}{Rewritten (and renamed) so a counter is used instead of a switch}
% |\caption@ifflag|\marg{number}\marg{yes-code}\marg{no-code}\\
% tests if the flag with the given number is set (where \meta{number} is one of 1, 2, 4, 8, 16, \ldots).
%    \begin{macrocode}
\newcommand*\caption@ifflag[1]{%
  \@tempcnta\c@caption@flags
  \divide\@tempcnta #1\relax
  \ifodd\@tempcnta
    \expandafter\@firstoftwo
  \else
    \expandafter\@secondoftwo
  \fi}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\caption@setcontinued}
% \changes{v3.6}{2020/09/20}{This macro added}
% |\caption@setcontinued| sets the `continued float' flag, i.e. |\continued|\-|float| was used.
%    \begin{macrocode}
\newcommand*\caption@setcontinued{\caption@setflag1}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\caption@ifcontinued}
% \changes{v3.3}{2011/12/28}{This switch added}
% \changes{v3.3}{2018/08/08}{\cs{ifcaption@ContinuedFloat} replaced by \cs{caption@ifflag1}}
% \changes{v3.6}{2020/09/20}{Revived as \cs{caption@ifcontinued}}
% |\caption@if|\-|continued|\marg{yes-code}\marg{no-code}\\
% tests if the `continued float' flag is set.
%    \begin{macrocode}
\newcommand*\caption@ifcontinued{\caption@ifflag1}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\caption@setcaption}
% \changes{v3.6}{2020/09/20}{This macro added}
% |\caption@setcaption| sets the `caption' flag, i.e. |\caption|, |\phantom|\-|caption|, or |\caption|\-|list|\-|entry| was used.
%    \begin{macrocode}
\newcommand*\caption@setcaption{\caption@setflag2}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\caption@ifcaption}
% \changes{v3.3}{2011/12/28}{This switch added}
% \changes{v3.3}{2018/08/08}{\cs{ifcaption@caption} replaced by \cs{caption@ifflag2}}
% \changes{v3.6}{2020/09/20}{Revived as \cs{caption@ifcaption}}
% |\caption@if|\-|caption|\marg{yes-code}\marg{no-code}\\
% tests if the `caption' flag is set.
%    \begin{macrocode}
\newcommand*\caption@ifcaption{\caption@ifflag2}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\caption@setsubcaption}
% \changes{v3.6}{2020/09/20}{This macro added}
% |\caption@setsubcaption| sets the `subcaption' flag, i.e. |\subcaption|, |\subcaptionbox|, \ldots was used.
%    \begin{macrocode}
\newcommand*\caption@setsubcaption{%
  \caption@ifcaption{\caption@setflag8}{\caption@setflag4}}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\caption@ifsubcaption@above}
% \changes{v3.3}{2011/12/28}{This switch added}
% \changes{v3.3}{2018/08/08}{\cs{ifcaption@subcaption} replaced by \cs{caption@ifflag4}}
% \changes{v3.6}{2020/09/20}{Revived as \cs{caption@ifsubcaption@above} and \cs{caption@ifsubcaption@below}}
% |\caption@if|\-|sub|\-|caption@above|\marg{yes-code}\marg{no-code}\\
% tests if the `subcaption' flag was set before the `caption' flag was set, i.e. a sub-caption was typeset \emph{above} the corresponding caption.
%    \begin{macrocode}
\newcommand*\caption@ifsubcaption@above{\caption@ifflag4}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\caption@ifsubcaption@below}
% \changes{v3.3}{2011/12/28}{This switch added}
% \changes{v3.3}{2018/08/08}{\cs{ifcaption@subcaption} replaced by \cs{caption@ifflag4}}
% \changes{v3.6}{2020/09/20}{Revived as \cs{caption@ifsubcaption@above} and \cs{caption@ifsubcaption@below}}
% |\caption@if|\-|sub|\-|caption@below|\marg{yes-code}\marg{no-code}\\
% tests if the `subcaption' flag was set after the `caption' flag was set, i.e. a sub-caption was typeset \emph{below} the corresponding caption.
%    \begin{macrocode}
\newcommand*\caption@ifsubcaption@below{\caption@ifflag8}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\caption@caption}
% \changes{v3.0f}{2005/05/22}{Bugfix: \cs{ContinuedFloat} added}
% \changes{v3.0f}{2005/06/13}{Support of \cs{caption*[]} removed}
% \changes{v3.0l}{2007/01/19}{Minimal support of \textsf{combine} package added}
% \changes{v3.1}{2007/02/04}{Re-written, does not save \& use original definition anymore}
% \changes{v3.6}{2022/01/05}{Usage of \cs{caption@Error} replaced by \cs{caption@OutsideFloat}}
%  Here comes our definition of |\caption| and |\caption*|.
%  Beside the support of the starred variant this code was adapted to the
%  various packages we support.
%  We are using |\caption@dblarg| instead of |\@dblarg| so |\caption{}|
%  (with an empty arg.) will produce a list-of entry, but |\caption[]{}|
%  won't.
%    \begin{macrocode}
\def\caption@caption{%
  \caption@iftype
    {\caption@checkgrouplevel\@empty\caption
     \caption@star
       {\caption@refstepcounter\@captype}%
       {\caption@dblarg{\@caption\@captype}}}%
    {\caption@OutsideFloat\caption
     \caption@withoptargs\@gobbletwo}}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\caption@OutsideFloat}
% \changes{v3.6}{2022/01/05}{This macro added}
% |\caption@OutsideFloat}| issues a ``\meta{command} outside float'' error.
%    \begin{macrocode}
\newcommand*\caption@OutsideFloat[1]{%
  \caption@Error{\string#1 outside float}}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\caption@star}
% \changes{v3.1}{2007/06/24}{Renamed from \cs{caption@caption} to \cs{caption@star}}
% \changes{v3.2c}{2011/08/21}{\cs{global} removed}
%  A helper macro which processes the optional |*| after |\caption|.
%    \begin{macrocode}
\newcommand*\caption@star[2]{%
  \@ifstar{\caption@startrue#2[]}{#1#2}}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\caption@@caption}
% \changes{v3.1}{2007/02/04}{Re-written, does not save\&use original definition anymore}
% \changes{v3.1f}{2007/11/28}{Bugfix: Handling of \texttt{@minipage} flag added}
% \changes{v3.1f}{2007/11/28}{Support of option \opt{@minipage} added}
% \changes{v3.1g}{2008/03/16}{Internal: Uses \cs{caption@prepareanchor} now}
% \changes{v3.2d}{2011/10/21}{Adapted to the \textsf{memoir} document class}
% \changes{v3.2f}{2012/01/14}{Usage of \cs{M@gettitle} moved to \cs{caption@prepareanchor}}
% \changes{v3.3}{2013/01/06}{Adapted to the \textsf{nag} package}
% \changes{v3.6}{2022/01/06}{Usage of \cs{caption@nobreak} added to improve \textsf{beamer} document class support}
%  As above, our version has been adapted to the packages we support.
%  Additionally our code is nested by |\caption@begin|\-|ex| \&
%  |\caption@end| instead of |\begin|\-|group| \& |\end|\-|group|.
%  Furthermore we use |\caption@par|\-|box|\-|restore| instead of
%  |\@parbox|\-|restore|.
%    \begin{macrocode}
\long\def\caption@@caption#1[#2]#3{%
%    \end{macrocode}
%    \begin{macrocode}
  \ifcaption@star \else
    \caption@prepareanchor{#1}{#2}%
    \memcaptioninfo{#1}{\csname the#1\endcsname}{#2}{#3}%
    \@nameuse{nag@hascaptiontrue}%
  \fi
%    \end{macrocode}
%    \begin{macrocode}
  \par
  \caption@nobreak
  \caption@beginex{#1}{#2}{#3}%
    \caption@setfloatcapt{%
      \caption@parboxrestore
      \if@minipage
        \@setminipage
      \fi
      \caption@normalsize
      \ifcaption@star
        \let\caption@makeanchor\@firstofone
      \fi
      \@makecaption{\csname fnum@#1\endcsname}%
                   {\ignorespaces\caption@makeanchor{#3}}\par
      \caption@nobreak
      \caption@if@minipage\@minipagetrue\@minipagefalse}%
  \caption@end}
%    \end{macrocode}
% \class{memoir} document class stuff:
%    \begin{macrocode}
\providecommand\memcaptioninfo[4]{}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\caption@prepareanchor}
% \changes{v3.1g}{2008/03/16}{This macro added}
% \changes{v3.2f}{2012/01/14}{Usage of \cs{M@gettitle} moved from \cs{caption@@caption}}
%    \begin{macrocode}
\newcommand*\caption@prepareanchor[2]{%
  \caption@makecurrent{#1}{#2}%
  \caption@ifhypcap\caption@@start\relax
  \M@gettitle{#2}}
%    \end{macrocode}
% \class{memoir} document class stuff:
%    \begin{macrocode}
\providecommand\M@gettitle[1]{}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\caption@nobreak}
% \changes{v3.6}{2022/01/06}{This macro added}
% |\caption@nobreak| for use in places where |\@caption| resp.~|\beamer@makecaption| does |\nobreak|.
% It's defined to do nothing unless the \cls{beamer} document class is used.
%    \begin{macrocode}
\newcommand*\caption@nobreak{}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\caption@parboxrestore}
% \changes{v3.1}{2007/03/03}{This macro definition added}
% \changes{v3.1b}{2007/09/17}{Bugfix: Redefinition of CR added}
% \changes{v3.2}{2010/11/07}{Support of option \opt{parboxrestore} added}
% \changes{v3.5g}{2020/10/26}{New implementation; renamed from \cs{caption@boxrestore} to \cs{caption@parboxrestore}}
% \changes{v3.6}{2021/01/02}{Always uses \cs{@parboxrestore} now}
% |\caption@parboxrestore| simply expands to |\@par|\-|box|\-|restore|.
%    \begin{macrocode}
\newcommand*\caption@parboxrestore{\@parboxrestore}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\caption@makecaption}
% \changes{v3.1i}{2008/05/06}{Usage of \cs{caption@rule} added}
% \changes{v3.6}{2022/01/06}{Usage of \cs{caption@nobreak} added to improve \textsf{beamer} document class support}
%  |\@makecaption|\marg{label}\marg{text}\par
%  We do basically the same as the original code (from the standard
%  \LaTeX\ document classes), but take care of the |position=| setting
%  and use |\caption@@make| from the \package{caption} kernel to finally
%  typeset the caption.
%    \begin{macrocode}
\long\def\caption@makecaption#1#2{%
  \caption@nobreak
  \caption@make@above
  \caption@nobreak
  \caption@@make{#1}{#2}%
  \caption@nobreak
  \caption@make@below
  \caption@nobreak}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\caption@make@above}
% \begin{macro}{\caption@make@below}
% \changes{v3.3a}{2019/04/02}{This macro added}
% |\caption@make@above|\\
% |\caption@make@below|\par
% Typesets the stuff above resp.~below the caption, depending on |\caption@iftop|.
%    \begin{macrocode}
\newcommand*\caption@make@above{%
  \caption@iftop
    \caption@belowskip
    {\caption@rule\caption@aboveskip}}
%    \end{macrocode}
%    \begin{macrocode}
\newcommand*\caption@make@below{%
  \caption@iftop
    {\caption@aboveskip\caption@rule}%
    \caption@belowskip}
%    \end{macrocode}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\caption@redefine}
% \changes{v3.1}{2007/05/09}{Re-definition of \cs{@xfloat} added}
% \changes{v3.1b}{2007/09/22}{cs{@xfloat} will now be redefined in compatibility mode, too}
% \changes{v3.1k}{2009/03/30}{The macro \cs{caption@redefine} contains the patching code now}
% \changes{v3.5}{2020/08/30}{Re-definition of \cs{@xdblfloat} added}
%    \begin{macrocode}
\newcommand*\caption@redefine{%
%    \end{macrocode}
%   Prior to \version{3.4} we only redefined |\caption| and |\@caption| if the current definitions
%   were well known, so documents written in the old (\package{caption} package \version{1.x}) days
%   (where |\caption| \& |\@caption| were not redefined by us) still compiled fine.
%   This used to make sense when introducing \version{3.0} in the year 2003
%   but is simply overcautious and especially unwanted by the user nowadays.
%   So starting with \version{3.4} we only do not redefine |\caption| and |\@caption| if the
%   `compatibility' option is set to `true', and starting with \version{3.6} we always redefine them.
%    \begin{macrocode}
  \let\caption\caption@caption
  \let\@caption\caption@@caption
%    \end{macrocode}
%   We redefine |\@x|\-|float| so inside floating environments our
%   type-specific options will be used, a \package{hyperref}
%   anchor will be set etc.
%    \begin{macrocode}
  \let\caption@ORI@xfloat\@xfloat
  \let\@xfloat\caption@xfloat
%    \end{macrocode}
%   We redefine |\@xdbl|\-|float|, too, so special options for |figure*|
%   resp.~|table*| will be applied here.
%    \begin{macrocode}
  \let\caption@ORI@xdblfloat\@xdblfloat
  \let\@xdblfloat\caption@xdblfloat
%    \end{macrocode}
%    \begin{macrocode}
}
%    \end{macrocode}
% Some packages (like the \package{hyperref} package for example) redefines
% |\caption| and |\@caption|, too.
% So we have to use |\At|\-|Begin|\-|Document| here, so we can make sure
% our definition is the one which will be valid at last.
%    \begin{macrocode}
\caption@AtBeginDocument{%
  \caption@redefine
  \let\caption@redefine\relax}
%    \end{macrocode}
% The redefinition of |\@make|\-|caption| will be done immediately.
%    \begin{macrocode}
\let\@makecaption\caption@makecaption
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\caption@xfloat}
% \changes{v3.1}{2007/05/09}{Re-definition of \cs{@xfloat} added}
% \changes{v3.5}{2020/08/30}{Definition and usage of \cs{caption@xfloat@hook} added}
% \changes{v3.6}{2020/12/27}{Re-definition of \cs{@xfloat} put into \cs{caption@xfloat}}
%    \begin{macrocode}
\def\caption@xfloat#1[#2]{%
  \caption@ORI@xfloat{#1}[#2]%
  \caption@settype{#1}%
  \caption@xfloat@hook}
%    \end{macrocode}
% Hook, could be extended with |\g@addto@macro\caption@x|\-|float@hook{|\ldots|}|.
% (The caption type could be found in |\@cap|\-|type|.)
%    \begin{macrocode}
\newcommand*\caption@xfloat@hook{}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\caption@xdblfloat}
% \changes{v3.5}{2020/08/30}{Re-definition of \cs{@xdblfloat} added}
% \changes{v3.5}{2020/08/30}{Definition and usage of \cs{caption@xdblfloat@hook} added}
% \changes{v3.6}{2020/12/27}{Re-definition of \cs{@xdblfloat} put into \cs{caption@xdblfloat}}
%    \begin{macrocode}
\def\caption@xdblfloat#1[#2]{%
  \caption@ORI@xdblfloat{#1}[#2]% expands to \@xfloat{#1}[#2] + extra stuff
  \caption@setoptions{#1*}%
  \caption@xdblfloat@hook}
%    \end{macrocode}
% Hook, could be extended with |\g@addto@macro\caption@xdbl|\-|float@hook{|\ldots|}|.
% (The caption type could be found in |\@cap|\-|type|.)
%    \begin{macrocode}
\newcommand*\caption@xdblfloat@hook{}
%    \end{macrocode}
% \end{macro}
%
% \subsection{\cs{setcaptiontype} and \cs{setcaptionsubtype}}
%
% \changes{v3.0d}{2004/08/03}{Option \opt{type=} added}
% \changes{v3.1}{2007/06/25}{Option \opt{type*=} added}
% \changes{v3.1f}{2007/11/16}{Option \opt{subtype} \& \opt{subtype*} added}
% \changes{v3.2}{2010/10/24}{Bugfix 10-10-17: Option \opt{type=} uses \cs{setcaptiontype} instead of \cs{caption@settype} now}
%
%    \begin{macrocode}
\caption@AtBeginDocument{%
%    \end{macrocode}
%    \begin{macrocode}
  \DeclareCaptionOption{type}{\setcaptiontype{#1}}%
  \DeclareCaptionOption{type*}{\setcaptiontype*{#1}}%
%    \end{macrocode}
%    \begin{macrocode}
  \DeclareCaptionOptionNoValue{subtype}{\setcaptionsubtype\relax}%
  \DeclareCaptionOptionNoValue{subtype*}{\setcaptionsubtype*}%
%    \end{macrocode}
%    \begin{macrocode}
}
%    \end{macrocode}
%
% \emph{Important Note:}
% Like |\captionof| the option |type=| should only be used inside a
% group, box, or environment and does not check if the argument is a valid
% floating environment or not.
%
% \begin{macro}{\setcaptiontype}
% \changes{v3.2}{2010/10/24}{This macro added}
% \changes{v3.4e}{2020/01/02}{Check added if the subtype is defined}
% \changes{v3.5}{2020/08/24}{Definition method adapted to the \package{caption-light} package}
% \changes{v3.6}{2021/01/02}{Usage of \cs{caption@initposition} added}
% \changes{v3.6}{2021/01/09}{Usage of \cs{flushsubcaptionlistentries} added}
% \changes{v3.6}{2022/02/20}{Optional argument added}
%  Like |\captionsetup{type=xxx}|, but also works if |\caption|\-|setup| was redefined.
%    \begin{macrocode}
\def\setcaptiontype{%
  \caption@parboxrestore@light
  \caption@settype}
%    \end{macrocode}
%    \begin{macrocode}
\newcommand*\caption@settype{%
  \caption@initposition
  \caption@clrflags
  \aftergroup\flushsubcaptionlistentries
  \caption@@settype}
%    \end{macrocode}
%    \begin{macrocode}
\newcommand*\caption@@settype{%
  \caption@teststar\caption@@settype@\@firstoftwo\@secondoftwo}
%    \end{macrocode}
%    \begin{macrocode}
\newcommand*\caption@@settype@[1]{%
  \@ifnextchar[%]
    {\caption@@settype@@{#1}}%
    {\caption@@@settype{}{#1}}}
%    \end{macrocode}
%    \begin{macrocode}
\def\caption@@settype@@#1[#2]#3{%
  \caption@@@settype{}{#1}{#3}%
  \caption@setoptions{#2}}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\setcaptionsubtype}
% \changes{v3.2a}{2011/08/15}{This macro added}
% \changes{v3.5d}{2020/09/28}{This macro revised}
% \changes{v3.6}{2022/01/05}{Usage of \cs{caption@Error} replaced by \cs{caption@OutsideFloat}}
% \changes{v3.6}{2022/01/07}{Multiple use is suppressed now by checking \cs{caption@ifsubtype}}
% Same, but sets the sub-type.
%    \begin{macrocode}
\newcommand*\setcaptionsubtype{%
  \caption@setsubtype}
%    \end{macrocode}
%    \begin{macrocode}
\newcommand*\caption@setsubtype{% used by the floatrow package
  \caption@teststar\caption@@setsubtype\@firstoftwo\@secondoftwo}
%    \end{macrocode}
%    \begin{macrocode}
\newcommand*\caption@@setsubtype[1]{%
  \caption@iftype
    {\caption@ifsubtype
       {\caption@Debug{subtype=\@subcaptype}}%
       {\caption@@@settype{sub}{#1}{sub\@captype}}}%
    {\caption@OutsideFloat\setcaptionsubtype}}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\caption@@@settype}
% \changes{v3.1}{2007/05/09}{This macro added}
% \changes{v3.1b}{2007/09/22}{Usage of \cs{caption@xlabel} added}
% \changes{v3.1d}{2007/10/23}{Error message for \cs{caption@checkgrouplevel} revised}
% \changes{v3.1f}{2007/11/16}{\cs{caption@setsubtype} added}
% \changes{v3.1f}{2007/12/03}{Crappy \cs{caption@iftypewarning} replaced}
% \changes{v3.1g}{2008/01/12}{Usage of \cs{ifcaptionsetup@star} added}
% \changes{v3.2}{2010/10/26}{Error message moved from here to \cs{caption@refstepcounter}}
% \changes{v3.3}{2011/12/28}{Resetting of \cs{ifcaption@caption} and \cs{ifcaption@subcaption} added}
% \changes{v3.4e}{2020/01/02}{Checks added to prevent misuse regading subtypes}
% \changes{v3.5d}{2020/09/28}{This macro revised}
% \changes{v3.6}{2020/12/27}{Some code out-sourced to \cs{caption@reset@currentlabel}}
%  |\caption@settype*|\marg{type}\par
%  sets |\@captype| and executes the options associated with it
%  (using |\caption@set|\-|options|).
%  Furthermore we check |\current|\-|group|\-|level| (if avail), and
%  use the macro |\caption@|(|sub|)|type|\-|hook| (which will be used by our
%  \package{float} package support).\par
%  The non-starred version sets a \package{hyperref} anchor additionally
%  (if |hypcap=|\-|true| and the \package{hypcap} package is not loaded).
%    \begin{macrocode}
\newcommand*\caption@@@settype[3]{%
% #1 = "" or "sub"
% #2 = \@firstoftwo in star form, \@secondoftwo otherwise
% #3 = <type>, e.g.: "figure" or "subfigure"
  \caption@Debug{#1type:=#3}%
  \@nameuse{caption@check#1type}{#3}%
    {\caption@checkgrouplevel{#1}{%
       \captionsetup{#1type#2*\@empty=...}#2{ or
                     \@backslashchar#1captionof}{}}%
%    \end{macrocode}
%    \begin{macrocode}
     \edef\caption@tempa{#3}%
     \expandafter\ifx\csname @#1captype\endcsname\caption@tempa \else
       \ifcaptionsetup@star\else\@nameuse{caption@#1type@warning}\fi
     \fi
     \expandafter\let\csname @#1captype\endcsname\caption@tempa
%    \end{macrocode}
%    \begin{macrocode}
     \@nameuse{caption@#1typehook}%
%    \end{macrocode}
%    \begin{macrocode}
     \caption@setoptions{#3}%
     \ifx\caption@opt\relax
       \@nameundef{caption@#1type@warning}%
     \else
       \@namedef{caption@#1type@warning}{\caption@Warning{%
         The #1type was already set to
         `\csname @#1captype\endcsname'\MessageBreak}}%
     \fi
%    \end{macrocode}
%    \begin{macrocode}
     #2{}{\caption@reset@currentlabel\caption@start}}}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\caption@parboxrestore@light}
% \changes{v3.2}{2010/10/24}{This macro added}
% \changes{v3.5g}{2020/10/26}{Renamed from \cs{caption@boxrestore@mini} to \cs{caption@parboxrestore@mini}}
% \changes{v3.6}{2021/01/02}{Renamed from \cs{caption@parboxrestore@mini} to \cs{caption@parboxrestore@light}}
% Resets |\par| so the very first |\par| in |\@caption| behaves quite the same as in floating environments.
% Will be used by |\set|\-|caption|\-|type|.
%    \begin{macrocode}
\newcommand*\caption@parboxrestore@light{%
  \let\par\@@par
  \parindent\z@ \parskip\z@skip
  \sloppy}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\caption@reset@currentlabel}
% \changes{v3.6}{2020/12/27}{This macro out-sourced from \cs{caption@settype}}
%  Redefine |\@currentlabel| so a |\label| before |\caption| will result
%  in a hint instead of a wrong reference.
%    \begin{macrocode}
\newcommand*\caption@reset@currentlabel{%
  \let\@currentlabel\caption@undefinedlabel
% \let\@currentHlabel\@undefined
  \ifx\caption@x@label\@undefined
    \let\caption@x@label\label
    \let\label\caption@xlabel
  \fi}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\caption@iftype}
% \changes{v3.1}{2007/04/11}{This macro definition added}
%  Since we often need to check if |\@cap|\-|type| is defined (means: we
%  are inside a floating environment) this helper macro was introduced.
%    \begin{macrocode}
\newcommand*\caption@iftype{\caption@ifdefined\@captype}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\caption@ifsubtype}
% \changes{v3.6}{2022/01/07}{This macro definition added}
%  Since we often need to check if |\@sub|\-|cap|\-|type| is defined (means: we
%  are inside a sub-caption group of a floating environment) this helper macro was introduced.
%    \begin{macrocode}
\newcommand*\caption@ifsubtype{\caption@ifdefined\@subcaptype}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\caption@checktype}
% \changes{v3.4g}{2020/01/02}{This macro definition added}
% \changes{v3.4m}{2020/07/29}{Check of \cs{sf@counterlist} from \package{subfig} package added}
% |\caption@checktype|\marg{type}\marg{code}\par
% is used by |\caption@settype| and should either expand the code or issue an error
% if the given type is not a proper type, i.e. it is a sub-type instead (either defined by
% |\DeclareCaptionSubType| or |\newsubfloat|\cite{subfig}).
%    \begin{macrocode}
\newcommand*\caption@checktype[1]{%
  \caption@ifdefined@subtype{#1}\@firstoftwo{\caption@ifin@list\sf@counterlist{#1}}%
    {\caption@Error{Should not be used with subtype `#1'}%
     \@gobble}%
    \@firstofone}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\caption@checksubtype}
% \changes{v3.4g}{2020/01/02}{This macro definition added}
% \changes{v3.4m}{2020/07/29}{Check of \cs{sf@counterlist} from \package{subfig} package added}
% |\caption@checksubtype|\marg{type}\marg{code}\par
% is used by |\caption@settype| and should either expand the code or issue an error
% if the given type is not a proper sub-type, i.e. not defined by |\Declare|\-|Caption|\-|Sub|\-|Type|.
% Since the |sub|\-|float|\-|row| environment offered by the \package{floatrow} package\cite{floatrow}
% is using |\caption|\-|setup{sub|\-|type}| even if the sub-type was defined by |\new|\-|sub|\-|float|
% offered by \package{subfig}\cite{subfig}, we take a more relaxed view of things here and allow
% those sub-types as well (but not without warning since we do not support this).
%    \begin{macrocode}
\newcommand*\caption@checksubtype[1]{%
  \caption@ifdefined@subtype{#1}%
    \@firstofone
    {\caption@ifin@list\sf@counterlist{#1}%
       {\caption@Warning{%
          \noexpand\setcaptionsubtype without \string\DeclareCaptionSubType.\MessageBreak
          This is not designed to work; you could try replacing\MessageBreak
          the `subfig' package with `subcaption' to resolve\MessageBreak
          this problem which occurred}%
        \@firstofone}%
       {\caption@Error{Undefined subtype `#1'}%
        \@gobble}}}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\caption@checkgrouplevel}
% \changes{v3.1}{2007/07/15}{This macro definition added}
% \changes{v3.1f}{2007/11/28}{Error changed to warning (compatibility)}
% \changes{v3.3}{2013/04/21}{Uses \cs{caption@ifeTeX} now}
% \changes{v3.5}{2019/09/11}{Relies on \eTeX{} now}
%  Checks if |\captionsetup{type=|\ldots|}| or |\caption| is done
%  inside a group or not -- in the latter case a warning message will
%  be issued.
%    \begin{macrocode}
\newcommand*\caption@checkgrouplevel[2]{%
  \@ifundefined{#1caption@grouplevel}{%
     \caption@ifundefined\caption@grouplevel{\let\caption@grouplevel\z@}{}%
     \ifnum\currentgrouplevel>\caption@grouplevel\relax
       \expandafter\edef\csname #1caption@grouplevel\endcsname{%
         \the\currentgrouplevel}%
     \else
       \caption@Warning{\string#2\MessageBreak outside box or environment}%
     \fi
  }{}}%
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\caption@undefinedlabel}
% \changes{v3.1}{2007/07/03}{This macro definition added}
% \changes{v3.1b}{2007/09/22}{Contents changed to \texttt{??}}
% \changes{v3.1i}{2008/04/13}{Contents changed to \cs{caption@xref}(\ldots)}
% \changes{v3.1k}{2009/03/30}{Bugfix 08-12-08: \cs{caption@xref} is robust now}
% \changes{v3.2c}{2011/09/13}{Text changed from `before' to `without proper'}
% \changes{v3.3}{2016/02/21}{Text changed from `without proper \cs{caption}' to `without proper reference'}
%  This label will be used for |\currentlabel| inside (floating) environments
%  as default. (see above)
%  \iffalse\Note{All commands used have to be robust here.}\fi
%    \begin{macrocode}
\newcommand*\caption@undefinedlabel{%
  \protect\caption@xref{\caption@labelname}{\on@line}}
%    \end{macrocode}
%    \begin{macrocode}
\DeclareRobustCommand*\caption@xref[2]{%
  \caption@WarningNoLine{\noexpand\label without proper reference#2}%
  \@setref\relax\@undefined{#1}}
%    \end{macrocode}
%    \begin{macrocode}
\newcommand*\caption@labelname{??}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\caption@xlabel}
% \changes{v3.1b}{2007/09/22}{This macro definition added}
% \changes{v3.1f}{2007/11/11}{Revised}
% \changes{v3.1i}{2008/04/13}{Bugfix: \cs{pageref} should always work now}
% \changes{v3.2c}{2011/08/19}{Works with optional arguments now, too}
%  The new code of |\label| inside floating environments.
%  |\label| will be redefined using |\caption@withoptargs|, so
%  |#1| are the optional arguments (if any), and
%  |#2| is the mandatory argument here.
%    \begin{macrocode}
\newcommand*\caption@xlabel{%
  \caption@withoptargs\caption@@xlabel}
%    \end{macrocode}
%    \begin{macrocode}
\newcommand*\caption@@xlabel[2]{%
  \caption@@@xlabel
  \def\caption@labelname{#2}%
  \caption@x@label#1{#2}}
%    \end{macrocode}
%    \begin{macrocode}
\newcommand*\caption@@@xlabel{%
  \global\let\caption@@@xlabel\@empty
  \@bsphack
    \protected@write\@auxout{}%
      {\string\providecommand*\string\caption@xref[2]{%
        \string\@setref\string\relax\string\@undefined{\string##1}}}%
  \@esphack}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\captionof}
% \changes{v3.1}{2007/05/09}{Uses \cs{caption@settype} instead of \cs{def}\cs{@captype}}
% \changes{v3.1c}{2007/09/22}{Bugfix: Redefinition of \cs{caption@setfloatcapt} removed}
% \changes{v3.1e}{2007/10/30}{Better compatibility: Will be defined with \cs{AtBeginDocument} now}
% \changes{v3.2}{2010/10/24}{Bugfix 10-10-17: Uses \cs{setcaptiontype} instead of \cs{caption@settype} now}
% \changes{v3.5}{2020/08/24}{Definition method adapted to the \package{caption-light} package}
%  |\captionof|\marg{type}\oarg{lst\_entry}\marg{heading}\\
%  |\captionof*|\oarg{lst\_entry}\marg{heading}\par
% \Note{This will be defined with \cs{AtBeginDocument} so
%  \cs{usepackage}\csmarg{caption,capt-of} will still work.
%  (Compatibility to \version{1.x})}
%    \begin{macrocode}
\caption@AtBeginDocument{%
  \def\captionof{\caption@teststar\caption@of{\caption*}\caption}}
%    \end{macrocode}
%    \begin{macrocode}
\providecommand*\caption@of[2]{\setcaptiontype*{#2}#1}
%    \end{macrocode}
% \end{macro}
%
% \subsection{\cs{phantomcaption}}
%
% \begin{macro}{\phantomcaption}
% \changes{v3.2}{2010/10/31}{Bugfix 10-09-01b: This macro added}
% \changes{v3.6}{2022/01/05}{Usage of \cs{caption@Error} replaced by \cs{caption@OutsideFloat}}
%  |\phantomcaption|\par
%  increments the counter and generates an reference
%  which could be used with |\label|, but does not typeset anything.
%    \begin{macrocode}
\newcommand*\phantomcaption{%
  \caption@iftype
    {\caption@refstepcounter\@captype}%
    {\caption@OutsideFloat\phantomcaption}}
%    \end{macrocode}
% \end{macro}
%
% \subsection{\cs{captionlistentry}}
%
% \begin{macro}{\captionlistentry}
% \changes{v3.1}{2007/07/28}{This macro added}
% \changes{v3.1f}{2007/11/16}{Bugfix 07-11-09: `space hack' added}
% \changes{v3.1g}{2008/01/20}{Starred variant added}
% \changes{v3.1l}{2010/01/09}{Adapted to current version of nameref package}
% \changes{v3.6}{2020/12/27}{With optional argument \cs{caption@refstepcounter@} is used instead of \cs{caption@refstepcounter}}
% \changes{v3.6}{2022/01/05}{Usage of \cs{caption@Error} replaced by \cs{caption@OutsideFloat}}
%  |\captionlistentry|\oarg{float type}\marg{list entry}\\
%  |\captionlistentry*|\oarg{float type}\marg{list entry}
%    \begin{macrocode}
\newcommand*\captionlistentry{%
  \caption@teststar\caption@listentry\@firstoftwo\@secondoftwo}
%    \end{macrocode}
%    \begin{macrocode}
\newcommand*\caption@listentry[1]{%
  \@ifnextchar[%]
    {\caption@listentry@{#1}}%
    {\caption@@listentry{#1}}}
%    \end{macrocode}
%    \begin{macrocode}
\def\caption@listentry@#1[#2]{%
  \caption@@@listentry{#1}{#2}{\caption@refstepcounter@}}
%    \end{macrocode}
%    \begin{macrocode}
\newcommand*\caption@@listentry[1]{%
  \caption@iftype
    {\caption@@@listentry{#1}{\@captype}{\caption@refstepcounter}}%
    {\caption@OutsideFloat\captionlistentry
     \@gobble}}
%    \end{macrocode}
%    \begin{macrocode}
\newcommand*\caption@@@listentry[4]{%
  \@bsphack
    #1{\caption@gettitle{#4}}%
      {#3{#2}\caption@makecurrent{#2}{#4}}%
    \caption@addcontentsline{#2}{#4}%
  \@esphack}
%    \end{macrocode}
% \end{macro}
%
% \subsection{\cs{captiontext}}
%
% \begin{macro}{\captiontext}
% \changes{v3.6}{2022/01/05}{This macro added}
% \changes{v3.6}{2022/01/05}{Usage of \cs{caption@Error} replaced by \cs{caption@OutsideFloat}}
%  |\captiontext*|\oarg{number}\marg{text for caption}\par
%  typesets the caption without incrementing the counter,
%  without putting an entry into the list, and without skips.
%  The starred variant skips the single-line-check additionally
%  and does not use a box or parbox or margin.
%    \begin{macrocode}
\newcommand*\captiontext{%
  \caption@iftype
    {\caption@text\@captype}%
    {\caption@OutsideFloat\captiontext
     \caption@withoptargs\@gobbletwo}}
\newcommand*\caption@text[1]{%
  \caption@teststar{\caption@@text{#1}}\caption@@@make\caption@@make}
\newcommand*\caption@@text[2]{%
  \kernel@ifnextchar[%]
    {\caption@@@text{#1}#2\@iden}%
    {\caption@@@text{#1}#2\@gobble[0]}}
\long\def\caption@@@text#1#2#3[#4]#5{%
  \begingroup
    #3{\csname c@#1\endcsname #4\relax}%
    #2{\caption@fnum{#1}}{#5}%
  \endgroup}
%    \end{macrocode}
% \end{macro}
%
% \subsection{The \env{captiongroup} environment}
%
% \begin{environment}{captiongroup}
% \changes{v3.6}{2022/02/20}{This environment definition added}
% \env{captiongroup} is simply an environment containing |\set|\-|caption|\-|type|, that's all.
% A starred variant of this environment is available, too, which uses |\set|\-|caption|\-|type*|.
%    \begin{macrocode}
\newenvironment{captiongroup}{\setcaptiontype}{}
\newenvironment{captiongroup*}{\setcaptiontype*}{}
%    \end{macrocode}
% \end{environment}
%
% \subsubsection{The \env{captionblock} environment}
%
% \begin{macro}{\caption@minipage}
% \changes{v3.6}{2022/02/20}{This macro definition added}
% This is a \env{minipage} with |\set|\-|caption|\-|type| as first contents line.
%    \begin{macrocode}
\newcommand*\caption@minipage{%
  \@testopt\caption@iminipage b}
%    \end{macrocode}
% We pass all other optional arguments using the generic helper macro
% |\caption@with|\-|opt|\-|args| offered by the \pkg{caption} kernel).
%    \begin{macrocode}
\def\caption@iminipage[#1]{%
  \caption@withoptargs{\caption@iiminipage{#1}}}
%    \end{macrocode}
% `B' and `T' will add a |\vspace{0pt}|, all other values (and additional
% optional arguments) will be passed unseen to the |minipage| environment.
%    \begin{macrocode}
\newcommand*\caption@iiminipage[3]{%
  \let\caption@endminipage@hook\@empty
  \if#1B%
    \minipage[b]#2{#3}%
    \def\caption@endminipage@hook{\vspace{0pt}}%
  \else\if#1T%
    \minipage[t]#2{#3}%
    \vspace{0pt}%
  \else
    \minipage[#1]#2{#3}%
  \fi\fi
  \@floatboxreset
  \setcaptiontype}
%    \end{macrocode}
%    \begin{macrocode}
\newcommand*\caption@endminipage{%
  \caption@endminipage@hook
  \endminipage}
%    \end{macrocode}
% \end{macro}
%
% \begin{environment}{captionblock}
% \changes{v3.6}{2022/02/20}{This environment definition added}
% \env{captionblock} is a \env{minipage} with |\set|\-|caption|\-|type| as first contents line.
%    \begin{macrocode}
\newenvironment{captionblock}{\caption@minipage}{\caption@endminipage}
%    \end{macrocode}
% \end{environment}
%
% \subsection{\cs{captionbox}}
%
% \begin{macro}{\captionbox}
% \changes{v3.2}{2010/12/17}{This macro added}
% \changes{v3.2a}{2011/08/16}{\cs{captionsetup} replaces with \cs{captionbox@settype} and \cs{caption@setposition}}
% \changes{v3.3}{2012/04/09}{Adapted to revised version of \cs{caption@withoptargs}}
% \changes{v3.3}{2017/03/19}{When used with fixed witdh the content will not be hboxed anymore}
% \changes{v3.3c}{2019/09/01}{Adapted so it could be used by \cs{subfloat} offered by \package{subcaption}}
% \changes{v3.5}{2020/07/28}{Adapted to \package{caption3} v2.0}
% \changes{v3.6}{2020/12/24}{Check of argument \meta{inner-pos} added}
% A |\parbox| with contents and caption, separated by an invisible |\hrule|.
%    \begin{macrocode}
\newcommand*\captionbox{%
  \caption@withoptargs{\caption@ibox\@gobble}}
%    \end{macrocode}
%    \begin{macrocode}
\newcommand\caption@ibox[3]{%
  \kernel@ifnextchar[%]
    {\caption@iibox{#1}{#2}{#3}}%
    {\caption@iibox@{#1}{#2}{#3}}}
%    \end{macrocode}
%    \begin{macrocode}
\long\def\caption@iibox#1#2#3[#4]{%
  \@testopt{\caption@iiibox{#1}{#2}{#3}[{#4}]}\captionbox@innerpos@default}
%    \end{macrocode}
%    \begin{macrocode}
\long\def\caption@iibox@#1#2#3#4{%
  \setbox\@tempboxa\hbox{#4}%
  \caption@iiibox{#1}{#2}{#3}[\wd\@tempboxa][\captionbox@innerpos@default]{\unhbox\@tempboxa}}
%    \end{macrocode}
%    \begin{macrocode}
\long\def\caption@iiibox#1{%
  \caption@iiiibox{#1}\vbox\vtop}
%    \end{macrocode}
%    \begin{macrocode}
\long\def\caption@iiiibox#1#2#3#4#5[#6][#7]#8{%
  \caption@checkdecl{justification}{#7}{%
    \begingroup
    #1*% set \caption@position
    \caption@iftop{%
      \endgroup
      \parbox[t]{#6}{%
        #1\relax
        \caption@setposition t%
        #2{\caption#4{#5}}%
        \captionbox@hrule
        \csname caption@justification@#7\endcsname
        #8}%
    }{%
      \endgroup
      \parbox[b]{#6}{%
        #1\relax
        \caption@setposition b%
        \csname caption@justification@#7\endcsname
        #8%
        \captionbox@hrule
        #3{\caption#4{#5}}}%
    }}}
%    \end{macrocode}
%    \begin{macrocode}
\newcommand*\captionbox@innerpos@default{c}
\newcommand*\captionbox@hrule{\hrule\@height\z@\relax}
%    \end{macrocode}
%    \begin{macrocode}
\providecommand*\caption@justification@c{\centering}
\providecommand*\caption@justification@l{\raggedright}
\providecommand*\caption@justification@r{\raggedleft}
\providecommand*\caption@justification@s{}
%    \end{macrocode}
% \end{macro}
%
% \subsection{\cs{continuedfloat}}
%
% \begin{macro}{\c@continuedfloat}
% \changes{v3.4}{2015/09/16}{Counter renamed from \cs{ContinuedFloat} to \cs{continuedfloat}}
% |\thecontinuedfloat| will be preset to |\@empty|, so usually the continuation counter is not
% included in the caption label or references.
%    \begin{macrocode}
\newcounter{continuedfloat}
\let\c@ContinuedFloat\c@continuedfloat     % defined for compatibility reasons
%    \end{macrocode}
%    \begin{macrocode}
\def\thecontinuedfloat{\theContinuedFloat}
\let\theContinuedFloat\@empty              % defined for compatibility reasons
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\continuedfloat@captype}
% \changes{v3.6}{Renamed from \cs{caption@CFtype} to \cs{continuedfloat@captype}}
% Since we have only a single `continuedfloat' counter (and not one per caption type),
% we need to attach a caption type to our counter to make sure that the counter is not
% (mis-)used for a different float type while it holds a value other than zero.
%    \begin{macrocode}
\newcommand*\continuedfloat@captype{??}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\caption@reset@continuedfloat}
%  |\caption@reset@continuedfloat|\marg{caption type}\\
%  resets the continuation counter to zero and attaches the given caption type to it.
%    \begin{macrocode}
\newcommand*\caption@reset@continuedfloat[1]{%
  \xdef\continuedfloat@captype{#1}%
  \@stpelt{continuedfloat}}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\caption@set@continuedfloat}
% \changes{v3.6}{2020/12/27}{Some code of \cs{continuedfloat} out-sourced to this macro}
%  |\caption@set@continuedfloat|\marg{yes-code}\marg{no-code}\\
%  checks if the current caption type matches the one attached to the `continuedfloat' counter
%  before increasing it.
%    \begin{macrocode}
\newcommand*\caption@set@continuedfloat{%
  \ifx\@captype\continuedfloat@captype
    \stepcounter{continuedfloat}%
    \expandafter\@firstoftwo
  \else
    \caption@Error{Continued `\@captype' after `\continuedfloat@captype'}%
    \expandafter\@secondoftwo
  \fi}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\continuedfloat}
% \changes{v3.0i}{2005/11/12}{Optional argument added}
% \changes{v3.0g}{2005/06/28}{Bugfix: \cs{newcounter} replaced by \cs{newcount}}
% \changes{v3.1}{2007/07/02}{Format of \package{hyperref} extension changed}
% \changes{v3.1}{2007/07/07}{\cs{caption@setoptions} added}
% \changes{v3.1g}{2008/01/29}{Starred variant added}
% \changes{v3.2f}{2011/12/17}{Undocumented optional argument removed}
% \changes{v3.2f}{2011/12/17}{Redefinition of \cs{caption@@@continuedfloat} added}
% \changes{v3.3}{2011/12/28}{Uses \cs{ifcaption@ContinuedFloat} now}
% \changes{v3.3}{2013/05/01}{Usage of \cs{caption@restorecounters} added}
% \changes{v3.3}{2013/12/16}{Bugfix: Does not use \cs{caption@ContinuedFloat} anymore since this breaks \cs{ContinuedFloat} offered by the \package{subfig} package}
% \changes{v3.4}{2015/09/16}{Renamed from \cs{ContinuedFloat} to \cs{continuedfloat}}
% \changes{v3.5f}{2020/10/06}{Usage of \cs{caption@restorecounters} removed}
% \changes{v3.6}{2020/12/27}{Check of counter caption type out-sourced to \cs{caption@check@continuedfloat}}
% \changes{v3.6}{2022/01/05}{Usage of \cs{caption@Error} replaced by \cs{caption@OutsideFloat}}
%  |\continuedfloat|\\
%  |\continuedfloat*|\par
%  This mainly sets the `continued float' flag, increments the continuation counter, and executes the given options.
%    \begin{macrocode}
\def\continuedfloat{%
  \caption@teststar\caption@continuedfloat\@firstoftwo\@secondoftwo}
%    \end{macrocode}
%    \begin{macrocode}
\newcommand*\caption@continuedfloat[1]{%
  \caption@iftype
    {#1{\caption@@refstepcounter\@captype}{}%
     \caption@@continuedfloat\@captype}%
    {\caption@OutsideFloat\continuedfloat}}
%    \end{macrocode}
%    \begin{macrocode}
\newcommand*\caption@@continuedfloat{%
  \caption@clrflags
  \caption@set@continuedfloat
    {\caption@setcontinued
     \caption@@@continuedfloat}%
    {\@gobble}}
%    \end{macrocode}
%    \begin{macrocode}
\newcommand*\caption@@@continuedfloat[1]{%
  \caption@setoptions{ContinuedFloat}% for compatibility reasons
  \caption@setoptions{continuedfloat}%
  \caption@setoptions{continued#1}%
  \expandafter\l@addto@macro\csname the#1\endcsname\thecontinuedfloat
%    \end{macrocode}
%  When the \package{hyperref} package is used we have the problem
%  that the usage of |\continued|\-|float| will create duplicate
%  hyper links -- |\@current|\-|Href| will be the same for the main float and
%  the continued ones. So we have to make sure unique labels and references
%  will be created each time. We do this by extending |\the|\-|H|\-|figure| and
%  |\the|\-|H|\-|table|, so for continued floats the scheme
%  \begin{quote}\meta{type}|.|\meta{type \#}|\alph{|\meta{continued \#}|}|\end{quote}
%  will be used instead of
%  \begin{quote}\meta{type}|.|\meta{type \#}\quad\quad.\end{quote}
%  \par{\small(This implementation follows an idea from Steven Douglas Cochran.)}
%  \Note{This does not help if the \package{hyperref} package option \texttt{naturalnames=true} is set.}
%    \begin{macrocode}
  \@ifundefined{theH#1}{}{%
    \expandafter\l@addto@macro\csname theH#1\endcsname{%
      \@alph\c@continuedfloat}}%
%    \end{macrocode}
% Make sure the options and the \package{hyperref} patch is only applied once (per group).
%    \begin{macrocode}
  \let\caption@@@continuedfloat\@gobble}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\ContinuedFloat}
% For compatibility reasons we still support the obsolete |\Continued|\-|Float|.
%    \begin{macrocode}
\def\ContinuedFloat{\continuedfloat} % defined for compatibility reasons
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\caption@ContinuedFloat}
% \changes{v3.0f}{2005/06/11}{This macro added}
% \changes{v3.3}{2013/12/16}{Bugfix: Revised and defined with \cs{def} instead of \cs{newcommand}}
% |\caption@ContinuedFloat|\marg{caption type}\par
% This one is used by \cs{ContinuedFloat} offered by the \package{subfig} package.
% Since the \package{subfig} package does its own counter handling we try not to
% interfere by changing couter-related flags.
% not interfere with it
%    \begin{macrocode}
\def\caption@ContinuedFloat{%
  \caption@set@continuedfloat\caption@@@continuedfloat\@gobble}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\nextfloat}
% \changes{v3.6}{2020/09/20}{This command added}
% \changes{v3.6}{2021/01/09}{Usage of \cs{flushsubcaptionlistentries} added}
% \changes{v3.6}{2022/01/05}{Usage of \cs{caption@Error} replaced by \cs{caption@OutsideFloat}}
% |\nextfloat| resets the flags (indicating that the next contents of the floating environment starts here),
% and sets a new \package{hyperref} anchor.
%    \begin{macrocode}
\providecommand*\nextfloat{%
    \caption@teststar\caption@nextfloat\@firstoftwo\@secondoftwo}
%    \end{macrocode}
%    \begin{macrocode}
\newcommand*\caption@nextfloat[1]{%
  \caption@iftype
    {\caption@@nextfloat\@captype
     #1{}{\caption@reset@currentlabel\caption@start}}%
    {\caption@OutsideFloat\nextfloat}}
%    \end{macrocode}
%    \begin{macrocode}
\newcommand*\caption@@nextfloat[1]{%
  \flushsubcaptionlistentries
  \caption@clrflags
  \ifx\caption@@@continuedfloat\@gobble
    % next continued float
    \caption@set@continuedfloat\caption@setcontinued\relax
  \fi}
%    \end{macrocode}
% \end{macro}
%
% \subsection{Internal helpers}
%
% \begin{macro}{\caption@refstepcounter}
% \changes{v3.1}{2007/07/28}{This macro added}
% \changes{v3.2}{2010/10/26}{Error message moved from \cs{caption@@@settype} to here}
% \changes{v3.2c}{2011/09/04}{Support of \cs{donemaincaptiontrue} from \textsf{memoir} document class added}
% \changes{v3.3}{2011/12/28}{Usage of \cs{ifcaption@caption}, \cs{ifcaption@subcaption}, and \cs{ifcaption@ContinuedFloat} added}
% \changes{v3.5e}{2020/09/28}{Bugfix in re-definition of \cs{stepcounter}; uses \cs{edef} instead of \cs{def} now}
% \changes{v3.6}{2020/09/20}{Handling of flags out-sourced to \cs{caption@ifrefstepcounter}}
% \changes{v3.6}{2020/12/27}{\cs{caption@@@refstepcounter} renamed to \cs{caption@refstepcounter@}}
% \changes{v3.6}{2021/01/09}{Adapted to current interface of \cs{caption@prepare@stepcounter}}
% |\caption@refstepcounter|\marg{counter}\\
% increments the float counter (using |\ref|\-|step|\-|counter|) and resets the continuation counter.
%    \begin{macrocode}
\newcommand*\caption@refstepcounter{%
  \@nameuse{donemaincaptiontrue}% Support of the memoir document class
  \caption@ifrefstepcounter\caption@@refstepcounter\caption@@refcounter}
%    \end{macrocode}
%    \begin{macrocode}
\newcommand*\caption@@refstepcounter[1]{%
  \caption@prepare@stepcounter{#1}%
  \caption@refstepcounter@{#1}}
%    \end{macrocode}
%    \begin{macrocode}
\newcommand*\caption@@refcounter[1]{%
  \let\caption@stepcounter@ORI\stepcounter
  \def\stepcounter##1{%
    \edef\caption@tempa{#1}%
    \edef\caption@tempb{##1}%
    \ifx\caption@tempa\caption@tempb
      % Suppress incrementation of counter
    \else
      \caption@stepcounter@ORI{##1}%
    \fi}%
  \caption@refstepcounter@{#1}%
  \let\stepcounter\caption@stepcounter@ORI}
%    \end{macrocode}
%    \begin{macrocode}
\newcommand*\caption@refstepcounter@{\refstepcounter}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\caption@stepcounter}
% \changes{v3.6}{2020/09/20}{This macro added}
% \changes{v3.6}{2020/12/27}{Handling of flags out-sourced to \cs{caption@ifstepcounter}}
% \changes{v3.6}{2020/12/27}{\cs{caption@@@stepcounter} renamed to \cs{caption@stepcounter@}}
% \changes{v3.6}{2021/01/09}{Adapted to current interface of \cs{caption@prepare@stepcounter}}
% |\caption@stepcounter|\marg{counter}\\
% increments the float counter (using |\step|\-|counter|) and resets the continuation counter.
%    \begin{macrocode}
\newcommand*\caption@stepcounter{%
  \caption@ifstepcounter\caption@@stepcounter\caption@@counter}
%    \end{macrocode}
%    \begin{macrocode}
\newcommand*\caption@@stepcounter[1]{%
  \caption@prepare@stepcounter{#1}%
  \caption@stepcounter@{#1}}
%    \end{macrocode}
%    \begin{macrocode}
\newcommand*\caption@@counter[1]{} % nothing to do
%    \end{macrocode}
%    \begin{macrocode}
\newcommand*\caption@stepcounter@{\stepcounter}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\caption@prepare@stepcounter}
% \changes{v3.3}{2011/12/28}{This macro added}
% \changes{v3.6}{2021/01/09}{Argument \meta{source hint} dropped; adapted to current interface of \cs{caption@addsubcontentslines}}
% |\caption@prepare@stepcounter|\marg{counter}
% Dumps the cached list entries and resets the continuation counter.
%    \begin{macrocode}
\newcommand*\caption@prepare@stepcounter{%
  \caption@addsubcontentslines\relax
  \caption@reset@continuedfloat}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\caption@ifrefstepcounter}
% \changes{v3.6}{2020/09/20}{This macro added}
% |\caption@ifrefstepcounter|\marg{yes-code}\marg{no-code}\\
% tests if the counter should be increased or not. Furthermore it updates the flags accordingly.
%    \begin{macrocode}
\newcommand*\caption@ifrefstepcounter{%
  \caption@ifcounter
%    \end{macrocode}
% If a caption was already typeset in this environment, we need to increment the counter (again).
%    \begin{macrocode}
    {\caption@ifcaption}%
%    \end{macrocode}
% If a caption and a sub-caption below it were already typeset, we issue a warning additionally.
% (This will only be done if |position=b| is set because this is the case were the sub-caption numbering got most likely wrong.)
%    \begin{macrocode}
    {\caption@ifsubcaption@below{\caption@iftop\@secondoftwo\@firstoftwo}{\@secondoftwo}}%
%    \end{macrocode}
% In each case set the `caption' flag to indicate a caption was typeset.
%    \begin{macrocode}
    {\caption@setcaption}}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\caption@ifstepcounter}
% \changes{v3.6}{2020/12/27}{This macro added}
% |\caption@ifstepcounter|\marg{yes-code}\marg{no-code}\\
% tests if the counter should be increased or not. Furthermore it updates the flags accordingly.
%    \begin{macrocode}
\newcommand*\caption@ifstepcounter{%
  \caption@ifcounter
%    \end{macrocode}
% If a caption and a sub-caption above it were already typeset in this environment, we need to increment the counter (again).
%    \begin{macrocode}
    {\caption@ifcaption\caption@ifsubcaption@above\@secondoftwo}%
%    \end{macrocode}
% In this case issue a warning additionally.
% (This will only be done if |position=t| is set because this is the case were the sub-caption numbering got most likely wrong.)
%    \begin{macrocode}
    {\caption@iftop}%
%    \end{macrocode}
% In each case set the `subcaption' flag to indicate a sub-caption was typeset.
%    \begin{macrocode}
    {\caption@setsubcaption}}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\caption@ifcounter}
% \changes{v3.6}{2020/12/28}{This macro added}
% |\caption@ifcounter|\marg{increment the counter?}\marg{issue a warning?}\marg{set flag}\marg{yes-code}\marg{no-code}\\
% contains the common code of |\caption@if|\-|ref|\-|step|\-|counter| and |\caption@if|\-|step|\-|counter|.
%    \begin{macrocode}
\newcommand*\caption@ifcounter[3]{%
  \caption@ifflags
%    \end{macrocode}
% Test if the counter should be incremented (again). If yes, test if a warning should be issued additionally.
% (If the counter gets incremented all flags will be cleared to indicate a new run.)
%    \begin{macrocode}
    {#1%
       {#2\caption@Warning\@gobble{Ambiguous sub-caption(s), use \string\nextfloat}%
        \caption@clrflags
        \let\caption@next\@firstoftwo}%
       {\let\caption@next\@secondoftwo}}%
%    \end{macrocode}
% Always increment the counter if no flag was set so far.
%    \begin{macrocode}
    {\let\caption@next\@firstoftwo}%
%    \end{macrocode}
% Set either the `caption' or `subcaption' flag.
%    \begin{macrocode}
  #3%
%    \end{macrocode}
%    \begin{macrocode}
  \caption@next}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\caption@dblarg}
% \changes{v3.1}{2007/02/05}{This macro added}
% \changes{v3.1f}{2007/12/06}{Bugfix 07-12-06: Changed so it works without \cs{kernel@ifnextchar} (which was introduced in \LaTeXe\ 2004/01/23), too}
% \changes{v3.3}{2012/03/25}{Support of option \opt{list-entry} added}
%  A |\relax| was added compared to |\@dblarg| so |\caption{}| will be
%  expanded to |\caption[\relax]{}| (and not to |\caption[]{}|).
% Furthermore support for option \opt{list-entry} was added.
%    \begin{macrocode}
\@ifundefined{kernel@ifnextchar}{\let\kernel@ifnextchar\@ifnextchar}{}
%    \end{macrocode}
%    \begin{macrocode}
\newcommand\caption@dblarg[1]{%
  \kernel@ifnextchar[%]
    {\caption@ydblarg{#1}}%
    {\caption@xdblarg{#1}}}
%    \end{macrocode}
%    \begin{macrocode}
\newcommand\caption@xdblarg[2]{%
  #1[{#2\relax}]{#2}}
%    \end{macrocode}
%    \begin{macrocode}
\long\def\caption@ydblarg#1[#2]#3{%
  \caption@iflistheading{#1[{#3}]{#3}}{#1[{#2}]{#3}}}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\caption@begin}
% \changes{v3.0a}{2004/01/23}{\cs{caption@settype} changed to \cs{caption@setfloattype}}
% \changes{v3.0e}{2005/04/12}{Check for default label format added}
% \changes{v3.0f}{2005/06/11}{Usage of \cs{caption@resetContinuedFloat} added}
% \changes{v3.1}{2007/05/09}{Usage of \cs{caption@setfloattype} \& \cs{caption@resetContinuedFloat} removed}
% \changes{v3.3}{2011/12/29}{Usage of \cs{caption@fixedposition} removed}
%  Our handling of |\caption| will always be surrounded by
%  |\caption@begin| (or |\caption@beginex|) and |\caption@end|.\par
%  |\caption@begin|\marg{type} performs these tasks:
%  \begin{enumerate}
%  \item[1.] Override the |position=| setting, if necessary.
%            (for example if set to |auto| or used inside a |supertabular|)
%  \item[2.] Start a new group.
%  \item[3.] Define |\fnum@|\meta{type} if the caption label format is set
%            to non-default.
%  \end{enumerate}
%    \begin{macrocode}
\newcommand*\caption@begin[1]{%
  \caption@fixposition
  \begingroup
    \caption@setfnum{#1}}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\caption@beginex}
% \changes{v3.0b}{2004/05/16}{Support of \opt{listof=} added}
% \changes{v3.0l}{2007/02/04}{Takes now 3 args instead of 2, check for empty heading added}
% \changes{v3.1}{2007/07/01}{Makes lst-entry now instead of redefining \cs{addcontentsline}}
% \changes{v3.2}{2010/10/26}{Bugfix 09-05-15: Setting of \cs{lst@@caption} added}
% \changes{v3.5h}{2022/03/01}{Hook added, setting of \cs{lst@@caption} removed}
%  |\caption@beginex|\marg{type}\marg{list entry}\marg{heading}\par
%  performs the same tasks as |\caption@begin| and additionally:
%  \begin{enumerate}
%  \item[4.] Apply the hook |\caption@beginex@hook|
%  \item[5.] Make an entry in the list-of-whatever.
%  \item[6.] Set |\caption@ifempty| according argument \meta{heading}.
% \end{enumerate}
%    \begin{macrocode}
\newcommand\caption@beginex[3]{%
  \caption@begin{#1}%
  \caption@beginex@hook
  \caption@addcontentsline{#1}{#2}%
  \caption@ifempty{#3}{}}
%    \end{macrocode}
%    \begin{macrocode}
\newcommand*\caption@beginex@hook{}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\caption@end}
% \changes{v3.3}{2011/12/29}{Usage of \cs{caption@fixedposition} removed}
%  |\caption@end| closes the group.
%    \begin{macrocode}
\newcommand*\caption@end{%
  \endgroup}
%    \end{macrocode}
% \end{macro}
%
% \changes{v3.0a}{2004/01/23}{Internal hooks \cs{caption@@begin} \& \cs{caption@@end} added}
% \changes{v3.0h}{2005/10/06}{Internal hooks \cs{caption@@begin} \& \cs{caption@@end} removed}
%
% \begin{macro}{\caption@normalsize}
% \changes{v3.1}{2007/05/05}{This macro definition added}
% \changes{v3.5}{2020/07/27}{Adapted to \package{caption3} v2.0}
%  This one will be used by |\@caption| instead of |\normalsize|.
%    \begin{macrocode}
\newcommand*\caption@normalsize{%
  \caption@font@normal\@unused}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\caption@setfloatcapt}
%  Needed for support of the \package{float} package, where the caption will
%  not be typeset directly, but catched in a |\vbox| called |\@floatcapt|
%  instead.
%    \begin{macrocode}
\let\caption@setfloatcapt\@firstofone
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\caption@makecurrent}
%  This one is needed for support of the \package{nameref} and \package{hyperref} package.
% \changes{v3.2f}{2012/01/14}{Bugfix: Usage of \cs{caption@gettitle} added}
%    \begin{macrocode}
\newcommand*\caption@makecurrent[1]{\caption@gettitle}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\caption@makeanchor}
% \begin{macro}{\caption@start}
% \begin{macro}{\caption@@start}
% \begin{macro}{\caption@freezeHref}
% \begin{macro}{\caption@defrostHref}
%  All these are needed for support of the \package{hyperref} package.
%    \begin{macrocode}
\let\caption@makeanchor\@firstofone
\let\caption@start\relax
\let\caption@@start\relax
\let\caption@freezeHref\relax
\let\caption@defrostHref\relax
%    \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\caption@gettitle}
% \changes{v3.1}{2007/05/05}{This macro definition added}
%  This one is needed for support of the \package{nameref} package.
%    \begin{macrocode}
\newcommand\caption@gettitle[1]{%
  \caption@ifdefined\NR@gettitle
    {\NR@gettitle{#1}}%
    {\def\@currentlabelname{#1}}}
%    \end{macrocode}
% \end{macro}
%
% \subsection{Support for sub-captions}
% \changes{v3.1f}{2007/11/16}{Support for sub-captions added}
%
% \begin{macro}{\caption@subtypehook}
% \changes{v3.1g}{2008/03/20}{Redefinition of \cs{caption@setlist} added}
% \changes{v3.1k}{2009/10/09}{Bugfix 09-08-12b: \cs{@makecaption} will now be restored here, too}
% \changes{v3.2}{2011/06/26}{Uses \cs{caption@@addcontentsline} instead of \cs{addcontentsline} now}
% \changes{v3.2a}{2011/08/17}{Redefinition of \cs{phantomcaption} added}
% \changes{v3.2a}{2011/08/17}{Usage of \cs{caption@warmup} added}
% \changes{v3.2c}{2011/09/30}{Bugfix 11-09-26: Usage of \cs{if@subfloatrow} added}
% \changes{v3.3}{2011/12/28}{Bugfix 11-12-16: \cs{caption@l@stepcounter} replaced by \cs{stepcounter}}
% \changes{v3.3}{2012/03/15}{Usage of \cs{caption@setbox} added}
% \changes{v3.3}{2013/05/01}{Redefinition of \cs{caption@settype} added}
% \changes{v3.3}{2013/06/17}{Missing redefinition of \cs{captionlistentry} added}
% \changes{v3.3}{2018/09/06}{Adapted to the \package{chkfloat} package}
% \changes{v3.4f}{2020/01/03}{Redefinition of \cs{@caption} added since it was redefined by the \env{threeparttable} environment}
% \changes{v3.5}{2020/07/27}{Adapted to \package{caption3} v2.0}
% \changes{v3.6}{2020/09/20}{Handling of flags out-sourced to \cs{caption@stepcounter}}
%  Hook, will be used inside \cs{caption@setsubtype}.\par
% (Note: If we are inside an |sub|\-|float|\-|row| environment we have to keep
% the |\@make|\-|caption| code of the \package{floatrow} package intact.)
%    \begin{macrocode}
\newcommand*\caption@subtypehook{%
  \ifx\caption\caption@subcaption \else
    \caption@warmup
    \caption@stepcounter\@captype
    \caption@ifcaption
      {}%
      {\let\caption@add@contentsline\caption@addsubcontentsline
       \let\caption@addsubcontentslines\@gobble}%
%    \end{macrocode}
%    \begin{macrocode}
    \c@continuedfloat=0\relax
    \let\caption@setfloatcapt\@firstofone
    \let\caption@chkfloat\@gobbletwo
%    \end{macrocode}
%    \begin{macrocode}
    \caption@set{box}{none}%
    \caption@clearmargin
    \caption@iflist{}{\let\caption@setlist\@gobble}%
    \caption@setoptions{sub}%
    \caption@setoptions{subfloat}% for subfig-package compatibility
%    \end{macrocode}
%    \begin{macrocode}
% redefine \setcaptiontype
    \def\caption@settype{\caption@withoptargs\caption@sub@settype}%
    \def\caption@sub@settype##1##2{%
      \edef\caption@tempa{##2}%
      \ifx\caption@tempa\@captype
%%%     \caption@setsubtype##1\relax
      \else
        \caption@Error{##2 inside \@subcaptype}%
      \fi}%
%    \end{macrocode}
%    \begin{macrocode}
% redefine \caption
    \let\caption\caption@subcaption
    \let\@caption\caption@@caption
    \let\phantomcaption\caption@subphantom
    \let\captionlistentry\caption@sublistentry
    \let\captiontext\caption@subtext
%   \let\@captype\@subcaptype
    \let\caption@refstepcounter\caption@refstepcounter@
%    \end{macrocode}
%    \begin{macrocode}
% restore \@makecaption
    \if@subfloatrow
      \caption@Debug{Keeping \string\@makecaption}%
    \else
      \let\@makecaption\caption@makecaption
    \fi
  \fi}%
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\if@subfloatrow}
% \changes{v3.2c}{2011/09/30}{This macro added}
% This macro tests if we are inside an |sub|\-|float|\-|row| or |sub|\-|float|\-|row*| environment.
%    \begin{macrocode}
\caption@AtBeginDocument{%
  \caption@ifundefined\@subfloatrowtrue
   {\newif\if@subfloatrow
    \caption@ifundefined\subfloatrow
    {}%
    {\caption@Debug{Patching subfloatrow environment}%
     \g@addto@macro\capsubrowsettings{\@subfloatrowtrue}%
     \g@addto@macro\killfloatstyle{%
       \ifx\c@FRobj\c@FRsobj\@subfloatrowtrue\fi}}}%
   {\caption@Debug{\string\if@subfloatrow is already defined}}}%
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\caption@subcaption}
% Makes a sub-caption.
%    \begin{macrocode}
\newcommand*\caption@subcaption{%
  \caption@checkgrouplevel{sub}\subcaption
  \caption@star
    {\caption@refstepcounter\@subcaptype}%
    {\caption@dblarg{\@caption\@subcaptype}}}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\caption@subphantom}
% \changes{v3.2a}{2011/08/17}{This macro added}
% Same as |\phantomcaption|, but for sub-captions.
%    \begin{macrocode}
\newcommand*\caption@subphantom{%
  \caption@checkgrouplevel{sub}\phantomsubcaption
  \caption@refstepcounter\@subcaptype}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\caption@sublistentry}
% \changes{v3.3}{2013/06/17}{This macro added}
% Same as |\captionlistentry|, but for sub-captions.
%    \begin{macrocode}
\newcommand*\caption@sublistentry{%
  \caption@teststar\@subcaptionlistentry\@firstoftwo\@secondoftwo}
%    \end{macrocode}
%    \begin{macrocode}
\newcommand*\@subcaptionlistentry[1]{%
  \@testopt{\caption@listentry{#1}}{\@subcaptype}}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\caption@subtext}
% \changes{v3.2a}{2011/08/17}{This macro added}
% Same as |\captiontext|, but for sub-captions.
%    \begin{macrocode}
\newcommand*\caption@subtext{%
% \caption@checkgrouplevel{sub}\subcaptiontext
  \caption@text\@subcaptype}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{caption@clearsubcontentslines}
% Clear pending sub-caption list entries.
%    \begin{macrocode}
\newcommand*\caption@clearsubcontentslines{%
  \global\let\caption@subcontentslines\@empty}
%    \end{macrocode}
%    \begin{macrocode}
\caption@clearsubcontentslines
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\caption@addsubcontentsline}
% \changes{v3.1i}{2008/08/02}{\cs{label}, \cs{index}, and \cs{glossary} are allowed inside the list entry now}
% \changes{v3.2}{2011/06/26}{Uses \cs{caption@@addcontentsline} instead of \cs{addcontentsline} now}
% \changes{v3.2c}{2011/08/19}{Uses \cs{caption@gobble} instead of \cs{@gobble} now}
% \changes{v3.3}{2012/01/15}{Debug message added}
% \changes{v3.3}{2013/03/10}{A single \cs{protect} replaced by \cs{noexpand}}
% Add a pending sub-caption list entry.
%    \begin{macrocode}
\newcommand*\caption@addsubcontentsline[4]{%
  \caption@Debug{\string\caption@addsubcontentsline{#1}{#2}}%
  \begingroup
  \let\label\caption@gobble
  \let\index\caption@gobble
  \let\glossary\caption@gobble
  \protected@edef\@tempa{\endgroup
    \noexpand\g@addto@macro\noexpand\caption@subcontentslines{%
      \noexpand\@namedef{the#2}{\csname the#2\endcsname}%
      \ifx\@currentHref\@undefined \else
        \noexpand\def\noexpand\@currentHref{\@currentHref}%
      \fi
      \noexpand\caption@@@addcontentsline{#1}{#2}{#3}{#4}}}%
  \@tempa}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\flushsubcaptionlistentries}
% \changes{v3.3}{2012/01/15}{Renamed from \cs{caption@addsubcontentslines} to \cs{flushsubcaptionlistentries}}
% \changes{v3.3}{2013/03/10}{Bugfix: Missing redefinition of \cs{caption@addsubcontentslines} added}
% \changes{v3.6}{2021/01/09}{Patch of \cs{chapter} and \cs{appendix} dropped}
% Writes pending sub-caption list entries.
% (Note: We keep the parameter of |\caption@add|\-|sub|\-|contents|\-|lines| for compatibility reasons although it's not used anymore.)
%    \begin{macrocode}
\newcommand*\flushsubcaptionlistentries{%
  \caption@addsubcontentslines\relax}
%    \end{macrocode}
%    \begin{macrocode}
\renewcommand*\caption@addsubcontentslines[1]{%
  \caption@Debug{\string\flushsubcaptionlistentries}%
  \begingroup
    \caption@subcontentslines
  \endgroup
  \caption@clearsubcontentslines}
%    \end{macrocode}
% \end{macro}
%
% \subsection{Babel package support}
%
% \subsubsection{The arabic \& farsi babel option}
% \changes{v3.5}{2020/08/02}{\package{arabic} babel support addded}
%
%    \begin{macrocode}
\caption@IfBabelArabi{%
%    \end{macrocode}
%
% The \package{arabicore} package re-defines |\@make|\-|caption|, |\fnum@figure|, and |\fnum@table|
% incompatible to the \package{caption} package, therefore we have to restore our resp.~the original definitions here.
%
%    \begin{macrocode}
  \let\@makecaption\caption@makecaption
  \def\fnum@figure{\figurename\nobreakspace\thefigure}%
  \def\fnum@table{\tablename\nobreakspace\thetable}%
%    \end{macrocode}
%
%    \begin{macrocode}
}{}
%    \end{macrocode}
%
% \subsubsection{The frenchle \& frenchpro package}
% \changes{v3.0h}{2005/10/03}{\package{frenchle/pro} package support added}
% \changes{v3.5}{2020/08/01}{\package{frenchle/pro} package support updated}
%
%    \begin{macrocode}
\caption@IfFrenchLe{%
%    \end{macrocode}
%
% \begin{macro}{\f@ffrench}
% \begin{macro}{\f@tfrench}
%  |\f@ffrench| and |\f@tfrench| reflect |\fnum@figure| and |\fnum@table|
%  when used in French mode. These contain additional code which typesets
%  the caption separator |\caption|\-|separator| instead of the usual colon.
%  Because this breaks with our |\@make|\-|caption| code we have to remove
%  this additional code here.
%    \begin{macrocode}
  \def\f@ffrench{\ifx\listoffigures\relax\else\figurename~\thefigure\fi}%
  \def\f@tfrench{\ifx\listoftables\relax\else\tablename~\thetable\fi}%
  \let\@eatDP\@undefined
%    \end{macrocode}
% \end{macro}
% \end{macro}
%
% Since the \package{frenchle} package overwrites |\@make|\-|caption| (within |\GO|\-|french|),
% we need to save it beforehand and restore it afterwards.
%    \begin{macrocode}
  \caption@AtBeginDocument{%
    \let\caption@original@makecaption\@makecaption}%
  \g@addto@macro\GOfrench{%
    \let\@makecaption\caption@original@makecaption}%
%    \end{macrocode}
%
%    \begin{macrocode}
}{}
%    \end{macrocode}
%
% \subsubsection{The hungarian \& magyar babel option}
% \changes{v3.2}{2009/03/29}{\package{magyar} babel support added}
% \changes{v3.3}{2018/08/26}{\package{magyar} babel support revised}
% \changes{v3.5}{2020/08/02}{\package{magyar} babel support updated}
%
%    \begin{macrocode}
\caption@IfBabelHungarian{%
%    \end{macrocode}
%
% Since the \package{magyar} package tends to overwrite |\@make|\-|caption|
% we save it beforehand and restore it afterwards.
% \Note{Currently it will not be overwritten, caused by a side-effect of a
%       work-around for the \package{floatrow} package within \package{caption3}.}
%
%    \begin{macrocode}
  \caption@AtBeginDocument{%
    \let\caption@original@makecaption\@makecaption}%
  \caption@ifdefined\extrashungarian{%
    \addto\extrashungarian{%
      \let\@makecaption\caption@original@makecaption}}{}%
  \caption@ifdefined\extrasmagyar{%
    \addto\extrasmagyar{%
      \let\@makecaption\caption@original@makecaption}}{}%
%    \end{macrocode}
%
%    \begin{macrocode}
}{}
%    \end{macrocode}
%
% \subsubsection{The latvian babel option}
% \changes{v3.5}{2020/08/02}{\package{latvian} babel support updated}
%
%    \begin{macrocode}
\caption@IfBabelLatvian{%
%    \end{macrocode}
%
% The \package{latvian} package re-defines |\@make|\-|caption| incompatible to the \package{caption} package,
% therefore we have to restore our definitions here.
%
%    \begin{macrocode}
  \let\@makecaption\caption@makecaption
%    \end{macrocode}
%
%    \begin{macrocode}
}{}
%    \end{macrocode}
%
% \subsection{Package support}
% \changes{v3.1}{2007/04/11}{Package options `float', `longtable' etc.~are not supported anymore, removed}
%
% \begin{macro}{\caption@IfPackageLoaded}
% \changes{v3.0f}{2005/05/29}{3rd argument \meta{code} added, so no extra check is needed}
% \changes{v3.1}{2007/07/04}{Re-written \& renamed from \cs{caption@ifpackage} to \cs{caption@IfPackageLoaded}}
% \changes{v3.3}{2018/12/26}{Bugfix: Missing curly braces added}
%  |\caption@IfPackageLoaded|\marg{package}\oarg{version}\marg{true}\marg{false}\par
%  Some kind of combination of |\@ifpackageloaded| and |\@ifpackagelater|.
%  If the \meta{package} is not loaded yet, the check will be (re-)done
%  |\AtBeginDocument|, so the \meta{package} could be loaded later on, too.
%    \begin{macrocode}
\newcommand\caption@IfPackageLoaded[1]{%
  \@testopt{\caption@@IfPackageLoaded{#1}}{}}
\@onlypreamble\caption@IfPackageLoaded
%    \end{macrocode}
%    \begin{macrocode}
\long\def\caption@@IfPackageLoaded#1[#2]#3#4{%
  \@ifpackageloaded{#1}\@firstofone{%
    \caption@Debug{#1 package is not loaded (yet)\@gobble}%
    \caption@AtBeginDocument}{%
      \caption@If@Package@Loaded{#1}[{#2}]{#3}{#4}}}
\@onlypreamble\caption@@IfPackageLoaded
%    \end{macrocode}
%    \begin{macrocode}
\long\def\caption@If@Package@Loaded#1[#2]{%
  \@ifpackageloaded{#1}{%
    \caption@InfoNoLine{#1 package is loaded}%
    \@ifpackagelater{#1}{#2}\@firstoftwo{%
      \caption@Error{%
        For a successful cooperation we need at least version\MessageBreak
          `#2' of package #1,\MessageBreak
        but only version\MessageBreak
          `\csname ver@#1.\@pkgextension\endcsname'\MessageBreak
        is available}%
      \@secondoftwo}%
  }{\@secondoftwo}}
\@onlypreamble\caption@If@Package@Loaded
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\caption@clearmargin}
% \changes{v3.1}{2007/05/05}{This macro definition added}
% \changes{v3.6}{2021/01/17}{Adapted to current implementation of \cs{caption@setmargin}}
%  This macro will be used by some package support stuff where the usual
%  margin setting is not welcome, e.g. in the \package{sidecap} package.
%    \begin{macrocode}
\newcommand*\caption@clearmargin{%
  \caption@setmargin\z@
  \let\caption@minmargin\@undefined}
%    \end{macrocode}
% \end{macro}
%
%    \begin{macrocode}
\caption@setbool{needfreeze}{0}
\caption@AtBeginDocument*{%
  \caption@ifneedfreeze{%
%    \end{macrocode}
%
% \begin{macro}{\caption@freezetype}
% \changes{v3.3}{2013/05/01}{This macro added}
%  |\caption@freezetype|\marg{type}\par
%  Used by the \package{fltpage} \& \package{sidecap} package support.
%    \begin{macrocode}
    \newcommand*\caption@freezetype[1]{%
      \caption@settype*{#1}%
      \captionsetup*[sub]{hypcap=true}% Note: This is just a (q&d) workaround!
      \caption@freeze}%
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\caption@freeze}
% \changes{v3.1}{2007/07/22}{This macro added}
% \changes{v3.1c}{2007/10/06}{\cs{caption} \& \cs{@caption} revised for enhanced compatibility}
% \changes{v3.1c}{2007/10/06}{Bugfix: Made \cs{@caption} long}
% \changes{v3.1f}{2007/11/16}{Uses `space hack' instead of \cs{ignorespaces} now}
% \changes{v3.1g}{2008/01/29}{Starred variants of \cs{ContinuedFloat} and \cs{captionsetup} added}
% \changes{v3.2}{2010/10/26}{Bugfix 10-09-01a: Uses \cs{ignorespaces} instead of `space hack' again}
% \changes{v3.2a}{2011/08/17}{Starred variant of \cs{caption@freeze} removed}
% \changes{v3.2b}{2011/08/18}{Redefines \cs{caption@setup} instead of \cs{captionsetup} now}
% \changes{v3.2b}{2011/08/18}{Redefinition of \cs{label} revised}
% \changes{v3.2c}{2011/08/21}{Revised}
% \changes{v3.3}{2013/01/06}{Adapted to new switch \cs{caption@caption} etc.}
% |\caption@freeze|\par
%  Used by the \package{bicaption} package.
%    \begin{macrocode}
    \newcommand*\caption@freeze{%
      \let\caption@frozen@continuedfloat\continuedfloat
      \def\continuedfloat{%
        \caption@@freeze{\caption@@@continuedfloat\@captype}%
        \caption@frozen@continuedfloat}%
%    \end{macrocode}
%    \begin{macrocode}
      \let\caption@frozen@nextfloat\nextfloat
      \def\nextfloat{\caption@freeze@error}%
%    \end{macrocode}
%    \begin{macrocode}
      \let\caption@frozen@setup\caption@setup
      \def\caption@setup##1{%
        \caption@@freeze{\caption@setup{##1}}%
        \caption@frozen@setup{##1}}%
%    \end{macrocode}
%    \begin{macrocode}
      \let\caption@frozen@caption\caption
      \def\caption{%
        \def\caption{\caption@freeze@error\caption@gobble}%
        \@ifstar
          {\caption@SC@caption*}%
          {\let\@currentlabel\caption@SClabel
           \caption@withoptargs\caption@SC@caption}}%
      \long\def\caption@SC@caption##1##2{%
        \caption@@freeze{\caption##1{##2}}%
        \ignorespaces}%
%    \end{macrocode}
%    \begin{macrocode}
      \let\caption@frozen@label\label
      \def\label{%
        \caption@withoptargs\caption@SC@label}%
      \def\caption@SC@label##1##2{%
        \ifx\@currentlabel\caption@SClabel
          \@bsphack
            \caption@freeze@label{##1}{##2}%
          \@esphack
        \else
          \caption@frozen@label##1{##2}%
        \fi}%
      \def\caption@SClabel{\caption@undefinedlabel}%
      \def\caption@freeze@label##1##2{%
        \caption@@freeze{\label##1{##2}}}%
%    \end{macrocode}
%    \begin{macrocode}
      \global\let\caption@frozen@content\@empty
      \long\def\caption@@freeze{%
        \g@addto@macro\caption@frozen@content}%
%    \end{macrocode}
%    \begin{macrocode}
      \def\caption@warmup{%
        \let\continuedfloat\caption@frozen@continuedfloat
        \let\nextfloat\caption@frozen@nextfloat
        \let\caption@setup\caption@frozen@setup
        \let\caption\caption@frozen@caption
        \let\label\caption@frozen@label}}%
%    \end{macrocode}
%    \begin{macrocode}
    \newcommand*\caption@freeze@error{%
      \caption@Error{Only one \noexpand\caption can be placed in this environment}}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\caption@prepare@defrost}
% \changes{v3.3}{2013/01/06}{This macro added}
% Prevent resetting the caption flags
%    \begin{macrocode}
    \newcommand*\caption@prepare@defrost{%
      \let\caption@settype\caption@@settype}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\caption@defrost}
% \changes{v3.1}{2007/07/22}{This macro added}
% \changes{v3.1g}{2008/01/30}{\cs{caption@defrost@setup} added}
% \changes{v3.2c}{2011/08/21}{Adapted to changes of \cs{caption@freeze}}
% \changes{v3.2c}{2011/08/21}{\cs{caption@defrost@setup} removed}
%  |\caption@defrost|
%    \begin{macrocode}
    \newcommand*\caption@defrost{%
      \ifx\caption@frozen@caption\@undefined
        \caption@frozen@content
      \else
        \caption@Error{Internal Error:\MessageBreak
          \noexpand\caption@defrost in same group as \string\caption@freeze}%
      \fi}%
%    \end{macrocode}
% \end{macro}
%
%    \begin{macrocode}
  }{}%
  \caption@undefbool{needfreeze}}
%    \end{macrocode}
%
% \begin{macro}{\caption@warmup}
% \changes{v3.2a}{2011/08/17}{This macro added}
%  |\caption@warmup|
%    \begin{macrocode}
\let\caption@warmup\relax
%    \end{macrocode}
% \end{macro}
%
% \subsubsection{The changepage package}
% \changes{v3.4k}{2020/05/30}{Patch of the \package{changepage} package added}
%
%    \begin{macrocode}
\caption@IfPackageLoaded{changepage}[2008/07/23 memoir-v3.7k]{%
%    \end{macrocode}
%
% Both environments, \env{adjustwidth} and \env{adjustwidth*}, are starting a \env{list} \cs{item}.
% But \cs{hsize} isn't set properly inside a \env{list} item, and therefore \cs{@makecaption}
% (offered by document classes) doesn't work properly when used inside \env{adjustwidth}.
% Therefore we try to detect the situation ``Are we inside a adjustwidth environment?''
% inside \cs{@makecaption} and fix this. (Sigh!)
%
% We cannot simply set and test a flag here since our adjustment to \cs{hsize} should
% not be done within a \cs{parbox} within a adjustwidth environment for example,
% and therefore we store \cs{hsize} and \cs{linewidth}, and test \cs{hsize} and \cs{linewidth}
% against the stored values instead. If they are equal we are (hopefully) quite save
% to assume that we are now inside a plain \env{adjustwidth} environment and therefore need
% to fix \cs{hsize} before typesetting the caption. (Deep sigh!)
%
% \begin{macro}{\caption@adjustwidth@hsize}
% \begin{macro}{\caption@adjustwidth@linewidth}
%    \begin{macrocode}
  \newdimen\caption@adjustwidth@hsize
  \newdimen\caption@adjustwidth@linewidth
%    \end{macrocode}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\caption@set@adjustwidth}
% \changes{v3.4k}{2020/05/30}{This macro definition added}
% \changes{v3.5h}{2022/03/01}{Usage of \cs{AtBeginCaption} replaced by \cs{l@addto@macro}\cs{caption@beginex@hook}}
% Store the values of \cs{hsize} and \cs{linewidth}.
%    \begin{macrocode}
  \providecommand*\caption@set@adjustwidth{%
    \caption@adjustwidth@hsize\hsize
    \caption@adjustwidth@linewidth\linewidth
    \l@addto@macro\caption@beginex@hook\caption@test@adjustwidth}%
%    \end{macrocode}
%    \begin{macrocode}
  \providecommand*\caption@patch@changepage[1]{%
    \expandafter\let\csname caption@#1\expandafter\endcsname\csname #1\endcsname
    \expandafter\renewcommand\csname #1\endcsname[2]{%
      \@nameuse{caption@#1}{##1}{##2}%
      \caption@set@adjustwidth}}%
  \caption@patch@changepage{adjustwidth}%
  \caption@patch@changepage{adjustwidth*}%
  \let\caption@patch@changepage\relax
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\caption@test@adjustwidth}
% \changes{v3.4k}{2020/05/30}{This macro definition added}
% Test if the values of \cs{hsize} and \cs{linewidth} are identical to
% the ones stored in the \env{adjustwidth} environment.
% If yes, set \cs{hsize} to the correct value.
%    \begin{macrocode}
  \providecommand\caption@test@adjustwidth{%
    \ifdim\hsize=\caption@adjustwidth@hsize
      \ifdim\linewidth=\caption@adjustwidth@linewidth
        \hsize=\linewidth
      \fi
    \fi}%
%    \end{macrocode}
% \end{macro}
%
%    \begin{macrocode}
  }{}%
%    \end{macrocode}
%
% \subsubsection{The chkfloat package}
% \changes{v3.3}{2018/09/06}{Support of the \package{chkfloat} package added}
%
%    \begin{macrocode}
\caption@IfPackageLoaded{chkfloat}[2012/08/19 v0.1]{%
%    \end{macrocode}
%
% \begin{macro}{\caption@chkfloat}
% \changes{v3.3}{2018/09/06}{This macro added}
%    \begin{macrocode}
  \caption@ifdefined\chkfloat@addcontentsline{%
    \renewcommand\caption@chkfloat{\chkfloat@addcontentsline}%
  }{%
    \renewcommand\caption@chkfloat[2]{%
      \caption@ifdefined\chkfloat@page{%
        \addtocontents{fof}{\protect\chkfloat@{\thepage}{\chkfloat@page}{\csname fnum@#1\endcsname: #2}}%
      }{}}%
  }%
%    \end{macrocode}
% \end{macro}
%
%    \begin{macrocode}
  }{}%
%    \end{macrocode}
%
% \subsubsection{The float package}
% \changes{v3.0f}{2005/05/31}{\package{float} package support rewritten and improved}
% \iffalse
% (This is a more straight-ahead implementation, but it only works with \version{1.3}
%  now, so \version{1.2} is no longer supported.
% \fi
%
% The \package{float} package usually do not use the \LaTeX\ kernel command
% |\@caption| to typeset the caption but |\float@caption| instead.
% (|\@caption| will only be used if the float is re-styled with
% |\restylefloat*|.)
%
% The main two things |\float@caption| is doing different are:
% \begin{itemize}
%   \item The caption will be typeset inside a |\savebox| called |\@floatcapt|
%   so it can be placed above or below the float contents afterwards.
%   \item |\@makecaption| will not be used to finally typeset the caption.
%   Instead |\@fs@capt| will be used which definition is part of the float
%   style.
%   (Note that |\@fs@capt| will not typeset any vertical space above or below
%   the caption; instead this space will be typeset by the float style code
%   itself.)
% \end{itemize}
%
%    \begin{macrocode}
\caption@IfPackageLoaded{float}[2001/11/08 v1.3d]{%
 \@ifpackageloaded{floatrow}{%
  \caption@If@Package@Loaded{floatrow}[2007/08/24 v0.2a]{}{}%
 }{%
%    \end{macrocode}
%
% \begin{macro}{\@float@setevery}
% \changes{v3.1k}{2009/10/09}{Bugfix 08-12-05: \cs{color@begin/endgroup} added
%                             to redefinition of \cs{caption@setfloatcapt}}
% \changes{v3.4b}{2019/12/16}{Usage of \cs{caption@float@setname} added}
%  |\@float@setevery|\marg{float type} is provided by the \package{float}
%  package; it's called every time a floating environment defined with
%  |\newfloat| or |\restylefloat| begins.
%  We use this hook to do some adaptations and to setup the proper caption
%  style (if defined) and additional settings declared with
%  |\captionsetup|\oarg{float style}.
%    \begin{macrocode}
  \let\caption@ORI@float@setevery\@float@setevery
  \def\@float@setevery#1{%
    \float@ifcaption{#1}{%
%    \end{macrocode}
%
%  First of all we set the caption position to it's proper value by
%  converting |\@fs@iftopcapt| (which is part of a float style and
%  controls where the caption will be typeset, above or below the float
%  contents) to our |position=| setting.
%  Since the spacing above and below the caption will be done by the float
%  style and \emph{not} by us this sounds quite useless. But in fact it isn't,
%  since some packages based on \thispackage\ (like the \package{subfig}
%  package) could have an interest for this information and therefore use the
%  |\caption@iftop| macro we provide in our kernel. Furthermore we need this
%  information for ourself in |\captionof| which uses |\@makecaption| to
%  finally typeset the caption with skips.
%    \begin{macrocode}
      \caption@setposition{\@fs@iftopcapt t\else b\fi}%
%    \end{macrocode}
%
%  Afterward we redefine |\caption@setfloatcapt| (which will be used inside
%  |\@caption|) so the caption will be set inside the box |\@floatcapt|,
%  without extra vertical space.
%    \begin{macrocode}
      \renewcommand\caption@setfloatcapt[1]{%
        \let\@makecaption\caption@@make
        \global\setbox\@floatcapt\vbox{%
          \color@begingroup ##1\color@endgroup}}%
%    \end{macrocode}
%
%  To allow different caption styles for different float styles we also
%  determine the current float style (e.g. `ruled') and select
%  a caption style (and additional settings) with the same name, if defined.
%    \begin{macrocode}
      \float@getstyle\float@style{#1}%
      \caption@setstyle*\float@style
      \caption@setoptions\float@style
%    \end{macrocode}
%
%    \begin{macrocode}
    }{}%
    \caption@float@setname{#1}%
    \caption@freezeHref % will be defrosted in \float@makebox
    \caption@ORI@float@setevery{#1}}%
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\float@makebox}
% \changes{v3.3}{2013/01/06}{Corrects wrong load order hyperref-float now}
% \changes{v3.3}{2013/02/03}{Correction of wrong load order hyperref-float revised}
% Redefine |\float@makebox|:
%    \begin{macrocode}
  \caption@AtBeginDocument{%
%    \end{macrocode}
% If it was redefined by the \package{hyperref} package,
% we need to build on the original definition (and not on the redefined one).
%    \begin{macrocode}
    \caption@ifdefined\HyOrg@float@makebox
      {\let\caption@ORI@float@makebox\HyOrg@float@makebox}%
      {\let\caption@ORI@float@makebox\float@makebox}%
    \renewcommand\float@makebox[1]{%
      \caption@ORI@float@makebox{#1\relax \caption@defrostHref}}%
%    \end{macrocode}
%    \begin{macrocode}
  }%
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\caption@float@setname}
% \changes{v3.1}{2007/07/08}{float package hook added}
% \changes{v3.4b}{2019/12/16}{Renamed from \cs{caption@typehook} to \cs{caption@float@setname}}
%  \LaTeX\ and almost every other packages use
%    |\|\meta{type}|name|
%  to provide a macro for the type resp.~environment name -- for example
%  the command |\figurename| will usually contain the name of the floating
%  environment |figure|:
%  \begin{quote}
%    |\newcommand\figurename{Figure}|
%  \end{quote}
%  But the \package{float} package doesn't follow this common naming
%  convention:
%  For floats defined with |\newfloat| it uses |\fname@|\meta{type} instead,
%  which breaks with our code (and with |\autoref| and some other things as
%  well).
%  So we have to map the \package{float} package name to the common one here.\par
%  \Note{If the float was not defined with \cs{newfloat} but with
%  \cs{restylefloat} instead, \cs{fname@}\meta{type} is not defined.}
%    \begin{macrocode}
  \newcommand*\caption@float@setname[1]{%
    \expandafter\ifx\csname #1name\endcsname\relax
      \expandafter\let\csname #1name\expandafter\endcsname\csname fname@#1\endcsname
    \fi}%
%    \end{macrocode}
% \end{macro}
%
% \changes{v3.0f}{2005/06/26}{Skips of \env{plaintop} and \env{boxed} floats corrected}
% \begin{macro}{\fs@plaintop}
% \begin{macro}{\fs@boxed}
%  Since the float styles |plaintop| and |boxed| don't use |\abovecaptionskip|
%  which could be set with |skip=| (|plaintop| uses |\belowcaptionskip| instead of
%  |\abovecaptionskip|, and |boxed| uses a fixed space of |2pt|)
%  we patch the according float style macros here to change this.
%    \begin{macrocode}
  \g@addto@macro\fs@plaintop{\def\@fs@mid{\vspace\abovecaptionskip\relax}}%
  \g@addto@macro\fs@boxed{\def\@fs@mid{\kern\abovecaptionskip\relax}}%
%    \end{macrocode}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\float@getstyle}
% \changes{v3.1}{2007/06/10}{This macro added}
% |\float@getstyle|\marg{cmd}\marg{type}\par
%  Determining the float style is not so easy because the only hint
%  provided by the \package{float} package is the macro
%  |\fst@|\meta{float type} which points to the macro which represents the
%  float style. So for example after
%  \begin{quote}
%    |\floatstyle{ruled}|\\
%    |\newfloat{Program}{tbp}{lop}|
%  \end{quote}
%  |\fst@Program| will be defined as
%  \begin{quote}
%    |\def\fst@Program{\fs@ruled}|\quad.
%  \end{quote}\par
%  So here is what we do: We make the first level expansion of
%  |\fst@|\meta{float type} a string so we can gobble the first four tokens
%  (= |\fs@|), so only the the name of the float style is left.\par
%  \emph{TODO:} We need to convert the catcodes here.
%    \begin{macrocode}
  \providecommand*\float@getstyle[2]{%
    \edef#1{%
      \noexpand\expandafter\noexpand\@gobblefour\noexpand\string
        \expandafter\expandafter\expandafter\noexpand
          \csname fst@#2\endcsname}%
    \edef#1{#1}%
    \caption@Debug{floatstyle{#2} = `#1'}}%
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\float@ifcaption}
% \changes{v3.1}{2007/06/23}{This macro added}
% |\float@ifcaption|\marg{type}\marg{if-clause}\marg{else-clause}\par
%  Here we determine if the user has used |\newfloat| resp.~|\restylefloat|,
%  or |\restylefloat*|.
%  This is quite easy: If |\@float@c@|\meta{captype} is the same as
%  |\float@caption|, the user has used |\newfloat| or |\restylefloat|,
%  otherwise we assume he has used |\restylefloat*|.
%  (This test will fail if some package re-defines |\float@caption|,
%  so we have to assume that there is no one.)
%    \begin{macrocode}
  \providecommand*\float@ifcaption[1]{%
    \expandafter\ifx\csname @float@c@#1\endcsname\float@caption
      \expandafter\@firstoftwo
    \else
      \expandafter\@secondoftwo
    \fi}%
%    \end{macrocode}
% \end{macro}
%
%    \begin{macrocode}
}}{%
  \providecommand*\float@ifcaption[1]{\@secondoftwo}%
% \clearcaptionsetup{boxed}% used by the floatrow package?
}
%    \end{macrocode}
%
% The skip between `boxed' floats and their caption defaults to |2pt|.
%
%    \begin{macrocode}
\captionsetup[boxed]{skip=2pt} % do not issue a warning when not used
%    \end{macrocode}
%
% \changes{v3.0f}{2005/05/26}{\opt{strut=0} added to caption style \opt{ruled}}
% \changes{v3.0f}{2005/05/27}{Option \opt{ruled} fixed}
% To emulate the `ruled' definition of |\@fs@capt| we provide a caption style
% `ruled' with appropriate options. But if the package option |ruled| was
% specified, we setup some caption parameters to emulate the behavior
% of \thispackage\ \version{1.x} option |ruled| instead, i.e.,
% the current caption settings will be used, but without margin and without
% `single-line-check'.
%    \begin{macrocode}
\caption@ifbool{ruled}{%
  \captionsetup[ruled]{margin=0pt,minmargin=0,slc=0}%
}{%
  \DeclareCaptionStyle{ruled}{labelfont=bf,labelsep=space,strut=0}%
}
\caption@undefbool{ruled}
%    \end{macrocode}
%
% \subsubsection{The floatflt package}
% \changes{v3.1}{2007/06/10}{Support of the \package{floatflt} package added}
%
%    \begin{macrocode}
\caption@IfPackageLoaded{floatflt}[1996/02/27 v1.3]{%
%    \end{macrocode}
%
% \begin{macro}{\floatingfigure}
% We patch |\floatingfigure| so |\caption@floatflt| will be used.
%    \begin{macrocode}
  \let\caption@ORI@floatingfigure\floatingfigure
  \def\floatingfigure{%
    \caption@floatflt{figure}%
    \caption@ORI@floatingfigure}%
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\floatingtable}
% Same with |\floatingtable|\ldots
%    \begin{macrocode}
  \let\caption@ORI@floatingtable\floatingtable
  \def\floatingtable{%
    \caption@floatflt{table}%
%   \caption@setautoposition b%
    \caption@ORI@floatingtable}%
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\caption@floatflt}
% \changes{v3.1c}{2007/10/06}{Bugfix: \cs{caption@clearmargin} added}
%  Here we do two things:
%  \begin{enumerate}
%    \item We use |\caption@set|\-|options{|\-|floating|\meta{type}|}| so
%       |\caption|\-|setup[|\-|floating|\meta{type}|]{|\ldots|}| is supported.
%    \item |\line|\-|width| must be set correctly.
%       Usually this is done by |\@par|\-|box|\-|restore| inside |\@caption|,
%       but since we use |\@caption@parbox|\-|restore| we have to map this to
%       |\@par|\-|box|\-|restore| instead.
%  \end{enumerate}
%    \begin{macrocode}
  \newcommand*\caption@floatflt[1]{%
    \caption@settype{#1}%
    \caption@clearmargin
    \caption@setoptions{floating#1}}%
%    \end{macrocode}
% \end{macro}
%
%    \begin{macrocode}
}{}
%    \end{macrocode}
%
% \subsubsection{The fltpage package}
% \changes{v3.1}{2007/07/22}{Support of the \package{fltpage} package added}
%
%    \begin{macrocode}
\caption@IfPackageLoaded{fltpage}[1998/10/29 v.0.3]{%
  \caption@setbool{needfreeze}{1}%
%    \end{macrocode}
%
% \begin{macro}{\FP@positionLabel}
% \changes{v3.2c}{2011/08/28}{This redefinition added}
% Original code:
% \begin{verbatim}
% \newcommand{\FP@positionLabel}{%
%   FP\@captype-\number\value{FP@\@captype C}-pos}
% \end{verbatim}%^^A
%    \begin{macrocode}
  \renewcommand\FP@positionLabel{%
    FP\FP@captype-\number\value{FP@\FP@captype C}-pos}%
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\FP@helpNote}
% Original code:
% \begin{verbatim}
% \newcommand{\FP@helpNote}[2]{%
%   \typeout{FP#1 is inserted on page \pageref{#2}!}}%
% \end{verbatim}%^^A
%    \begin{macrocode}
  \renewcommand\FP@helpNote[2]{%
    \begingroup % save \caption@thepage
      \caption@pageref{#2}%
      \typeout{FP#1 is inserted on page \caption@thepage!}%
    \endgroup}%
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\FP@floatBegin}
% \changes{v3.1f}{2007/11/16}{Uses `space hack' instead of \cs{ignorespaces} now}
% \changes{v3.1k}{2009/10/09}{Bugfix 09-09-11: Missing \cs{ignorespaces} added}
% \changes{v3.2c}{2011/08/28}{Adapted to current version of \cs{caption@freeze}}
% \changes{v3.2f}{2012/02/19}{Bugfix 12-02-16: \texttt{minipage} environment added}
% \changes{v3.3}{2013/05/01}{Usage of \cs{caption@freeze} replaced by \cs{caption@freezetype}}
% Original code:
% \begin{verbatim}
% \newcommand{\FP@floatBegin}[1]{%
%   \gdef\@captype{#1}%
%   \global\let\FP@savedCaptionCommand\caption%
%   \global\let\FP@savedLabelCommand\label%
%   \ifthenelse{\equal{\@captype}{figure}}
%      {\global\let\old@Fnum\fnum@figure}%
%      {\global\let\old@Fnum\fnum@table}%
%   \let\FP@LabelText\@empty%
%   \let\FP@CaptionText\@empty%
%   \let\FP@optionalCaptionText\@empty%
%   \renewcommand\label[1]{\gdef\FP@LabelText{##1}}%
%   \renewcommand\caption[2][]{%
%     \gdef\FP@optionalCaptionText{##1}\gdef\FP@CaptionText{##2}}%
%   \begin{lrbox}{\FP@floatCorpusBOX}%
% }%
% \end{verbatim}%^^A
%    \begin{macrocode}
  \renewcommand*\FP@floatBegin[1]{%
    \def\FP@captype{#1}%
    \begin{lrbox}{\FP@floatCorpusBOX}%
    \minipage\hsize % changes from LR mode to vertical mode
    \caption@freezetype{#1}%
    \ignorespaces}%
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\FP@floatEnd}
% \changes{v3.1g}{2008/01/30}{Some minor bugfixes}
% \changes{v3.2c}{2011/08/28}{Adapted to current version of \cs{caption@freeze}}
% \changes{v3.2f}{2012/02/19}{Bugfix 12-02-16: \texttt{minipage} environment added}
% Original code:
% \begin{verbatim}
% \newcommand{\FP@floatEnd}{%
%   \end{lrbox}%
%   \global\setbox\FP@floatCorpusBOX=\box\FP@floatCorpusBOX
%   \stepcounter{FP@\@captype C}%
%   \FP@savedLabelCommand{\FP@positionLabel}%
%   \FP@helpNote{\@captype}{\FP@positionLabel}%
%   \FP@float
%     {\FP@positionLabel}% location label test
%     {\begin{\@captype}[p!]
%        \usebox{\FP@floatCorpusBOX}%
%        \refstepcounter{\@captype}%
%        \ifthenelse{\equal{\FP@LabelText}{\@empty}}
%          {}{\FP@savedLabelCommand{\expandafter\protect\FP@LabelText}}%
%      \end{\@captype}}
%     {\addtocounter{\@captype}{-1}}
%     {\begin{\@captype}[b!]%
%        \ifthenelse{\equal{\FP@guide}{\@empty}}%
%          {}{\ifthenelse{\equal{\@captype}{figure}}%
%              {\renewcommand{\fnum@figure}{\old@Fnum\ {\FP@guide}}}%
%              {\renewcommand{\fnum@table}{\old@Fnum\ {\FP@guide}}}}%
%        \setlength{\abovecaptionskip}{2pt plus2pt minus 1pt} % length above caption
%        \setlength{\belowcaptionskip}{2pt plus2pt minus 1pt} % length above caption
%        \FP@separatorCaption%
%        \ifthenelse{\equal{\FP@optionalCaptionText}{\@empty}}%
%          {\FP@savedCaptionCommand{\expandafter\protect\FP@CaptionText}}%
%          {\FP@savedCaptionCommand[\expandafter\protect\FP@optionalCaptionText]%
%                                  {\expandafter\protect\FP@CaptionText}}%
%      \end{\@captype}}%
% }%
% \end{verbatim}%^^A
%    \begin{macrocode}
  \renewcommand*\FP@floatEnd{%
    \endminipage
    \end{lrbox}%
%    \end{macrocode}
%    \begin{macrocode}
    \stepcounter{FP@\FP@captype C}%
    \caption@label\FP@positionLabel
    \FP@helpNote\FP@captype\FP@positionLabel
%    \end{macrocode}
%    \begin{macrocode}
    \FP@float
      {\FP@positionLabel}% location label test
      {\caption@prepare@defrost
       \begin\FP@captype[p!]%
         \usebox\FP@floatCorpusBOX
       \end\FP@captype}%
      {\@ifundefined{theH\FP@captype}{}{%
         \expandafter\l@addto@macro\csname theH\FP@captype\endcsname{.FP}}}%
      {\caption@prepare@defrost
       \begin\FP@captype[b!]%
         \let\FP@savedSetfnumCommand\caption@setfnum
         \def\caption@setfnum##1{%
           \FP@savedSetfnumCommand{##1}%
           \ifx\FP@guide\@empty \else
             \expandafter\l@addto@macro\csname fnum@##1\endcsname{\ {\FP@guide}}%
           \fi}%
         \setlength\abovecaptionskip{2pt plus 2pt minus 1pt}% length above caption
         \setlength\belowcaptionskip{2pt plus 2pt minus 1pt}% length below caption
         \caption@setoptions{FP\@captype}%
         \FP@separatorCaption
         \caption@defrost
       \end\FP@captype}%
  }%
%    \end{macrocode}
% \end{macro}
%
%    \begin{macrocode}
}{%
  \let\caption@ifFPlistcap\@undefined
  \let\caption@ifFPrefcap\@undefined
}
%    \end{macrocode}
%
% \subsubsection{The hyperref package}
% \changes{v3.0f}{2005/06/11}{Support of the \package{hyperref} package added}
% \changes{v3.1}{2007/03/09}{Usage of \cs{hyper@makecurrent} instead of
%   \cs{theHfigure} as indicator for \package{hyperref} package}
% \changes{v3.2}{2011/07/30}{Test if \package{hyperref} has stopped early revised}
% \changes{v3.2c}{2011/08/24}{Test if \package{hyperref} has stopped early adapted to current version of \package{hyperref} package: Usage of \cs{IfHyperBoolean} added}
%
%    \begin{macrocode}
\caption@IfPackageLoaded{hyperref}[2003/11/30 v6.74m]{%
  % Test if hyperref has stopped early
  \caption@ifundefined\IfHyperBoolean{%
    \caption@set@bool\caption@ifhyp@stoppedearly0%
    \caption@ifundefined\H@refstepcounter
      {\caption@set@bool\caption@ifhyp@stoppedearly1}{%
    \caption@ifundefined\hyper@makecurrent
      {\caption@set@bool\caption@ifhyp@stoppedearly1}{%
    \caption@ifundefined\measuring@true
      {\caption@set@bool\caption@ifhyp@stoppedearly1}{}}}%
  }{%
    \def\caption@ifhyp@stoppedearly{\IfHyperBoolean{stoppedearly}}%
  }%
  \caption@ifhyp@stoppedearly{% hyperref has stopped early
    \caption@InfoNoLine{%
      Hyperref support is turned off\MessageBreak
      because hyperref has stopped early}%
  }{%
    \AtCaptionSingleLineCheck{\measuring@true}%
%    \end{macrocode}
%
% \begin{macro}{\caption@refstepcounter@}
% We redefine |\caption@refstepcounter@| so |\H@refstepcounter| will be used
% instead of |\refstepcounter| inside |\caption| \& |\captionlistentry|.
%    \begin{macrocode}
    \renewcommand*\caption@refstepcounter@{\H@refstepcounter}%
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\caption@makecurrent}
% \changes{v3.1l}{2010/01/09}{Adapted to current version of nameref package}
% We redefine |\caption@makecurrent| so a \package{hyperref} label
% will be defined inside |\@caption|.
% \Note{Will be redefined by \cs{caption@start}.}
%    \begin{macrocode}
    \renewcommand*\caption@makecurrent[2]{%
      \caption@makecurrentHref{#1}%
      \caption@Debug{hyperref current=\@currentHref}%
      \caption@gettitle{#2}}%
%    \end{macrocode}
%    \begin{macrocode}
    \newcommand*\caption@makecurrentHref{\hyper@makecurrent}%
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\caption@makeanchor}
% \changes{v3.1l}{2010/01/09}{Adapted to the current hyperref package}
% We redefine |\caption@makeanchor| so a \package{hyperref} anchor
% will be set inside |\@caption|.
% \Note{Will be redefined by \cs{caption@start}.}
%    \begin{macrocode}
    \renewcommand\caption@makeanchor[1]{%
      \caption@Debug{hyperref anchor: \@currentHref}%
      % If we cannot have nesting, the anchor is empty.
      \ifHy@nesting
        \expandafter\hyper@@anchor\expandafter{\@currentHref}{#1}%
      \else
        \Hy@raisedlink{%
          \expandafter\hyper@@anchor\expandafter{\@currentHref}{\relax}%
        }#1%
      \fi}%
%    \end{macrocode}
%    \begin{macrocode}
    \AtCaptionSingleLineCheck{\let\caption@makeanchor\@firstofone}%
%    \end{macrocode}
% \end{macro}
%
% \paragraph{The hypcap option}
%
% \begin{macro}{\if@capstart}
% Like the \package{hypcap} package we define the switch |\if@capstart|, too.
%    \begin{macrocode}
    \newif\if@capstart
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\caption@start}
% \changes{v3.0l}{2007/02/20}{%
%         \cs{caption@currentHref} renamed to \cs{hc@currentHref}}
% \changes{v3.1}{2007/06/21}{%
%         This macro renamed from \cs{capstart} to \cs{caption@start} and revised}
% While the \package{hypcap} package defines a macro called |\capstart|
% our variant is called |\caption@start| and is controlled by the option
% |hypcap=||false|/|true|.
%    \begin{macrocode}
    \def\caption@start{\caption@ifhypcap\caption@start@\relax}%
    \def\caption@start@{%
%    \end{macrocode}
% Generate the \package{hyperref} label and set the \package{hyperref} anchor,
% usually (if |hypcap=false|) both is done inside |\@caption|.
%    \begin{macrocode}
      \caption@makestart\@captype
      \caption@startanchor\@currentHref
%    \end{macrocode}
% Prevent |\@caption| from generating a new \package{hyperref} label,
% use the label we save in |\hc@currentHref| instead.
% (We also support the |@capstart| flag from the \package{hypcap} package.)
%    \begin{macrocode}
      \global\@capstarttrue
      \let\hc@currentHref\@currentHref
      \def\caption@makecurrentHref##1{%
        \global\@capstartfalse
        \global\let\@currentHref\hc@currentHref}%
%    \end{macrocode}
% Prevent |\@caption| from generating a \package{hyperref} anchor since this
% has already been done.
%    \begin{macrocode}
      \let\caption@makeanchor\@firstofone
%    \end{macrocode}
%    \begin{macrocode}
    }%
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\caption@makestart}
% \changes{v3.1c}{2007/09/30}{\cs{@currentHref} will be extended by \texttt{caption}
%        instead of \texttt{xxx} now}
%  |\caption@makestart|\marg{type}
%  defines a \package{hyperref} anchor inside |\caption@start|.\par
%  Since we offer |\continuedfloat| the float counter can change between
%  `now' and |\caption|, i.e., we simply don't know the figure or table counter
%  yet and therefore we are not able to generate the `right' \package{hyperref}
%  label.
%  Two different solutions of this problem came into my mind:
%  \begin{enumerate}
%  \item I could use the aux file for this purpose.\par
%  -or-
%  \item I set |hypertexnames=false| locally.
%  Furthermore I use |#1.caption.|\meta{counter} (instead of |#1.|\meta{counter})
%  as naming scheme for |\@currentHref| to avoid conflicts with other hyper
%  links which are generated with |hypertexnames=true|.
%  \end{enumerate}
%  The first idea has the advantage that the `right' anchor name will be
%  generated, but one needs an additional \LaTeX\ run if figures or tables
%  will be inserted or removed.\par
%  The second idea has the advantage that it's very easy to implement, but
%  has some side-effects, e.g. the anchor names don't follow the figure or
%  table label names anymore.\par
%  Since I'm lazy I implemented the second idea, maybe I will revise this
%  later on.
%    \begin{macrocode}
    \newcommand*\caption@makestart[1]{%
      \begingroup
        \Hy@hypertexnamesfalse
%       \gdef\@currentHlabel{}%
        \hyper@makecurrent{#1.caption}%
      \endgroup
      \caption@Debug{hypcap start=\@currentHref}}%
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\caption@startanchor}
% \changes{v3.1b}{2007/09/17}{Bugfix 06-09-17: We use \cs{caption@anchor} instead of \cs{hyper@@anchor}}
% \changes{v3.1g}{2008/03/16}{Warning about TeX mode replaced with debug info}
% |\caption@startanchor|\marg{Href}
% sets a \package{hyperref} anchor inside |\caption@start|.\par
% This code was taken from the \package{hypcap} package\cite{hypcap} and adapted.
% \Note{Since \cs{hyper@@anchor}\marg{Href}\csmarg{\string\relax} can cause
% a change from vertical mode to horizontal mode (design flaw in
% \package{hyperref} package!?), and since the workaround
% \cs{let}\cs{leavevmode}\cs{relax} which can be found in the
% \package{hypcap} package is not always sufficient
% (for example with ``Direct pdfmark support'' and \texttt{breaklinks=true}),
% we use \cs{caption@anchor} instead of \cs{hyper@@anchor} here.}
%    \begin{macrocode}
    \newcommand*\caption@startanchor[1]{%
      \ifvmode\begingroup
        \caption@Debug{hypcap anchor: #1 (vertical mode)}%
        \@tempdima\prevdepth
        \nointerlineskip
        \vspace*{-\caption@hypcapspace}%
        \caption@anchor{#1}%
        \vspace*{\caption@hypcapspace}%
        \prevdepth\@tempdima
      \endgroup\else
        \caption@Debug{hypcap anchor: #1 (horizontal mode)}%
        \caption@anchor{#1}%
      \fi}%
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\caption@anchor}
% \changes{v3.1c}{2007/10/17}{Workaround 07-10-17: We use \cs{caption@raisedlink} instead of \cs{Hy@raisedlink} now}
% |\caption@anchor|\marg{Href} sets a \package{hyperref} anchor.
%    \begin{macrocode}
    \newcommand*\caption@anchor[1]{%
      \ifmeasuring@ \else
        \caption@raisedlink{\hyper@anchorstart{#1}\hyper@anchorend}%
      \fi}%
%    \end{macrocode}
% \Note{Since \cs{Hy@raisedlink} change \cs{@tempdima} we surrounded it by \cs{ifvmode},
% suppressing ``\texttt{LaTeX Warning: Float too large for page by 1.0pt}'' in \texttt{sideways} floats.
% (This is not necessary since \package{hyperref} \version{6.77}.)}
%    \begin{macrocode}
    \ifx\HyperRaiseLinkLength\@tempdima
      \def\caption@raisedlink#1{\ifvmode#1\else\Hy@raisedlink{#1}\fi}%
    \else
      \let\caption@raisedlink\Hy@raisedlink
    \fi
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\caption@@start}
% Will be used by |\caption@freezeHref|. Apart from that we issue a warning
% if we expect a saved \package{hyperref} label coming from |\caption@start|,
% but there isn't any.
%    \begin{macrocode}
    \def\caption@@start{%
      \caption@ifundefined\hc@currentHref{%
        \caption@Warning{%
          The option `hypcap=true' will be ignored for this\MessageBreak
          particular \string\caption}}{}}%
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\caption@freezeHref}
%  Suppress |\caption@start| from generating a \package{hyperref} label and
%  setting a \package{hyperref} anchor. Instead if |\@caption| generates a
%  \package{hyperref} label, it will be stored in |\caption@currentHref|.
%  Furthermore we need to redefine |\caption@setfloatcapt| so no
%  \package{hyperref} anchor will be placed in |\@caption|.
% \iffalse
%  (Since |\caption@setfloatcapt| will be set to |\@firstofone| inside
%   |\subcaption| there is no need to add its restauration to
%   |\caption@subtypehook|.)
% \fi
%    \begin{macrocode}
    \def\caption@freezeHref{%
      \let\caption@ORI@start\caption@start
      \def\caption@start{\let\caption@start\caption@ORI@start}%
%    \end{macrocode}
%    \begin{macrocode}
%     \let\caption@ORI@@start\caption@@start
%     \l@addto@macro\caption@subtypehook{%
%       \let\caption@@start\caption@ORI@@start}%
%    \end{macrocode}
%    \begin{macrocode}
      \global\let\caption@currentHref\@undefined
      \def\caption@@start{\global\let\caption@currentHref\@currentHref}%
%    \end{macrocode}
%    \begin{macrocode}
      \let\caption@ORI@setfloatcapt\caption@setfloatcapt
      \renewcommand*\caption@setfloatcapt{%
        \ifx\caption@currentHref\@undefined \else
          \let\caption@makeanchor\@firstofone
        \fi
        \caption@ORI@setfloatcapt}}%
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\caption@defrostHref}
%  If there is a freezed |\@currentHref|, we set the \package{hyperref}
%  anchor here.
%    \begin{macrocode}
    \def\caption@defrostHref{%
      \ifx\caption@currentHref\@undefined \else
        \caption@startanchor\caption@currentHref
        \global\let\caption@currentHref\@undefined
      \fi}%
%    \end{macrocode}
% \end{macro}
%
%    \begin{macrocode}
  }}{}
%    \end{macrocode}
%
% \subsubsection{The hypcap package}
% \changes{v3.0f}{2005/06/22}{Support of the \package{hypcap} package added}
% \changes{v3.0l}{2007/02/20}{Adapted to \package{hypcap} \version{1.6}}
% \changes{v3.1e}{2007/11/04}{\package{hypcap} support adapted to \package{hyperref} \version{6.77}}
%
%    \begin{macrocode}
\caption@IfPackageLoaded{hypcap}{% v1.0
  \ifx\caption@start\relax \else % hyperref hasn't stopped early
%    \end{macrocode}
%
% If the \package{hypcap} package was loaded, we give up our own
% hyperlink placement algorithm and give the control over the placement
% to the \package{hypcap} package instead.
%
% \begin{macro}{\capstart}
% \changes{v3.1k}{2009/10/09}{Support of \cs{ifcapstart} (\package{hypcap} package \version{1.10}) added}
% We do this simply by mapping |\capstart| to |\caption@start@|,
% although our code does not behave exactly like the original one:
% The original |\capstart| has an effect on the next |\caption|
% only but our version affects \emph{all} |\caption|s in the same
% environment, at least unless a new |\capstart| will be placed.
%    \begin{macrocode}
    \caption@ifundefined\capstarttrue % check for v1.10 of hypcap package
      {\def\capstart{\caption@start@}}%
      {\def\capstart{\ifcapstart\caption@start@\fi}}%
    \let\caption@start\relax
    \let\caption@@start\relax
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\caption@hypcapspace}
% Furthermore we map our |\caption@hypcapspace| to |\hypcapspace|
% offered by the \package{hypcap} package.
%    \begin{macrocode}
    \caption@set@bool\caption@ifhypcap 1%
    \renewcommand*\caption@hypcapspace{\hypcapspace}%
%    \end{macrocode}
% \end{macro}
%
%    \begin{macrocode}
  \fi}{}
%    \end{macrocode}
%
% \subsubsection{The listings package}
% \changes{v3.0b}{2004/05/16}{Support of the \package{listings} package added}
%
%    \begin{macrocode}
\caption@IfPackageLoaded{listings}[2004/02/13 v1.2]{%
%    \end{macrocode}
%
% \begin{macro}{\lst@MakeCaption}
% \changes{v3.1g}{2008/01/20}{Bugfix: Skips are handled correctly now}
% \changes{v3.1k}{2008/03/29}{Bugfix 08-10-16-dctt: \texttt{rule=0} added}
% \changes{v3.2}{2010/10/26}{Bugfix 10-07-20a: Set \cs{hsize} to \cs{linewidth}, if necessary}
% \changes{v3.4c}{2020/01/01}{Ugly workaround for usage in lists added}
% \changes{v3.4d}{2020/01/01}{Ugly workaround for usage in lists revised}
% \changes{v3.6}{2021/01/04}{Re-definition of \cs{addcontentsline} added}
%  To support the \package{listings} package we need to redefine
%  |\lst@Make|\-|Caption| so the original stuff is nested with
%  |\caption@begin| and |\caption@end| etc.\par
% We set a flag inside the "Init" hook of the \package{listings} package (where adaption of |\line|\-|width| etc.~takes place).
%    \begin{macrocode}
  \caption@setbool{lst@Init}{0}%
  \lst@AddToHook{Init}{\caption@setbool{lst@Init}{1}}%
%    \end{macrocode}
%    \begin{macrocode}
  \let\caption@ORI@lst@MakeCaption\lst@MakeCaption
  \renewcommand*\lst@MakeCaption[1]{% #1 is `t' or `b'
%    \end{macrocode}
% This macro is always called twice by the \package{listings} package (with `t' resp. `b' as parameter),
% therefore we need an extra group here.
%    \begin{macrocode}
    \begingroup
%    \end{macrocode}
% Inside lists the \package{listings} package ignores the left margin (|\@total|\-|left|\-|margin|) for captions.
% We emulate this behaviour by adding a negative skip which will be typeset ahead of |\caption@box|.\par
% Note: We only need to do this if the ``Init'' hook of the \package{listings} package wasn't called yet.
%    \begin{macrocode}
      \caption@iflst@Init{}{%
        \edef\caption@lst@leftskip{\noexpand\hskip-\the\@totalleftmargin\noexpand\relax}%
        \l@addto@macro\caption@beginhook\caption@lst@leftskip}%
%    \end{macrocode}
% We set |position=#1| and if it was set to `top',
% we swap the skips so the default behavior of the \package{listings} package
% will not be changed. (Note that the \package{listings} package has set its
% own |\abovecaptionskip| \& |\belowcaptionskip| values prior to calling
% \cs{lst@MakeCaption}.)
%    \begin{macrocode}
      \caption@setposition{#1}%
      \caption@iftop{%
        \@tempdima\belowcaptionskip
        \belowcaptionskip\abovecaptionskip
        \abovecaptionskip\@tempdima}{}%
%    \end{macrocode}
% Workaround for issue with wrong skips (FIXME: This should be examined further)
%    \begin{macrocode}
      \caption@setup{rule=0}%
%    \end{macrocode}
% Afterwards we set the local `lstlisting' options.
%    \begin{macrocode}
      \caption@setoptions{lstlisting}%
%    \end{macrocode}
% If the |position=| is now set to |auto|, we take over the |captionpos=|
% setting from the \package{listings} package.
%    \begin{macrocode}
      \caption@setautoposition{#1}%
%    \end{macrocode}
%    \begin{macrocode}
% We re-define |\addcontentsline| so our list format gets used for the lol entry etc.
      \ifx\lst@@caption\@empty \else
        \let\caption@ORI@addcontentsline\addcontentsline
        \renewcommand*\addcontentsline[3]{%
          \let\addcontentsline\caption@ORI@addcontentsline
          \caption@addcontentsline{lstlisting}{\lst@@caption}}%
      \fi
%    \end{macrocode}
% At the end we do similar stuff as in our \cs{@caption} code.
%    \begin{macrocode}
      \caption@begin{lstlisting}%
        \caption@ORI@lst@MakeCaption{#1}%
      \caption@end
%    \end{macrocode}
%    \begin{macrocode}
    \endgroup}%
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\lst@makecaption}
% \begin{macro}{\lst@maketitle}
% Wrapper macros for typesetting the |caption=| resp. |title=| value.
%    \begin{macrocode}
  \def\lst@makecaption{\caption@starfalse\@makecaption}%
  \def\lst@maketitle{\caption@startrue\@makecaption\@empty}%
%    \end{macrocode}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\ext@lstlisting}
% \changes{v3.1}{2007/03/03}{This macro added}
% Since the \package{listings} package do not define |\ext@lstlisting|
% but we needed it when |\captionof{lstlisting}| will be done by the end user,
% we define it here.
%    \begin{macrocode}
  \providecommand*\ext@lstlisting{lol}%
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\lst@@caption}
% \changes{v3.1}{2007/03/03}{This macro added}
% \changes{v3.1a}{2007/07/13}{Bugfix 07-09-13: \cs{lst@@caption} will not be re-defined anymore}
% \changes{v3.2}{2010/10/26}{Bugfix 09-05-15: Setting of \cs{lst@@caption} added to \cs{caption@beginex}}
% \changes{v3.5h}{2022/03/01}{Re-definition of \cs{lst@@caption} moved from \cs{caption@beginex} to \cs{caption@beginex@hook}}
% We define |\lst@@caption| to non-|\@empty|, so |\fnum@lst|\-|listing| will
% include a numbering.
%    \begin{macrocode}
  \l@addto@macro\caption@beginex@hook{\let\lst@@caption\relax}%
%    \end{macrocode}
% \end{macro}
%
%    \begin{macrocode}
}{}
%    \end{macrocode}
%
% \subsubsection{The longtable package}
%
% \begin{macro}{\LTcaptype}
% \changes{v3.1}{2007/07/06}{This macro and its support added}
%  |\LTcaptype| is preset to |table|.
%    \begin{macrocode}
\providecommand*\LTcaptype{table}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\caption@AtBeginLongtable}
% \changes{v3.5}{2018/04/15}{This macro added}
%    \begin{macrocode}
\providecommand*\caption@LT@array{}
\newcommand\caption@AtBeginLongtable{%
  \g@addto@macro\caption@LT@array}
%    \end{macrocode}
% \end{macro}
%
%    \begin{macrocode}
\caption@IfPackageLoaded{longtable}[1995/05/24 v3.14]{%
%    \end{macrocode}
%    \begin{macrocode}
  \RequirePackage{ltcaption}[2018/08/26]%
  \let\LT@@makecaption\@undefined
%    \end{macrocode}
%
% \begin{macro}{\LT@array}
% \changes{v3.1}{2007/07/22}{This redefinition added}
% \changes{v3.1a}{2007/09/16}{Bugfix: This redefinition will always be done \cs{AtBeginDocument}}
% \changes{v3.1g}{2008/01/20}{Bugfix in \cs{captionlistentry}: Table counter will not be incremented anymore, \cs{nameref} works}
% \changes{v3.3}{2016/01/31}{Support for \cs{bicaption} added}
% \changes{v3.3}{2018/10/05}{Definition of \cs{captionlistentry} fixed}
% \changes{v3.5}{2018/04/15}{Usage of \cs{caption@AtBeginLongtable} added}
% \changes{v3.6}{2022/01/05}{Usage of \cs{caption@Error} replaced by \cs{caption@OutsideFloat}}
% We redefine |\LT@array| here to get |\captionsetup|\marg{options} working inside |longtable|s.
% \Note{Since the \package{hyperref} package patches \cs{LT@array} as well
%  and since this only works with the original definition of \cs{LT@array},
%  we have to do this after the \package{hyperref} package, i.e.~\cs{AtBeginDocument}.}
%    \begin{macrocode}
  \caption@AtBeginDocument{%
    \let\caption@ORI@LT@array\LT@array
    \renewcommand*\LT@array{%
      \caption@LT@array
      \caption@ORI@LT@array}}%
%    \end{macrocode}
%    \begin{macrocode}
  \caption@AtBeginLongtable{%
% |\captionsetup| for longtable:
%    \begin{macrocode}
    \global\let\caption@opt@@longtable\@undefined
    \def\captionsetup{%
      \noalign\bgroup
      \@ifstar\@captionsetup\@captionsetup}% gobble *
    \def\@captionsetup#1{\LT@captionsetup{#1}\egroup}%
    \def\LT@captionsetup#1{%
      \captionsetup@startrue\caption@setup@options[@longtable]{#1}%
      \global\let\caption@opt@@longtable\caption@opt@@longtable}%
%    \end{macrocode}
% |\captionlistentry| for longtable:
%    \begin{macrocode}
    \def\captionlistentry{%
      \noalign\bgroup
      \@ifstar{\egroup\LT@listentry\LTcaptype}% gobble *
              {\egroup\LT@listentry\LTcaptype}}%
%    \end{macrocode}
% |\continuedfloat| for longtable:\\
% {\small(Commented out, since it's not deeply tested and quite useless anyway)}
% \Note{\package{hyperref} versions $<$ v6.76j uses $2\times$ \cs{hyper@makecurrent}}
%    \begin{macrocode}
%   \caption@ifhypcap{%
%     \let\caption@ORI@hyper@makecurrent\hyper@makecurrent
%     \def\hyper@makecurrent##1{%
%       \let\hyper@makecurrent\caption@ORI@hyper@makecurrent
%       \caption@makestart{##1}%
%%      \let\Hy@LT@currentHlabel\@currentHlabel
%       \let\Hy@LT@currentHref\@currentHref
%       \def\hyper@makecurrent####1{%
%%        \let\@currentHlabel\Hy@LT@currentHlabel
%         \let\@currentHref\Hy@LT@currentHref}}%
%     \let\caption@ORI@continuedfloat\continuedfloat
%     \def\continuedfloat{\noalign{%
%       \gdef\caption@setContinuedFloat{%
%         \let\caption@reset@continuedfloat\@gobble}%
%       \def\caption@setoptions##1{%
%         \g@addto@macro\caption@setContinuedFloat{%
%           \caption@setoptions{##1}}}%
%       \let\@captype\LTcaptype
%       \caption@ORI@ContinuedFloat}}%
%   }{%
%     \def\continuedfloat{\noalign{%
%       \caption@Error{%
%         \noexpand\continuedfloat inside longtables\MessageBreak
%         is only available with `hypcap=true'}}}%
%   }%
%   \global\let\caption@setContinuedFloat\@empty
    \def\continuedfloat{\noalign{%
      \caption@OutsideFloat\continuedfloat}}%
%    \end{macrocode}
% |\bicaption| for longtable:
%    \begin{macrocode}
    \let\bicaption\LT@bicaption
%    \end{macrocode}
%    \begin{macrocode}
  }%
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\LT@capti@n}
% \changes{v3.3}{2016/02/01}{This re-definition added}
%  The original implementation:
%  \begin{verbatim}
%  \def\LT@capti@n{%
%    \@ifstar
%      {\egroup\LT@c@ption\@gobble[]}%
%      {\egroup\@xdblarg{\LT@c@ption\@firstofone}}}
%  \end{verbatim}%^^A
%  Our implementation uses |\caption@xdblarg| instead of |\@xdblarg|:
%    \begin{macrocode}
  \def\LT@capti@n{%
    \@ifstar
      {\egroup\LT@c@ption\@gobble[]}%
      {\egroup\caption@xdblarg{\LT@c@ption\@firstofone}}}%
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\LT@makecaption}
% \changes{v3.0d}{2004/08/10}{Bugfix 04-08-04: \cs{abovecaptionskip} \& \cs{belowcaptionskip} will be used now}
% \changes{v3.0e}{2005/05/05}{Bugfix: \cs{captionsetup[longtable]} overrides \cs{LTcapwidth} now}
% \changes{v3.0h}{2005/10/07}{\cs{caption@LT@make} introduced}
% \changes{v3.3}{2016/02/01}{Support for \cs{bicaption} via \cs{caption@LT@setup} added}
% \changes{v3.3a}{2019/04/02}{Work-around for problem with \package{floatrow} added}
% \changes{v3.6}{2021/01/09}{Adapted to current interface of \cs{caption@prepare@stepcounter}}
%  |\LT@makecaption|\marg{cmd}\marg{label}\marg{text}\par
%  \smallskip
%  The original definition:
%  \begin{verbatim}
%  \def\LT@makecaption#1#2#3{%
%    \LT@mcol\LT@cols c{\hbox to\z@{\hss\parbox[t]\LTcapwidth{%
%      % Based on article class "\@makecaption", "#1" is "\@gobble" in star
%      % form, and "\@firstofone" otherwise.
%      \sbox\@tempboxa{#1{#2: }#3}%
%      \ifdim\wd\@tempboxa>\hsize
%        #1{#2: }#3%
%      \else
%        \hbox to\hsize{\hfil\box\@tempboxa\hfil}%
%      \fi
%      \endgraf\vskip\baselineskip}%
%    \hss}}}
%  \end{verbatim}%^^A
%  Our definition:
%    \begin{macrocode}
  \renewcommand\LT@makecaption[3]{%
    \caption@LT@make{%
      \caption@LT@settype\LTcaptype
%    \end{macrocode}
% |\caption@LT@setup| is re-defined inside the \package{bicaption} package
% and contains the preparation of typesetting of the bilingual caption.
%    \begin{macrocode}
      \caption@LT@setup
%    \end{macrocode}
% \iffalse
%  The default |position=| setting for longtables is |top|.
%  (This emulates the standard behavior of the \package{longtable} package
%   which has no skip above the caption but a skip below it.)
% \fi
%  |position=auto| is a bad idea for longtables, but we do our very best.
%  This works quite well for captions inside the longtable contents, but
%  not for captions inside the longtable (end)foot.
%  \Note{This should be `top' if unclear!}
%    \begin{macrocode}
      \caption@setautoposition{\ifcase\LT@rows t\else b\fi}%
%    \end{macrocode}
%  We set |\ifcaption@star| according the 1st argument.
%    \begin{macrocode}
      \caption@startrue#1\caption@starfalse
%    \end{macrocode}
%    \begin{macrocode}
      \caption@prepare@stepcounter\LTcaptype
%    \end{macrocode}
% \changes{v3.1}{2007/05/05}{\cs{caption@font@normal} added}
%    \begin{macrocode}
      \caption@begin\LTcaptype
        \caption@normalsize
%    \end{macrocode}
%  The following skip has the purpose to correct the height of the
%  |\parbox[t]|. Usually it's the height of the very first line, but
%  because of our extra skips (|\abovecaptionskip| and |\belowcaptionskip|)
%  it's always |0pt|.\par
%  (A different idea would be typesetting the first skip outside the longtable
%   column with |\noalign{\vskip|\ldots|}|, but this means we have to move
%   |\caption@begin| to some other place because it does not work in tabular
%   mode. And at the moment I have no idea on how to do this in an elegant
%   way\ldots)
%    \begin{macrocode}
        \vskip-\ht\strutbox
%    \end{macrocode}
%  Work-around for problem with \package{floatrow}:
%  The |\below|\-|caption|\-|skip| disturbs the environment in which the caption is actually typeset (by creating extra, unwanted space),
%  so we supress this skip if the \package{floatrow} package is loaded.
%  (This fixes \issue{50})
%    \begin{macrocode}
        \caption@ifdefined\FBifcaptop{%
          \let\caption@belowskip\@empty}{}%
%    \end{macrocode}
%  The following code should look familiar. We do our skips and use
%  |\caption@@make| to typeset the caption itself.
%    \begin{macrocode}
        \caption@make@above
        \caption@@make{#2}{#3}\endgraf
        \caption@make@below
      \caption@end}}%
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\LT@listentry}
% \changes{v3.3}{2018/08/26}{This macro added}
% \changes{v3.3}{2018/10/05}{Bugfix: \cs{ignorespaces} added}
% \changes{v3.3}{2018/12/26}{Bugfix: Missing curly braces added}
%    \begin{macrocode}
  \renewcommand*\LT@listentry[2]{%
    \begingroup
      \caption@LT@settype{#1}%
      \caption@listentry\@firstoftwo[{#1}]{#2}%
    \endgroup\ignorespaces}%
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\caption@LT@settype}
% \changes{v3.3}{2018/08/26}{This macro added}
% \changes{v3.3}{2018/10/05}{Uses argument no. 1 instead of \cs{LTcaptype}}
% \changes{v3.6}{2021/01/17}{Adapted to current implementation of \cs{caption@setwidth}}
%    \begin{macrocode}
  \newcommand*\caption@LT@settype[1]{%
    \caption@settype*{#1}%
%    \end{macrocode}
%  If |\LTcapwidth| is not set to its default value |4in| we assume
%  that it shall overwrite our own setting.
%  (But |\captionsetup[longtable]{width=|\ldots|}| will overwrite |\LTcapwidth|.)
%    \begin{macrocode}
    \ifdim\LTcapwidth=4in \else
      \caption@setwidth\LTcapwidth
    \fi
%    \end{macrocode}
%    \begin{macrocode}
    \caption@setoptions{longtable}%
%   \caption@setContinuedFloat
%    \end{macrocode}
%  Finally set options applied by |\captionsetup| inside the longtable.
%    \begin{macrocode}
    \caption@setoptions{@longtable}}%
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\flrow@setlist}
% \changes{v3.4g}{2020/01/03}{Redefinition of this macro added}
% The \package{floatrow} package uses |\flrow@setlist{{table}{longtable}}| inside its redefinition of |\LT@array| without setting |\@captype| first,
% and this makes |\captionsetup[table]{name=...}| doomed to fail for longtables (``Undefined control sequence'').
% Unfortunately we cannot easily patch |\LT@array| again to fix this bug in \package{floatrow} since it will be patched |\AtBeginDocument|.
% Therefore we patch |\flrow@setlist| instead to catch and fix the bug on-the-fly.
%    \begin{macrocode}
  \caption@AtBeginDocument{\caption@ifdefined\flrow@setlist@{%
    \caption@InfoNoLine{Fixing longtable code of `floatrow' package}%
    \let\caption@flrow@setlist@\flrow@setlist@
    \renewcommand\flrow@setlist@[1]{%
      \def\caption@tempa{{table}{longtable}}%
      \def\caption@tempb{#1}%
      \ifx\caption@tempa\caption@tempb
        \def\@captype{table}%
      \fi
      \caption@flrow@setlist@{#1}}%
  }{}}%
%    \end{macrocode}
% \end{macro}
%
%    \begin{macrocode}
}{%
  \let\caption@AtBeginLongtable\@gobble
  \let\caption@LT@array\@undefined
}
%    \end{macrocode}
%
% \begin{macro}{\caption@LT@setup}
% \changes{v3.3}{2016/02/01}{This macro added}
% Hook for stuff which prepares the typesetting of the \package{longtable} caption.
%    \begin{macrocode}
\providecommand*\caption@LT@setup{}
%    \end{macrocode}
% \end{macro}
%
% \subsubsection{The picinpar package}
% \changes{v3.1}{2007/06/13}{Support of the \package{picinpar} package added}
%
%    \begin{macrocode}
\caption@IfPackageLoaded{picinpar}{%
%    \end{macrocode}
%
% \begin{macro}{\figwindow}
% \begin{macro}{\tabwindow}
% The \package{picinpar} package comes with its own caption code
% (|\wincaption|, |\@wincaption|, |\@makewincaption|, \ldots)
% so we redefine |\figwindow| \& |\tabwindow| to use |\caption| instead.
%    \begin{macrocode}
  \long\def\figwindow[#1,#2,#3,#4] {%
    \caption@window{figure}%
    \caption@setoptions{figwindow}%
    \begin{window}[#1,#2,{#3},\caption@wincaption{#4}] }%
%    \end{macrocode}
%    \begin{macrocode}
  \long\def\tabwindow[#1,#2,#3,#4] {%
    \caption@window{table}%
    \caption@setoptions{tabwindow}%
    \begin{window}[#1,#2,{#3},\caption@wincaption{#4}] }%
%    \end{macrocode}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\caption@window}
% \changes{v3.1c}{2007/10/06}{Bugfix: \cs{caption@clearmargin} added}
% Beside calling |\caption@settype| we redefine |\caption@par|\-|box|\-|restore|
% (as in \package{floatflt} \& \package{picins} package support)
% and |\@makecaption| (as in \package{float} package support) here.
%    \begin{macrocode}
  \newcommand*\caption@window[1]{%
    \let\@makecaption\caption@@make
    \caption@setautoposition b%
    \caption@settype{#1}%
    \caption@clearmargin}%
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\caption@wincaption}
% \changes{v3.1d}{2007/10/25}{Missing \% added}
% \changes{v3.3}{2013/04/14}{\cs{caption@ContinuedFloattrue} added}
% \changes{v3.3}{2018/10/06}{\cs{caption@ContinuedFloattrue} replaced by \cs{caption@setflag1}}
% \changes{v3.6}{2020/12/28}{\cs{caption@setflag1} replaced by \cs{caption@clrflags}\cs{caption@setcontinued}}
% This one finally typesets the caption using |\caption|.
%    \begin{macrocode}
  \newcommand\caption@wincaption[1]{%
%    \end{macrocode}
% This will be done twice for every |figwindow| \& |tabwindow| caption --
% on the first run |\picwd| is |0pt|, on the second run |\picwd| is |\hsize|.
%    \begin{macrocode}
    \ifdim\picwd=\z@
      \let\caption@makecurrent\@gobbletwo
      \let\caption@@start\relax
      \caption@prepareslc
    \else
      % don't increment the figure or table counter again
      \caption@clrflags
      \caption@setcontinued
    \fi
%    \end{macrocode}
% The argument |#1| could contain simply the caption text
% (e.g.~|A figure caption|), but it could also contain an optional argument,
% the \meta{lst\_entry}
% (e.g.~|[An| |entry| |to| |the| |LOF]||{A| |figure| |caption}|).
% Therefore we have to test if |#1| begins with~|[| or not; furthermore we
% support a starred variant -- as in |\caption*| -- so we test for~|*|, too.
%    \begin{macrocode}
    \edef\@tempa{\expandafter\noexpand\@car#1\@nil}%
    \if\@tempa*%
      \let\@tempa\@firstofone
    \else\if\@tempa[%]
      \let\@tempa\@firstofone
    \else
      \let\@tempa\@empty
    \fi\fi
    \expandafter\caption\@tempa{#1}}%
%    \end{macrocode}
% \end{macro}
%
%    \begin{macrocode}
}{}
%    \end{macrocode}
%
% \subsubsection{The picins package}
% \changes{v3.0j}{2006/01/26}{Support of the \package{picins} package added}
%
% \begin{macro}{\piccaptiontype}
% |\piccaptiontype|\marg{type}\par
% We offer this macro for changing the \meta{type} of the caption, so the user
% doesn't have to redefine |\@captype|, as proposed in the \package{picins}
% documentation.
% \Note{We define this macro here so it can be used in the
%  preamble of the document, even when \thispackage\ was loaded prior to the
%  \package{picins} package.}
%    \begin{macrocode}
\newcommand*\piccaptiontype[1]{\def\@piccaptype{#1}}
%    \end{macrocode}
% \end{macro}
%
%    \begin{macrocode}
\caption@IfPackageLoaded{picins}{%
%    \end{macrocode}
%
% Initial set |\@piccaptype| and undefine |\@captype| which was set to
% |figure| by the \package{picins} package.
%    \begin{macrocode}
  \caption@ifundefined\@piccaptype{%
    \caption@iftype{%
      \let\@piccaptype\@captype
    }{%
      \def\@piccaptype{figure}%
    }%
  }{}%
  \let\@captype\@undefined
%    \end{macrocode}
%
% \begin{macro}{\piccaption}
%  The original code:
%  \begin{verbatim}
%  \def\piccaption{\@ifnextchar [{\@piccaption}{\@piccaption[]}}
%  \end{verbatim}%^^A
%  Our code uses |\caption@star| so |\piccaption*| works,
%  and |\caption@dblarg| so |\piccaption{}| works correctly.
%    \begin{macrocode}
  \def\piccaption{\caption@star\relax{\caption@dblarg\@piccaption}}%
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\make@piccaption}
% \changes{v3.1}{2007/12/06}{Bugfix: \cs{caption@clearmargin} will always be used now}
%  The original code:
%  \begin{verbatim}
%  \def\make@piccaption{%
%   [...]
%   \setbox\@TEXT=\vbox{\hsize\hsiz@\caption[\sh@rtf@rm]{\capti@nt@xt}}%
%  }
%  \end{verbatim}%^^A
%  In our code we have to correct several things:
%  \begin{enumerate}
%    \item |\@captype| must be defined, since we have removed the global
%          definition.
%    \item We use |\caption@setoptions{parpic}| so
%          |\captionsetup[parpic]{|\ldots|}| is supported.
%    \item |\linewidth| must be set correctly.
%          Usually this is done by |\@parbox|\-|restore| inside |\@caption|,
%          but since we use |\@caption@parbox|\-|restore| we have to map this to
%          |\@parbox|\-|restore| instead.
%    \item The two arguments of |\caption| (|\sh@rtf@rm| \& |\capti@nt@xt|)
%          should be expanded on first level so |\caption[]{|\ldots|}| and
%          |\caption[|\ldots|]{}| work correctly.
%  \end{enumerate}
%    \begin{macrocode}
  \let\caption@ORI@make@piccaption\make@piccaption
  \def\make@piccaption{%
    \let\caption@ORI\caption
%    \end{macrocode}
%    \begin{macrocode}
    \long\def\caption[##1]##2{%
      \caption@freezeHref % will be defrosted in \ivparpic
      \caption@settype\@piccaptype
%     \ifnum\c@piccaptionpos>2\relax
        \caption@clearmargin
%     \else
%       \caption@width\z@ % do not use "width=" setting
%     \fi
      \caption@setoptions{parpic}%
      \caption@setautoposition b%
%    \end{macrocode}
%    \begin{macrocode}
      \expandafter\expandafter\expandafter\caption@ORI
        \expandafter\expandafter\expandafter[%
        \expandafter\expandafter\expandafter{%
        \expandafter##1\expandafter}\expandafter]\expandafter{##2}}%
%    \end{macrocode}
% {\footnotesize\begin{quote}
%   \leavevmode\llap{-or-\quad}%^^A
%   |\begingroup|\\
%   |  \toks0\expandafter{##1}| |\toks2\expandafter{##2}|\\
%   |  \edef\x{\endgroup|\\
%   |    \noexpand\caption@ORI[{\the\toks0}]{\the\toks2}}|\\
%   |  \x|
% \end{quote}
% \begin{quote}
%   \leavevmode\llap{-or-\quad}%^^A
%   |\edef\x{%|\\
%   |  \noexpand\caption@ORI[{\unexpanded\expandafter{##1}}]%|\\
%   |                        {\unexpanded\expandafter{##2}}}|\\
%   |\-|
% \end{quote}}
%    \begin{macrocode}
    \caption@ORI@make@piccaption
    \let\caption\caption@ORI}%
%    \end{macrocode}
% \end{macro}
%

% \begin{macro}{\ivparpic}
% \changes{v3.3}{2018/12/26}{Bugfix: Missing curly braces added}
% We need to set our \package{hyperref} anchor here.
% Not bullet-proof since we have to redefine |\noindent| here!
%    \begin{macrocode}
  \let\caption@ORI@ivparpic\ivparpic
  \def\ivparpic(#1,#2)(#3,#4)[#5][#6]#7{%
    \let\caption@ORI@noindent\noindent
    \def\noindent{%
      \caption@defrostHref
      \let\noindent\caption@ORI@noindent
      \noindent}%
    \caption@ORI@ivparpic(#1,#2)(#3,#4)[{#5}][{#6}]{#7}%
    \let\noindent\caption@ORI@noindent}%
%    \end{macrocode}
% \end{macro}
%
%    \begin{macrocode}
}{%
  \let\piccaptiontype\@undefined
}
%    \end{macrocode}
%
% \subsubsection{The rotating package}
%
%    \begin{macrocode}
\caption@IfPackageLoaded{rotating}[1995/08/22 v2.10]{%
%    \end{macrocode}
%
% \begin{macro}{\rotcaption}
% \changes{v3.0c}{2004/07/16}{Bugfix: Check for \cs{caption@star} removed}
% \changes{v3.0i}{2005/12/07}{Rewritten, works with \package{hyperref} now}
%  Make |\rotcaption*| work.
%    \begin{macrocode}
  \def\rotcaption{\let\@makecaption\@makerotcaption\caption}%
% \let\@rotcaption\@undefined
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\rotcaptionof}
% \changes{v3.0i}{2005/12/07}{New}
%  Make |\rotcaptionof(*)| work.
%    \begin{macrocode}
  \def\rotcaptionof{%
    \caption@teststar\caption@of{\rotcaption*}\rotcaption}%
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@makerotcaption}
% \changes{v3.0i}{2005/12/06}{Rewritten, should finally work proper now}
% \changes{v3.0m}{2007/03/04}{Uses \cs{caption@parbox} instead of \cs{caption@start/endbox}}
% \changes{v3.3}{2012/12/26}{Rewritten (again)}
% \changes{v3.6}{2021/01/17}{Adapted to current implementation of \cs{caption@setmargin}}
%  Original (bugfixed) code:
%  \begin{verbatim}
%  \long\def\@makerotcaption#1#2{%
%    \setbox\@tempboxa\hbox{#1: #2}%
%    \ifdim \wd\@tempboxa > .8\vsize
%      \rotatebox{90}{%
%      \begin{minipage}{.8\textheight}#1: #2\end{minipage}%
%      }%\par   % <== \par removed (AR)
%    \else%
%      \rotatebox{90}{\box\@tempboxa}%
%    \fi
%    \nobreak\hspace{12pt}% <== \nobreak added (AR)
%  }
%  \end{verbatim}%^^A
%  Our version emulates this behavior, but if |width=| is set,
%  the rotated caption is always typeset as |\parbox|.
%  (Note that |margin=| is not supported here.)
%    \begin{macrocode}
  \long\def\@makerotcaption#1#2{%
    \rotatebox{90}{%
      \ifdim\caption@width=\z@
        \caption@setwidth{.8\vsize}%
        \l@addto@macro\caption@singleline{%
          \caption@setup{parbox=none}}%
      \fi
      \let\caption@calcmargin\relax
      \caption@@make{#1}{#2}}%
    \nobreak\hspace{12pt}}%
%    \end{macrocode}
% \end{macro}
%
%    \begin{macrocode}
}{}
%    \end{macrocode}
%
% \subsubsection{The sidecap package}
%
%    \begin{macrocode}
\caption@IfPackageLoaded{sidecap}[2003/06/06 v1.6f]{%
  \caption@setbool{needfreeze}{1}%
%    \end{macrocode}
%
% \begin{macro}{\SC@zfloat}
% \changes{v3.0b}{2004/05/16}{Local definition of \cs{captionsetup} added}
% \changes{v3.0c}{2004/07/16}{Bugfix 04-07-15: Check for \cs{caption@star} removed}
% \changes{v3.1c}{2007/10/06}{\cs{caption} will be saved \& restored now}
% \changes{v3.2a}{2011/08/17}{Bugfix: Uses \cs{caption@freeze} instead of \cs{caption@freeze*} now}
% \changes{v3.3}{2013/05/01}{Usage of \cs{caption@freeze} replaced by \cs{caption@freezetype}}
%  This macro will be called at the start of the environment, here is a good
%  opportunity to do some adaptations to |\caption| and |\captionsetup|.
%    \begin{macrocode}
  \let\caption@ORI@SC@zfloat\SC@zfloat
  \def\SC@zfloat#1#2#3[#4]{%
%    \end{macrocode}
%  First we use the original definition, but restore \cs{caption} and \cs{label}
%  so \cs{caption@freeze} and \cs{caption@warmup} will work correctly.
%    \begin{macrocode}
    \caption@ORI@SC@zfloat{#1}{#2}{#3}[#4]%
    \SC@RestoreCommands
%    \end{macrocode}
%  Since the sidecap package uses our |\caption| code outside the
%  environment the regular |\captionsetup| will not work.
%  So we need a special version here which saves the given argument list
%  which will be executed later on.
%  Furthermore we need to make |\caption*| work.
%    \begin{macrocode}
    \caption@freezetype{#2}%
%    \end{macrocode}
% The sidecap package uses |\ifx\label\SC@label| to test if it is just inside a
% |SC|\-|figure| or not. So we redefine |\SC@label| here so this test will still work.
%    \begin{macrocode}
    \let\SC@label\label}%
%    \end{macrocode}
%    \begin{macrocode}
  \providecommand*\SC@RestoreCommands{%
    \let\caption=\SC@orig@caption \let\label=\SC@orig@label}%
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\endSC@FLOAT}
% \changes{v3.0i}{2006/01/12}{\cs{@listdepth}\cs{z@} added}
% \changes{v3.1}{2007/05/05}{Call of \cs{caption@setoptions}\arg{SCfloat} added}
%  This macro will be called at the end of the environment, here we need to
%  setup our stuff before the \package{sidecap} package actually typesets
%  its caption.
%    \begin{macrocode}
  \let\caption@ORI@endSC@FLOAT\endSC@FLOAT
  \def\endSC@FLOAT{%
%    \end{macrocode}
%  Before we can typeset the caption we need to set the margin to zero
%  because any extra margin would only be disturbing here.\par
%  (We don't need to take care about the caption position because
%   the sidecap package set both |\abovecaptionskip| and |\belowcaptionskip|
%   to a skip of zero anyway.)\par
%  Furthermore |\SC@justify| will override the caption justification, if set.
%  The usage of |\SC@justify| differs from version to version of the
%  \package{sidecap} package:\par
%  \begin{tabular}{ll}
%    Version 1.4: & |\SC@justify| is not defined\\
%    Version 1.5: & |\SC@justify| is |\relax| when not set\\
%    Version 1.6: & |\SC@justify| is |\@empty| when not set\\
%  \end{tabular}
%    \begin{macrocode}
    \def\caption@setSC@justify{%
      \caption@clearmargin
        \ifx\SC@justify\@empty \else
          \let\caption@justification\SC@justify
          \let\SC@justify\@empty
        \fi}%
%    \end{macrocode}
%  Make the original definition of |\endSC@FLOAT| to use our caption
%  stuff instead of its own.
%  \Note{At this point the \package{sidecap} definition of \cs{caption} is valid,
%  not the regular one!}
%    \begin{macrocode}
    \let\caption\SC@orig@caption
    \def\SC@orig@caption[##1]##2{%
      \caption@setSC@justify
%%%   \caption@setoptions{SC}%
      \caption@setoptions{SC\@captype}%
      \caption@defrost}%
%    \end{macrocode}
%  Finally we call the original definition of |\endSC@FLOAT|.
%    \begin{macrocode}
    \caption@setSC@justify % for compatibility mode
    \caption@prepare@defrost
    \caption@ORI@endSC@FLOAT}%
%    \end{macrocode}
% \end{macro}
%
%    \begin{macrocode}
}{}
%    \end{macrocode}
%
% \subsubsection{The subfigure package}
% \changes{v3.1}{2007/04/06}{subfigure package support added}
%
%    \begin{macrocode}
\caption@IfPackageLoaded{subfigure}[2002/01/23 v2.1]{%
%    \end{macrocode}
%
% \begin{macro}{\sf@ifpositiontop}
% \changes{v3.1a}{2007/09/15}{Bugfix 07-09-15: Check for \cs{@captype} added}
%  If the \package{subfigure} package is loaded, we map |\sf@ifpositiontop|
%  to |\iffiguretopcap| resp. |\iftabletopcap|, so the \package{subfigure}
%  \version{2.1} options \opt{figbotcap} etc. will still work.
%    \begin{macrocode}
  \def\sf@ifpositiontop{%
    \ifx\@captype\@undefined
      \expandafter\@gobbletwo
    \else\ifx\@captype\relax
      \expandafter\expandafter\expandafter\@gobbletwo
    \else
      \expandafter\expandafter\expandafter\sf@if@position@top
    \fi\fi}
%    \end{macrocode}
%    \begin{macrocode}
  \def\sf@if@position@top{%
    \@ifundefined{if\@captype topcap}%
      {\@gobbletwo}%
      {\@nameuse{if\@captype topcap}%
         \expandafter\@firstoftwo
       \else
         \expandafter\@secondoftwo
       \fi}}
%    \end{macrocode}
% \end{macro}
%
%    \begin{macrocode}
}{}
%    \end{macrocode}
%
% \subsubsection{The supertabular and xtab packages}
%
%    \begin{macrocode}
\caption@IfPackageLoaded{supertabular}[2002/07/19 v4.1e]{%
%    \end{macrocode}
%
% \begin{macro}{\tablecaption}
% \changes{v3.0e}{2005/05/05}{Made \cs{topcaption*} and \cs{bottomcaption*} work}
% \changes{v3.1h}{2008/04/01}{Bugfix: Star variant does not increment table counter anymore}
%  Make |\topcaption*| and |\bottomcaption*| work.
%    \begin{macrocode}
  \renewcommand*\tablecaption{%
    \caption@star
      {\refstepcounter{table}}%
      {\caption@dblarg{\@xtablecaption}}}%
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@xtablecaption}
% \changes{v3.1h}{2008/04/01}{Made \cs{nameref} \& \cs{autoref} work}
% \changes{v3.1l}{2010/01/09}{Adapted to current version of nameref package}
% \changes{v3.3}{2018/12/26}{Bugfix: Missing curly braces added}
%  Make |\nameref| and |\autoref| work.
%    \begin{macrocode}
  \let\caption@ORI@xtablecaption\@xtablecaption
  \long\def\@xtablecaption[#1]#2{%
    \caption@gettitle{#2}%
    \caption@ORI@xtablecaption[{#1}]{#2}}%
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\ST@caption}
% \changes{v3.0a}{2004/01/23}{Bugfix: Missing \cs{par} added}
% \changes{v3.1h}{2008/04/01}{Bugfix: \cs{@currentlabelname} will be set now}
%  The original code:
%  \begin{verbatim}
%  \long\def\ST@caption#1[#2]#3{\par%
%    \addcontentsline{\csname ext@#1\endcsname}{#1}%
%                    {\protect\numberline{%
%                        \csname the#1\endcsname}{\ignorespaces #2}}
%    \begingroup
%      \@parboxrestore
%      \normalsize
%      \if@topcaption \vskip -10\p@ \fi
%      \@makecaption{\csname fnum@#1\endcsname}{\ignorespaces #3}\par
%      \if@topcaption \vskip 10\p@ \fi
%    \endgroup}
%  \end{verbatim}%^^A
%    \begin{macrocode}
  \long\def\ST@caption#1[#2]#3{\par%
    \caption@settype*{#1}%
    \caption@setoptions{supertabular}%
%    \end{macrocode}
%  The |position=| setting will be overwritten by the
%  \package{supertabular} package: If |\topcaption| was used,
%  the position will be |top| automatically, |bottom| otherwise.
%    \begin{macrocode}
    \caption@setposition{\if@topcaption t\else b\fi}%
%    \end{macrocode}
%    \begin{macrocode}
    \caption@beginex{#1}{#2}{#3}%
      \caption@parboxrestore
      \caption@normalsize
      \@makecaption{\csname fnum@#1\endcsname}{\ignorespaces #3}\par
    \caption@end}%
%    \end{macrocode}
% \end{macro}
%
%    \begin{macrocode}
}{}
%    \end{macrocode}
%
% \changes{v3.1h}{2008/04/01}{Support of the xtab package added}
%    \begin{macrocode}
\caption@IfPackageLoaded{xtab}[2000/04/09 v2.3]{%
%    \end{macrocode}
%
% \begin{macro}{\tablecaption}
%  Make |\topcaption*| and |\bottomcaption*| work.
%    \begin{macrocode}
  \renewcommand*\tablecaption{%
    \caption@star
      {\refstepcounter{table}}%
      {\caption@dblarg{\@xtablecaption}}}%
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@xtablecaption}
% \changes{v3.1l}{2010/01/09}{Adapted to current version of nameref package}
% \changes{v3.3}{2018/12/26}{Bugfix: Missing curly braces added}
%  Make |\nameref| and |\autoref| work.
%    \begin{macrocode}
  \let\caption@ORI@xtablecaption\@xtablecaption
  \long\def\@xtablecaption[#1]#2{%
    \caption@gettitle{#2}%
    \caption@ORI@xtablecaption[{#1}]{#2}}%
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\ST@caption}
%  The original code:
%  \begin{verbatim}
%  \long\def\ST@caption#1[#2]#3{\par%
%    \@initisotab
%    \addcontentsline{\csname ext@#1\endcsname}{#1}%
%                    {\protect\numberline{%
%                      \csname the#1\endcsname}{\ignorespaces #2}}%
%    \begingroup
%      \@parboxrestore
%      \normalsize
%  %%  \if@topcaption \vskip -10\p@ \fi
%      \@makecaption{\csname fnum@#1\endcsname}{\ignorespaces #3}\par
%  %%  \if@topcaption \vskip 10\p@ \fi
%    \endgroup
%    \global\advance\ST@pageleft -\PWSTcapht
%    \ST@trace\tw@{Added caption. Space left for xtabular: \the\ST@pageleft}}
%  \end{verbatim}%^^A
%    \begin{macrocode}
  \long\def\ST@caption#1[#2]#3{\par%
    \caption@settype*{#1}%
    \caption@setoptions{xtabular}%
%    \end{macrocode}
%    \begin{macrocode}
    \caption@set{position}{\if@topcaption t\else b\fi}%
%    \end{macrocode}
%    \begin{macrocode}
    \@initisotab
    \caption@beginex{#1}{#2}{#3}%
      \caption@parboxrestore
      \caption@normalsize
      \@makecaption{\csname fnum@#1\endcsname}{\ignorespaces #3}\par
    \caption@end
    \global\advance\ST@pageleft -\PWSTcapht
    \ST@trace\tw@{Added caption. Space left for xtabular: \the\ST@pageleft}}%
%    \end{macrocode}
% \end{macro}
%
%    \begin{macrocode}
}{}
%    \end{macrocode}
%
% \subsubsection{The threeparttable package}
% \changes{v3.1}{2007/05/08}{Support of the \package{threeparttable} package added}
%
%    \begin{macrocode}
\caption@IfPackageLoaded{threeparttable}[2003/06/13 v3.0]{%
%    \end{macrocode}
%
% \begin{macro}{\threeparttable}
% \changes{v3.3}{2016/01/31}{Bugfix: \cs{@captype} will be used if already defined}
% Unfortunately |\@captype| is not set when |\TPT@common| will be used,
% so we have to redefine |\threeparttable| and |\measuredfigure| instead.
%    \begin{macrocode}
  \let\caption@ORI@threeparttable\threeparttable
  \renewcommand*\threeparttable{%
    \caption@settype{\@ifundefined{@captype}{table}{\@captype}}%
%%% \caption@setposition{auto}% ?
    \caption@clearmargin
    \caption@setoptions{threeparttable}%
    \caption@ORI@threeparttable}%
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\measuredfigure}
% \changes{v3.3}{2016/01/31}{Bugfix: \cs{@captype} will be used if already defined}
%  Same here\ldots
%    \begin{macrocode}
  \let\caption@ORI@measuredfigure\measuredfigure
  \renewcommand*\measuredfigure{%
    \caption@settype{\@ifundefined{@captype}{figure}{\@captype}}%
%%% \caption@setposition{auto}% ?
    \caption@clearmargin
    \caption@setoptions{measuredfigure}%
    \caption@ORI@measuredfigure}%
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\TPT@caption}
%  The original code:
%  \begin{verbatim}
%  \def\TPT@caption#1[#2]#3{\gdef\TPT@docapt
%   {\par\global\let\TPT@docapt\@undefined \TPT@LA@caption{#1}[{#2}]%
%     {\strut\ignorespaces#3\ifhmode\unskip\@finalstrut\strutbox\fi}}%
%   \ifx\TPT@hsize\@empty \let\label\TPT@gatherlabel \abovecaptionskip\z@skip
%   \else \TPT@docapt \fi \ignorespaces}
%  \end{verbatim}%^^A
%    \begin{macrocode}
  \def\TPT@caption#1[#2]#3{%
    \gdef\TPT@docapt{%
      \global\let\TPT@docapt\@undefined
      \caption@setautoposition\caption@TPT@position
      \TPT@LA@caption{#1}[{#2}]{#3}}%
    \ifx\TPT@hsize\@empty
      \let\label\TPT@gatherlabel % Bug: does not work for measuredfigures
      \gdef\caption@TPT@position{t}%
      \g@addto@macro\TPT@docapt\caption@TPT@eatvskip
    \else
      \def\caption@TPT@position{b}%
      \TPT@docapt
    \fi
    \ignorespaces}%
%    \end{macrocode}
%    \begin{macrocode}
  %\newcommand*\caption@TPT@eatvskip{\vskip-.2\baselineskip}%
  \def\caption@TPT@eatvskip#1\vskip{#1\@tempdima=}%
%    \end{macrocode}
% \end{macro}
%
%    \begin{macrocode}
}{}
%    \end{macrocode}
%
% \subsubsection{The wrapfig package}
% \changes{v3.1}{2007/05/05}{Support of the \package{wrapfig} package added}
% \changes{v3.2d}{2011/11/02}{Support of the \package{wrapfig} package rewritten}
%
%    \begin{macrocode}
\caption@IfPackageLoaded{wrapfig}[2003/01/31 v3.6]{%
%    \end{macrocode}
%
% \begin{macro}{\wrapfloat}
% \changes{v3.2d}{2011/11/02}{Redefinition of this macro added}
% \changes{v3.6}{2020/12/28}{Usage of \cs{@testopt} added}
% First of all we make the \package{wrapfig} package independent from the package
% load order regarding the \package{float} package.
% Since the usage of |\@float@set|\-|every| is missing in the code of the \package{wrapfig}
% package (it should be in the redefinition of |\float@re|\-|style|, right after
% |\@nameuse{fst@#1}|), we don't use it here, too,
% especially since |\wrap|\-|float| will usually not be used when used with re-styled floats.
%    \begin{macrocode}
  \renewcommand*\wrapfloat[1]{%
    \def\@captype{#1}%
    \@ifundefined{fst@#1}{}{%
      \@nameuse{fst@#1}%
%     \@float@setevery{#1}%
      \def\WF@floatstyhook{\let\@currbox\WF@box 
         \global\setbox\WF@box\float@makebox{\wd\WF@box}}}%
    \@testopt\WF@wr{}}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\WF@rapt}
% \changes{v3.2d}{2011/11/02}{Usage of \cs{WF@captionstyhook} added}
% Original code:
% \begin{verbatim}
%   \def\WF@rapt[#1]#2{% final two args: #1 = overhang,  #2 = width,
%     \gdef\WF@ovh{#1}% hold overhang for later, when \width is known
%     \global\setbox\WF@box\vtop\bgroup \setlength\hsize{#2}%
%     \ifdim\hsize>\z@ \@parboxrestore \else
%     \setbox\z@\hbox\bgroup \let\wf@@caption\caption \let\caption\wf@caption
%     \ignorespaces \fi}
% \end{verbatim}%^^A
% Our code has |\WF@captionstyhook| in addition:
%    \begin{macrocode}
  \def\WF@rapt[#1]#2{% final two args: #1 = overhang,  #2 = width,
    \gdef\WF@ovh{#1}% hold overhang for later, when \width is known
    \global\setbox\WF@box\vtop\bgroup \setlength\hsize{#2}%
    \expandafter\WF@captionstyhook\expandafter{\@captype}% <= new
    \ifdim\hsize>\z@ \@parboxrestore \else
    \setbox\z@\hbox\bgroup \let\wf@@caption\caption \let\caption\wf@caption
    \ignorespaces \fi}%
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\WF@captionstyhook}
% \changes{v3.2d}{2011/11/02}{This macro added}
% \changes{v3.2e}{2011/11/10}{Bugfix 11-11-09: float package support fixed}
% We place our \package{hyperref} anchor here, 	apply the `wrap' options etc.
% Since the usage of |\@float@set|\-|every| is missing in the \package{wrapfig}
% package we will catch it up here for making the necessary adaptions to the
% \package{float} package.
%    \begin{macrocode}
  \def\WF@captionstyhook#1{%
    \let\@captype\@undefined
    \@ifundefined{fst@#1}{}{\@float@setevery{#1}}%
    \caption@settype{#1}%
    \caption@clearmargin
%%% \caption@setoptions{wrap}%
    \caption@setoptions{wrap#1}}%
%    \end{macrocode}
% \end{macro}
%
%    \begin{macrocode}
}{}
%    \end{macrocode}
%
% \subsection{Debug stuff}
%
% \begin{macro}{\caption@checkcounter}
% \changes{v3.6}{2020/12/28}{This macro added}
% |\caption@checkref|\marg{counter}\marg{expected value}\\
% checks if |\value|\marg{counter} would result in the \meta{expected value}.
%    \begin{macrocode}
\newcommand*\caption@checkcounter[1]{%
  \caption@check{\the#1}{\@nameuse{the#1}}}
%    \end{macrocode}
%    \begin{macrocode}
\newcommand*\caption@check[3]{%
  \edef\caption@tempa{#2}%
  \edef\caption@tempb{#3}%
  \ifx\caption@tempa\caption@tempb
    \caption@Info{\string#1 = \caption@tempa}%
  \else
    \caption@Error{\string#1 = \caption@tempa\space <> \caption@tempb}%
  \fi}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\caption@checkref}
% \changes{v3.6}{2020/12/28}{This macro added}
% |\caption@checkref|\marg{marker}\marg{expected value}\\
% checks if |\ref|\marg{marker} would result in the \meta{expected value}.
%    \begin{macrocode}
\newcommand*\caption@checkref[2]{%
  \@ifundefined{r@#1}{}%
    {\expandafter\expandafter\expandafter
       \caption@@checkref\csname r@#1\endcsname\@nil{#1}{#2}}}
%    \end{macrocode}
%    \begin{macrocode}
\def\caption@@checkref#1#2\@nil#3#4{%
  \caption@check{\ref{#3}}{#1}{#4}}
%    \end{macrocode}
% \end{macro}
%
% \subsection{That's all Folks!}
%
% Execute the code declared with |\After|\-|Caption|\-|Package|.
%
%    \begin{macrocode}
\caption@endtitles@code
\let\caption@endtitles@code\@undefined
\let\AfterCaptionPackage\@firstofone
%    \end{macrocode}
%
% \iffalse
%</package>
% \fi
%
% \iffalse
% --------------------------------------------------------------------------- %
% \fi
%
% \clearpage
% \Finale
%
\endinput