summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/caption/subcaption.dtx
blob: 38104d18ce342354cc64625cb2091b5e40ffcde8 (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
% \iffalse meta-comment
% 
% This is file `subcaption.dtx'.
% 
% Copyright (C) 2007-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{468}
%
% \iffalse
%<*driver>
\NeedsTeXFormat{LaTeX2e}[1994/12/01]
\ProvidesFile{subcaption.drv}[2022/02/20 v1.5 Adds a sub-caption feature to the caption package]
\hbadness=9999 \newcount\hbadness \hfuzz=74pt % Make TeX shut up.
%\errorcontextlines=3
%
\documentclass{ltxdoc}
\setlength\parindent{0pt}
\setlength\parskip{\smallskipamount}
\addtolength\marginparwidth{15pt}
%
\usepackage{ifpdf}
\ifpdf
  \usepackage{mathptmx,courier}
  \usepackage[scaled=0.90]{helvet}
\fi
%
\usepackage[bottom]{footmisc}
\usepackage{array,diagbox,graphicx,overpic,pict2e,stackengine,tikz}
%
\PassOptionsToPackage{breaklinks=true}{hyperref}
\usepackage{hypdoc}
\ifpdf\usepackage{hypdestopt}\fi
\hypersetup{pdfkeywords={LaTeX, package, subcaption},pdfstartpage={},pdfstartview={}}
%
\usepackage{caption}[2022/01/07]    % needs v3.6 or newer to typeset this document
\usepackage{subcaption}[2022/01/07] % needs v1.5 or newer to typeset this document
\DeclareCaptionSubType*[arabic]{table}
\captionsetup[subtable]{labelformat=simple,labelsep=colon}
%
\newcommand*\purerm[1]{{\upshape\mdseries\rmfamily #1}}
\newcommand*\puresf[1]{{\upshape\mdseries\sffamily #1}}
\newcommand*\purett[1]{{\upshape\mdseries\ttfamily #1}}
\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$}
%
\usepackage{marvosym}
\makeatletter
\newcommand*\INFO{\@ifstar{\@INFO{}}{\@INFO{\vbox to \ht\strutbox}}}
\newcommand*\@INFO[1]{\MARGINSYM{#1{\LARGE\Info}}}
\makeatother
%
\usepackage[alpine]{ifsym}
\newenvironment{background}{\par\bigskip\csname background*\endcsname}{\csname endbackground*\endcsname}
\newenvironment{background*}{\small\MARGINSYM{\Mountain}\ignorespaces}{\par}
%
\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
%
\newcommand*\PageBreak{\pagebreak[3]}
\newcommand*\changenote[1]{}
%
\begin{document}
  \DocInput{subcaption.dtx}
\end{document}
%</driver>
% \fi
%
% \let\subsectionautorefname\sectionautorefname
% \let\subsubsectionautorefname\sectionautorefname
%
% \def\thispackage{the \pkg{subcaption} package}
% \def\Thispackage{The \pkg{subcaption} package}
%
% \newcommand\NEWfeature{\NEW{New feature}}
% \newcommand\NEWdescription{\NEW{New description}}
%
% \makeatletter
% \def\Ref{\@ifstar{\@Ref\ref}{\@Ref\autoref}}
% \def\@Ref#1#2{#1{#2}: \textit{\nameref{#2}}}
% \makeatother
% \def\See#1{\nopagebreak{\small (See #1)}}
%
% \GetFileInfo{subcaption.drv}
% \let\docdate\filedate
% \let\docversion\fileversion
% \GetFileInfo{subcaption.sty}
%
% \title{\texorpdfstring{\Thispackage\thanks{%^^A
%          This package has version number \docversion.}}%^^A
%        {The subcaption package}}
% \author{Axel Sommerfeldt\\
%         \url{https://gitlab.com/axelsommerfeldt/caption}}
% \date{\docdate}
% \maketitle
% 
% \begin{abstract}
% This package offers an user interface to typeset sub-captions.
% \end{abstract}
%
% \begin{background}
% At the end of each section, text marked with the mountain symbol
% will contain background knowledge on how the particular command or
% environment is actually implemented.
% If you just want to use this package as it is, you don't have to read or
% understand them.
% \end{background}
%
% \begin{background*}
% Since version $3.1$ the \pkg{caption} package offers a low-level interface to typeset sub-captions:
% |\Declare|\-|Caption|\-|Sub|\-|Type| defines the required counters and internal commands,
% |\set|\-|caption|\-|sub|\-|type| switches to the sub-caption mode, and
% |\caption@sub|\-|type|\-|hook| could be extended to apply own code when a switch to the sub-caption mode is in progress.
%
% This package demonstrates its usage by offering a high-level user interface additionally.
% \end{background*}
% 
% \bigskip
% \INFO
% \emph{Please note:}
% This package is incompatible with the \pkg{subfigure} and \pkg{subfig} packages.
%
% \clearpage
% \setcounter{tocdepth}{2}
% \tableofcontents
%
% \iffalse
% --------------------------------------------------------------------------- %
% \fi
%
% \clearpage
% \section{Loading the package}
%
% Load this package using
% \begin{quote}
%   |\usepackage|\oarg{options}|{subcaption}|\quad.
% \end{quote}
% The options for \thispackage\ are the same ones as for the \pkg{caption}
% package, but specify settings which are used for sub-captions
% \emph{additionally}.
% In fact
% \begin{quote}
%   |\usepackage|\oarg{options}|{subcaption}|
% \end{quote}
% is identical to
% \begin{quote}
%   |\usepackage{subcaption}|\\
%   |\captionsetup[sub]|\marg{options}\quad.
% \end{quote}
%
% \bigskip
%
% \pagebreak[3]
% The default settings for sub-captions are:
% \begin{quote}
%   |margin=0pt,font+=smaller,labelformat=parens,labelsep=space,|\\
%   |skip=6pt,list=false,hypcap=false|~\footnote{%^^A
%     This means that sub-captions are not listed in the List of Figures
%     or Tables by default, but you can enable it by
%     specifying the option \texttt{list=true}.}
% \end{quote}
%
% Options specified with |\usepackage[|\ldots|]{sub|\-|caption}| and
% |\caption|\-|setup[sub]{|\ldots|}| will override the ones specified by
% |\caption|\-|setup{|\ldots|}| and |\caption|\-|setup[fig|\-|ure]{|\ldots|}|,
% but are again overwritten by |\caption|\-|setup[sub|\-|figure]{|\ldots|}|
% (same for `table'). So finally we have the following order how
% settings for sub-captions are applied:
% \begin{enumerate}
% \item Global settings
%  {\small(|\usepackage[|\ldots|]{caption}| and |\captionsetup{|\ldots|}|)}
% \item Environmental settings
%  {\small(|\captionsetup[figure|\emph{ -or- }|table]{|\ldots|}|)}
% \item Local settings
%  {\small(|\captionsetup{|\ldots|}| inside |figure| or |table| environment)}
% \item Default `sub' settings
%  {\small(|margin=0pt,font+=smaller,|\ldots, see above)}
% \item Custom `sub' settings
%  {\small(|\usepackage[|\ldots|]{subcaption}| and |\captionsetup[sub]{|\ldots|}|)}
% \item Environmental `sub' settings
%  {\small(|\captionsetup[subfigure|\emph{ -or- }|subtable]{|\ldots|}|)}
% \item Local `sub' settings
%  {\small(|\captionsetup{|\ldots|}| inside |sub|\-|figure| or |sub|\-|table|)}
% \end{enumerate}
%
% \pagebreak[3]
% An example:
% \begin{quote}
%   |\usepackage[labelsep=quad,indention=10pt]{caption}|\\
%   |\usepackage[labelfont=bf,list=true]{subcaption}|\\
%   |\captionsetup[table]{textfont=it,position=top}|\\
%   |\captionsetup[subtable]{textfont=sf}|
% \end{quote}
% causes the captions inside |sub|\-|table| environments to be typeset with
% the settings
% \begin{quote}
%   |indention=10pt,position=top,margin=0pt,font=small,|\\
%   |labelformat=parens,labelsep=space,skip=6pt,hypcap=false,|\\
%   |labelfont=bf,list=true,textfont=sf|\quad.
% \end{quote}
%
% \iffalse
% --------------------------------------------------------------------------- %
% \fi
%
% \PageBreak
% \section{The \cs{subcaptionbox} command}
%
% \DescribeMacro\subcaptionbox
% The |\sub|\-|caption|\-|box| command typesets given content and caption.
% It automatically aligns the sub-figures resp.~sub-tables by their very first caption line.
%
% \pagebreak[3]
% Its syntax is:
% \begingroup
% \leftmargini=12pt
% \begin{quote}
%   |\subcaptionbox|\oarg{list entry}\marg{heading}\oarg{width}\oarg{inner-pos}\marg{contents}\\
%   |\subcaptionbox*|\marg{heading}\oarg{width}\oarg{inner-pos}\marg{contents}
% \end{quote}
% \endgroup
% \begin{small}
% The arguments \meta{list entry} \& \meta{heading} will be used for typesetting the |\caption|.
%
% \meta{width} is the width of the resulting |\par|\-|box|; the default value is the width of the contents.
%
% \meta{inner-pos} specifies how the contents will be justified inside the resulting |\parbox|;
% it can be either `c' (for |\centering|), `l' (for |\ragged|\-|right|),
% `r' (for |\ragged|\-|left|), or `s' (for no special justification).
% The default is `c'.
% (But you can use any justification defined with
% |\Declare|\-|Caption|\-|Jus|\-|ti|\-|fi|\-|ca|\-|tion| as well,
% e.g.: `|center|\-|last|')
% \end{small}
%
% \bigskip
%
% When using |\sub|\-|caption|\-|box|, the baseline of the resulting box will be placed
% right between contents and heading. So usually you don't have to care about the
% vertical alignment of the sub-figures for yourself.
% Also the hyperlink anchor is placed properly with respect to the |hyp|\-|cap=| setting.
%
% \pagebreak[3]
% An example:
% \begin{quote}
%   |\begin{figure}|\\
%   |  \centering|\\
%   |  \subcaptionbox{A cat\label{cat}}|\\
%   |    {\includegraphics{cat}}|\\
%   |  \subcaptionbox{An elephant\label{elephant}}|\\
%   |    {\includegraphics{elephant}}|\\
%   |  \caption{Two animals}\label{animals}|\\
%   |\end{figure}|
% \end{quote}
% \noindent\begin{minipage}{\linewidth}
%   \captionsetup{type=figure}
%   \centering
%   \subcaptionbox{A cat\label{cat}}
%     {\includegraphics[width=30pt]{cat}}
%   \subcaptionbox{An elephant\label{elephant}}
%     {\includegraphics[width=140pt]{elephant}}
%   \caption[Two animals]{Two animals~\footnotemark}\label{animals}
% \end{minipage}
% \footnotetext{The pictures were taken with permission from the
%   \LaTeX\ Companion\cite{TLC2} examples.}
%
% \bigskip
%
% As you see the result is not satisfying;
% the caption below the cat looks ugly because of the small width of the
% graphic. This can be solved by using the optional arguments of
% |\sub|\-|caption|\-|box|, increasing the width of the resulting box:
% \begin{quote}
%   |  |\ldots\\
%   |  \subcaptionbox{A cat\label{cat}}|\\
%   |    |\textcolor{blue}{\csoarg{2.5cm}}|{\includegraphics{cat}}|\\
%   |  |\ldots
% \end{quote}
% \noindent\begin{minipage}{\linewidth}
%   \captionsetup{type=figure}
%   \centering
%   \subcaptionbox{A cat\label{cat2}}
%     [2.5cm]{\includegraphics[width=30pt]{cat}}
%   \subcaptionbox{An elephant\label{elephant2}}
%     {\includegraphics[width=140pt]{elephant}}
%   \caption{Two animals}\label{animals2}
% \end{minipage}
%
% \bigskip
%
% Furthermore the main caption, which is centered with respect to the
% |\text|\-|width|, looks mis-aligned with respect to the sub-captions.
% This can (again) be solved by using the optional arguments of
% |\sub|\-|caption|\-|box|, giving both boxes the same width, for example:
% \begin{quote}
%   |  |\ldots\\
%   |  \subcaptionbox{A cat\label{cat}}|\\
%   |    |\textcolor{blue}{\csoarg{.4\cs{textwidth}}}|{\includegraphics{cat}}%|\\
%   |  \subcaptionbox{An elephant\label{elephant}}|\\
%   |    |\textcolor{blue}{\csoarg{.4\cs{textwidth}}}|{\includegraphics{elephant}}|\\
%   |  |\ldots
% \end{quote}
% \noindent\begin{minipage}{\linewidth}
%   \captionsetup{type=figure}
%   \centering
%   \subcaptionbox{A cat\label{cat3}}
%     [.4\textwidth]{\includegraphics[width=30pt]{cat}}%^^A
%   \subcaptionbox{An elephant\label{elephant3}}
%     [.4\textwidth]{\includegraphics[width=140pt]{elephant}}
%   \caption{Two animals}\label{animals3}
% \end{minipage}
%
% \bigskip
%
% \begin{background}
% The |\sub|\-|caption|\-|box| is a |\par|\-|box| with
% |\set|\-|caption|\-|sub|\-|type| as first contents line.
% \end{background}
%
% \subsection{Comparison with \cs{captionbox}}
%
% Both, |\caption|\-|box| (offered by the \pkg{caption} package) and |\sub|\-|caption|\-|box|,
% put its contents and caption into a |\par|\-|box| of either natural or given width and share the
% same (mandatory and optional) arguments, but while |\caption|\-|box| uses a regular caption,
% |\sub|\-|caption|\-|box| uses a sub-caption instead, like ``(a)'' or ``2.1''.
%
% \pagebreak[3]
% So for example the last example would look like this when using |\caption|\-|box|
% instead of |\sub|\-|caption|\-|box|:
% \begin{quote}
%   |\begin{figure}|\\
%   |  \centering|\\
%   |  \captionbox{A cat\label{cat}}|\\
%   |    |\csoarg{.4\cs{textwidth}}|{\includegraphics{cat}}%|\\
%   |  \captionbox{An elephant\label{elephant}}|\\
%   |    |\csoarg{.4\cs{textwidth}}|{\includegraphics{elephant}}|\\
%   |\end{figure}|
% \end{quote}
% \noindent\begin{minipage}{\linewidth}
%   \captionsetup{type=figure}
%   \centering
%   \captionbox{A cat\label{cat3.1}}
%     [.4\textwidth]{\includegraphics[width=30pt]{cat}}%^^A
%   \captionbox{An elephant\label{elephant3.1}}
%     [.4\textwidth]{\includegraphics[width=140pt]{elephant}}
% \end{minipage}
%
% \iffalse
% --------------------------------------------------------------------------- %
% \fi
%
% \PageBreak
% \section{The \env{subcaptionblock} environment}
%
% \DescribeEnv{subcaptionblock}
% \NEWfeature*{v1.5}
% The |sub|\-|caption|\-|block| environment makes a box with given width.
% Inside this box the regular caption commands (like |\caption|, |\phantom|\-|caption|, \ldots) could be used to typeset sub-captions.
%
% \pagebreak[3]
% |sub|\-|caption|\-|block| has the same (optional \& mandatory) arguments as the |mini|\-|page| environment:
% \begingroup
% \leftmargini=12pt
% \begin{quote}
%   |\begin{subcaptionblock}|\oarg{outer-pos}\oarg{height}\oarg{inner-pos}\marg{width}\\
%   |  |\ldots\\
%   |\end{subcaptionblock}|
% \end{quote}
% \endgroup
%
% The default value for \meta{outer-pos} is `b' and the default value for \meta{inner-pos} is `s'.
% (Note that the default value for \meta{outer-pos} has changed from `c' to `b' in version $1.5$ of \thispackage.)
%
% \NEWfeature{v1.2}
% Beside the \meta{outer-pos} values of `c', `t', and `b', \thispackage\ also offers the
% values `T' and `B' additionally which align the |sub|\-|figure| at the
% very top resp.~bottom. (In contrast `t' and `b' align the |sub|\-|figure| at the
% top resp.~bottom \textit{baseline}.)
%
% \bigskip
%
% \pagebreak[3]
% The same example as \autoref{animals3}, but this time using the |sub|\-|caption|\-|block| environment
% instead of |\sub|\-|caption|\-|box|:
% \begin{quote}
%   |\begin{figure}|\\
%   |  \centering|\\
%   |  |\textcolor{blue}{\cs{begin}\csmarg{subcaptionblock}\csmarg{.4\cs{textwidth}}}\\
%   |    \centering|\\
%   |    \includegraphics{cat}|\\
%   |    |\textcolor{blue}{\cs{caption}}|{A cat}\label{cat}|\\
%   |  |\textcolor{blue}{\cs{end}\csmarg{subcaptionblock}}|%|\\
%   |  |\textcolor{blue}{\cs{begin}\csmarg{subcaptionblock}\csmarg{.4\cs{textwidth}}}\\
%   |    \centering|\\
%   |    \includegraphics{elephant}|\\
%   |    |\textcolor{blue}{\cs{caption}}|{An elephant}\label{elephant}|\\
%   |  |\textcolor{blue}{\cs{end}\csmarg{subcaptionblock}}|%|\\
%   |  \caption{Two animals}\label{animals}|\\
%   |\end{figure}|
% \end{quote}
% \noindent\begin{minipage}{\linewidth}
%   \captionsetup{type=figure}
%   \centering
%   \begin{subcaptionblock}{.4\textwidth}
%     \centering
%     \includegraphics[width=30pt]{cat}
%     \caption{A cat}\label{cat4}
%   \end{subcaptionblock}%
%   \begin{subcaptionblock}{.4\textwidth}
%     \centering
%     \includegraphics[width=140pt]{elephant}
%     \caption{An elephant}\label{elephant4}
%   \end{subcaptionblock}
%   \caption{Two animals}\label{animals4}
% \end{minipage}
%
% \medskip
%
% \pagebreak[3]
% Some additional notes:
% \begin{itemize}
% \item
% You can override the setttings for a specific subcaption
% with a |\caption|\-|setup| inside the |sub|\-|caption|\-|block|, e.g.:
% \begin{quote}
%   |\begin{subcaptionblock}{.4\textwidth}|\\
%   |  \centering|\\
%   |  \includegraphics{owl}|\\
%   |  |\textcolor{blue}{\cs{captionsetup}\csmarg{skip=3pt}}\\
%   |  \caption{An owl}\label{owl}|\\
%   |\end{subcaptionblock}|
% \end{quote}
% \item
% Just like |figure| or |table|, a |sub|\-|caption|\-|block| could have multiple captions, e.g.:
% \begin{quote}
%   |\begin{subcaptionblock}{.4\textwidth}|\\
%   |  \centering|\\
%   |  \includegraphics{cat}|\\
%   |  \caption{A cat}\label{cat}|\\
%   |  \medskip|\\
%   |  \includegraphics{elephant}|\\
%   |  \caption{An elephant}\label{elephant}|\\
%   |\end{subcaptionblock}|
% \end{quote}
% \item
% Hyperlinks targeted to this sub-figure will jump to the beginning
% of the |sub|\-|caption|\-|block|, and not to the |\caption| inside it
% (if |hypcap=true| is set for sub-captions).
% \See{\Ref{hypcap}}
% \end{itemize}
%
% \DescribeEnv{subfigure}
% \DescribeEnv{subtable}
% The |sub|\-|caption|\-|block| environment is also offered as |sub|\-|figure| resp.~|sub|\-|table|.
% (And prior version $1.5$ of \thispackage\ it was only available as |sub|\-|figure| resp.~|sub|\-|table|.)
%
% There is no difference in them except the environment name should match the current floating environment,
% i.e. inside a |figure| a |sub|\-|figure| should be used, and inside a |table| a |sub|\-|table| should be used.
% Using the wrong sub-environment will cause a warning since \version{1.5} of the \pkg{subcaption} package.
%
% So if in doubt, or when writing own \LaTeX\ commands which should work in every floating environment,
% using |sub|\-|caption|\-|block| is the correct choice.
%
% \smallskip
%
% \begin{background}
% The |sub|\-|caption|\-|block|, |sub|\-|figure|, and |sub|\-|table| environments are |mini|\-|page|
% environments with |\set|\-|caption|\-|sub|\-|type| as first contents line.
%
% |sub|\-|figure| and |sub|\-|table| are defined with the help of
% |\For|\-|Each|\-|Caption|\-|Sub|\-|Type| offered by the \pkg{caption} package,
% which executes code for every sub-type declared with |\Declare|\-|Caption|\-|Sub|\-|Type|.
% \end{background}
%
% \iffalse
% --------------------------------------------------------------------------- %
% \fi
%
% \PageBreak
% \section{The \env{subcaptiongroup} environment}
%
% \DescribeEnv{subcaptiongroup}
% \NEWfeature*{v1.5}
% The |sub|\-|caption|\-|group| environment is only switching to the sub-caption mode inside an own \TeX\ group.
% Inside this environment the regular caption commands (like |\caption|, |\phantom|\-|caption|, \ldots) could be used to typeset sub-captions.
%
% \pagebreak[3]
% Its syntax is:
% \begingroup
% \leftmargini=12pt
% \begin{quote}
%   |\begin{subcaptiongroup}|\\
%   |  |\ldots\\
%   |\end{subcaptiongroup}|
% \end{quote}
% \endgroup
%
% \pagebreak[3]
% There is a starred variant of this environment as well which uses |\set|\-|caption|\-|sub|\-|type*|
% instead of |\set|\-|caption|\-|sub|\-|type| internally:
% \begingroup
% \leftmargini=12pt
% \begin{quote}
%   |\begin{subcaptiongroup*}|\\
%   |  |\ldots\\
%   |\end{subcaptiongroup*}|
% \end{quote}
% \endgroup
%
% While this gives you great flexibility, it also offers you no help formatting its contents.
%
% \pagebreak[3]
% The same example as \autoref{animals4}, but this time using the |sub|\-|caption|\-|group| environment
% instead of |\sub|\-|caption|\-|block|:
% \begin{quote}
%   |\begin{figure}|\\
%   |  \centering|\\
%   |  |\textcolor{blue}{\cs{begin}\csmarg{subcaptiongroup}}\\
%   |    \centering|\\
%   |    \parbox[b]{.4\textwidth}{%|\\
%   |      \centering|\\
%   |      \includegraphics{cat}|\\
%   |      \caption{A cat}\label{cat}}%|\\
%   |    \parbox[b]{.4\textwidth}{%|\\
%   |      \centering|\\
%   |      \includegraphics{elephant}|\\
%   |      \caption{An elephant}\label{elephant}}%|\\
%   |  |\textcolor{blue}{\cs{end}\csmarg{subcaptiongroup}}\\
%   |  \caption{Two animals}\label{animals}|\\
%   |\end{figure}|
% \end{quote}
% --or--
% \begin{quote}
%   |\begin{figure}|\\
%   |  \centering|\\
%   |  |\textcolor{blue}{\cs{begin}\csmarg{subcaptiongroup}}\\
%   |    \centering|\\
%   |    \begin{minipage}[b]{.4\textwidth}|\\
%   |      \centering|\\
%   |      \includegraphics{cat}|\\
%   |      \caption{A cat}\label{cat}|\\
%   |    \end{minipage}%|\\
%   |    \begin{minipage}[b]{.4\textwidth}|\\
%   |      \centering|\\
%   |      \includegraphics{elephant}|\\
%   |      \caption{An elephant}\label{elephant}|\\
%   |    \end{minipage}|\\
%   |  |\textcolor{blue}{\cs{end}\csmarg{subcaptiongroup}}\\
%   |  \caption{Two animals}\label{animals}|\\
%   |\end{figure}|
% \end{quote}
% \noindent\begin{minipage}{\linewidth}
%   \captionsetup{type=figure}
%   \centering
%   \begin{subcaptiongroup}
%     \centering
%     \begin{minipage}[b]{.4\textwidth}
%       \centering
%       \includegraphics[width=30pt]{cat}
%       \caption{A cat}\label{cat5}
%     \end{minipage}%
%     \begin{minipage}[b]{.4\textwidth}
%       \centering
%       \includegraphics[width=140pt]{elephant}
%       \caption{An elephant}\label{elephant5}
%     \end{minipage}
%   \end{subcaptiongroup}
%   \caption{Two animals}\label{animals5}
% \end{minipage}
%
% \bigskip
%
% \begin{background}
% The |sub|\-|caption|\-|group| environment is a \LaTeX\ environment
% with |\set|\-|caption|\-|sub|\-|type| as first contents line.
% \end{background}
%
% \iffalse
% --------------------------------------------------------------------------- %
% \fi
%
% \PageBreak
% \section{The \cs{DeclareCaptionSubType} command}
%
% \DescribeMacro\DeclareCaptionSubType
% For using the sub-caption feature of the \pkg{caption} package some
% commands and counters must be prepared. This is done with
% \begin{quote}
%  |\DeclareCaptionSubType|\oarg{numbering scheme}\marg{type}\\
%  |\DeclareCaptionSubType*|\oarg{numbering scheme}\marg{type}
% \end{quote}
% For the environments |figure| \& |table|, and all the ones
% defined with |\Declare|\-|Floating|\-|Environment| offered by the
% \pkg{newfloat} package, this will be done automatically,
% but for other environments (e.g.~the ones defined with |\newfloat| offered by the
% \pkg{float} package or |\Declare|\-|New|\-|Float|\-|Type| offered by the
% \pkg{floatrow} package) this has to be done manually.
%
% \medskip
%
% The starred variant provides the sub-caption numbering format
% \meta{type}|.|\meta{subtype} (for example `|1.2|') while the non-starred variant
% simply uses \meta{subtype} (for example `|a|').
%
% \pagebreak[3]
% Own numbering formats can be created by redefining |\thesub|\meta{type}, e.g.:
% \begingroup
% \leftmargini=12pt
% \begin{quote}
%   |\DeclareCaptionSubType*{figure}|\\
%   |\renewcommand\thesubfigure{\thefigure\alph{subfigure}}|
% \end{quote}
% \endgroup
% would give you sub-caption numbers like `|1b|'.
%
% The default numbering scheme is |alph|, but you can use any \LaTeX\ (or self-defined)
% command name here which converts a counter to a text value, e.g.: |arabic|, |roman|,
% |Roman|, |alph|, |Alph|, |fnsymbol|, \ldots
%
% \pagebreak[3]
% But |\DeclareCaptionSubType| is not only for defining new sub-caption types,
% you can use this command for re-definitions as well, e.g.:
% \begingroup
% \leftmargini=12pt
% \begin{quote}
%   |\DeclareCaptionSubType*[arabic]{table}|\\
%   |\captionsetup[subtable]{labelformat=simple,labelsep=colon}|
% \end{quote}
% \endgroup
% \pagebreak[2]
% will give you sub-captions in |table|s like these ones:
% \par\bigskip
% \noindent\begin{minipage}{\linewidth}
%   \captionsetup{type=table}
%   \centering
%   \caption{Two tables}
%   \subcaptionbox{Table one}[3cm][c]{\begin{tabular}{cc}A & B\\ C & D\\ \end{tabular}}
%   \subcaptionbox{Table two}[3cm][c]{\begin{tabular}{cc}E & F\\ G & H\\ \end{tabular}}
% \end{minipage}
%
% \begin{background}
% |\Declare|\-|Caption|\-|Sub|\-|Type| and |\For|\-|Each|\-|Caption|\-|Sub|\-|Type|
% are integral parts of the \pkg{caption} package kernel.
% \end{background}
%
% \iffalse
% --------------------------------------------------------------------------- %
% \fi
%
% \PageBreak
% \section{Cross Referencing}
% \label{crossreferencing}
%
% The macro |\the|\-\meta{counter} is not only responsible for the look of the \meta{counter},
% but for the look of the references typeset with |\ref|, too. References will be prefixed by
% \LaTeX{} with the internal macro |\p@|\-\meta{counter}.
%
% |\Declare|\-|Caption|\-|Sub|\-|Type| will define both of them for sub-captions
% (e.g. |sub|\-|figure| and |sub|\-|table|), and as you have seen in the last section
% |\Declare|\-|Caption|\-|Sub|\-|Type| will give you some options to control the
% internal (re-)definition of |\the|\-\meta{counter} and |\p@|\-\meta{counter}.
%
% \pagebreak[3]
% \DescribeMacro\thesubfigure
% \DescribeMacro\p@subfigure
% For example |\thesubfigure| and |\p@subfigure| are (as default) internally defined as
% \begin{quote}
% |\newcommand\thesubfigure{\alph{subfigure}}|\\
% |\newcommand\p@subfigure{\thefigure}|
% \end{quote}
% so the label of sub-captions will look like `|a|' (decorated by the selected label format),
% while references will look like `|1a|' since they are prefixed by |\p@sub|\-|figure| $=$
% |\the|\-|figure|.
%
% After |\Declare|\-|Caption|\-|Sub|\-|Type*[arabic]{figure}|, |\the|\-|sub|\-|figure| and
% |\p@sub|\-|figure| will look like
% \begin{quote}
% |\renewcommand\thesubfigure{\thefigure.\arabic{subfigure}}|\\
% |\renewcommand\p@subfigure{}|
% \end{quote}
%
% But if you want detailed control on how the references will look like,
% the options of |\Declare|\-|Caption|\-|Sub|\-|Type| are potentially not sufficient.
% In this case one need to redefine these two macros on his/her own.
% Some examples:
%
% If you want parentheses around the sub-figure part of the reference,
% so they will look like `|1(a)|', you may get them this way:
% \begin{quote}
% |\usepackage[labelformat=simple]{subcaption}|\\
% |\renewcommand\thesubfigure{(\alph{subfigure})}|
% \end{quote}
% {\small (\emph{Note:} Since |parens| is the default label format you will get double
% parentheses in sub-captions when not specifiying a different label format, e.g. |simple|.)}
%
% But if you want only a closing parenthesis, so references will look like `|1a)|',
% but the sub-captions itself should still look like `|(a)|',
% this would be a possible solution:
% \begin{quote}
% |\usepackage{subcaption}|\\
% |\renewcommand\thesubfigure{\alph{subfigure})}|\\
% |\DeclareCaptionLabelFormat{opening}{(#2}|\\
% |\captionsetup[subfigure]{labelformat=opening}|
% \end{quote}
%
% \bigskip
%
% \INFO
% {\small Please note that you need to surround redefinitions of |\p@|\-\meta{counter}
% with |\makeatletter| and |\makeatother|. See
% \url{http://tex.stackexchange.com/questions/8351/}
% for details.}
%
% \pagebreak[3]
% \subsection{The \cs{subref} command}
% \label{subref}
%
% While |\ref|\marg{key} (and |\ref*|\marg{key}, if the \pkg{hyperref}
% package is used) usually gives a combined result representing the main
% caption counter and the sub-caption one, it is sometimes useful to have
% a reference to the sub-caption only. For this purpose you can use
% \begin{quote}
%   |\subref|\marg{key}\\
%   |\subref*|\marg{key}~\footnote{%^^A
%     Like \cs{ref*}, \cs{subref*} is only available if the \pkg{hyperref}
%     package\cite{hyperref} is used.}%^^A
%     \qquad.
% \end{quote}
% So for example |\ref{cat}| gives the result `\ref{cat}' but |\subref{cat}|
% gives `\subref{cat}'.
%
% \begin{small}
% \emph{Note:} If the sub-caption was (re-)defined with the starred variant
% |\Declare|\-|Caption|\-|Sub|\-|Type*|, both |\ref| and |\sub|\-|ref| usually gives
% the same result.
% \end{small}
%
% \begin{background}
% The |\sub|\-|ref| command demonstrates the usage of |\caption@sub|\-|type|\-|hook|
% which will be called during |\caption|\-|setup{sub|\-|type}|.
% \end{background}
%
% \pagebreak[3]
% \subsection{The \opt{subrefformat=} option}
% \label{subrefformat}
%
% \DescribeMacro{subrefformat=}
% \NEWfeature*{v1.1}
% By applying |\Declare|\-|Caption|\-|Sub|\-|Type|, or by redefining |\the|\-\meta{counter}
% and |\p@|\-\meta{counter}, you will change the look of references typeset with |\ref|
% \emph{and} |\sub|\-|ref|.
%
% But maybe you only want to change the output of |\sub|\-|ref| without
% affecting the references typeset with |\ref|?
%
% \pagebreak[3]
% This is possible, too, by using the option \opt{subrefformat}:
% \begin{quote}
%   |\captionsetup{subrefformat=|\meta{label format}|}|
% \end{quote}
% This one will choose a label format (either a pre-defined one, or a one defined with
% |\Declare|\-|Caption|\-|Label|\-|Format|) as decorative element to sub-references.
% The default one is |simple| which has no decorative elements but simply typeset
% the reference as it is.
%
% \pagebreak[3]
% For example
% \begin{quote}
%   |\captionsetup{subrefformat=parens}|
% \end{quote}
% will result in references (typeset with |\ref|) like `|1a|' but sub-references
% (typeset with |\subref|) like `|(a)|'.
%
% \subsection{Referencing sub-figures without sub-captions}
% \label{without}
%
% \DescribeMacro\phantomcaption
% If you don't want to give a sub-figure a caption (yet), because the picture itself
% already contains the caption, or for some other reason, you could use the command
% \begin{quote}
%   |\phantomcaption|
% \end{quote}
% instead of |\caption|.
%
% |\phantom|\-|caption| is offered by the \pkg{caption} package since version $3.2$ and
% does not generate any output but increases the sub-figure resp.~sub-table counter
% and gives you an anchor for a |\label| command which can be placed after it.
%
% \pagebreak[3]
% An example:
% \begin{quote}
%   |\begin{figure}|\\
%   |  \centering|\\
%   |  \begin{subcaptiongroup}|\\
%   |    \includegraphics{cat_with_a}|\\
%   |    |\textcolor{blue}{\cs{phantomcaption}}|\label{cat}|\\
%   |    \includegraphics{elephant_with_b}|\\
%   |    |\textcolor{blue}{\cs{phantomcaption}}|\label{elephant}|\\
%   |  \end{subcaptionblock}|\\
%   |  \captionsetup{subrefformat=parens}|\\
%   |  \caption{Two animals: \subref{cat} a cat,|\\
%   |           and \subref{elephant} an elephant}|\\
%   |  \label{animals}|\\
%   |\end{figure}|
% \end{quote}
% \noindent\begin{minipage}{\linewidth}
%   \captionsetup{type=figure}
%   \centering
%   \begin{subcaptiongroup}
%     \phantomcaption\label{cat6.3}
%     \begin{overpic}[width=30pt]{cat}
%       \put(40,34){\captiontext*{}}
%     \end{overpic}
%     \phantomcaption\label{elephant6.3}
%     \begin{overpic}[width=140pt]{elephant}
%       \put(58,40){\captiontext*{}}
%     \end{overpic}
%   \end{subcaptiongroup}
%   \captionsetup{subrefformat=parens}
%   \caption{Two animals: \subref{cat6.3} a cat, and \subref{elephant6.3} an elephant}
% \end{minipage}
%
% \bigskip
%
% \pagebreak[3]
% \DescribeMacro\captionlistentry
% If you don't want to give a sub-figure a caption (yet), because the picture itself
% already contains the caption, or for some other reason, you could also use the command
% \begin{quote}
%   |\captionlistentry|\marg{list entry}
% \end{quote}
% instead of |\caption|.
%
% |\caption|\-|list|\-|entry| is offered by the \pkg{caption} package since version $3.3$ and
% (just like |\phantom|\-|caption|) does not generate any output but increases
% the sub-figure resp.~sub-table counter
% and gives you an anchor for a |\label| command which can be placed after it.
% Additionally to |\phantom|\-|caption| this command puts an entry into the list
% of figures resp.~tables.
%
% \pagebreak[3]
% An example:
% \begin{quote}
%   |\begin{figure}|\\
%   |  \centering|\\
%   |  \begin{subcaptiongroup}|\\
%   |    \includegraphics{cat_with_a}|\\
%   |    |\textcolor{blue}{\cs{captionlistentry}\csmarg{A cat}}\\
%   |    \label{cat}|\\
%   |    \includegraphics{elephant_with_b}|\\
%   |    |\textcolor{blue}{\cs{captionlistentry}\csmarg{An elephant}}\\
%   |    \label{elephant}|\\
%   |  \end{subcaptionblock}|\\
%   |  \captionsetup{subrefformat=parens}|\\
%   |  \caption{Two animals: \subref{cat} a cat,|\\
%   |           and \subref{elephant} an elephant}|\\
%   |  \label{animals}|\\
%   |\end{figure}|
% \end{quote}
%
% \pagebreak[3]
% \subsection{Typesetting sub-captions without generating a (new) reference}
% \label{without2}
%
% The |\caption| command is a multi-purpose command:
% \begin{enumerate}
% \item It increments the sub-figure resp.~sub-table counter and generates an internal reference which could be used with |\label|
% \item It puts an entry into the list of figures resp.~tables
% \item It finally typesets a caption
% \end{enumerate}
%
% When put into a command or into an environment which either evaluates its content more than once or
% does not like one of the first two actions (for whatever reason), the result could be either an error message or an incorrect
% result, for example a sub-figure resp.~sub-table counter which was incremented more than once.
%
% \DescribeMacro\captiontext
% In these cases the |\caption| command could be split into
% |\phantom|\-|caption| which performs step one only (or |\caption|\-|list|\-|entry| which performs steps one and two),
% and |\caption|\-|text| which performs step three only.
% This way critical steps could be out-sourced from the target command or environment,
% for example by prepending |\phantom|\-|caption| and using |\caption|\-|text| inside.
%
% \pagebreak[3]
% The syntax of |caption|\-|text| is
% \begin{quote}
%   |\captiontext|\oarg{number}\marg{text of sub-caption}\\
%   |\captiontext*|\oarg{number}\marg{text of sub-caption}
% \end{quote}
% |\caption|\-|text| is offered by the \pkg{caption} package since version $3.6$ and
% as opposite to |\caption| it does not increase the sub-figure resp.~sub-table counter
% and does not give you an anchor for a |\label| command.
% It typesets the caption only, using existing counter values unless a \meta{number} is given explicitly.
%
% For example code please take a look at \Ref{inside}.
%
% \pagebreak[3]
% \subsection{Where to place the \cs{label} command?}
% \label{label}
%
% When |\caption|
% inside a |caption|\-|sub|\-|block|, |sub|\-|figure|, |sub|\-|table|, or |caption|\-|sub|\-|group| environment,
% the |\label| can be either placed inside the caption text or right after the command, e.g.:
% \begin{quote}
%   |\caption{Some text here\label{text}}|\\
%    \ldots\\
%   |\caption{Some other text}\label{othertext}|\\
%    \ldots\\
%   |\caption{Something completely different}|\\
%   |\label{differenttext}|
% \end{quote}
%
% When using |\phantom|\-|caption| or |\caption|\-|list|\-|entry|
% inside a |caption|\-|sub|\-|block|, |sub|\-|figure|, |sub|\-|table|, or |caption|\-|sub|\-|group| environment,
% the |\label| should be placed right after the command, e.g.:
% \begin{quote}
%   |\phantomcaption\label{this}|\\
%    \ldots\\
%   |\phantomcaption|\\
%   |\label{that}|
% \end{quote}
%
% But when using the |\sub|\-|caption|\-|box| command, the |\label| should be placed inside
% the caption text, e.g.:
% \begin{quote}
%   |\subcaptionbox{A description here\label{todo1}}|\\
%   |              {Some content here}|\\
%    \ldots\\
%   |\subcaptionbox[List-of-Figures entry]|\\
%   |              {A description here\label{todo2}}|\\
%   |              {Some content here}|
% \end{quote}
% Placing |\label| outside the |\sub|\-|caption|\-|box| would produce an incorrect reference.
%
% \pagebreak[3]
% \subsection{Where do hyperlinks jump?}
% \label{hypcap}
%
% For the |caption|\-|sub|\-|block|, |sub|\-|figure|, |sub|\-|table|, and |caption|\-|sub|\-|group| environments,
% and for the |\sub|\-|caption|\-|box| command (and all other constructs which use |\set|\-|caption|\-|sub|\-|type|)
% the hyperlink anchors will be placed in respect to the |hypcap=| setting.
% While usage of this option is straight-forward for ordinary captions,
% the usage for sub-captions depends on the setting regarding the main captions.
%
% This table gives you an overview where the hyperlinks will jump:
%
% \bigskip
%
% \begin{small}
% \centering
% \DeleteShortVerb{\|}
% \renewcommand\arraystretch{1.5}
% \begin{tabular}{|l|p{3cm}p{3cm}|}
% \hline
% \backslashbox{subcaption}{caption} &
%   \multicolumn{1}{c}{\texttt{hypcap=false}} &
%   \multicolumn{1}{c|}{\texttt{hypcap=true}} \\
% \hline
% \raisebox{-1.5ex}[1.5ex]{\texttt{hypcap=false}} &
%   sub-caption & figure or table\par\hfill\textit{(default setting)}\\
% \raisebox{-1.5ex}[1.5ex]{\texttt{hypcap=true}} &
%   sub-figure or\par sub-table & sub-figure or\par sub-table \\
% \hline
% \end{tabular}\par
% \MakeShortVerb{\|}
% \end{small}
% \bigskip
%
% But if the |caption|\-|sub|\-|group*| environment is used
% (or a different construct which uses |\set|\-|caption|\-|sub|\-|type*|)
% and |hypcap=true| is set for sub-captions,
% \thispackage\ does not know where the sub-figure or sub-table actually
% begins, so it will jump to the sub-caption instead.
%
% \medskip
% \emph{Remember:} If you use the \pkg{hypcap} package\cite{hypcap},
% it controls the placement of the hyperlink anchors, making the rules
% above invalid.
%
% \bigskip
% {\small(See also the documentation of the \pkg{caption} package,
% sections about \pkg{hyperref} \& \pkg{hypcap}.)}
%
% \iffalse
% --------------------------------------------------------------------------- %
% \fi
%
% \PageBreak
% \section{Captions inside sub-figures}
% \label{inside}
%
% Nearly all code examples so far have placed the caption either above or below the sub-figure.
% But it is possible to put the caption inside the sub-figure, too:
% \begin{itemize}
% \item The caption could already be part of the image. (This case is already handled in \Ref{without}.)
% \item \LaTeX\ packages like \pkg{overpic}, \pkg{stackengine}, or \pkg{tikz} could be used.
% Note that the commands resp.~environments offered by these packages usually evaluate their content more than once,
% resulting in either errors or wrong reference counters.
% For this reason |\caption| should not be used here, instead
% |\phantomcaption| or |\captionlistentry| should be used outside the command resp.~environment and
% |\captiontext| should be used inside it.
% See also \Ref{without2}
% \item The options |skip=| and |margin=| could be used to place the caption onto the image.
% \end{itemize}
%
% \pagebreak[3]
% \subsection{Using the overpic package}
% \label{overpic}
%
% The same example as in section \Ref{without}, but using the \env{overpic} environment
% offered by the \pkg{overpic} package~\cite{overpic}
% to place the captions inside the pictures:
% \begin{quote}
%   |\usepackage{overpic}|\\
%   \ldots\\
%   |\begin{figure}|\\
%   |  \centering|\\
%   |  \begin{subcaptiongroup}|\\
%   |    |\textcolor{blue}{\cs{subcaptionlistentry}\csmarg{A cat}}\\
%   |    \label{cat}|\\
%   |    \begin{overpic}[width=60pt]{cat}|\\
%   |      \put(40,34){|\textcolor{blue}{\cs{captiontext*}\csmarg{}}|}|\\
%   |    \end{overpic}|\\
%   |    |\textcolor{blue}{\cs{subcaptionlistentry}\csmarg{An elephant}}\\
%   |    \label{elephant}|\\
%   |    \begin{overpic}[width=140pt]{elephant}|\\
%   |      \put(58,40){|\textcolor{blue}{\cs{captiontext*}\csmarg{}}|}|\\
%   |    \end{overpic}|\\
%   |  \end{subcaptiongroup}|\\
%   |  \captionsetup{subrefformat=parens}|\\
%   |  \caption{Two animals: \subref{cat} a huge cat,|\\
%   |           and \subref{elephant} an elephant}|\\
%   |\end{figure}|
% \end{quote}
% \noindent\begin{minipage}{\linewidth}
%   \captionsetup{type=figure}
%   \centering
%   \begin{subcaptiongroup}
%     \subcaptionlistentry{A cat}\label{cat7.1}
%     \begin{overpic}[width=60pt]{cat}
%       \put(40,34){\captiontext*{}}
%     \end{overpic}
%     \subcaptionlistentry{An elephant}\label{elephant7.1}
%     \begin{overpic}[width=140pt]{elephant}
%       \put(58,40){\captiontext*{}}
%     \end{overpic}
%   \end{subcaptiongroup}
%   \captionsetup{subrefformat=parens}
%   \caption{Two animals: \subref{cat7.1} a huge cat, and \subref{elephant7.1} an elephant}
% \end{minipage}
%
% \bigskip
%
% If neither a reference to the sub-figures nor an entry in the List of Figures is needed,
% the usage of |\phantom|\-|caption| resp.~|\caption|\-|list|\-|entry| could be dropped.
% Since this leaves |\caption|\-|text| without a valid sub-figure number value it must be
% given to it explicitly as optional argument.
%
% Furthermore the usage of the |sub|\-|caption|\-|group| environment could be dropped here,
% instead it would be sufficient to replace |\caption|\-|text| with |\sub|\-|caption|\-|text|.
% \See{\Ref{subcaption}}
%
% \begin{quote}
%   |\usepackage{overpic}|\\
%   \ldots\\
%   |\begin{figure}|\\
%   |  \centering|\\
%   |  \begin{overpic}[width=60pt]{cat}|\\
%   |    \put(40,34){|\textcolor{blue}{\cs{subcaptiontext*}\csoarg{1}\csmarg{}}|}|\\
%   |  \end{overpic}|\\
%   |  \begin{overpic}[width=140pt]{elephant}|\\
%   |    \put(58,40){|\textcolor{blue}{\cs{subcaptiontext*}\csoarg{2}\csmarg{}}|}|\\
%   |  \end{overpic}|\\
%   |  \caption{Two animals: A huge cat and an elephant}|\\
%   |\end{figure}|
% \end{quote}
%
% \pagebreak[3]
% \subsection{Using the stackengine package}
% \label{stackengine}
%
% The same example as in section \Ref{without}, but using the |\stack|\-|inset| command
% offered by the \pkg{stackengine} package~\cite{stackengine}
% to place the captions inside the pictures:
% \begin{quote}
%   |\usepackage{stackengine}|\\
%   \ldots\\
%   |\begin{figure}|\\
%   |  \centering|\\
%   |  \begin{subcaptiongroup}|\\
%   |    |\textcolor{blue}{\cs{subcaptionlistentry}\csmarg{A cat}}\\
%   |    \label{cat}|\\
%   |    \stackinset{l}{25pt}{b}{20pt}{|\textcolor{blue}{\cs{captiontext*}\csmarg{}}|}|\\
%   |      {\includegraphics[width=60pt]{cat}}|\\
%   |    |\textcolor{blue}{\cs{subcaptionlistentry}\csmarg{An elephant}}\\
%   |    \label{elephant}|\\
%   |    \stackinset{l}{80pt}{b}{60pt}{|\textcolor{blue}{\cs{captiontext*}\csmarg{}}|}|\\
%   |      {\includegraphics[width=140pt]{elephant}}|\\
%   |  \end{subcaptiongroup}|\\
%   |  \captionsetup{subrefformat=parens}|\\
%   |  \caption{Two animals: \subref{cat} a huge cat,|\\
%   |           and \subref{elephant} an elephant}|\\
%   |\end{figure}|
% \end{quote}
% \noindent\begin{minipage}{\linewidth}
%   \captionsetup{type=figure}
%   \centering
%   \begin{subcaptiongroup}
%     \subcaptionlistentry{A cat}\label{cat7.2}
%     \stackinset{l}{25pt}{b}{20pt}{\captiontext*{}}{\includegraphics[width=60pt]{cat}}
%     \subcaptionlistentry{An elephant}\label{elephant7.2}
%     \stackinset{l}{80pt}{b}{60pt}{\captiontext*{}}{\includegraphics[width=140pt]{elephant}}
%   \end{subcaptiongroup}
%   \captionsetup{subrefformat=parens}
%   \caption{Two animals: \subref{cat7.2} a huge cat, and \subref{elephant7.2} an elephant}
% \end{minipage}
%
% \bigskip
%
% \pagebreak[3]
% If neither a reference to the sub-figures nor an entry in the List of Figures is needed,
% this code could be simpified to:
% \begin{quote}
%   |\usepackage{stackengine}|\\
%   \ldots\\
%   |\begin{figure}|\\
%   |  \centering|\\
%   |  \stackinset{l}{25pt}{b}{20pt}{|\textcolor{blue}{\cs{subcaptiontext*}\csoarg{1}\csmarg{}}|}|\\
%   |    {\includegraphics[width=60pt]{cat}}|\\
%   |  \stackinset{l}{80pt}{b}{60pt}{|\textcolor{blue}{\cs{subcaptiontext*}\csoarg{2}\csmarg{}}|}|\\
%   |    {\includegraphics[width=140pt]{elephant}}|\\
%   |  \caption{Two animals: A huge cat and an elephant}|\\
%   |\end{figure}|
% \end{quote}
%
% \pagebreak[3]
% \subsection{Using the tikz package}
% \label{tikz}
%
% The same example as in section \Ref{without}, but using the \env{tikzpicture} environment
% offered by the \pkg{tikz} package~\cite{tikz}
% to place the captions inside the pictures:
% \begin{quote}
%   |\usepackage{tikz}|\\
%   \ldots\\
%   |\begin{figure}|\\
%   |  \centering|\\
%   |  \begin{subcaptiongroup}|\\
%   |    |\textcolor{blue}{\cs{subcaptionlistentry}\csmarg{A cat}}\\
%   |    \label{cat}|\\
%   |    \begin{tikzpicture}|\\
%   |      \node (cat) at (0,0)|\\
%   |        {\includegraphics[width=60pt]{cat}};|\\
%   |      \node at (0.1,-0.1) {|\textcolor{blue}{\cs{captiontext*}\csmarg{}}|};|\\
%   |    \end{tikzpicture}|\\
%   |    |\textcolor{blue}{\cs{subcaptionlistentry}\csmarg{An elephant}}\\
%   |    \label{elephant}|\\
%   |    \begin{tikzpicture}|\\
%   |      \node (elephant) at (0,0)|\\
%   |        {\includegraphics[width=140pt]{elephant}};|\\
%   |      \node at (0.5,-0.1) {|\textcolor{blue}{\cs{captiontext*}\csmarg{}}|};|\\
%   |    \end{tikzpicture}|\\
%   |  \end{subcaptiongroup}|\\
%   |  \captionsetup{subrefformat=parens}|\\
%   |  \caption{Two animals: \subref{cat} a huge cat,|\\
%   |           and \subref{elephant} an elephant}|\\
%   |\end{figure}|
% \end{quote}
%
% \noindent\begin{minipage}{\linewidth}
%   \captionsetup{type=figure}
%   \centering
%   \begin{subcaptiongroup}
%     \subcaptionlistentry{A cat}\label{cat7.3}
%     \begin{tikzpicture}
%       \node (cat) at (0,0) {\includegraphics[width=60pt]{cat}};
%       \node at (0.1,-0.1) {\captiontext*{}};
%     \end{tikzpicture}
%     \subcaptionlistentry{An elephant}\label{elephant7.3}
%     \begin{tikzpicture}
%       \node (cat) at (0,0) {\includegraphics[width=140pt]{elephant}};
%       \node at (0.5,-0.1) {\captiontext*{}};
%     \end{tikzpicture}
%   \end{subcaptiongroup}
%   \captionsetup{subrefformat=parens}
%   \caption{Two animals: \subref{cat7.3} a huge cat, and \subref{elephant7.3} an elephant}
% \end{minipage}
%
% \bigskip
%
% \pagebreak[3]
% If neither a reference to the sub-figures nor an entry in the List of Figures is needed,
% this code could be simpified to:
% \begin{quote}
%   |\usepackage{tikz}|\\
%   \ldots\\
%   |\begin{figure}|\\
%   |  \centering|\\
%   |  \begin{tikzpicture}|\\
%   |    \node (cat) at (0,0)|\\
%   |      {\includegraphics[width=60pt]{cat}};|\\
%   |    \node at (0.1,-0.1) {|\textcolor{blue}{\cs{subcaptiontext*}\csoarg{1}\csmarg{}}|};|\\
%   |  \end{tikzpicture}|\\
%   |  \begin{tikzpicture}|\\
%   |    \node (elephant) at (0,0)|\\
%   |      {\includegraphics[width=140pt]{elephant}};|\\
%   |    \node at (0.5,-0.1) {|\textcolor{blue}{\cs{subcaptiontext*}\csoarg{2}\csmarg{}}|};|\\
%   |  \end{tikzpicture}|\\
%   |  \caption{Two animals: A huge cat and an elephant}|\\
%   |\end{figure}|
% \end{quote}
%
% \pagebreak[3]
% \subsection{Using the skip and margin options}
% For a particular sub-caption the |skip=|\ldots could be set to a negative value so it will overlap with the image.
% Combined with |singlelinecheck=off| (to switch off the centering of short captions) and |margin=|\ldots it could be placed
% at a specific horizontal position within the image, too.
%
% \pagebreak[3]
% The same example as in section \Ref{without}, but using the |skip=|\ldots and |margin=|\ldots options:
% \begin{quote}
%   |\begin{figure}|\\
%   |  \centering|\\
%   |  \captionsetup[subfigure]|\\
%   |    {skip=-28pt,slc=off,margin={25pt,0pt}}|\\
%   |  \subcaptionbox{\label{cat}}|\\
%   |    {\includegraphics[width=60pt]{cat}}|\\
%   |  \captionsetup[subfigure]|\\
%   |    {skip=-60pt,slc=off,margin={80pt,0pt}}|\\
%   |  \subcaptionbox{\label{elephant}}|\\
%   |    {\includegraphics[width=140pt]{elephant}}|\\
%   |  \captionsetup{subrefformat=parens}|\\
%   |  \caption{Two animals: \subref{cat} a huge cat,|\\
%   |           and \subref{elephant} an elephant}|\\
%   |\end{figure}|
% \end{quote}
%
% \noindent\begin{minipage}{\linewidth}
%   \captionsetup{type=figure}
%   \centering
%   \captionsetup[subfigure]{skip=-28pt,slc=off,margin={25pt,0pt}}
%   \subcaptionbox{\label{cat7.4}}{\includegraphics[width=60pt]{cat}}
%   \captionsetup[subfigure]{skip=-60pt,slc=off,margin={80pt,0pt}}
%   \subcaptionbox{\label{elephant7.4}}{\includegraphics[width=140pt]{elephant}}
%   \captionsetup{subrefformat=parens}
%   \caption{Two animals: \subref{cat7.4} a huge cat, and \subref{elephant7.4} an elephant}
% \end{minipage}
%
% \iffalse
% --------------------------------------------------------------------------- %
% \fi
%
% \PageBreak
% \section{Numbering}
%
% \subsection{Pittfall \#1: Using multiple main captions}
%
% When multiple main captions are used within a figure or table, and sub-captions
% are used as well, how does the \pkg{subcaption} package know which
% sub-captions belong to which caption, i.e. what is the main counter value for
% the sub-captions?
%
% \pagebreak[3]
% Let's illustrate this problem with an example document:
% \begin{quote}
%   |\documentclass{article}|\\
%   |\usepackage{graphicx,subcaption}|\\
%   |\begin{document}|\\
%   |\begin{figure}|\\
%   |  \centering|\\
%   |  \includegraphics[width=4cm]{example-image-c}|\\
%   |  \caption{Caption no. 1}|\\
%   |  \bigskip|\\
%   |  \subcaptionbox|\\
%   |    {\label{fig:2a}}|\\
%   |    {\includegraphics[width=2cm]{example-image-a}}|\\
%   |  \subcaptionbox|\\
%   |    {\label{fig:2b}}|\\
%   |    {\includegraphics[width=2cm]{example-image-b}}|\\
%   |  \caption{Caption no. 2}|\\
%   |\end{figure}|\\
%   |Look at sub-figures \ref{fig:2a} and \ref{fig:2b}.|\\
%   |\end{document}|
% \end{quote}
%
% It's obvious that the sub-captions belong to 2nd caption, and therefore
% |\ref{fig:2a}| will become ``2a'', isn't it?
% But since the \pkg{subcaption} package is only involved when using
% \LaTeX\ commands either defined or patched by the \pkg{caption} or
% \pkg{subcaption} package, this is what the \pkg{caption} package
% is aware of:
% \begin{quote}
%   |\usepackage{subcaption}|\\
%   |\begin{document}|\\
%   |\begin{figure}|\\
%   |  \caption{Caption no. 1}|\\
%   |  \subcaptionbox|\\
%   |    {\label{fig:2a}}|\\
%   |    {|\meta{unknown content}|}|\\
%   |  \subcaptionbox|\\
%   |    {\label{fig:2b}}|\\
%   |    {|\meta{unknown content}|}|\\
%   |  \caption{Caption no. 2}|\\
%   |\end{figure}|\\
%   |\end{document}|
% \end{quote}
%
% So from \pkg{caption}s point of view it's not easy to decide if the
% sub-captions belong to the 1st or 2nd main caption since they are placed
% between them. (Note: The \pkg{subcaption} package is only offering
% an user interface to the sub-caption feature of the \pkg{caption} package,
% and therefore this decision is the responsibility of the \pkg{caption} package.)
%
% But how does the \pkg{caption} package makes a decision?
% If in doubt, it rather clings to the past than to the future, i.e.~in this
% case it decides that the sub-captions belong to the 1st caption and therefore
% the result of |\ref{fig:2a}| is not ``2a'' but ``1a''.
% If the \pkg{caption} package is unsure about its decision (like in this
% case), a warning will be issued:
% \begingroup
% \leftmargini=12pt
% \begin{quote}
%   |Package caption Warning: Ambiguous sub-caption(s),|\\
%   |                         use \nextfloat on input line 15.|\\
%   |See the caption package documentation for explanation.|
% \end{quote}
% \endgroup
%
% \pagebreak[3]
% How to fix it? Use |\next|\-|float| to tell the \pkg{caption} package
% where the 2nd figure within the |figure| environment starts:
% \begin{quote}
%   |\documentclass{article}|\\
%   |\usepackage{graphicx,subcaption}|\\
%   |\begin{document}|\\
%   |\begin{figure}|\\
%   |  \centering|\\
%   |  \includegraphics[width=4cm]{example-image-c}|\\
%   |  \caption{Caption no. 1}|\\
%   |  \bigskip|\\
%   ||\textcolor{blue}{\cs{nextfloat}}\\
%   |  \subcaptionbox|\\
%   |    {\label{fig:2a}}|\\
%   |    {\includegraphics[width=2cm]{example-image-a}}|\\
%   |  \subcaptionbox|\\
%   |    {\label{fig:2b}}|\\
%   |    {\includegraphics[width=2cm]{example-image-b}}|\\
%   |  \caption{Caption no. 2}|\\
%   |\end{figure}|\\
%   |Look at sub-figures \ref{fig:2a} and \ref{fig:2b}.|\\
%   |\end{document}|
% \end{quote}
%
% \INFO
% Note that the |\next|\-|float| command was introduced in \pkg{caption} package
% \version{3.6}.
% Previous versions of the \pkg{caption} package have bound the decision to the
% |position=| setting of the floating environment instead, i.e.~sub-captions belonged to
% the caption above if |position=top| was set and they belonged to the caption below
% if |position=below| was set.
% While this would be beneficial in this case, there were several cases were it was not
% and especially it was not always comprehensible to the user why his references got an
% incorrect numbering.
%
% Furthermore the new decision algorithm always succeeds if there is only one caption
% within the figure or table (which is the case most of the time) while the old one did not.
%
% \pagebreak[3]
% If you still prefer the old decision algorithm (for example because you want to process
% an already existing document), you need to specify the \pkg{caption} package version
% explicitly, for example:
% \begin{quote}
%   |\documentclass{article}|\\
%   |\usepackage{caption}[=v3.5]|\\
%   |\usepackage{graphicx,subcaption}|\\
%   \ldots
% \end{quote}
%
% See also: \Ref{sec:caption}
%
% \subsection{Pittfall \#2: Expecting \cs{caption} to increment the counter}
%
% \pagebreak[3]
% Usually |\caption| increments the figure resp.~table counter and therefore
% it is usally safe to assume that the counter was not incremented yet in code
% used before |\caption|:
% \begin{quote}
%   |\documentclass{article}|\\
%   |\begin{document}|\\
%   |\begin{figure}|\\
%   |  Figure counter before caption: \thefigure|\\
%   |  \caption{Some text}|\\
%   |  Figure counter after caption: \thefigure|\\
%   |\end{figure}|\\
%   |\end{document}|
% \end{quote}
%
% Unsurprisingly the results are 0 and 1 for the counter values.
%
% \pagebreak[3]
% But this happens if we use the \pkg{subcaption} package:
% \begin{quote}
%   |\documentclass{article}|\\
%   |\usepackage{subcaption}|\\
%   |\begin{document}|\\
%   |\begin{figure}|\\
%   |  \subcaptionbox{}{some content}|\\
%   |  \subcaptionbox{}{some content}|\\
%   |  Figure counter before caption: \thefigure|\\
%   |  \caption{Some text}|\\
%   |  Figure counter after caption: \thefigure|\\
%   |\end{figure}|\\
%   |\end{document}|
% \end{quote}
%
% Here the results are 1 and 1 for the counter values. Why?
%
% Since the \pkg{caption} package assumes that there will be a |\caption|
% following |\sub|\-|caption|\-|box| it decides that the sub-captions belong
% to the upcoming main caption and therefore share the same main counter value
% which needs to be incremented before its use.
% Therefore the first |\sub|\-|caption|\-|box| in the figure increments the
% figure counter while the second one and especially the |\caption| does not.
%
% Usually this is no problem at all but keep this in mind if you are doing
% tricky stuff with the figure resp.~table counter within figures resp.~tables.
%
% \iffalse
% --------------------------------------------------------------------------- %
% \fi
%
% \PageBreak
% \section{Abbreviatory commands}
% \label{subcaption}
%
% \DescribeMacro\subcaption
% \DescribeMacro\phantomsubcaption
% \DescribeMacro\subcaptionlistentry
% \DescribeMacro\subcaptiontext
% \hskip1pt %^^A work-around for bug in \DescribeMacro to prevent red colored margin note
% As we have seen in sections {\Ref{overpic}, \Ref{stackengine}, and \Ref{tikz}}
% it's sometimes inconvenient to use the commands and environments
% described so far.
%
% \pagebreak[3]
% For example it would be inconvenient to use \env{captiongroup} just for
% a single |\caption|\-|text| in this particular case:
% \begin{quote}
%   \ldots\\
%   |\begin{overpic}[width=60pt]{cat}|\\
%   |  \put(40,34)|\\
%   |    {\begin{captiongroup*}|\\
%   |       \captiontext*[1]{}|\\
%   |     \end{captiongroup*}}|\\
%   |\end{overpic}|\\
%   \ldots
% \end{quote}
%
% \pagebreak[3]
% Since |\caption|\-|text| is already used in an extra environment (|overpic|)
% we don't need an extra |caption|\-|group*| here,
% instead using |\set|\-|caption|\-|sub|\-|type*| (which switches into the
% sub-caption mode without making an \pkg{hyperref} anchor) would be sufficient:
% \begin{quote}
%   \ldots\\
%   |\begin{overpic}[width=60pt]{cat}|\\
%   |  \put(40,34)|\\
%   |    {\setcaptionsubtype*|\\
%   |     \captiontext*[1]{}}|\\
%   |\end{overpic}|\\
%   \ldots
% \end{quote}
%
% \pagebreak[3]
% But this is still inconvenient when used many times, and therefore \thispackage\ defines
% several extra commands which are prefixed with |\set|\-|caption|\-|sub|\-|type*|:
%
% \medskip
%
% \begin{minipage}{\textwidth}
% \centering
% \begin{tabular}{l|l|l}
%   Regular command     & with \cs{setcaptionsubtype*} & available since \\
%   \hline
%   |\caption|          & |\subcaption|                & \version{1.0} \\
%   |\phantomcaption|   & |\phantomsubcaption|         & \version{1.1} \\
%   |\captionlistentry| & |\subcaptionlistentry|       & \version{1.5} \\
%   |\captiontext|      & |\subcaptiontext|            & \version{1.5} \\
% \end{tabular}
% \end{minipage}
%
% \bigskip
%
% \pagebreak[3]
% This way our code snipped above could be simplified to:
% \begin{quote}
%   \ldots\\
%   |\begin{overpic}[width=60pt]{cat}|\\
%   |  \put(40,34){\subcaptiontext*[1]{}}|\\
%   |\end{overpic}|\\
%   \ldots
% \end{quote}
%
% \INFO
% Since |\set|\-|caption|\-|sub|\-|type| should only be used within an
% extra group or environment, the same applies to these commands as well.
% (In this case |\sub|\-|caption|\-|text| is encapsulated by the
% |overpic| environment, so we are ok here.
%
% \begin{background}
% The |\sub|\-|caption| command is just a simple combination of
% |\set|\-|caption|\-|sub|\-|type*| and |\caption|. Same for all other
% abbreviatory commands here.
% \end{background}
%
% \iffalse
% --------------------------------------------------------------------------- %
% \fi
%
% \PageBreak
% \section{The \cs{subfloat} command}
% \label{subfloat}
%
% \DescribeMacro\subfloat
% \NEWfeature*{v1.3}
% To allow a smoother transition from the \pkg{subfig} package~\cite{subfig}
% (which is unmaintained for over 16 years)
% this package also offers |\sub|\-|float| with the same syntax:
% \begin{quote}
%   |\subfloat|\oarg{list\_entry}\oarg{sub-caption}\marg{body}
% \end{quote}
%
% \iffalse
% --------------------------------------------------------------------------- %
% \fi
%
% \section{Required packages}
% \label{sec:caption}
%
% \NEWfeature{v1.4}
% Starting with version $1.4$ the \pkg{subcaption} package requires at least version $3.1$
% of the \pkg{caption} package and loads it automatically.
% (Older versions of the \pkg{subcaption} package have required exactly the version of the
% \pkg{caption} package which was released with it.)
%
% \pagebreak[3]
% If you need to use a specific version of the \pkg{caption} package you need to load it
% \emph{before} the \pkg{subcaption} package, e.g.:
% \begin{quote}
%   |\usepackage[| \ldots |]{caption}[=v3.5]|\\
%   |\usepackage[| \ldots |]{subcaption}|
% \end{quote}
%
% \pagebreak[3]
% Note that there are limitations if an older version of the \pkg{caption} package
% is used:
% \begin{itemize}
%   \item The |\phantomsubcaption| command need at least \pkg{caption} \version{3.2}.
%   \item The |\subcaptionlistentry| command need at least \pkg{caption} \version{3.3}.
%   \item The |\subcaptiontext| command need at least \pkg{caption} \version{3.6}.
%   \item The |\subfloat| emulation needs at least \pkg{caption} \version{3.4}.
% \end{itemize}
%
% \iffalse
% --------------------------------------------------------------------------- %
% \fi
%
% \PageBreak
% \section{Beyond this package}
% \label{keyfloat}\label{floatrow}
%
% For a more advanced usage of the sub-caption feature of the
% \pkg{caption} package, please take a look at the excellent
% \pkg{keyfloat} package\cite{keyfloat} which provides the environments
% |key|\-|sub|\-|figs|, |key|\-|sub|\-|tabs|, and |key|\-|sub|\-|floats| for
% typesetting sub-figures and sub-tables.
%
% Furthermore the \pkg{floatrow} package\cite{floatrow} provides the
% |sub|\-|float|\-|row| environment for typesetting sub-figures.
%
% \iffalse
% --------------------------------------------------------------------------- %
% \fi
%
% \PageBreak
% \section{Thanks}
%
% I would like to thank
% Stephen Dalton
% who helped to make this package a better one.
%
% \iffalse
% --------------------------------------------------------------------------- %
% \fi
%
% \StopEventually{%^^A
% \begin{thebibliography}{9}
%
%   \bibitem{TLC2}
%   Frank Mittelbach and Michel Goossens:\\
%   \newblock {\em The {\LaTeX} Companion (2nd.~Ed.)},\\
%   \newblock Addison-Wesley, 2004.
%
%   \bibitem{caption}
%   Axel Sommerfeldt:\\
%   \href{http://www.ctan.org/pkg/caption}%
%        {\emph{Customizing captions of floating environments}},\\
%   2022/01/07
%
%   \bibitem{floatrow}
%   Olga Lapko:\\
%   \href{http://www.ctan.org/pkg/floatrow}%
%        {\emph{The floatrow package documentation}},\\
%   2007/12/24
%
%   \bibitem{hyperref}
%   Sebastian Rahtz \& Heiko Oberdiek:\\
%   \href{http://www.ctan.org/pkg/hyperref}%
%        {\emph{Hypertext marks in \LaTeX}},\\
%   November 12, 2007
%
%   \bibitem{hypcap}
%   Heiko Oberdiek:\\
%   \href{http://www.ctan.org/pkg/hypcap}%
%        {\emph{The hypcap package -- Adjusting anchors of captions}},\\
%   2007/04/09
%
%   \bibitem{keyfloat}
%   Brian Duun:\\
%   \href{http://www.ctan.org/pkg/keyfloat}%
%        {\emph{The \LaTeX\ keyfloat Package}},\\
%   2019/09/23
%
%   \bibitem{overpic}
%   Rolf Niepraschk:\\
%   \href{http://www.ctan.org/pkg/overpic}%
%        {\emph{The overpic package}},\\
%   2020/02/22
%
%   \bibitem{stackengine}
%   Steven B. Segletes:\\
%   \href{http://www.ctan.org/pkg/stackengine}%
%        {\emph{The stackengine Package}},\\
%   July 22, 2021
%
%   \bibitem{tikz}
%   Till Tantau:\\
%   \href{http://www.ctan.org/pkg/tikz}%
%        {\emph{The TikZ and PGF Packages}},\\
%   May 15, 2021
%
%   \bibitem{subfig}
%   Steven D. Cochran:\\
%   \href{http://www.ctan.org/pkg/subfig}%
%        {\emph{The subfig package}},\\
%   2005/07/05
%
% \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{\@ifnextchar,\@ifpackagelater,\@ifpackageloaded}
% \DoNotIndex{\@ifstar,\@ifundefined,\@latex@error,\@namedef,\@nameuse}
% \DoNotIndex{\@onlypreamble,\@parboxrestore,\@plus,\@ptionlist}
% \DoNotIndex{\@removeelement,\@restorepar,\@secondoftwo,\@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}
% \changes{v0.1}{2007/09/01}{First demo}
% \changes{v0.2}{2007/11/11}{\cs{subcaptionbox} added}
% \changes{v0.3}{2007/12/06}{Adapted to \pkg{caption} package \version{3.1f}}
% \changes{v1.0}{2008/03/16}{\cs{subfloat} added}
% \changes{v1.0}{2010/10/27}{An error message will be issued when the subfigure or subfig package is loaded}
% \changes{v1.0}{2011/01/22}{Undocumented command \cs{subfloat} removed}
%
% \newcommand*\Note[2][Note]{\par{\small\emph{#1:} #2}}
%
% \iffalse
% --------------------------------------------------------------------------- %
% \fi
%
% \clearpage
% \section{The implementation}
%
% \iffalse
%<*package>
% \fi
%
% \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}
\DeclareCurrentRelease{v1}{2007/12/06}
%    \end{macrocode}
%
% Identify the current version of the package.
%    \begin{macrocode}
\ProvidesPackage{subcaption}[2022/01/07 v1.5 Sub-captions (AR)]
%    \end{macrocode}
%
% Since we base on the \pkg{caption} package we load it here.
%    \begin{macrocode}
\RequirePackage{caption}[2010/01/09] % we need at least v3.1m
%    \end{macrocode}
%
% \subsection{Initial code}
%
% \begin{macro}{\subcaption@Warning}
% \changes{v1.5}{2022/01/06}{This macro added}
%   |\subcaption@Warning|\marg{message}\\
%   issues an warning message (with code line indication).
%    \begin{macrocode}
\newcommand*\subcaption@Warning{%
  \PackageWarning{subcaption}}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\subcaption@Error}
% \changes{v1.3h}{2020/09/28}{This macro added}
%   |\subcaption@Error|\marg{message}\\
%   issues an error message (with code line indication).
%    \begin{macrocode}
\newcommand*\subcaption@Error[1]{%
  \PackageError{subcaption}{#1}{\caption@@eh{subcaption}}}
%    \end{macrocode}
%    \begin{macrocode}
\providecommand*\caption@@eh[1]{%
  If you do not understand this error, please take a closer look\MessageBreak
  at the documentation of the `#1' package, especially the\MessageBreak
  section about errors.\MessageBreak\@ehc}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\subcaption@OutsideFloat}
% \changes{v1.5}{2022/01/07}{This macro definition added}
% |\subcaption@OutsideFloat}| issues a ``\meta{command} outside float'' error.
%    \begin{macrocode}
\newcommand*\subcaption@OutsideFloat[1]{%
  \subcaption@Error{\string#1 outside float}}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\subcaption@CheckCompatibility}
% \changes{v1.1}{2011/09/01}{Compatibility error added}
% \changes{v1.1}{2016/05/22}{The presence of \pkg{subfigure} or \pkg{subfig} will be checked \cs{AtBeginDocument}, too}
% \changes{v1.3g}{2020/08/01}{Error text adapted to \pkg{caption} package~\version{4.0}}
% \changes{v1.4}{2020/12/22}{Adapted to fallback concept}
% Since we are incompatible to them an error message will be issued when
% the \pkg{subfigure} or \pkg{subfig} package is loaded.
%    \begin{macrocode}
\newcommand*\subcaption@CheckCompatibility{%
%    \end{macrocode}
%    \begin{macrocode}
  \@ifpackageloaded{subfigure}{%
    \subcaption@Error
      {This package can't be used in cooperation\MessageBreak
       with the subfigure package}%
    \endinput}{}%
%    \end{macrocode}
%    \begin{macrocode}
  \@ifpackageloaded{subfig}{%
    \subcaption@Error
      {This package can't be used in cooperation\MessageBreak
       with the subfig package}%
    \endinput}{}%
%    \end{macrocode}
%    \begin{macrocode}
}
%    \end{macrocode}
%    \begin{macrocode}
\subcaption@CheckCompatibility
\caption@AtBeginDocument{%
  \subcaption@CheckCompatibility
  \let\subcaption@CheckCompatibility\@undefined}
%    \end{macrocode}
% \end{macro}
%
% \subsection{Main code}
%
% \begin{macro}{\setcaptionsubtype}
% \changes{v1.4}{2020/12/24}{This macro definition added}
% \changes{v1.5}{2022/01/07}{Check added if used inside a floating environment}
% |\setcaptionsubtype| is available since \pkg{caption} package \version{3.2},
% so we need to define it first if only an older version is loaded (in fallback mode).
%    \begin{macrocode}
\providecommand\setcaptionsubtype{%
  \caption@iftype
    {\@ifstar{\captionsetup{subtype*}}{\captionsetup{subtype}}}%
    {\subcaption@OutsideFloat\setcaptionsubtype}}
%    \end{macrocode}
% \end{macro}
%
% \subsubsection{The \env{subcaptiongroup} environment}
%
% \begin{environment}{subcaptiongroup}
% \changes{v1.5}{2022/01/07}{This environment definition added}
% \env{subcaptiongroup} is the simplest of all environments or commands this package has to offer.
% It's simply an environment containing |\set|\-|caption|\-|sub|\-|type|, that's all.
% A starred variant of this environment is available, too, which uses |\set|\-|caption|\-|sub|\-|type*|.
%    \begin{macrocode}
\newenvironment{subcaptiongroup}
  {\caption@iftype
     {\setcaptionsubtype\relax}%
     {\subcaption@OutsideFloat{subcaptiongroup}}}
  {}
%    \end{macrocode}
%    \begin{macrocode}
\newenvironment{subcaptiongroup*}
  {\caption@iftype
     {\setcaptionsubtype*}%
     {\subcaption@OutsideFloat{subcaptiongroup*}}}
  {}
%    \end{macrocode}
% \end{environment}
%
% \subsubsection{The \env{subcaptionblock} environment (and aliases)}
%
% \begin{macro}{\subcaption@minipage}
% \changes{v1.2}{2016/02/21}{Optional argument values `B' and `T' added}
% \changes{v1.3d}{2020/01/22}{Definition and usage of \cs{@subfloatboxreset} added}
% \changes{v1.5}{2022/01/07}{This macro definition out-sourced from \cs{subcaption@newminipage}}
% \changes{v1.5}{2022/01/07}{Usage of \cs{@ifnextchar} replaced by \cs{@testopt}}
% \changes{v1.5}{2022/01/07}{Default value of \meta{outer-pos} changes from `c' to `b'}
% This is a \env{minipage} with |\set|\-|caption|\-|sub|\-|type| as first contents line.
%    \begin{macrocode}
\newcommand*\subcaption@minipage{%
  \@testopt\subcaption@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\subcaption@iminipage[#1]{%
% \caption@withoptargs{\subcaption@iiminipage{#1}}}  % would need at least caption3 v1.5
  \def\subcaption@tempa{\subcaption@iiminipage{#1}}%
  \caption@withoptargs\subcaption@tempa}
%    \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*\subcaption@iiminipage[3]{%
  \let\subcaption@endminipage@hook\@empty
  \if#1B%
    \minipage[b]#2{#3}%
    \def\subcaption@endminipage@hook{\vspace{0pt}}%
  \else\if#1T%
    \minipage[t]#2{#3}%
    \vspace{0pt}%
  \else
    \minipage[#1]#2{#3}%
  \fi\fi
  \@subfloatboxreset
  \setcaptionsubtype\relax}
%    \end{macrocode}
%    \begin{macrocode}
\newcommand*\subcaption@endminipage{%
  \subcaption@endminipage@hook
  \endminipage}
%    \end{macrocode}
%    \begin{macrocode}
\providecommand*\@subfloatboxreset{}
%    \end{macrocode}
% \end{macro}
%
% \begin{environment}{subcaptionblock}
% \changes{v1.5}{2022/01/07}{This environment definition added}
% \env{subcaptionblock} is a \env{minipage} with |\set|\-|caption|\-|sub|\-|type| as first contents line.
%    \begin{macrocode}
\newenvironment{subcaptionblock}{\subcaption@minipage}{\subcaption@endminipage}
%    \end{macrocode}
% \end{environment}
%
% \begin{macro}{\subcaption@newminipage}
% \changes{v1.4d}{2022/01/04}{Test of environment name added, should match `sub\cs{@captype}'}
% \changes{v1.5}{2022/01/06}{Test of environment name revised, results in a warning now instead of an error}
% \changes{v1.5}{2022/01/07}{This command renamed from \cs{subcaption@newenvironment} to \cs{subcaption@newminipage} and revised}
% |\subcaption@newminipage|\marg{name of new environment}\\
% defines a new environment containing |\sub|\-|caption@mini|\-|page| and |\sub|\-|caption@end|\-|mini|\-|page|.
% Furthermore a test will be included which checks if the environment name matches |sub\@captype|.
%    \begin{macrocode}
\newcommand*\subcaption@newminipage[1]{%
  \newenvironment{#1}{\subcaption@minipage@{#1}}{\subcaption@endminipage}}
%    \end{macrocode}
%    \begin{macrocode}
\newcommand*\subcaption@minipage@[1]{%
  \caption@iftype
    {\edef\caption@tempa{#1}%
     \edef\caption@tempb{sub\@captype}%
     \ifx\caption@tempa\caption@tempb \else
       \subcaption@Warning{%
         `\caption@tempa' is treated as `\caption@tempb'\MessageBreak}%
     \fi}%
    {\subcaption@OutsideFloat{#1}}%
  \subcaption@minipage}
%    \end{macrocode}
% \end{macro}
%
% \begin{environment}{subfigure}
% \begin{environment}{subtable}
% \changes{v1.3e}{2020/07/29}{Uses \cs{ForEachCaptionSubType} (instead of \cs{caption@For}) to define the environments now}
% The sub-environments will be defined using the helper macro |\For|\-|Each|\-|Caption|\-|Sub|\-|Type|
% offered by the \pkg{caption} kernel v1.13 (2020/07/29), so for every caption sub-type
% declared with |\Declare|\-|Caption|\-|Sub|\-|Type| a corresponding `sub' environment will be defined automatically.
% (If the \pkg{caption} kernel v1.13 is not available we use \cs{caption@For} as fallback.)
%    \begin{macrocode}
\@ifundefined{ForEachCaptionSubType}  % caption3 v1.13
  {\caption@For{subtypelist}{\subcaption@newminipage{sub#1}}}
  {\ForEachCaptionSubType{\subcaption@newminipage{#1}}}
%    \end{macrocode}
% \end{environment}
% \end{environment}
%
% \subsubsection{The \cs{subcaptionbox} command}
%
% \begin{macro}{\subcaptionbox}
% \changes{v1.0}{2008/05/06}{Adapted to the \opt{rule} option of the \pkg{caption} package}
% \changes{v1.0}{2008/08/31}{Definition and usage of \cs{subcaption@hrule} added}
% \changes{v1.0}{2010/12/17}{Uses \cs{caption@box} now}
% \changes{v1.1}{2011/08/16}{Adapted to actual version of \cs{caption@box}}
% \changes{v1.1}{2012/04/09}{Adapted to actual version of \cs{caption@ibox}}
% \changes{v1.4}{2020/12/24}{Fallback definition of \cs{caption@ibox} added}
% A |\parbox| with contents and sub-caption, separated by an invisible |\hrule|.\par
% The code of this macro was moved to the \pkg{caption} package \version{3.2}
% (so it could offer it as |\caption|\-|box| as well), so since then it's
% sufficient to simply use |\caption@ibox| here.\par
% But if only \pkg{caption} package \version{3.1} is available (since the user
% decided to use this particular fallback version), we still must define the code
% on our own.
%    \begin{macrocode}
\@ifundefined{caption@ibox}{%
%    \end{macrocode}
%    \begin{macrocode}
  \newcommand*\subcaptionbox{%  caption v3.1
    \def\subcaption@tempa{\caption@ibox\setcaptionsubtype\relax}%
    \caption@withoptargs\subcaption@tempa}
%    \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{%
    \@ifundefined{caption@hj@#7}%
      {\subcaption@Error{Undefined justification `#7'}\@gobble}%
      {\@firstofone}%
    {\begingroup
     #1*% set \caption@position so \caption@iftop expands correctly
     \caption@iftop{%
       \endgroup
       \parbox[t]{#6}{%
         #1\relax
         \caption@setposition t%
         #2{\caption#4{#5}}%
         \captionbox@hrule
         \csname caption@hj@#7\endcsname
         #8}%
     }{%
       \endgroup
       \parbox[b]{#6}{%
         #1\relax
         \caption@setposition b%
         \csname caption@hj@#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@hj@c{\centering}
  \providecommand*\caption@hj@l{\raggedright}
  \providecommand*\caption@hj@r{\raggedleft}
  \providecommand*\caption@hj@s{}
%    \end{macrocode}
%    \begin{macrocode}
}{\@ifundefined{caption@iiibox}{%
%    \end{macrocode}
%    \begin{macrocode}
  \newcommand*\subcaptionbox{%  caption v3.2
    \def\captionbox@type{subtype}%
    \let\captionbox@settype\setcaptionsubtype
    \caption@withoptargs\caption@box}
%    \end{macrocode}
%    \begin{macrocode}
}{%
%    \end{macrocode}
%    \begin{macrocode}
  \newcommand*\subcaptionbox{%  caption >= v3.3
    \caption@withoptargs{\caption@ibox\setcaptionsubtype}}
%    \end{macrocode}
%    \begin{macrocode}
}}
%    \end{macrocode}
% \end{macro}
%
% \subsubsection{The \cs{subref} command}
%
% We redefine |\label| to |\subcaption@label| at |\setcaptionsubtype|.
%    \begin{macrocode}
\g@addto@macro\caption@subtypehook{%
  \ifx\label\subcaption@label \else
    \let\subcaption@ORI@label\label
    \let\label\subcaption@label
  \fi}
%    \end{macrocode}
%
% \begin{macro}{\subcaption@label}
% \changes{v1.1}{2011/09/12}{Adapted to the \pkg{showkeys} package}
% \changes{v1.1}{2011/09/12}{Uses \cs{caption@withoptargs} now}
% \changes{v1.1}{2016/02/20}{Unwanted space removed}
% \changes{v1.4b}{2021/01/08}{Local re-definitions of \cs{@bsphack} and \cs{@esphack} added}
% \changes{v1.4c}{2021/04/10}{Adaption to the \pkg{showkeys} package out-sourced to \cs{subcaption@prepare@label}}
% When a label will be placed for a sub-caption, we automatically place
% a second one for |\sub|\-|ref|, too. This second label will contain
% the sub-type counter only.
%    \begin{macrocode}
\newcommand*\subcaption@label{%
  \caption@withoptargs\subcaption@@label}
%    \end{macrocode}
%    \begin{macrocode}
\newcommand*\subcaption@@label[2]{%
  \@bsphack\begingroup
    \let\@bsphack\relax
    \let\@esphack\relax
%    \end{macrocode}
% Label |\@currentlabel| by expanding the original |\label| code.
%    \begin{macrocode}
    \subcaption@ORI@label#1{#2}%
%    \end{macrocode}
% Set |\@currentlabel| to the `sub' counter value and expand the original |\label| code again.
% (But this time without optional arguments.)
%    \begin{macrocode}
    \subcaption@prepare@label
    \protected@edef\@currentlabel{\csname thesub\@captype\endcsname}%
    \subcaption@ORI@label{sub@#2}%
  \endgroup\@esphack}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\subcaption@prepare@label}
% \changes{v1.4c}{2021/04/10}{This macro added}
% \changes{v1.4c}{2021/04/10}{Adapted to the \pkg{showlabels} package}
%    \begin{macrocode}
\newcommand*\subcaption@prepare@label{%
%    \end{macrocode}
% Adaption to the \pkg{showkeys} package: Hide the `sub' label from it.
%    \begin{macrocode}
  \let\SK@\@gobbletwo
%    \end{macrocode}
% Adaption to the \pkg{showlabels} package: Hide the `sub' label from it
% by expanding to the original definition saved to |\SL@orig#1|
% (with |#1| $=$ |\SL@orig|\-|label|, \ldots).
%    \begin{macrocode}
  \def\SL@showlabels##1{\@nameuse{SL@orig##1}}}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\subref}
% \changes{v1.1}{2011/08/14}{Caption option \opt{subrefformat=} added}
% \changes{v1.1}{2011/08/18}{Uses \cs{caption@setoptions*} now}
% \changes{v1.1}{2012/01/12}{Usage of \cs{caption@setoptions*} replaced by \cs{caption@setoptions}}
% \changes{v1.1}{2012/04/09}{Revised}
% \changes{v1.1}{2018/12/26}{Bugfix: Missing curly braces added}
% This one calls |\ref| with the second label. (see |\subcaption@label|)
%    \begin{macrocode}
\DeclareRobustCommand*\subref{%
  \@ifstar
    {\caption@withoptargs\subcaption@ref*}%
    {\caption@withoptargs\@subref}}
\newcommand*\@subref[2]{%
  \@ifundefined{hyperref}%
    {\subcaption@ref{#1}{#2}}%
    {\hyperref[{#2}]{\subcaption@ref{*#1}{#2}}}}
%    \end{macrocode}
%    \begin{macrocode}
\newcommand*\subcaption@ref[2]{%
  \begingroup
    \caption@setoptions{sub}%
    \subcaption@reffmt\p@subref{\ref#1{sub@#2}}%
  \endgroup}
%    \end{macrocode}
%    \begin{macrocode}
\newcommand*\p@subref{}
%    \end{macrocode}
% \end{macro}
%
%    \begin{macrocode}
\DeclareCaptionOption{subrefformat}{\subcaption@setrefformat{#1}}
%    \end{macrocode}
%
% \begin{macro}{\subcaption@setrefformat}
% \changes{v1.3g}{2020/07/27}{Adapted to \pkg{caption3} v2.0}
% \changes{v1.3h}{2020/09/28}{Usage of \cs{caption@Error} replaced by \cs{subcaption@Error}}
% \changes{v1.3j}{2020/10/07}{Definition of the label formats \texttt{subsimple} and \texttt{subparens} added}
% \changes{v1.4}{2020/12/24}{Adapted to older versions of the caption package (fallback)}
%  |\subcaption@setrefformat|\marg{name}\par
%  Selecting a subref format simply means saving the code (in |\subcaption@reffmt|).
%    \begin{macrocode}
\newcommand*\subcaption@setrefformat[1]{%
  \@ifundefined{caption@labelformat@#1}%  caption3 v2.x
    {\@ifundefined{caption@lfmt@#1}%      caption3 v1.x
       {\subcaption@Error{Undefined label format `#1'}}%
       {\expandafter\let\expandafter\subcaption@reffmt\csname caption@lfmt@#1\endcsname}}%
    {\expandafter\let\expandafter\subcaption@reffmt\csname caption@labelformat@#1\endcsname}}
%    \end{macrocode}
%    \begin{macrocode}
\subcaption@setrefformat{simple}
%    \end{macrocode}
%  To offer a smooth transition from the \pkg{subfig} to the \pkg{subcaption} package
%  we offer the options |sub|\-|ref|\-|format=sub|\-|simple| and |sub|\-|ref|\-|format=sub|\-|parens|, too.
%    \begin{macrocode}
\DeclareCaptionLabelFormat{subsimple}{#2}
\DeclareCaptionLabelFormat{subparens}{(#2)}
%    \end{macrocode}
% \end{macro}
%
% \subsection{Execution of options}
%
% \changes{v1.1}{2018/05/01}{Option \texttt{font+=small} changed to \texttt{font+=smaller}}        \changenote{released 2018/05/02}
% \changes{v1.2}{2018/05/13}{Option \texttt{font+=smaller} changed to \texttt{size=smaller}}       \changenote{merged from former SVN/trunk 2019/03/16, released 2019/08/18}
% \changes{v1.3e}{2020/07/27}{Option \texttt{size=smaller} changed back to \texttt{font+=smaller}} \changenote{merged from feature/documentclass 2020/07/29, released 2020/08/30}
% We use |\caption@Execute|\-|Options| and |\caption@Process|\-|Options| here to add
% the options to the `|sub|' option list instead of executing them immediately.
%    \begin{macrocode}
\let\caption@setkeys@ORI\caption@setkeys
\@ifundefined{caption@SetupOptions}  % caption3 v1.3
  {\renewcommand\caption@setkeys[2]{\captionsetup[sub]{#2}}}
  {\caption@SetupOptions{subcaption}{\captionsetup[sub]{#2}}}
%    \end{macrocode}
%    \begin{macrocode}
\@ifundefined{caption@smaller}       % caption3 v1.7-169
  {\caption@ExecuteOptions{subcaption}{%
     font+=small,labelformat=parens,labelsep=space,skip=6pt,list=0,hypcap=0}}
  {\caption@ExecuteOptions{subcaption}{%
     font+=smaller,labelformat=parens,labelsep=space,skip=6pt,list=0,hypcap=0}}
%    \end{macrocode}
%    \begin{macrocode}
\caption@ProcessOptions*{subcaption}
%    \end{macrocode}
%    \begin{macrocode}
\let\caption@setkeys\caption@setkeys@ORI
\let\caption@setkeys@ORI\@undefined
%    \end{macrocode}
%
% We call |\Declare|\-|Caption|\-|Sub|\-|Type| for |figure| and |table|,
% and each floating environment declared with |\Declare|\-|Floating|\-|Environment| here.
%    \begin{macrocode}
\@ifundefined{ForEachCaptionType}      % caption3 v1.13
  {\@ifundefined{caption@ForEachType}  % caption3 v1.4a
     {\@ifundefined{c@figure}{}{\DeclareCaptionSubType{figure}}%
      \@ifundefined{c@table}{}{\DeclareCaptionSubType{table}}%
      \caption@For{typelist}{\DeclareCaptionSubType{#1}}}
     {\caption@ForEachType{\DeclareCaptionSubType{#1}}}}
  {\ForEachCaptionType{\DeclareCaptionSubType{#1}}}
%    \end{macrocode}
%
% \subsection{Bonus material}
%
% \subsubsection{The \cs{subcaption}, \cs{phantomsubcaption}, \cs{subcaptionlistentry}, and \cs{subcaptiontext} commands}
%
% \begin{macro}{\subcaption@newabbreviation}
% \changes{v1.5}{2022/01/07}{This macro added}
% |\subcaption@newabbreviation|\marg{new command}\marg{existing command}\marg{extra code in case of error}\\
% defines a new command as abbreviation of |\set|\-|caption|\-|sub|\-|type*| plus \meta{command}.
% (With a prefacing |\set|\-|caption|\-|sub|\-|type|, \meta{new command} is reduced to \meta{command}.
% Unfortunately we have to do this on our own since using |\set|\-|caption|\-|sub|\-|type| multiple times
% is not suppressed until \pkg{caption} package \version{3.6}.)
% \Note{Since \cs{setcaptionsubtype} is used, the new command is designed to be used inside an own group!}
%    \begin{macrocode}
\newcommand*\subcaption@newabbreviation[3]{%
%    \end{macrocode}
%    \begin{macrocode}
  \newcommand*{#1}{%
    \caption@iftype
      {\setcaptionsubtype*#2}%
      {\subcaption@OutsideFloat#1#3}}%
%    \end{macrocode}
%    \begin{macrocode}
  \g@addto@macro\caption@subtypehook{\let#1#2}}% needed for caption < 3.6
%    \end{macrocode}
%    \begin{macrocode}
\@onlypreamble\subcaption@newabbreviation
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\caption@gobble}
% \changes{v1.4}{2020/12/24}{This macro added}
%   |\caption@gobble*|\oarg{arg}\oarg{\ldots}\marg{arg}\\
%   is similar to |\@gobble| but gobbles a star and optional arguments as well.
%    \begin{macrocode}
\@ifundefined{caption@gobble}{%
  \DeclareRobustCommand*\caption@gobble{%  caption3 < v1.4
    \caption@withoptargs\@gobbletwo}%
}{}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\subcaption}
% \changes{v1.1}{2012/04/06}{Overwrites the definition defined by the \pkg{memoir} document class}
% |\subcaption| is an abbreviation of |\set|\-|caption|\-|sub|\-|type*| plus |\caption|.
%    \begin{macrocode}
\@ifclassloaded{memoir}{\let\subcaption\undefined}{}
\subcaption@newabbreviation\subcaption\caption\caption@gobble
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\phantomsubcaption}
% \changes{v1.1}{2011/08/17}{This macro added}
% \changes{v1.3h}{2020/09/28}{Usage of \cs{caption@Error} replaced by \cs{subcaption@Error}}
% |\phantom|\-|sub|\-|caption| is an abbreviation of |\set|\-|caption|\-|sub|\-|type*| plus |\phantom|\-|caption|.
% \Note{This commands needs at least \pkg{caption} package \version{3.2}.}
%    \begin{macrocode}
\subcaption@newabbreviation\phantomsubcaption\phantomcaption\relax
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\subcaptionlistentry}
% \changes{v1.5}{2022/01/05}{This macro added}
% |\sub|\-|caption|\-|list|\-|entry| is an abbreviation of |\set|\-|caption|\-|sub|\-|type*| plus |\caption|\-|list|\-|entry|.
% \Note{This commands needs at least \pkg{caption} package \version{3.3}.}
%    \begin{macrocode}
\subcaption@newabbreviation\subcaptionlistentry\captionlistentry\caption@gobble
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\subcaptiontext}
% \changes{v1.5}{2022/01/05}{This macro added}
% |\sub|\-|caption|\-|text| is an abbreviation of |\set|\-|caption|\-|sub|\-|type*| plus |\caption|\-|text|.
% \Note{This commands needs at least \pkg{caption} package \version{3.6}.}
%    \begin{macrocode}
\subcaption@newabbreviation\subcaptiontext\captiontext\caption@gobble
%    \end{macrocode}
% \end{macro}
%
% \subsubsection{The \cs{subfloat} command}
%
% \begin{macro}{\subfloat}
% \changes{v0.4}{2008/03/01}{This macro added}
% \changes{v1.0c}{2011/01/22}{This macro removed since it's too incompatible with the one from \pkg{subfig}}
% \changes{v1.3}{2019/08/31}{This macro re-added and revised}
% \changes{v1.3a}{2019/09/01}{\cs{ignorespaces} copied from \cs{sf@@@subfloat}}
% \changes{v1.3b}{2020/01/03}{Previous definition of \cs{subfloat} will be overwritten}
% \changes{v1.3f}{2020/07/29}{Bugfix: Usage of \cs{caption@hj@default} replaced by \cs{captionbox@innerpos@default}}
% \changes{v1.3i}{2020/09/28}{This macro will be defined with \cs{providecommand} now to preserve an original definition}
% \changes{v1.4}{2020/12/24}{Usage of \cs{caption@getlabel} replaced by \cs{subcaption@getlabel}}
% \changes{v1.4a}{2020/12/26}{Clearance of \cs{caption@thelabel} replaced by \cs{subcaption@clrlabel}}
% \changes{v1.5}{2022/01/07}{Usage of \cs{@ifnextchar} replaced by \cs{kernel@ifnextchar}}
% \changes{v1.5}{2022/01/07}{Overwrites the definition defined by the \pkg{memoir} document class}
%  |\subfloat|\oarg{list\_entry}\oarg{sub-caption}\marg{body}\par
%  If \meta{sub-caption} is given, we map this to |\sub|\-|caption|\-|box|
%  but transfer the |\label| from \meta{body} to \meta{sub-caption}.
%  If not, we do the same as |\sub|\-|caption|\-|box| does, but use |\phantom|\-|caption| instead of |\caption|.
%  In both cases we do a |\ignore|\-|spaces| at the end since the original implementation of |\sub|\-|float| does this, too.
%    \begin{macrocode}
\@ifclassloaded{memoir}{\let\subfloat\undefined\let\endsubfloat\undefined}{}
%    \end{macrocode}
%    \begin{macrocode}
\caption@AtBeginDocument{%
  \providecommand*\subfloat{%
    \kernel@ifnextchar[%]
      \subcaption@subfloat
      \subcaption@subfloat@}}
%    \end{macrocode}
%    \begin{macrocode}
\long\def\subcaption@subfloat[#1]{%
  \kernel@ifnextchar[%]
    {\subcaption@@subfloat{#1}}%
    {\subcaption@@@subfloat\subcaptionbox{#1}}}
%    \end{macrocode}
%    \begin{macrocode}
\long\def\subcaption@@subfloat#1[#2]{%
  \subcaption@@@subfloat{\subcaptionbox[{#1}]}{#2}}
%    \end{macrocode}
%    \begin{macrocode}
\long\def\subcaption@@@subfloat#1#2#3{%
  \subcaption@getlabel{#3}%
  #1{#2\caption@thelabel}{\let\label\caption@gobble#3}%
  \subcaption@clrlabel
  \ignorespaces}
%    \end{macrocode}
%    \begin{macrocode}
\def\subcaption@subfloat@#1{%
  \setbox\@tempboxa\hbox{#1}%
  \caption@iiiibox
    \setcaptionsubtype
    {\phantomcaption\@gobble}{\phantomcaption\@gobble}% no box with \caption
    {}% no optional arguments for \caption
    {}% no sub-caption
    [\wd\@tempboxa][\captionbox@innerpos@default]%
    {\unhbox\@tempboxa}%
  \ignorespaces}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\subcaption@getlabel}
% \changes{v1.4}{2020/12/24}{This macro added}
%   |\subcaption@getlabel|\marg{text}\\
%   gets the label command out of the given caption text and stores it to |\caption@the|\-|label|.
%   It uses |\caption@get|\-|label| for this purpose which interface unfortunately has changed over time.
%   (Changing the interface was a bad idea in the first place but now it is as it is).
%    \begin{macrocode}
\@ifundefined{caption@getlabel}{%
%    \end{macrocode}
%    \begin{macrocode}
  \newcommand\subcaption@getlabel[1]{%  caption3 < v1.7
    \subcaption@Error{\noexpand\subfloat needs at least caption v3.4}%
    \let\caption@thelabel\relax}
%    \end{macrocode}
%    \begin{macrocode}
}{\@ifundefined{caption@@@@getlabel}{%
%    \end{macrocode}
%    \begin{macrocode}
  \newcommand\subcaption@getlabel[1]{%  caption3 >= v1.7
    \caption@getlabel#1\label{}\@nil}
%    \end{macrocode}
%    \begin{macrocode}
}{%
%    \end{macrocode}
%    \begin{macrocode}
  \newcommand*\subcaption@getlabel{%    caption3 >= v2.0
    \caption@getlabel}
%    \end{macrocode}
%    \begin{macrocode}
}}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\subcaption@clrlabel}
% \changes{v1.4a}{2020/12/26}{This macro added}
%   |\subcaption@clrlabel|\\
%   resets |\caption@the|\-|label| to |\relax|.
%    \begin{macrocode}
\@ifundefined{caption@clrlabel}{%
%    \end{macrocode}
%    \begin{macrocode}
  \newcommand*\subcaption@clrlabel{\let\caption@thelabel\relax} %  caption3 < v2.3
%    \end{macrocode}
%    \begin{macrocode}
}{%
%    \end{macrocode}
%    \begin{macrocode}
  \newcommand*\subcaption@clrlabel{\caption@clrlabel}           %  caption3 >= v2.3
%    \end{macrocode}
%    \begin{macrocode}
}
%    \end{macrocode}
% \end{macro}
%
% \iffalse
%</package>
% \fi
%
% \iffalse
% --------------------------------------------------------------------------- %
% \fi
%
% \Finale
%
\endinput