1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
|
% \iffalse % hhsubfigure.dtx
% Subfigure/subtable macros for use with the LaTeX figure/table environments.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Copyright (C) 2003 Harald Harders.
%
% This is a slightly modified version of the `subfigure' package by
% Steven Douglas Cochran. The origianl package can be downloaded from
% <ftp://ftp.dante.de/tex-archive/macros/latex/contrib/subfigure/>.
%
% The hhsubfigure package is free software; it may be distributed under
% the conditions of the LaTeX Project Public License, either version 1.1
% 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.1 or later is part of all distributions of LaTeX version
% 1999/06/01 or later.
%
% The captcont package is distributed in the hope that it will be
% useful, but WITHOUT ANY WARRANTY; without even the implied warranty
% of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
% LaTeX Project Public License for more details.
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% @LaTeX-style-file{
%% author = "Steven Douglas Cochran (modified by Harald Harders)",
%% version = "2.1.4",
%% date = "2003/09/14",
%% time = "09:34:13",
%% filename = "hhsubfigure.sty",
%% email = "h.harders@tu-bs.de",
%% codetable = "ISO/ASCII",
%% keywords = "LaTeX, float, figure, table, captcont",
%% supported = "yes",
%% abstract = "LaTeX package for providing support for the
%% inclusion of small, `sub', figures and tables. It
%% simplifies the positioning, captioning and
%% labeling of them within a single figure or table
%% environment. In addition, this package allows
%% such subcaptions to be written to the List of
%% Figures or List of tables if desired."
%% }
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
%<*driver>
\NeedsTeXFormat{LaTeX2e}[1994/12/01]
\ProvidesFile{hhsubfigure.dtx}
\documentclass{ltxdoc}
\usepackage[tight,TABTOPCAP]{hhsubfigure}[2002/03/15]
\setlength\hfuzz{100pt}
\setlength\vfuzz{100pt}
\clubpenalty=10000
\widowpenalty=10000
\displaywidowpenalty=5000
\brokenpenalty=5000
\begin{document}
\DocInput{hhsubfigure.dtx}
\end{document}
%</driver>
%
%<*ltxdoc>
\AtBeginDocument{
% \OnlyDescription % comment out for implementation details
\EnableCrossrefs
\RecordChanges
\CodelineIndex}
\AtEndDocument{
\PrintChanges
\PrintIndex}
%</ltxdoc>
%
% \fi
% \catcode`\^=14 ^^A We will use a ^ for a comment rather than ^^A.
% \newcommand*{\Lopt}[1]{\textsf{#1}} ^ Package options
% \newcommand*{\Lfile}[1]{\texttt{#1}} ^ File names
% \newcommand*{\Lpack}[1]{\textsf{#1}} ^ Package names
% \newcommand*{\Lenv}[1]{\texttt{#1}} ^ Environment names
% \newcommand*{\Lcount}[1]{\textsl{\small#1}} ^ Counter names
% \newcommand*{\Lif}[1]{\textsc{\bf#1}} ^ \if names
% ^ NOTE: Hacks added to make the final format are marked ``^finalhack''.
%
% \changes{v1.0}{05 Mar 1986}{Created.}
%
% \changes{v1.1}{02 Nov 1988}{Initial revision.}
%
% \changes{v1.2}{30 Aug 1989}{Added a separate bottom margin and
% expanded the comments.}
%
% \changes{v1.3}{22 Oct 1990}{Changed test for empty subcaption inside
% of \cmd{\@subfigure} to compare tokens and not the subcaption vs.\
% \cmd{\@empty}. The former (incorrect) test caused an error when the
% first two letters of the subcaption were the same.}
%
% \changes{v1.4}{27 Jun 1992}{Added a hack to allow the \cmd{\label}
% command to be used within the body of the subfigure giving a
% reference label in the form \cmd{\arabic{thefigure}\thesubfigure}.
% Added standard file header for style.}
%
% \changes{v1.5}{11 Aug 1992}{Fixed a bug which caused a problem with
% subcaptions that contained expressions like \cmd{\sqrt}; This was
% pointed out by Tom Scavo (scavo\@cie.uoregon.edu). A separate bug
% was fixed which caused different sized subcaptions to be misaligned;
% This problem was pointed out by Simon Marshall
% (S.Marshal\@Hull.ac.uk). Also cleaned up the code a mite and
% {\bf changed} the figure spacing so that if no optional section is
% given, then the figure is only followed by \cmd{\subfigbottomskip}
% and not that plus $(\cmd{\subfigcapskip}+\cmd{\strut}\hbox{height})$.
% This should make it easier to adjust spacing as desired.}
%
% \changes{v1.6}{13 May 1993}{Changed to use the \cmd{\thefigure}
% command in building the referenced label. The old form caused a
% problem when used with the report.sty as pointed out by Andrew
% Anselmo (anselmo\@cumesb.mech.columbia.edu). Also modified to
% restrict the scope of the subfigure \cmd{\label} to the body of the
% subfigure. Added \cmd{\@thesubfigure} to allow a separate labeling
% of the subfigure in the figure and in the text. By default it is
% the same as \cmd{\thesubfigure} with space appended. Added some
% code to print the subfigure captions to the List-of-Figures file
% if desired. Finally, added the corresponding support for subtables
% as well as subfigures. NOTE: the optional subcaption is now a moving
% argument and any fragile commands that appear in the subcaption must
% be preceded by a \cmd{\protect} (just like that of the \cmd{\caption}
% command).}
%
% \changes{v2.0}{06 Mar 1995}{This version of \cmd{\subfigure} is the
% first to be ported to \LaTeXe\ (with backward compatibility to
% \LaTeX2.09). \cmd{\subfigure} and \cmd{\subtable} are now identical
% and the environment controls internal differences between them. Now,
% the subcaption setting portion of \cmd{\@subfloat} is broken into the
% separate commands \cmd{\@makesubfigurecaption} and
% \cmd{\@makesubtablecaption} to allow a separate hook for the
% modification of how the subcaption is constructed and to allow the
% subtable and subfigure captions to be different. In addition, support
% of the \Lopt{normal}, \Lopt{hang}, \Lopt{center}, \Lopt{centerlast},
% \Lopt{nooneline}; \Lopt{scriptsize}, \ldots, \Lopt{Large}; \Lopt{up},
% \Lopt{it}, \Lopt{sl}, \Lopt{sc}, \Lopt{md}, \Lopt{bf}, \Lopt{rm},
% \Lopt{sf}, and \Lopt{tt} package options were added for compatibility
% with the caption.sty by H.A. Sommerfeldt.}
%
% \changes{v2.1}{23 Jan 2002}{Upgraded to fix a \cmd{\protect} bug that
% crept in due to changes in \LaTeXe\ and to enhance the interaction
% with the ``List-of'' files. Backward compatibility with \LaTeX2.09 is
% \textbf{not} supported. This version allows optional subcaption
% strings for the ``List-of'' files and the companion captcont.sty
% allows further extensions. Added check for \Lfile{subfigure.cfg} file
% for automatic configuration. Added more options for adjustment of the
% look-and-feel of the subcaption. Added the ability to independently
% move the float caption and subcaption before or after the figure.
% Removed extra space from the top of a figure at the top of a page and
% some accidental whitespace. Reduced the default space around the
% figure and made it actual skips. Updated the documentation to
% describe the new changes and to make some points more clear.}
%
% \DoNotIndex{\@@@,\@auxout,\@bsphack,\@dottedtocline,\@empty,\@esphack}
% \DoNotIndex{\@flushglue,\@for,\@gobble,\@ifnextchar,\@ifpackageloaded}
% \DoNotIndex{\@ifstar,\@ifundefined,\@minipagefalse,\@nameuse,\@ne}
% \DoNotIndex{\@rightskip,\@tempboxa,\@tempcnta,\@tempdima}
% \DoNotIndex{\@tempdimb,\@tempskipb,\@xaddvskip,\addcontentsline}
% \DoNotIndex{\addtolength,\advance,\alph,\arabic,\AtBeginDocument}
% \DoNotIndex{\AtEndOfPackage,\begingroup,\bfseries,\bgroup,\box}
% \DoNotIndex{\DeclareOption,\def,\do,\edef,\egroup,\else,\endgroup}
% \DoNotIndex{\ExecuteOption,\ExecuteOptions,\ext@figure,\ext@table}
% \DoNotIndex{\familydefault,\fi,\footnotesize,\fontfamily,\fontseries}
% \DoNotIndex{\fontshape,\gdef,\global,\hbox,\hfil,\hskip,\hss,\if@minipage}
% \DoNotIndex{\ifcase,\ifdim,\ifnum,\ifx,\ignorespaces,\InputIfFileExists}
% \DoNotIndex{\itshape,\label,\lastskip,\leftskip,\Large,\large,\leavevmode}
% \DoNotIndex{\let,\long,\m@ne,\mdseries,\multiply,\NeedsTeXFormat}
% \DoNotIndex{\newcommand,\newcounter,\newdimen,\newif,\newlabel,\newskip}
% \DoNotIndex{\noexpand,\normalsize,\numberline,\or,\p@,\par,\parbox}
% \DoNotIndex{\parfillskip,\parindent,\ProcessOptions,\protect}
% \DoNotIndex{\protected@write,\protected@edef,\providecommand}
% \DoNotIndex{\ProvidesPackage,\ref,\refstepcounter,\relax,\renewcommand}
% \DoNotIndex{\RequirePackage,\rightskip,\rmfamily,\sbox,\scriptsize}
% \DoNotIndex{\scshape,\selectfont,\seriesdefault,\setbox,\setcounter}
% \DoNotIndex{\setlength,\sffamily,\shapedefault,\slshape,\small,\space}
% \DoNotIndex{\string,\strut,\thefigure,\thepage,\thetable,\ttfamily,\tw@}
% \DoNotIndex{\typeout,\undefined,\upshape,\usebox,\vbox,\vskip,\vspace}
% \DoNotIndex{\vtop,\wd,\xdef,\z@,\z@skip}
%
% \CheckSum{770}%
% ^ Allow a little more freedom in typesetting floats.
% \setcounter{topnumber}{8}
% \def\topfraction{.8}
% \setcounter{bottomnumber}{8}
% \def\bottomfraction{.8}
% \setcounter{totalnumber}{8}
% \def\textfraction{.2}
% \def\floatpagefraction{.8}
% \setcounter{dbltopnumber}{8}
% \def\dbltopfraction{.8}
% \def\dblfloatpagefraction{.8}
%
% ^ Add some space above any footnotes.
% \skip\footins=1.5\baselineskip
%
% \makeatletter
%
% ^ Remove some space above minipage footnotes.
% \skip\@mpfootins=2.6\p@
%
% ^ Define a raggedright for use in tabular's.
% \newcommand{\rr}{^
% \@rightskip\@flushglue
% \rightskip\@rightskip
% \leftskip\z@
% \parindent\z@}
%
% ^ Turn off any list entries by ``eating'' any \addcontentsline stuff.
% \newcommand*{\eatthree}[3]{}^
% \newcommand*{\turnofflistentry}{\let\addcontentsline=\eatthree}
%
% ^ Print text (#2) only if reference (r@#1) is defined.
% \newcommand{\PrintIfDefined}[3]{^
% \@bsphack
% \@ifundefined{r@#1}{#3}{#2}^
% \@esphack}
%
% \makeatother
%
% \def\docdate{2002/07/02}
% \def\fileversion{v2.1.4a}
% \def\filedate{2003/09/14}
% \def\filename{hhsubfigure.dtx}
%
% \title{The \Lpack{hhsubfigure} Package\footnote{This paper documents
% the \Lpack{hhsubfigure} package \fileversion, last revised \filedate.}}
% \author{Steven Douglas Cochran\\[5pt]
% Digital Mapping Laboratory, School of Computer Science \\
% Carnegie-Mellon University, 5000 Forbes Avenue \\
% Pittsburgh, PA 15213--3890, USA\\[5pt]
% \texttt{sdc+@cs.cmu.edu}}
% \date{\docdate}
%
% \maketitle
%
% \begin{abstract}
% \noindent
% This article documents the \LaTeX\ package `\Lpack{hhsubfigure}', which
% provides support for the inclusion of small, `sub', figures and
% tables. It simplifies the positioning, captioning and labeling of
% such objects within a single \Lenv{figure} or \Lenv{table}
% environment. In addition, this package allows such subcaptions to be
% written to a List-of-Figures or List-of-Tables if desired. The
% `\Lpack{hhsubfigure}' package also cooperates with the `\Lpack{caption}'
% and `\Lpack{caption2}' packages by H.A. Sommerfeldt
% \cite{Somm95a,Somm95b}, the `\Lpack{ccaption}' and `\Lpack{tocloft}'
% packages \cite{Wils01,Wils01B} by Peter Wilson, the `\Lpack{hyperref}'
% package by Sebastian Rahtz \cite{Raht02}, the `\Lpack{captcont}' package
% \cite{Coch02}, and should be compatible with all other packages that
% modify or extend the \Lenv{float} environment or the \cmd{\caption} or
% \cmd{\label} commands.
%
% \end{abstract}
%
% \newpage
% \tableofcontents
%
% \newpage
% \setcounter{lotdepth}{2}^
% \listoftables
% \setcounter{lofdepth}{2}^
% \listoffigures
%
% \newpage
% \section{Introduction}
% \enlargethispage{24pt}^finalhack
%
% This package provides support for the manipulation and reference of
% small or `sub' figures and tables within a single \Lenv{figure} or
% \Lenv{table} environment\@.\footnote{Section~\ref{sec:customfloat}
% describes how to add support for additional \Lenv{float}
% environments.} It is convenient to use this package when your
% subfigures are to be separately captioned, referenced, or when such
% subcaptions are to be included in the List-of-Figures.
%
% Before using the \Lpack{hhsubfigure} package, consider the following to
% see if you really need it. If you simply want to center your figure,
% then you can use |\centerline|, |\centering| or the \Lenv{center}
% environment to do so. If your figure has a short width or if you wrap
% your figure in a |\parbox| or a \Lenv{minipage} of a short width, then
% you can place multiple figures or tables side-by-side. For example,
% the following will put two images side-by-side in a single figure as
% shown in figure~\ref{fig:1figs}:\footnote{You might have to use the
% optional position arguments `[b]' or `[t]' if the figures are of
% different heights.}
%
% \begin{verbatim}
% \begin{figure}%
% \centering
% \parbox{1.2in}{...figure code...}%
% \qquad
% \begin{minipage}{1.2in}%
% ...figure code...
% \end{minipage}%
% \caption{Here are two figures side-by-side.}%
% \label{fig:1figs}%
% \end{figure}
% \end{verbatim}
% \vspace{-1\baselineskip}
% \begin{figure}^
% \abovecaptionskip=6pt^
% \centering
% \parbox{1.2in}{^
% \fboxsep=-\fboxrule
% \fbox{\hbox to 1.2in{\vbox to 15mm{\null\vfil}\hfil}}}^
% \qquad
% \begin{minipage}{1.2in}^
% \fboxsep=-\fboxrule
% \fbox{\hbox to 1.2in{\vbox to 15mm{\null\vfil}\hfil}}^
% \end{minipage}^
% \caption{Here are two figures side-by-side.}^
% \label{fig:1figs}^
% \vspace{-10pt}
% \end{figure}
%
% \noindent
% Further, if you place the caption inside the |\parbox| or
% \Lenv{minipage}, then the width of the caption will be limited to the
% width of the parbox or minipage as shown in figures~\ref{fig:2figsA}
% and \ref{fig:2figsB}:
%
% \begin{verbatim}
% \begin{figure}%
% \centering
% \parbox{1.2in}{%
% ...figure code...
% \caption{First.}%
% \label{fig:2figsA}}%
% \qquad
% \begin{minipage}{1.2in}%
% ...figure code...
% \caption{Second.}%
% \label{fig:2figsB}%
% \end{minipage}%
% \end{figure}%
% \end{verbatim}
% \vspace{-\baselineskip}
% \begin{figure}^
% \abovecaptionskip=2pt^
% \centering
% \parbox{1.2in}{^
% \fboxsep=-\fboxrule
% \fbox{\hbox to 1.2in{\vbox to 15mm{\vfil\null}\hfil}}^
% \caption{First.}^
% \label{fig:2figsA}}^
% \qquad
% \begin{minipage}{1.2in}^
% \fboxsep=-\fboxrule
% \fbox{\hbox to 1.2in{\vbox to 15mm{\vfil\null}\hfil}}^
% \caption{Second.}^
% \label{fig:2figsB}^
% \end{minipage}^
% \vspace{-10pt}
% \end{figure}
%
% For more information on typesetting figures and tables, see the
% document ``Using Imported Graphics in \LaTeXe'' by Keith Reckdahl
% \cite{Reck97}.
%
% \section{The User Interface}
% \vspace{-5pt}^finalhack
% \enlargethispage{12pt}^finalhack
%
% To use this package place
% \begin{quote}
% |\usepackage|\oarg{options}\marg{hhsubfigure}
% \end{quote}
% in the preamble of your document. The supported options are shown in
% table~\ref{tab:options}.
% \DescribeMacro{\subfigure}
% \DescribeMacro{\subtable}
% Within a \Lenv{figure} or \Lenv{table}
% environment, you can use the following commands to create a subfigure
% or subtable ``box'' with an optional subcaption underneath.
% \vspace{-2pt}
% \begin{quote}
% |\subfigure|\oarg{list\_entry}\oarg{subcaption}\marg{figure}\\
% |\subtable|\oarg{list\_entry}\oarg{subcaption}\marg{figure}
% \end{quote}
% \vspace{-2pt}
%
% \noindent
% If a subcaption argument is given (including the null subcaption
% `{\ttfamily [$\;$]}') then the subfigure is labeled with a counter
% formatted by the command `|\thesubfigure|' which returns, by default,
% `(a)', `(b)', etc. The counter used for labeling the subfigures is
% \Lcount{hhsubfigure} and is incremented for each subfigure regardless of
% whether a subcaption was printed. The internals of the |\subtable|
% command are symmetric to those of the |\subfigure| command. Further,
% if a List-of-Figures (or List-of-Tables) is generated, then the
% \meta{list\_entry} argument controls how the caption text is used
% there. Table~\ref{tab:calling} shows the possibilities.
%
% \changes{v2.1.4}{30 Apr 2002}{Changed the label and caption defaults
% from \cmd{\rmfamily}\cmd{\mdseries}\cmd{\upshape} to
% \cmd{\familydefault}\cmd{\seriesdefault} \cmd{\shapedefault}.}
% \DeleteShortVerb{\|}
% \begin{table}
% \def\M#1{\vspace*{#1}}
% \centering
% \caption{\Lpack{hhsubfigure} package options.}
% \label{tab:options}
% \vspace{8pt}
% \fbox{\begin{tabular}{|p{0.36\textwidth}|p{0.63\textwidth}|} \hline
% \multicolumn{1}{|c|}{{\large\bf\strut Option}}
% & \multicolumn{1}{c|}{{\large\bf Description}}
% \\ \hline\hline
% \Lopt{normal} & \rr Provides `normal' subcaptions, this is the
% default. \\ \hline
% \raisebox{-1.4ex}{\Lopt{hang}, \Lopt{isu}}
% & \rr Causes the label to be a hanging
% indentation to the subcaption paragraph.
% (\Lopt{isu} is a synonym for \Lopt{hang}.)
% \\ \hline
% \raisebox{-1.4ex}{\Lopt{center}}
% & \rr Causes each line of the paragraph to be
% separately centered. Overrides
% \Lopt{centerlast}.\\ \hline
% \raisebox{-1.4ex}{\Lopt{centerlast}, \Lopt{anne}}
% & \rr Causes the last line only to be centered.
% Overrides \Lopt{nooneline}. (\Lopt{anne} is
% a synonym for \Lopt{centerlast}.) \\ \hline
% \raisebox{-2.6ex}{\Lopt{nooneline}}
% & \rr If a subcaption fits on one line it will, by
% default, be centered. This option
% treats a single line like a mid-line of a
% multi-line caption.\\ \hline
% \raisebox{-1.4ex}{\Lopt{raggedright}}
% & \rr Causes the subcaption text to be raggedright.
% Overrides \Lopt{center} and \Lopt{centerlast}.
% \\ \hline
% \raisebox{-1.4ex}{\Lopt{RaggedRight}}
% & \rr Causes the subcaption text to be
% raggedright with hyphenation (using the
% ragged2e package).
% Overrides \Lopt{center} and \Lopt{centerlast}.
% \\ \hline\hline
% \Lopt{scriptsize{\rm,} footnotesize{\rm,} small{\rm,}\hfil\null\linebreak
% normalsize{\rm,} large{\rm,} Large}
% & \rr Sets the font size of the subcaptions (both
% the label and the text), \Lopt{footnotesize}
% is default. \\ \hline
% \M{1.8ex}
% \Lopt{rm{\rm,} sf{\rm,} tt{\rm,} md{\rm,} bf{\rm,}\efill
% up{\rm,} it{\rm,} sl{\rm,} sc{\rm,}}\hfil\null\linebreak
% \Lopt{RM{\rm,} SF{\rm,} TT{\rm,} MD{\rm,} BF{\rm,}\efill
% UP{\rm,} IT{\rm,} SL{\rm,} SC}
% & \rr The lowercase commands set the font attributes
% of the subcaption label. The capitalized version
% sets the font attributes of the text. Family,
% shape and style attributes may be mixed.
% The default is to set the document defaults for
% the family, series and shape.\\ \hline\hline
% \M{4ex}
% \Lopt{figbotcap}{\rm,} \Lopt{tabbotcap}{\rm,}\hfil\null\linebreak
% \Lopt{FIGBOTCAP}{\rm,} \Lopt{TABBOTCAP}
% & \rr Sets the figure or table numbering based on
% the assumption that the figure or table caption
% comes after the subfigures or subtables. The
% capitalized version also places the subcaption
% after the figure (``\Lopt{FIGBOTCAP}'' and
% ``\Lopt{TABBOTCAP}'' are the default settings).
% \\ \hline
% \M{3.9ex}
% \Lopt{figtopcap}{\rm,} \Lopt{tabtopcap}{\rm,}\hfil\null\linebreak
% \Lopt{FIGTOPCAP}{\rm,} \Lopt{TABTOPCAP}
% & \rr Sets the figure or table numbering based on
% the assumption that the figure or table caption
% precedes the subfigures or subtables. The
% capitalized version also places the subcaption
% before the figure (``\Lopt{TABTOPCAP}'' is the
% preferred table setting, see
% section~\ref{sec:position} for details).
% \\ \hline\hline
% \M{2.6ex}
% \Lopt{loose}{\rm,} \Lopt{tight}
% & \rr The (default) \Lopt{loose} option sets the
% historically normal whitespace around the subfloat.
% The \Lopt{tight} option sets less space around the
% subfigure (this is the preferred setting).
% \\ \hline
% \end{tabular}}%
% \end{table}
% \MakeShortVerb{\|}
%
% \begin{table}
% \centering
% \caption{\cmd{\subfigure} calling arguments.}
% \label{tab:calling}
% \begingroup\small
% \begin{tabular}{llc} \\ \hline
% {\normalsize Subfigure Command}
% & {\normalsize LoF/LoT}
% & \multicolumn{1}{r}{\hbox to .25in{%
% \hss\normalsize
% Subfigure Caption}}
% \\ \hline
% \cmd{\subfigure}\{\dots fig\dots\}
% & & \\
% \cmd{\subfigure}[~]\{\dots fig\dots\}
% & (b)\ \ . . . . . . . . . .
% & (b) \\
% \cmd{\subfigure}[Subcaption.]\{\dots fig\dots\}
% & (c) Subcaption. . . .
% & (c) Subcaption. \\
% \cmd{\subfigure}[\space][Subcaption.]\{\dots fig\dots\}
% & & (d) Subcaption. \\
% \cmd{\subfigure}[\space][\space]\{\dots fig\dots\}
% & & (e) \\
% \cmd{\subfigure}[List\_entry.][Subcaption.]\{\dots fig\dots\}
% & (f) List\_entry. . . .
% & (f) Subcaption. \\
% \cmd{\subfigure}[List\_entry.][~]\{\dots fig\dots\}
% & (g) List\_entry. . . .
% & (g) \\ \hline
% \end{tabular}
% \endgroup
% \vspace{-8pt}
% \end{table}
%
% If you wish to reference a specific subfigure or subtable, you can
% include a |\label| inside the body of either the \meta{subcaption} or
% \meta{figure} argument to the command (but not the \meta{list\_entry}
% argument). If supplied by itself, the \meta{subcaption} is a ``moving
% argument''\footnote{See \cite[\textsection~4.7 and
% \textsection~C.1.3]{Lamp94} for a more detailed description of
% ``moving arguments'' and ``fragile'' commands.} and, therefore, any
% ``fragile'' commands contained within it must be |\protect|'ed. If
% the \meta{list\_entry} argument is supplied, then the
% \meta{subcaption} is not a ``moving argument''; however, the
% \meta{list\_entry} is.
%
% {\bf Note:} since the |\subfigure| and |\subtable| commands have optional
% arguments, delimited with square brackets, before their required argument,
% you cannot use the `]' character at the top level of either the
% \meta{subcaption} or \meta{list\_entry} argument. To overcome this
% problem, you must wrap the portion of the text containing the `]'
% character (or the entire argument), in a pair of curly brackets (see
% \cite[\textsection~C.1.1]{Lamp94} for more detail). For example:
%
% \begin{verbatim}
% \subfigure[This does not $sqrt[3]{8}$ work.]{... figure text ...}
% \subfigure[This works {$sqrt[3]{8}$} fine.]{... figure text ...}
% \subfigure[{This also works $sqrt[3]{8}$ fine.}]{... figure text ...}
% \end{verbatim}
%
% One final note, the |\subfigure| and |\subtable| commands are
% actually identical and it is the surrounding environment that defines
% actually identical and it is the surrounding environment that defines
% whether a subtable or subfigure will be generated and not which command
% is used. At the user level, the choice of names is purely cosmetic
% (and historical). Therefore you can use |\subfigure| for any float
% ({\it e.g.\/}, \Lenv{figure}, \Lenv{table}, or other) environment.
%
% \subsection{Format Options}
% \label{sec:format}
%
% There are six options for formatting the layout of the caption label
% and text. The first is \Lopt{normal}, which produces the style shown
% in figure~\ref{fig:format-01}. The other options may be used in
% various combinations to produce the layouts shown in
% figures~\ref{fig:format-02} thru \ref{fig:format-14}. Note that some
% combinations, like \Lopt{center} and \Lopt{centerlast} do not make
% sense since \Lopt{center} overrides \Lopt{centerlast}. Also,
% \Lopt{nooneline}, when combined with either \Lopt{center} or
% \Lopt{centerlast} has no effect (unless the \Lopt{hang} option is
% also set); and, \Lopt{raggedright} overrides both \Lopt{center} and
% \Lopt{centerlast}.
%
% \begingroup
% \def\sc{Short.}
% \def\lc{This is a long caption of gibberish: Aafas d taed
% gaihgghn adf irin sadf aets etsd na.}
% \def\b{\fboxsep=-\fboxrule
% \fbox{\hbox to 2.0in{\vbox to 2mm{\vfil\null}\hfil}}}
% \def\g{\hspace{.5in}}
% \subfigtopskip=20pt
% \subfigcapskip=-3pt
% \subfigbottomskip=0pt
% \abovecaptionskip=5pt
% \begin{figure}^
% \centering
% \turnofflistentry
% \subcaphangfalse
% \subcapcenterfalse
% \subcapcenterlastfalse
% \subcapnoonelinefalse
% \subcapraggedrightfalse
% \subfigure[\sc]{\b}\g\subfigure[\lc]{\b}\\
% \caption{Format option [\Lopt{normal}].}^
% \label{fig:format-01}^
% \subcapnoonelinetrue
% \subfigure[][\sc]{\b}\g\subfigure[][\lc]{\b}\\
% \caption{Format option [\Lopt{nooneline}].}^
% \label{fig:format-02}^
% \subcapcenterlasttrue
% \subcapnoonelinefalse
% \subfigure[][\sc]{\b}\g\subfigure[][\lc]{\b}\\
% \caption{Format option [\Lopt{centerlast}]; \Lopt{centerlast} overrides
% \Lopt{nooneline}.\footnotemark}
% \label{fig:format-03}^
% \subcapcentertrue
% \subcapcenterlastfalse
% \subfigure[][\sc]{\b}\g\subfigure[][\lc]{\b}\\
% \caption{Format option [\Lopt{center}]; \Lopt{center} overrides
% \Lopt{nooneline} and \Lopt{centerlast}.}^
% \label{fig:format-04}^
% \subcaphangtrue
% \subcapcenterfalse
% \subfigure[][\sc]{\b}\g\subfigure[][\lc]{\b}\\
% \caption{Format option [\Lopt{hang}].}
% \label{fig:format-05}
% \subcapnoonelinetrue
% \subfigure[][\sc]{\b}\g\subfigure[][\lc]{\b}\\
% \caption{Format options [\Lopt{hang},\Lopt{nooneline}].}
% \label{fig:format-06}
% \subcapcenterlasttrue
% \subcapnoonelinefalse
% \subfigure[][\sc]{\b}\g\subfigure[][\lc]{\b}\\
% \caption{\Lpack{Hhsubfigure}\ format options [\Lopt{hang},^
% \Lopt{centerlast}].}
% \label{fig:format-07}
% \vspace{2\baselineskip}
% \begin{minipage}{\linewidth}
% \footnotetext{\raise1ex\hbox to 0pt{\hss\tiny\thefootnote}^
% So this is the same as [\Lopt{centerlast},\Lopt{nooneline}]. Only
% the shortest number of options to achieve an effect is shown.
% Adding any combination of overridden options has no effect.}
% \end{minipage}
% \end{figure}
%
% \begin{figure}
% \turnofflistentry
% \centering
% \subcaphangtrue
% \subcapcenterfalse
% \subcapcenterlasttrue
% \subcapnoonelinetrue
% \subcapraggedrightfalse
% \subfigure[][\sc]{\label{fig:format-08A}\b}\g\subfigure[][\lc]{\b}\\
% \caption{Format options [\Lopt{hang},\Lopt{centerlast},\Lopt{nooneline}].}
% \label{fig:format-08}
% \subcapcentertrue
% \subcapcenterlastfalse
% \subcapnoonelinefalse
% \subfigure[][\sc]{\b}\g\subfigure[][\lc]{\b}\\
% \caption{Format options [\Lopt{hang},\Lopt{center}];
% \Lopt{center} overrides \Lopt{centerlast}.}
% \label{fig:format-09}
% \subcapnoonelinetrue
% \subfigure[][\sc]{\label{fig:format-10A}\b}\g\subfigure[][\lc]{\b}\\
% \caption{Format options [\Lopt{hang},\Lopt{center},\Lopt{nooneline}];
% \Lopt{center} overrides \Lopt{centerlast}.}
% \label{fig:format-10}
% \subcaphangfalse
% \subcapcenterfalse
% \subcapnoonelinefalse
% \subcapraggedrighttrue
% \subfigure[][\sc]{\b}\g\subfigure[][\lc]{\b}\\
% \caption{Format option [\Lopt{raggedright}];
% \Lopt{raggedright} overrides \Lopt{center} and \Lopt{centerlast}.}
% \label{fig:format-11}
% \subcapnoonelinetrue
% \subfigure[][\sc]{\b}\g\subfigure[][\lc]{\b}\\
% \caption{Format options [\Lopt{raggedright},\Lopt{noonelirne}];
% \Lopt{raggedright} overrides \Lopt{center} and \Lopt{centerlast}.}
% \label{fig:format-12}
% \subcaphangtrue
% \subcapnoonelinefalse
% \subfigure[][\sc]{\b}\g\subfigure[][\lc]{\b}\\
% \caption{Format options [\Lopt{hang},\Lopt{raggedright}];
% \Lopt{raggedright} overrides \Lopt{center} and \Lopt{centerlast}.}
% \label{fig:format-13}
% \subcapnoonelinetrue
% \subfigure[][\sc]{\label{fig:format-14A}\b}\g\subfigure[][\lc]{\b}\\
% \caption{\Lpack{hhsubfigure}\ format options [\Lopt{hang},\Lopt{raggedright},
% \Lopt{nooneline}]; \Lopt{raggedright} overrides \Lopt{center}
% and \Lopt{centerlast}.}
% \label{fig:format-14}
% \end{figure}
% \endgroup
%
% \addtocontents{lof}{^
% \string\contentsline
% {figure}
% {\numberline{\ref{fig:format-01}--\ref{fig:format-14}}^
% {\ignorespaces \Lpack{Hhsubfigure}\ format options.}}^
% {\pageref{fig:format-01}--\pageref{fig:format-14}}}
%
% \subsection{Font Size and Style Options}
% \label{sec:font}
%
% There are twenty-four options for setting the font of the subcaption.
% The first six set the size of both the subcaption label and text.
% They are: \Lopt{scriptsize}, \Lopt{footnotesize} (default),
% \Lopt{small}, \Lopt{normalsize}, \Lopt{large}, and \Lopt{Large}.
% Their effect is shown in figure~\ref{fig:font1}.
%
% The next nine, \Lopt{rm}: \Lopt{sf}, \Lopt{tt}, \Lopt{md}, \Lopt{bf},
% \Lopt{up}, \Lopt{it}, \Lopt{sl}, and \Lopt{sc}, set the family, series
% or shape of the subcaption label, as shown in
% figures~\ref{fig:font2A}--~\ref{fig:font2I}. The last nine:
% \Lopt{RM}, \Lopt{SF}, \Lopt{TT}, \Lopt{MD}, \Lopt{BF}, \Lopt{UP},
% \Lopt{IT}, \Lopt{SL}, and \Lopt{SC}, do the same for the text of the
% subcaption, as shown in figure~\ref{fig:font2J}--\ref{fig:font2R}.
% These size and style options may be combined in 3456 ways to set the
% label and text of the subcaption (as long as the selected font
% combination exists\@!) The font family for the text and label may be
% set as roman (\Lopt{rm}/\Lopt{RM}), sans serif (\Lopt{sf}/\Lopt{SF}),
% and typewriter (\Lopt{tt}/\Lopt{TT}). These may be combined with
% those for the font series, medium (\Lopt{md}/\Lopt{MD}) and bold
% (\Lopt{bf}/\Lopt{BF}); and the font shape, upright
% (\Lopt{up}/\Lopt{UP}), italic (\Lopt{it}/\Lopt{IT}), slanted
% (\Lopt{sl}/\Lopt{SL}), and small caps (\Lopt{sc}/\Lopt{SC}).
%
% \begin{figure}^
% \def\b{\fboxsep=-\fboxrule
% \fbox{\hbox to 2.0in{\vbox to 2mm{\vfil\null}\hfil}}}^
% \subfigtopskip=8pt^
% \subfigcapskip=0pt^
% \subfigbottomskip=4pt^
% \centering
% {\renewcommand{\subcapsize}{\scriptsize}^
% \subfigure[][Font option {[scriptsize]}.]{\b}}\qquad
% {\renewcommand{\subcapsize}{\footnotesize}^
% \subfigure[][Font option {[footnotesize]}.]{\b}}\\
% {\renewcommand{\subcapsize}{\small}^
% \subfigure[][Font option {[small]}.]{\b}}\qquad
% {\renewcommand{\subcapsize}{\normalsize}^
% \subfigure[][Font option {[normalsize]}.]{\b}}\\
% {\renewcommand{\subcapsize}{\large}^
% \subfigure[][Font option {[large]}.]{\b}}\qquad
% {\renewcommand{\subcapsize}{\Large}^
% \subfigure[][Font option {[Large]}.]{\b}}%
% \caption[\Lpack{Hhsubfigure} font size options.]{%
% \Lpack{Hhsubfigure} font size options. (Default:
% \Lopt{footnotesize}).}^
% \label{fig:font1}^
% \end{figure}
%
% \begin{figure}^
% \def\b{\fboxsep=-\fboxrule
% \fbox{\hbox to 2.0in{\vbox to 2mm{\vfil\null}\hfil}}}^
% \subfigtopskip=8pt^
% \subfigcapskip=0pt^
% \subfigbottomskip=4pt^
% \centering
% \begin{minipage}{2.0in}^
% {\renewcommand{\subcaplabelfont}{\rmfamily}^
% \subfigure[][Subcaption label font option {[\Lopt{rm}]}.]{\b^
% \label{fig:font2A}}}\\
% {\renewcommand{\subcaplabelfont}{\sffamily}^
% \subfigure[][Subcaption label font option {[\Lopt{sf}]}.]{\b}}\\
% {\renewcommand{\subcaplabelfont}{\ttfamily}^
% \subfigure[][Subcaption label font option {[\Lopt{tt}]}.]{\b}}\\
% {\renewcommand{\subcaplabelfont}{\mdseries}^
% \subfigure[][Subcaption label font option {[\Lopt{md}]}.]{\b}}\\
% {\renewcommand{\subcaplabelfont}{\bfseries}^
% \subfigure[][Subcaption label font option {[\Lopt{bf}]}.]{\b}}\\
% {\renewcommand{\subcaplabelfont}{\upshape}^
% \subfigure[][Subcaption label font option {[\Lopt{up}]}.]{\b}}\\
% {\renewcommand{\subcaplabelfont}{\itshape}^
% \subfigure[][Subcaption label font option {[\Lopt{it}]}.]{\b}}\\
% {\renewcommand{\subcaplabelfont}{\slshape}^
% \subfigure[][Subcaption label font option {[\Lopt{sl}]}.]{\b}}\\
% {\renewcommand{\subcaplabelfont}{\scshape}^
% \subfigure[][Subcaption label font option {[\Lopt{sc}]}.]{^
% \label{fig:font2I}\b}}\\
% \end{minipage}^
% \qquad
% \begin{minipage}{2.0in}^
% {\renewcommand{\subcapfont}{\rmfamily}^
% \subfigure[][Subcaption font option {[\Lopt{RM}]}.]{^
% \label{fig:font2J}\b}}\\
% {\renewcommand{\subcapfont}{\sffamily}^
% \subfigure[][Subcaption font option {[\Lopt{SF}]}.]{\b}}\\
% {\renewcommand{\subcapfont}{\ttfamily}^
% \subfigure[][Subcaption font option {[\Lopt{TT}]}.]{\b}}\\
% {\renewcommand{\subcapfont}{\mdseries}^
% \subfigure[][Subcaption font option {[\Lopt{MD}]}.]{\b}}\\
% {\renewcommand{\subcapfont}{\bfseries}^
% \subfigure[][Subcaption font option {[\Lopt{BF}]}.]{\b}}\\
% {\renewcommand{\subcapfont}{\upshape}^
% \subfigure[][Subcaption font option {[\Lopt{UP}]}.]{\b}}\\
% {\renewcommand{\subcapfont}{\itshape}^
% \subfigure[][Subcaption font option {[\Lopt{IT}]}.]{\b}}\\
% {\renewcommand{\subcapfont}{\slshape}^
% \subfigure[][Subcaption font option {[\Lopt{SL}]}.]{\b}}\\
% {\renewcommand{\subcapfont}{\scshape}^
% \subfigure[][Subcaption font option {[\Lopt{SC}]}.]{^
% \label{fig:font2R}\b}}^
% \end{minipage}^
% \caption[\Lpack{Hhsubfigure} font style options.]{%
% \Lpack{Hhsubfigure} font style options. (Default:
% \Lopt{rm,md,up,RM,MD,UP}). Note: The above single options
% are loaded after the default settings and multiple options are
% allowed, see the text, section~\ref{sec:font}.}^
% \label{fig:font2}^
% \end{figure}
%
% \subsection{Caption Position Options}
% \enlargethispage{12pt}^finalhack
% \label{sec:position}
%
% There are eight options that control the {\em position\/} of the
% subcaption and how the subcaption {\em numbering\/} is related to the
% ``containing'' figure or table's caption. The following shows only
% the subfigure-related options, but the subtable options are symmetric.
%
% The first option, \Lopt{figbotcap} tells the subfigure command that
% the ``containing'' figure's |\caption| occurs {\bf after} the
% subfigures. This information is needed to decide if the current
% figure counter shows the number for the last figure (\Lopt{figbotcap})
% or for the current one (\Lopt{figtopcap}, see below).
%
% The second option, \Lopt{figtopcap} tells the subfigure command that
% the ``containing'' figure's |\caption| occurs {\bf before} the
% subfigures. The subcaption is automatically placed below the figure
% for each of these options.
%
% The third option, \Lopt{FIGBOTCAP}, is similar to \Lopt{figbotcap},
% except that it also forces the subcaption to be placed under the
% figure. This is the default setting for figures (and \Lopt{TABBOTCAP}
% for tables) and is shown in figure~\ref{fig:position1}.
%
% The fourth option, \Lopt{FIGTOPCAP}, is similar to \Lopt{figtopcap},
% except that it forces the subcaption to be placed above the figure
% box. (While not the default, it is the preferred format for tables,
% which uses the option \Lopt{TABTOPCAP}\@.) An example of this option
% is shown in figure~\ref{fig:position2}. Note that the baseline of the
% subfigure is along the top of the two subfigures. See
% section~\ref{sec:custom-position} for another way of positioning the
% caption when captions are placed above the figure or table.
%
% \begin{figure}^
% \subfigtopskip=8pt^
% \subfigcapskip=0pt^
% \subfigbottomskip=4pt^
% \abovecaptionskip=5pt^
% \centering
% \subfigure[First caption.]{^
% \fbox{\hbox to 1.5in{\vbox to 15mm{\vfil\null}\hfil}}}^
% \hspace{0.2in}^
% \subfigure[Second long, long, long, long, long, long, caption.]{^
% \fbox{\hbox to 1.5in{\vbox to 10mm{\vfil\null}\hfil}}}^
% \caption{Subcaption position option [\Lopt{FIGBOTCAP}].}
% \label{fig:position1}^
% \end{figure}
%
% \begin{figure}^
% \subfigtopskip=8pt^
% \subfigcapskip=0pt^
% \subfigbottomskip=0pt^
% \belowcaptionskip=5pt^
% \caption{Subcaption position option: [\Lopt{FIGTOPCAP}].}^
% \label{fig:position2}^
% \centering
% \figuretopcaptrue
% \subfiguretopcaptrue
% \subfigure[First caption.]{^
% \fbox{\hbox to 1.5in{\vbox to 15mm{\vfil\null}\hfil}}}^
% \hspace{0.2in}^
% \subfigure[Second long, long, long, long, long, long caption.]{^
% \fbox{\hbox to 1.5in{\vbox to 10mm{\vfil\null}\hfil}}}^
% \setcounter{subfigure}{0}^
% \vspace{-18pt}
% \end{figure}
%
% \subsection{Recent Changes and Backward Compatibility}
% \enlargethispage{24pt}^finalhack
% \label{sec:back-compat}
%
% There are some significant changes in this version of the
% \Lpack{hhsubfigure} package. One of them was to pack the subfigure
% tighter together by removing the space at the top of the subfigure at
% the beginning of a page, or minipage, and to reduce the spacing around
% the subfigure, see table~\ref{tab:spacing}. If you have been using an
% older version of the \Lpack{hhsubfigure} package ({\it i.e.\/}, version
% 2.0 or eariler) than the default (\Lopt{loose}) setting will not cause
% any change in your existing documents.\footnote{If you have been using
% a beta release version of \Lpack{subfigure} 2.1, than you will need to
% use the \Lopt{tight} option in order to maintain the ``look-and-feel''
% that you are used to.}
%
% If you want to use the new and preferred, \Lopt{tight} option, your
% subfigures will take up less space and should provide a more balanced
% visual appearance for your paper.
%
% The second significant change is the ability to make the text on the
% List-of-Figures page different than that in the subcaption. The use
% of a second optional argument to the |\subfigure| command is shown in
% table~\ref{tab:calling}. This should not cause any compatibility
% problems.
%
% The third significant change is the it is now possible to have the
% captions and subcaptions come before or after the corresponding
% figure/table portion. While the default settings support the old view
% of the subcaptions following the figure/table and, in turn, followed
% by the main caption. The preferred format is for figures to retain
% that layout and for tables to have both their subcaption and main
% captions come before the table portion. This preferred setting may be
% specified by adding the option \Lopt{TABTOPCAP} when loading the
% \Lpack{hhsubfigure} package.
%
% The fourth update is that the font style options have been generalized
% so that an option from each of the family, series and shape, may be
% combined, as long as that combination exists; and you can set the font
% of the label and text separately. In addition, the the |\space| that
% separated the label from the text in the subcaption has been replaced
% with a horizontal skip of |\subfiglabelskip| which has the default
% value of |0.33em plus 0.07em minus 0.03em|. This extension should not
% cause any compatibility problems.
%
% The last major change is that there is now a |\subref| command that
% allows a reference to the subfigure without the figure number. An
% example of the use of this command is shown later in
% section~\ref{sec:ex3}. Associated with this change is that the
% |\label| command will accept an optional argument, for use with the
% \Lpack{hyperref} package, when used within the scope of the
% |\subfigure| or |\subtable|, see section~\ref{sec:hyperref} for details.
%
% \DeleteShortVerb{\|}
% \MakeShortVerb{\/}
% \begin{table}^
% \def\pz{\phantom{0}}^
% \centering
% \caption{\Lpack{hhsubfigure} spacing changes.}^
% \label{tab:spacing}^
% \vspace{4pt}^
% \begin{tabular}{|l|c|c|c|} \hline
% \multicolumn{1}{|c|}{\bf{\Lpack{hhsubfigure}}}
% & \multicolumn{1}{c|}{{\bf Old (v2.0)}}
% & \multicolumn{1}{c|}{\bf\Lopt{loose}}
% & \multicolumn{1}{c|}{\bf\Lopt{tight}} \\
% \multicolumn{1}{|c|}{{\bf Constant}}
% & \multicolumn{1}{c|}{{\bf Value}}
% & \multicolumn{1}{c|}{{\bf Option}}
% & \multicolumn{1}{c|}{{\bf Option}}
% \\ \hline
% /\subfigtopskip/ & 10 pt & 10 pt & 5 pt \\
% /\subfigcapskip/ & 10 pt & 10 pt & 0 pt \\
% /\subfigcaptopadj/ & | &\pz0 pt & 3 pt \\
% /\subfigbottomskip/ & 10 pt & 10 pt & 5 pt \\
% /\subfigcapmargin/ & 10 pt & 10 pt & 0 pt \\
% /\subfiglabelskip/ & | & 0.33 em &
% \vtop{\hbox to 1.2in{0.33 em plus 0.07 em}
% \hbox to 1.2in{\hfill minus 0.03 em}}
% \\[8pt] \hline
% \end{tabular}^
% \end{table}
% \DeleteShortVerb{\/}
% \MakeShortVerb{\|}
%
% The \Lpack{hhsubfigure} package checks for and loads a configuration
% file called \Lfile{subfigure.cfg} which is placed anywhere that \LaTeX\
% will look for classes or packages (see
% section~\ref{sec:customization}). By default, the \Lfile{subfigure.sty}
% file tries to look unchanged from older versions. In order to
% have it automatically use the preferred settings, you can add a
% configuration file containing the options \Lopt{tight} to reduce the
% extra whitespace around the subfigures and \Lopt{TABTOPCAP} to show
% that table captions will come before the table and the the subcaptions
% for tables should be set above the subtable. The following line is all
% you need in your configuration file:
%
% \iffalse
%<*newconf>
% \fi
% \begin{macrocode}
\ExecuteOptions{tight,TABTOPCAP}
% \end{macrocode}
% \iffalse
%</newconf>
% \fi
%
% You could also load the subfigure package with the options with the
% following in your \LaTeX\ preamble:
% \begin{quote}
% |\usepackage[tight,TABTOPCAP]{hhsubfigure}|
% \end{quote}
%
% \subsection{Frequently Asked Questions}
% \label{sec:faq}
%
% The four most frequently asked questions about the \Lpack{hhsubfigure}
% package are:
%
% \begin{enumerate}
% \item ``My subfigures are not aligned along their bottoms. Why?''
%
% Remember! The \Lpack{hhsubfigure} package aligns subfigure along
% their baselines with the subcaption (if any) sticking out above or
% below. The above problem is usually due to using a \Lenv{minipage},
% \Lenv{tabular} or \Lenv{array} environment that, by default,
% places the baseline at the center of the box that it generates.
% If the two subfigures are different sizes, or if one subfigure is
% generated in some other way with its baseline not at the expected
% place (perhaps an |\includegraphics|), then the subfigures will be
% misaligned. One solution is to use the environment options `[t]'
% or `[b]' to move the baseline to the top or bottom rather than the
% center.
%
% \item ``How can I get my figures/subfigures to line up the way I want?''
%
% A similar question, but this one is caused by extra whitespace in
% the source text generating spaces next to the figures, and |\par|'s
% generated by blanklines. The main thing is {\it be aware\/} that
% extra whitespace can move figures and subfigures around, sometimes
% a lot and sometimes just a little so that they look ``wrong''.
% Placing too many `\%'s at the end of the lines is better than too
% few in the figure and table environments. (See the discussion of
% ``white space'' in section~\ref{sec:examples}.)
%
% \item ``I have too many subfigures for one page, How can I spread
% them over two or more pages and continue the numbering?''
% \begin{description}
% \item[Option 1:] Adjust the \Lcount{figure} and \Lcount{subfigure}
% counters (or the \Lcount{table} and
% \Lcount{subtable} counters) as needed before and
% after each figure (or table) See, for example
% \emph{Using Imported Graphics in \LaTeXe}
% \cite[\textsection~30]{Reck97}.
% \item[Option 2:] Use the \Lpack{ccaption} package by Peter Wilson
% \cite{Wils01}.
% \item[Option 3:] Use the simpler \Lpack{captcont} package by
% Steven Cochran \cite{Coch02}.
% \end{description}
% All of these options work well. Of the packages, the
% \Lpack{ccaption} package is bigger and offers more control over
% what is done (and things to do) at the expense of being a little
% harder to use. The \Lpack{captcont} package is easier to use,
% but only provides for continued floats.
% \newpage^finalhack
% \item ``Why do I get a garbled caption or an error when I use
% square brackets?''
% \vspace{-2pt}
% \begin{verbatim}
% \subfigure[SHIFT: ``register[3] $<<=$ 3;'']{... figure text ...}
% \end{verbatim}
% \vspace{-12pt}
% Since the |\subfigure| and |\subtable| commands have optional
% arguments, delimited with square brackets, before their required
% argument, you cannot use the `]' character at the top level of
% either the \meta{subcaption} or \meta{list\_entry} argument. To
% overcome this problem, you must wrap all or the portion of the text
% containing the `]' character, in a pair of curly brackets
% (see \cite[\textsection~C.1.1]{Lamp94} for more detail). For example:
% \begin{verbatim}
% \subfigure[SHIFT: ``register{[3]} $<<=$ 3;'']{... figure text ...}
% \end{verbatim}
% \vspace{-16pt}
% \noindent
% or
% \vspace{-4pt}
% \begin{verbatim}
% \subfigure[{SHIFT: ``register[3] $<<=$ 3;''}]{... figure text ...}.
% \end{verbatim}
% \vspace{-12pt}
% \end{enumerate}
%
% \section{Three Examples}
% \label{sec:examples}
%
% The easiest way to show the use of this package is to give a few
% examples. The two most important things to remember when working
% with the \Lpack{hhsubfigure} package are that (1) the subfigures are
% aligned along their baselines (see figure~\ref{fig:layout} and
% section~\ref{sec:customlayout}) and (2) that whitespace in the
% \Lenv{figure} environment are significant and affect the layout.
%
% The baseline of the subfigure is usually at the bottom of the
% subfigure or (when the subcaption appears at the top) at the bottom of
% the subcaption {\em and\/} the |\subfigcapskip| space---which is usually
% the same as the top of the subfigure. However sometimes, especially
% when using the \Lenv{tabular}, \Lenv{array}, or \Lenv{minipage}
% environments to build the figure, the baseline appears elsewhere. The
% above environments are all aligned at their center by default but that
% may be changed with the optional `{\bf [t]}' or `{\bf [b]}' arguments.
% As a last resort you can wrap all of your figures in a |\vtop| box with
% a |\vbox to 0pt{\null}| at the top followed by the figure.
%
% If your figure is not quite centered or where you want it to be, the
% problem is often a space character being placed to one side or the
% other of the figure. Some general rules of thumb are:\footnote{See
% chapters 7 and 8 of ``The \TeX book'' \cite{Knut86} for details.}
% \begin{itemize}\itemsep0pt
% \item Two end-of-lines following each other (ignoring any
% whitespace) are turned into a |\par| or paragraph break.
% \item Multiple whitespace (including the end-of-line) are
% compressed into a single space.
% \item The spaces after a macro command name ({\it e.g.\/}, |\foo|)
% are ignored.
% \item A `\%' character at the end of the line suppresses the
% end-of-line and all of the spaces (if any) at the
% beginning of the next line.
% \end{itemize}
%
% To suppress significant extra whitespace, you can add some `\%'
% characters at the end of each line that doesn't end with a command name.
% This is more than is required, but extra `\%' usually don't cause a
% problem.
%
% The other case where things are not correctly centered is when the
% subfigure uses only the label for the subcaption. This is often the
% case when the description for each subfigure is given in the figure
% caption rather than in each subcaption. In this case, the default
% label has the form `(a)\ \ ' where the trailing space is defined by
% |\subfiglabelskip|. In this case the style should redefine this space
% as `0pt' so that the label is perfectly centered (see
% section~\ref{sec:ex3}, below for an example).
%
% \subsection{A Simple Example}
% \enlargethispage{12pt}
%
% The first example, shown in figure~\ref{3figs}, specifies |\centering|
% \DescribeMacro{\subfigure}
% to horizontally center the set of subfigures, and uses |\\| and
% some horizontal space (using |\qquad|) to control the placement of
% the subfigures. Note that the alignment of the top two subfigures
% is along the bottom of the figure portion of each.
%
% \begin{figure}^
% \centering
% \fboxsep=-\fboxrule
% \fbox{^
% \begin{minipage}{4.0in}^
% \vspace{10pt}^
% \centering
% \begin{minipage}{3.5in}^
% \subfigtopskip=3pt^
% \subfigcapskip=-2pt^
% \subfigbottomskip=5pt^
% \subfigcapmargin=3pt^
% \abovecaptionskip=5pt^
% \centering
% \subfigure[First.]{^
% \fbox{\hbox to 20mm{\vbox to 15mm{\vfil\null}\hfil}}}\qquad
% \subfigure[Second figure.]{^
% \fbox{\hbox to 20mm{\vbox to 10mm{\vfil\null}\hfil}}}\\[6pt]
% \subfigure[Third.]{\label{3figs-c}^
% \fbox{\hbox to 20mm{\vbox to 10mm{\vfil\null}\hfil}}}\\
% \caption{Three subfigures.}^
% \label{3figs}^
% \rr
% \vspace{15pt}^
% Figure~\ref{3figs} contains two top `subfigures' and
% figure~\ref{3figs-c}.$\!$\footnotemark
% \end{minipage}^
% \vspace{4pt}^
% \end{minipage}}
% \vspace{-5pt}^
% \end{figure}
% \footnotetext{In this and later boxed figures, the boxes are intended to
% represent a portion of the page in which the figure occurs. This is
% usually to show the figure along with some text or to show the effect
% of some option on multiple pages.}
%
% \begin{verbatim}
% \begin{figure}%
% \centering
% \subfigure[First.]{...}\qquad
% \subfigure[Second figure.]{...}\\
% \subfigure[Third.]{\label{3figs-c}...}%
% \caption{Three subfigures.}
% \label{3figs}
% \end{figure}
% ...
% Figure~\ref{3figs} contains two top `subfigures' and
% figure~\ref{3figs-c}.
% \end{verbatim}
%
% \subsection{A More Advanced Example}
%
% A second example, shown in figure~\ref{fig:ex2}, demonstrates how to
% change the subfigure labels and have the subfigure captions printed in
% the List-of-Figures.
%
% The first |\renewcommand| changes the reference to |\thesubfigure| to
% return both the figure number and the subfigure number separated with
% a period. The next two |\renewcommand|'s turn off the |\p@subfigure|
% (since it is now included in |\thesubfigure| and adds the colon and
% space to the subfigure label. Later in the file, the
% \Lcount{lofdepth} is set to ``2'' so allow the subfigure captions to
% show and the |\listoffigures| is loaded. Finally, the \Lenv{figure}
% is defined and a little following text is given that refers to it.
%
% \begin{verbatim}
% \renewcommand{\thesubfigure}{\thefigure.\arabic{subfigure}}
% \makeatletter
% \renewcommand{\p@subfigure}{}
% \renewcommand{\@thesubfigure}{\thesubfigure:\hskip\subfiglabelskip}
% \makeatother
% ...
% \setcounter{lofdepth}{2}
% \listoffigures
% ...
% \begin{figure}%
% \centering
% \subfigure[First.]{%
% \label{fig:first}%
% ...}%
% \qquad
% \subfigure[Second.]{%
% \label{fig:second}%
% ...}%
% \caption{Two subfigures.}
% \end{figure}
% ...
% See figures~\ref{fig:first} and \ref{fig:second}.
% \end{verbatim}%
%
% \begin{figure}^
% \centering
% \fboxsep=-\fboxrule
% \renewcommand{\thesubfigure}{\thefigure.\arabic{subfigure}}^
% \makeatletter
% \renewcommand{\p@subfigure}{}^
% \renewcommand{\@thesubfigure}{\thesubfigure:\hskip\subfiglabelskip}^
% \makeatother
% \fbox{^
% \begin{minipage}{4.0in}^
% \centering
% \begin{minipage}{3.5in}^
% \setcounter{lofdepth}{2}^
% \vspace{.1in}^
% \section*{ List of Figures}^
% \vspace{-15pt}^
% \hspace{40pt}\dots
% \vspace{3pt}^
% \contentsline{figure}{\numberline{\ref{fig:ex2}}^
% {\ignorespaces Two subfigures.}}{\pageref{fig:ex2}}^
% \contentsline{subfigure}{\numberline{\ref{fig:first}}^
% {\ignorespaces First.}}{\pageref{fig:first}}^
% \contentsline{subfigure}{\numberline{\ref{fig:second}}^
% {\ignorespaces Second.}}{\pageref{fig:second}}^
% \hspace{40pt}\dots
% \vspace{8pt}^
% \end{minipage}^
% \end{minipage}}\\
% \fbox{^
% \begin{minipage}{4.0in}^
% \centering
% \begin{minipage}{3.5in}^
% \subfigtopskip=3pt^
% \subfigcapskip=-2pt^
% \abovecaptionskip=5pt^
% \vspace{10pt}^
% \centering
% \subfigure[First.]{^
% \label{fig:first}^
% \fbox{\hbox to 22mm{\vbox to 15mm{\vfil\null}\hfil}}}^
% \hspace{14pt}^
% \subfigure[Second.]{^
% \label{fig:second}^
% \fbox{\hbox to 22mm{\vbox to 15mm{\vfil\null}\hfil}}}\\
% \caption{Two subfigures.}^
% \label{fig:ex2}^
% \rr
% \vspace{15pt}^
% See figures~\ref{fig:first} and \ref{fig:second}.
% \vspace{4pt}^
% \end{minipage}^
% \end{minipage}}^
% \vspace{-8pt}
% \end{figure}
% \vspace{-12pt}^finalhack
%
% \subsection{An Example Without Subcaption Text}
% \label{sec:ex3}
%
% The last example, shown in figure~\ref{fig:ex3}, demonstrates a
% \DescribeMacro{\subref}
% \DescribeMacro{\Subref}
% \enlargethispage{12pt}
% commonly required format where the subfigure are just labeled and the
% description occurs in the main caption. This is easy to do by using
% the ``empty'' optional caption arguments ``[\space ][\space ]''. This
% creates a label for the subfigure in the text, but it does not show on
% the List-of-Figures page. However, by default the caption may not be
% perfectly centered, so |\subfiglabelskip| is reduced to zero points to
% ensure that there is not any extra space hidden in the subcaption. To
% refer to the subfigure label within the text or the main caption, you
% can use the |\subref| command, which is similar to the |\ref| command,
% but does not carry the figure number. (The |\Subref| command is the
% same but sets it with |\subcaplabelfont|).
%
% \begin{figure}^
% \centering
% \fboxsep=-\fboxrule
% \subfiglabelskip=0pt
% \fbox{^
% \begin{minipage}{4.0in}^
% \centering
% \begin{minipage}{3.5in}^
% \setcounter{lofdepth}{2}^
% \vspace{.1in}^
% \section*{ List of Figures}^
% \vspace{-15pt}^
% \hspace{40pt}\dots
% \vspace{3pt}^
% \contentsline{figure}{\numberline{\ref{fig:ex3}}^
% {\ignorespaces A set of four subfigures.}}^
% {\pageref{fig:ex3}}^
% \hspace{40pt}\dots
% \vspace{8pt}^
% \end{minipage}^
% \end{minipage}}\\
% \fbox{^
% \begin{minipage}{4.0in}^
% \centering
% \begin{minipage}{3.5in}^
% \subfigtopskip=3pt^
% \subfigcapskip=-2pt^
% \subfigbottomskip=3pt^
% \abovecaptionskip=5pt^
% \vspace{7pt}^
% \centering
% \makeatletter
% \subfigure[][]{^
% \label{fig:ex3-a}^
% \fbox{\hbox to 1.2in{\vbox to 15mm{\null\vfil}\hfil}}}%
% \hspace{8pt}%
% \subfigure[][]{^
% \label{fig:ex3-b}^
% \fbox{\hbox to 1.2in{\vbox to 15mm{\null\vfil}\hfil}}}\\
% \subfigure[][]{^
% \label{fig:ex3-c}^
% \fbox{\hbox to 1.2in{\vbox to 15mm{\null\vfil}\hfil}}}%
% \hspace{8pt}%
% \subfigure[][]{^
% \label{fig:ex3-d}^
% \fbox{\hbox to 1.2in{\vbox to 15mm{\null\vfil}\hfil}}}%
% \caption[A set of four subfigures.]{A set of four subfigures:
% \subref{fig:ex3-a} describes the first subfigure;
% \subref{fig:ex3-b} describes the second subfigure;
% \subref{fig:ex3-c} describes the third subfigure; and,
% \subref{fig:ex3-d} describes the last subfigure.}^
% \label{fig:ex3}^
% \rr
% \vspace{15pt}^
% The text references the main figure as figure~\ref{fig:ex3}
% or part of it as figures~\ref{fig:ex3-a}--\subref{fig:ex3-c}.
% \vspace{4pt}^
% \end{minipage}^
% \end{minipage}}^
% \vspace{-12pt}
% \end{figure}
%
% \enlargethispage{12pt}
% \begin{verbatim}
% \subfiglabelskip=0pt
% ...
% \listoffigures
% ...
% \begin{figure}%
% \centering
% \subfigure[][]{%
% \label{fig:ex3-a}%
% ...figure code...}%
% \hspace{8pt}%
% \subfigure[][]{%
% \label{fig:ex3-b}%
% ...figure code...}\\
% \subfigure[][]{%
% \label{fig:ex3-c}%
% ...figure code...}%
% \hspace{8pt}%
% \subfigure[][]{%
% \label{fig:ex3-d}%
% ...figure code...}%
% \caption[A set of four subfigures.]{A set of four subfigures:
% \subref{fig:ex3-a} describes the first subfigure;
% \subref{fig:ex3-b} describes the second subfigure;
% \subref{fig:ex3-c} describes the third subfigure; and,
% \subref{fig:ex3-d} describes the last subfigure.}%
% \label{fig:ex3}%
% \end{figure}
% ...
% The text references the main figure as figure~\ref{fig:ex3} or part
% of it as figures~\ref{fig:ex3-a}--\subref{fig:ex3-c}.
% \end{verbatim}%
%
% \section{Customization}
% \label{sec:customization}
%
% The following sections describe the internal parameters used by the
% \Lpack{hhsubfigure} package to define the layout of the subfigures
% or tables, as well as the labels and captions the accompany them.
% In addition, adjustments to the entries on a ``List-of'' page and
% the addition of new \Lenv{float} environments are described.
%
% Adjusting these values allows extensive customization of the
% \Lpack{hhsubfigure} package. If you want to customize the package, an
% alternative to actually changing the code is to create a a file called
% \Lfile{subfigure.cfg} and place it anywhere that \LaTeX\ will look for
% classes or packages. Any changes placed in the file will affect the
% predefined parameters and you can override the default settings. Any
% user options will be processed after this file is loaded.
%
% In order to change the major commands in the \Lpack{hhsubfigure} package
% with this configure file, you will need to use the |\AtEndOfPackage|
% command to defer that portion of your changes until the end of the
% package.
%
% \subsection{Changing the Layout}
% \enlargethispage{15pt}^finalhack
% \label{sec:customlayout}
%
% \noindent
% The layout of the |\subfigure| or |\subtable| is defined by several
% internal values which may be changed to customize appearance of the
% object. The following illustration shows the relationship of these
% values. Figure~\ref{fig:layout-A} shows the standard layout with the
% caption following the figure. The figure is vertically centered with
% |\subfigtopskip| of space added above, then |\subfigcapskip| of
% space is added below the figure followed by the subcaption and,
% finally, |\subfigbottomskip| of space added at the bottom. The baseline
% is located at the bottom of the figure. It is along this baseline that
% adjacent subfigure boxes are aligned. Figure~\ref{fig:layout-C} shows
% the case where the caption precedes the figure ({\it ie.\/},
% |\subfiguretopcaptrue| or |\subtabletopcaptrue|). In this case the
% various boxes and glue are reversed,$\!$\footnote{The \cmd{\subfigtopskip}
% and \cmd{\subfigbottomskip} actually follow the \Lif{figuretopcap}
% and \Lif{tabletopcap} flags, so that the actual top spacing used is
% \cmd{\subfigtopskip} when the flags are {\bf false} and
% \cmd{\subfigbottomskip} when they are {\bf true}.}
% except that the |\subfigcapskip| is increased by |\subfigcaptopadj|.
% The other two cases, figures~\ref{fig:layout-B} and
% \subref{fig:layout-D}, show the cases where there is no caption. Note
% that the |\subfigcapskip| is left out when there is no caption.
% Note also, for all of these cases, that the space at the top of the
% subfigure is automatically removed for items that are the first box
% in a vertical list or other than the first box in a horizontal list.
% This allows tighter packing of the subfigures and the full use of
% the page or \Lenv{minipage}.
%
% Each of these values |\subfigtopskip|, |\subfigcapskip|, and
% |\subfigbottomskip|; as well as |\subfigcapmargin| and
% |\subfiglabelskip| (the latter not shown in figure~\ref{fig:layout})
% may be changed from their defaults (see
% table~{\PrintIfDefined{tab:defaults}{\ref{tab:defaults}}{\ref{tab:spacing}}})
% to adjust the subfigure for the current layout style. In addition,
% they may all assume negative values, which in some cases may solve
% problems with the layout. Even though these constants are ``skips'',
% only the last two (|\subfigcapmargin| and |\subfiglabelskip|) will
% shrink or expand since the others assume their natural size in the
% subfigure box and are fixed at that size.
%
% \begin{figure}[p]
% \subfigtopskip=10pt^
% \subfigcapskip=4pt^
% \subfigbottomskip=12pt^
% \abovecaptionskip=3pt^
% \centering
% \fboxsep=-\fboxrule
% \newbox{\tempbox}
% \newdimen{\tempdima}
% \newdimen{\tempdimb}
% \setbox\tempbox\hbox{
% $\stackrel{\longleftrightarrow}{\cs{subfigcapmargin}}$}
% \setbox\tempbox\hbox{\cs{subfigcapmargin}}
% \tempdimb \wd\tempbox
% \setbox\tempbox\hbox to \tempdimb{^
% \kern -.5mm\hbox{$\leftarrow$}\kern -.5mm^
% \leaders\hrule width1pt height2.6pt depth-2.2pt\hfill
% \kern -.13mm$\rightarrow$}
% \tempdima \wd\tempbox
% \advance\tempdima 1mm
% \tempdimb \tempdima
% \multiply\tempdimb -2
% \advance\tempdimb 4.5in
% \advance\tempdimb -4mm
% \subfigure[Standard layout {[FIGBOTCAP] or [TABBOTCAP]}.]{
% \label{fig:layout-A}
% \fbox{\parbox{4.5in}{
% \vspace{1pt}
% \hbox to 4.5in{
% \hspace{1.5in}
% $\left\updownarrow\vrule width0pt height11pt depth1pt\right.$
% (\cs{subfigtopskip})
% \hfil}
% \fbox{\vbox to 45pt{
% \vskip1pt
% \vskip\baselineskip
% \vfil
% \hbox to 4.5in{
% \hfil
% {\scshape subfigure} or {\scshape subtable}
% \hfil}
% \vfil
% \vbox to 0pt{%
% \vss
% \hbox to 4.5in{
% \hspace{9pt}
% {\small Baseline}
% \hfil}}
% \vspace{1pt}}}
% \hbox to 4.5in{
% \hspace{1.5in}
% $\left\updownarrow\vrule width0pt height11pt depth1pt\right.$
% \cs{subfigcapskip}
% \hfil}
% \hbox to 4.5in{
% \hbox to\tempdima{
% \vbox to 20pt{
% \vfil
% \copy\tempbox
% \vfil
% \hbox{\kern .5mm\cs{subfigcapmargin}}
% \vfil}}
% \fbox{\vbox to 20pt{
% \vfil
% \hbox to\tempdimb{
% \hfil
% {\scshape subcaption}
% \hfil}
% \vfil}}
% \hbox to\tempdima{
% \vbox to 20pt{
% \vfil
% \copy\tempbox
% \vfil
% \hbox{\kern .5mm\cs{subfigcapmargin}}
% \vfil}}
% \hfill}
% \hbox to 4.5in{
% \hspace{1.5in}
% $\left\updownarrow\vrule width0pt height11pt depth1pt\right.$
% \cs{subfigbottomskip}
% \hfil}}}}
%
% \subfigure[Standard layout {[FIGBOTCAP] or [TABBOTCAP]} with no
% caption present.]{
% \label{fig:layout-B}
% \fbox{\parbox{4.5in}{
% \vspace{1pt}
% \hbox to 4.5in{
% \hspace{1.5in}
% $\left\updownarrow\vrule width0pt height11pt depth1pt\right.$
% (\cs{subfigtopskip})
% \hfil}
% \fbox{\vbox to 45pt{
% \vskip1pt
% \vskip\baselineskip
% \vfil
% \hbox to 4.5in{
% \hfil
% {\scshape subfigure} or {\scshape subtable}
% \hfil}
% \vfil
% \hbox to 4.5in{
% \hspace{9pt}
% {\small Baseline}
% \hfil}
% \vspace{1pt}}}
% \hbox to 4.5in{
% \hspace{1.5in}
% $\left\updownarrow\vrule width0pt height11pt depth1pt\right.$
% \cs{subfigbottomskip}
% \hfil}}}}
%
% \subfigure[Reversed layout {[FIGTOPCAP] or [TABTOPCAP]}.]{
% \label{fig:layout-C}
% \fbox{\parbox{4.5in}{
% \vspace{1pt}
% \hbox to 4.5in{
% \hspace{1.5in}
% $\left\updownarrow\vrule width0pt height11pt depth1pt\right.$
% (\cs{subfigbottomskip})
% \hfil}
% \hbox to 4.5in{
% \hbox to\tempdima{
% \vbox to 20pt{
% \vfil
% \copy\tempbox
% \vfil
% \hbox{\kern -.5mm\cs{subfigcapmargin}}
% \vfil}}
% \fbox{\vbox to 20pt{
% \vfil
% \hbox to\tempdimb{
% \hfil
% {\scshape subcaption}
% \hfil}
% \vfil}}
% \hbox to\tempdima{
% \vbox to 20pt{
% \vfil
% \box\tempbox
% \vfil
% \hbox{\kern -.5mm\cs{subfigcapmargin}}
% \vfil}}
% \hfill}
% \hbox to 4.5in{
% \hbox to 0pt{
% \hspace{9pt}
% \smash{\raisebox{-6.5pt}{\small Baseline}}
% \hss}
% \hspace{1.5in}
% $\left\updownarrow\vrule width0pt height11pt depth1pt\right.$
% \cs{subfigcapskip}$+$\cs{subfigcaptopadj}
% \hfil}
% \fbox{\vbox to 45pt{
% \vfil
% \hbox to 4.5in{
% \hfil
% {\scshape subfigure} or {\scshape subtable}
% \hfil}
% \vfil}}
% \hbox to 4.5in{
% \hspace{1.5in}
% $\left\updownarrow\vrule width0pt height11pt depth1pt\right.$
% \cs{subfigtopskip}
% \hfil}}}}
%
% \subfigure[Reversed layout {[FIGTOPCAP] or [TABTOPCAP]} with no
% caption present.]{
% \label{fig:layout-D}
% \fbox{\parbox{4.5in}{
% \vspace{1pt}
% \hbox to 4.5in{
% \hbox to 0pt{
% \hspace{9pt}
% \smash{\raisebox{-6.5pt}{\small Baseline}}
% \hss}
% \hspace{1.5in}
% $\left\updownarrow\vrule width0pt height11pt depth1pt\right.$
% (\cs{subfigbottomskip})
% \hfil}
% \fbox{\vbox to 45pt{
% \vfil
% \hbox to 4.5in{
% \hfil
% {\scshape subfigure} or {\scshape subtable}
% \hfil}
% \vfil}}
% \hbox to 4.5in{
% \hspace{1.5in}
% $\left\updownarrow\vrule width0pt height11pt depth1pt\right.$
% \cs{subfigtopskip}
% \hfil}}}}
% \caption{Subfigure and subtable layout.}
% \label{fig:layout}
% \end{figure}
%
% \subsection{Adjusting the Subcaption}
% \label{sec:customlabel}
%
% The subfigure label has three forms. The first is the one that
% \DescribeMacro{\subref}
% \DescribeMacro{\Subref}
% appears in the text when you use the |\ref| command; the second is the
% one that appears on the List-of-Figures page and may be used to
% reference individual subfigures within the figure and subfigure captions,
% using the |\subref| or |\Subref| commands; and the third is the fully
% formatted version used under the subfigure as the label part of the caption.
%
% The |\ref| command yields the string, saved by the |\label| command,
% composed by concatenating the value of |\p@subfigure| to
% |\thesubfigure|. By default these are defined by: ``|\thefigure|''
% and ``|(\alph{subfigure})|'', respectively, which produces a reference
% of the figure number followed by the subfigure letter in parentheses.
%
% The label used on the List-of-Figures page may be retrieved with the
% |\subref| command (this value is saved by the |\label| command when
% the |\label| command is used within the scope of the subfigure. This is
% the string defined by |\@@thesubfigure|, which, by default, is the
% value ``|\thesubfigure|'' (or ``|(\alph{subfigure})|'').
%
% The label used with the subcaption text is defined by the internal
% value |\@thesubfigure|, which, by default, has the
% value\hfil\null\linebreak
% \centerline{``\cmd{\thesubfigure}\cmd{\hskip}\cmd{\subfiglabelskip}''.}
% It is prefixed by |\subcapsize\subcaplabelfont| and followed by the
% subcaption text which is set with |\subcapfont|.
%
% \changes{v2.1.4}{30 Apr 2002}{Changed the label and caption defaults
% from \cmd{\rmfamily}\cmd{\mdseries}\cmd{\upshape} to
% \cmd{\familydefault}\cmd{\seriesdefault} \cmd{\shapedefault}.}
% Note that by default |\subcaplabelfont| has the default value
% ``|{\familydefault| |\seriesdefault\shapedefault}|''. The package
% options described in table~\ref{tab:options} allow you to set these
% values for your paper. If you update the |\@subfigure| command, you
% should include any separator character or spacing between the label
% and the start of the subcaption text. The default is
% |\hskip\subfiglabelskip| placed after the label.
%
% Finally, the text of the subcaption is prefixed by |\subcapfont| which
% may be changed using the set of nine lower-case font options described
% in table~\ref{tab:options}\@.$\!$\footnote{It is also prefixed by
% \cmd{\subcapsize} as part of the overall label and caption.} \ One other
% way of changing the layout of the lapel and caption is by replacing
% the |\@makesubfigurecaption| or |\@makesubtablecaption| command (which
% by default are identical).
%
% \subsection{Adjusting the Subfigure and Subtable Counters}
% \label{sec:counters}
%
% To create some special effects, such as continuing the subfigure
% \DescribeMacro{\c@figure}
% \DescribeMacro{\c@table}
% numbering across several pages as part of one long continued figure,
% you can back off the number change from a caption with the command:
% \begin{quote}
% |\addtocounter{|\Lcount{figure}|}{|-1|}|
% \end{quote}
% within the \Lenv{figure} environment. In addition, you can adjust for
% previous subfigures or subtables with one of the following (here
% we assume that two subfigures or subtables appeared in the previous
% pages:
% \begin{quote}
% |\addtocounter{|\Lcount{subfigure}|}{|2|}|
% \end{quote}
% \vspace{-5pt}
% \noindent
% or
% \vspace{-5pt}
% \begin{quote}
% |\addtocounter{|\Lcount{subtable}|}{|2|}|.
% \end{quote}
%
% Two other things that may be necessary, if you switch between figures
% and tables in the same \Lenv{figure} environment ({\it e.g.\/}, by
% changing |\@captype|, see section~\ref{sec:float_env}), is to add the
% command |\listsubcaptions| following the last subfigure when the
% subfigure is using the \Lopt{TOPCAP} or \Lopt{topcap} option. This is
% necessary to flush the list of subcaptions before the next
% \Lenv{subfigure} or \Lenv{subtable}. This also may be necessary if
% you switch between |\figuretopcaptrue| and |\figuretopcapfalse|. The
% other thing that may be required in some cases, is to reset the
% subfigure counter by entering:
% \begin{quote}
% |\setcounter{|\Lcount{subfigure}|}{|0|}|
% \end{quote}
% \noindent
% This should only be necessary if you are dynamically switching between
% different \Lpack{hhsubfigure} options, or changing the |\@captype|,
% within a float environment.
%
% \subsection{Modifying the List-of-Figures and List-of-Tables}
% \label{sec:listof}
%
% To generate a List-of-Figures, or List-of-Tables, page you need to
% \DescribeMacro{\l@subfigure}
% \DescribeMacro{\@dottedxxxline}
% add a |\listoffigures| or |\listoftables| command where
% you want the list to appear. These
% commands also cause the appropriate captions and subcaptions to be
% written to a file with the extensions \Lfile{lof} (\Lfile{lot}). If
% you want the subcaption text to appear in the List-of-Figures or
% List-of-Tables page, you need to change the value of the counter
% \Lcount{lofdepth} (\Lcount{lotdepth}) counter from its default of `1'.
% For example, to have the \Lpack{hhsubfigure} subcaptions to appear on
% the List-of-Figures, add the following to the preamble of your
% paper:
% \begin{quote}
% |\setcounter{|\Lcount{lofdepth}|}{2}|
% \end{quote}
%
% If you want to change how the subcaption appears on the ``List-of''
% pages you can change its format by redefining the |\l@subfigure|
% or |\l@subtable| command. Usually you will want to use the
% |\@dottedxxxline| command
% \PrintIfDefined{sec:dl}{(section~\ref{sec:dl},
% page~\pageref{sec:dl})\space}{} to help with the formatting. For
% instance the default value of |\l@subfigure| is:
%
% \begin{verbatim}
% \newcommand{\l@subfigure}{%
% \@dottedxxxline{\ext@subfigure}{2}{3.8em}{2.5em}}
% \end{verbatim}
% \vspace{-10pt}
%
% \noindent
% The arguments of the |\@dottedxxxline| command are:
% \begin{quote}
% \begin{enumerate}
% \itemsep -\parsep
% \item \underline{\smash{\textsf{Type}}}. The usual values are
% : \Lfile{lof} or \Lfile{lot}. The internal
% values |\ext@subfigure| and |\ext@subtable| stand for
% these extensions.
% \item \underline{\textsf{Level}}. By default this is `2'
% for the \Lcount{subfigure} and \Lcount{subtable}. If the level
% is greater than \Lcount{\meta{Type}depth} (where
% \underline{\smash{\meta{Type}}} is the first argument, above),
% then no line is produced.
% \item \underline{\textsf{Indent}}. Total indentation
% from the left margin.
% \item \underline{\textsf{Numwidth}}. Width of box for the
% label number if the \underline{\textsf{Title}} has a
% |\numberline| command. This is also the amount of extra
% indentation added to second and later lines of a multiple
% line entry.
% \item \underline{\textsf{Title}}. Contents of entry ({\it e.g.\/} the
% \meta{list\_entry} or \meta{subcaption}).
% \item \underline{\smash{\textsf{Page}}}. The page number of the
% figure or table.
% \end{enumerate}
% \end{quote}
%
% \noindent
% The final two arguments, \underline{\textsf{title}} and
% \underline{\smash{\textsf{page}}}, are automatically appended to the
% value of |\l@subfigure| (and symmetrically for |\l@subtable|).
%
% For example, to change the amount of space reserved for the label
% (if, for instance, you have a lot of figures and the and you need extra
% space for the figure number) you could widen the
% \texttt{2.5em} space for the label to \texttt{4.0em}:
% \begin{verbatim}
% \makeatletter
% \renewcommand{\l@subfigure}{%
% \@dottedxxxline{\ext@subfigure}{2}{3.8em}{4.0em}}
% \makeatother
% \end{verbatim}
%
% \subsection{Aligning Captions Above the Figure}
% \label{sec:custom-position}
%
% \begin{figure}^
% \figuretopcaptrue
% \subfigtopskip=-5pt^
% \subfigcapskip=-3pt^
% \subfigbottomskip=2pt^
% \centering
% \caption{Caption position option: [\Lopt{figtopcap}] with changing
% settings of \cmd{\subfiguretopcap}.}^
% \label{fig:position3}^
% \subfiguretopcapfalse
% \subfigure[First caption.]{\hbox to 1.5in{\hfil\null}}^
% \hspace{0.2in}^
% \subfigure[Second long, long, long, long,
% long, long, long, long caption.]{^
% \hbox to 1.5in{\hfil\null}}\\[5pt]
% \subfiguretopcaptrue
% \subfigure{\fbox{\hbox to 1.5in{\vbox to 15mm{\vfil\null}\hfil}}}^
% \hspace{0.2in}^
% \subfigure{\fbox{\hbox to 1.5in{\vbox to 10mm{\vfil\null}\hfil}}}^
% \setcounter{subfigure}{0}
% \end{figure}
%
% \noindent
% For unbalanced sets of captions placed, above the figures or tables,
% \DescribeMacro{\subfiguretopcaptrue}
% \DescribeMacro{\subfiguretopcapfalse}
% \DescribeMacro{\figuretopcaptrue}
% the caption portion looks unbalanced, such as the ones in
% figure~\ref{fig:position2}. If you prefer to have the caption portion
% aligned along the top rather than the bottom, as shown in
% figure~\ref{fig:position3}, you can use the
% \Lopt{figtopcap} option as in figure~\ref{fig:position2}, but use
% two ``empty'' subfigures to position the captions followed by
% two more containing the figures, but without captions. The code
% to produce this example is:
%
% \begin{verbatim}
% \begin{figure}%
% \centering
% \caption{Caption position option: [\Lopt{figtopcap}] with changing
% settings of \subfiguretopcap.}%
% \label{fig:position3}%
% \subfiguretopcapfalse
% \subfigure[First caption.]{\hbox to 1.5in{\hfil\null}}%
% \hspace{0.2in}%
% \subfigure[Second long, long, long, long,
% long, long, long, long caption.]{%
% \hbox to 1.5in{\hfil\null}}\\[5pt]
% \subfiguretopcaptrue
% \subfigure{\fbox{\hbox to 1.5in{\vbox to 15mm{\vfil\null}\hfil}}}%
% \hspace{0.2in}%
% \subfigure{\fbox{\hbox to 1.5in{\vbox to 10mm{\vfil\null}\hfil}}}%
% \end{figure}
% \end{verbatim}
%
% This example makes use of one of the four flags that control how the
% caption labels are numbered and where the subcaption appears. Two are
% for |\subfigure| and two for |\subtable|. The first of each set tell
% the |\subfigure| or |\subtable| command that the related main caption
% appears before or after the set of subfloats. |\figuretopcaptrue| and
% |\tabletopcaptrue| indicate that the caption appears before and
% |\figureotopcapfalse| and |\tabletopcapfalse| indicate that the it
% appears after. The other two flags force the subcaption to be placed
% before (|\subfiguretopcaptrue| and |\subtabletopcaptrue|) or after the
% actual subfigure or subtable (|\subfiguretopcapfalse| and
% |\subtabletopcapfalse|).
%
% There are two difficulties with this approach, first, you need to keep
% changing the setting of |\subfiguretopcap|, and second, if you have
% more than one row of subfigures or subtables, then you will need to
% fiddle with the counter (see section~\ref{sec:counters} to keep the
% numbers straight. The reason that this format is not supported by the
% \Lpack{hhsubfigure} package is that you need information about all of
% the subfigure or subtables on a row to box the figures correctly and
% this information is not available locally.
%
% \subsection{Adding Subfloats to New Environments}
% \enlargethispage{15pt}^finalhack
% \label{sec:customfloat}
%
% It is easy to add a \Lenv{subfloat} command to a new environment. For
% instance, let us assume we have a new \Lenv{float}
% environment\footnote{For information on creating new float
% environments, see any of the following: \cite{Lamp01}, \cite{Wils01}
% or \cite{Ling01}.} called ``\Lenv{map}'' in which various maps are
% displayed and for which a List-of-Maps is to be generated in the
% contents section. If we wanted to have \Lenv{submaps}, then we could
% define the following:
%
% \vspace{-4pt}
% \begin{verbatim}
% \makeatletter
% \newcounter{submap}[map]
% \newif\ifmaptopcap
% \newif\ifsubmaptopcap
% \newcommand{\p@submap}{\themap}
% \newcommand{\thesubmap}{(\alph{submap})}
% \newcommand{\@thesubmap}{\themap\hskip\subfiglabelskip}
% \newcommand{\@@thesubmap}{\themap}
% \newcommand{\ext@submap}{\ext@map}
% \newcommand{\l@submap}{\@dottedxxxline{\ext@submap}{2}{3.8em}{2.5em}}
% \newcounter{lomdepth}
% \setcounter{lomdepth}{1}
% \newcommand{\submap}{\subfigure}
% \newcommand{\@makesubmapcaption}{\@makesubfigurecaption}
% \ifhyperrefloaded
% \newcommand\theHsubmap{\themap.\arabic{submap}}
% \newcommand{\toclevel@submap}{1}
% \fi
% \makeatother
% \end{verbatim}
% \vspace{-14pt}
%
% The first and last lines make the character `@' act like a letter
% between them and therefore it may be part of a command name used there.
% First a new counter for the \Lpack{submap} is created along with two
% conditionals that define where the position ({\i.e.\/}, above or
% below) of the main caption and subcaption is with respect to the
% submap. Then the four commands that define the \Lpack{submap} label
% are created. The first two, |\p@submap| and |\thesubmap| define the
% standard label returned by |\ref|. The next, |\@thesubmap| gives the
% label as shown under or over the submap with the subcaption and the
% last, |\@@thesubmap| shows how the label is displayed on the List-of-Maps
% and/or referenced with the |\subref| command.
%
% The next four lines show where and how to print to the List-of-Maps
% page: |\ext@submap| gives the List-of-Maps file extension; |\l@submap|
% shows how to print the submap line on the List-of-Maps page; and the last
% two lines show how to create and set the counter \Lcount{lomdepth}, which
% controls how many caption levels are shown on the page when it is printed.
%
% The next two lines create the |\submap| and |\@makesubmapcaption|
% commands by making them the same as the |\subfigure| and
% |\@makesubfigurecaption| commands.
%
% The last four lines conditionally create the |\theHsubmap| and
% |\toclevel@submap| commands which are used by the \Lpack{hyperref}
% Package to name the item and to control the presence of the item
% bookmark.
%
% Of course, this is where the \Lpack{ccaption} package \cite{Wils01}
% comes in handy since it will do all of the above with one command:
%
% \vspace{-4pt}
% \begin{verbatim}
% \newsubfloat{map}
% \end{verbatim}
% \vspace{-10pt}
%
%
% \subsection{Interaction with Other Parts of \LaTeX}
% In the following sections, the interaction of the \Lpack{hhsubfigure}
% package with other parts of \LaTeX\ is documented. These ``other
% parts'' may be either part of the the \LaTeX\ base or contributed
% packages or classes.
%
% \subsubsection{\TeX 's ``Mouth''}
% The most important thing to remember when laying out your figures
% within a \Lenv{float} environment is that spaces take room. If you
% have an extra space between two figures, then they will be separated
% by a little bit.
%
% \TeX 's state varies as it reads a line of text from a file. It
% ignores some spaces and carriage-returns and converts others to
% |\space|'s or |\par|'s. You can use a `|%|' to insure that you only
% have real spaces where you want them. To understand which spaces
% are significant, you should read chapters~7 and 8 of the \TeX book
% \cite{Knut86}. However, the main source of unexpected
% extra spacing is carriage-returns which are turned in to |\space|'s.
% As a general rule: if in doubt, then add a `|%|' immediately after
% the last significant character of the line.
%
% \subsubsection{The Float Environment}
% \label{sec:float_env}
%
% Although the \Lpack{hhsubfigure} package was designed to work within a
% \Lenv{float} environment ({\it e.g.\/}, \Lenv{figure} or
% \Lenv{table}), it can be used outside with the following two caveats:
% \begin{enumerate}\itemsep=5pt
% \item You need to define |\@captype|. This is usually either
% \Lenv{figure} or \Lenv{table}. For example add the following
% to the preamble of your document:
% \begin{verbatim}
% \makeatletter
% \newcommand{\change_cap_type}[1]{%
% \renewcommand{\@captype}{#1}}
% \makeatother
% \end{verbatim}\vspace{-15pt}
% Then use the new command to switch in the middle of a given
% \Lenv{float} environment, say from ``figure'' to ``table'' with
% the command |\change_cap_type{table}|.
% \item If you want to define references using |\label|, then you also
% need to redefine the \LaTeX\ internal |\@currentlabel|. For
% example:
% \begin{verbatim}
% \makeatletter
% \edef\@currentlabel{\p@subfigure\thesubfigure}
% \makeatother
% \end{verbatim}\vspace{-15pt}
% before using the |\label| command. NOTE: Many other commands change
% |\@currentlabel|, including all of the ``section'' commands,
% |\caption|, \Lenv{equation}'s, and \Lenv{theorem}'s.
% \end{enumerate}
%
% \subsubsection{Interaction with Other Packages}
%
% \changes{v2.1}{22 Jan 2001}{Added \Lpack{ccaption} reference.}
%
% \changes{v2.1}{11 Oct 1996}{Revised subsubsection on use with
% the caption package and extended this section to talk about the
% \Lpack{captcont} package.}
%
% \noindent
% The only packages that directly interact with the \Lpack{hhsubfigure}
% package are the \Lpack{caption}/\Lpack{caption2} packages by
% H.A. Sommerfeldt \cite{Somm95a,Somm95b}, the \Lpack{ccaption} package
% and \Lpack{tocloft} packages by Peter Wilson \cite{Wils01,Wils01B},
% and the \Lpack{captcont} package by S.D. Cochran \cite{Coch02}.
%
% \paragraph{\Lpack{caption}}
%
% If you load the \Lpack{hhsubfigure} package {\bf before} the
% \Lpack{caption} package, then the \Lpack{caption} package will detect
% that fact and will change the |\subcapsize| when the options
% \Lopt{scriptsize}, \ldots, \Lopt{Large} are specified (overriding such
% options used when loading the \Lpack{hhsubfigure} package). In
% addition, it redefines |\@thesubfigure| and |\@thesubtable| to use
% |\captionlabelfont|. It also uses an older layout of
% |\@thesubsubfigure| and |\@thesubtable|.
%
% The best plan is to load the \Lpack{caption} package {\bf before} the
% \Lpack{hhsubfigure} package. In addition, you should try to coordinate
% the ``look and feel'' of the two packages. This limits you a little
% since, although the two packages have similar options, the options in
% the \Lpack{caption} package do not combine the same way. You can pick
% one from each column:\par\null
%
% \DeleteShortVerb{\|}
% \noindent\hfil\begin{tabular}{*{4}{p{17mm}|}p{17mm}}
% \rr \Lopt{normal}, \Lopt{hang}, \Lopt{center}, \Lopt{centerlast} &
% \rr \Lopt{nooneline} &
% \rr \Lopt{scriptsize}, \Lopt{footnotesize}, \Lopt{small},
% \Lopt{normalsize}, \Lopt{large}, \Lopt{Large} &
% \rr \Lopt{up}, \Lopt{it}, \Lopt{sl}, \Lopt{sc}, \Lopt{md},
% \Lopt{bf}, \Lopt{rm}, \Lopt{sf}, \Lopt{tt} &
% \rr (Other options---see package.)
% \end{tabular}
% \MakeShortVerb{\|}
% \vskip14pt
%
% \paragraph{\Lpack{caption2}}
%
% This package acts similarly to the \Lpack{caption} package. If you
% specify the \Lopt{subfigure} it will try to support the subfigure
% package, if you specify \Lopt{nosubfigure} than it will not. If
% neither option is specified, than load order matters. If loaded
% {\bf before} the \Lpack{hhsubfigure} package, than it will not try to
% support the package and if loaded {\bf after} it will.
%
% Again, the best plan is to load the \Lpack{caption2} package
% {\bf before} the \Lpack{hhsubfigure} package, and specify the
% \Lopt{nosubfigure} option. In addition, you should try to coordinate
% the ``look and feel'' of the two packages. This limits you a little
% since, although the two packages have similar options, they are not
% exactly the same; however, most of the good looking combinations are
% easily available. You can pick one from each column:\par\null
%
% \DeleteShortVerb{\|}
% \noindent\hfil\begin{tabular}{*{5}{p{17mm}|}p{17mm}}
% \rr \Lopt{nosubfigure}, \Lopt{subfigure} &
% \rr \Lopt{normal}, \Lopt{hang}, \Lopt{center}, \Lopt{centerlast}
% \Lopt{flushleft}, \Lopt{indent} &
% \rr \Lopt{oneline}, \Lopt{nooneline} &
% \rr \Lopt{scriptsize}, \Lopt{footnotesize}, \Lopt{small},
% \Lopt{normalsize}, \Lopt{large}, \Lopt{Large} &
% \rr \Lopt{up}, \Lopt{it}, \Lopt{sl}, \Lopt{sc}, \Lopt{md},
% \Lopt{bf}, \Lopt{rm}, \Lopt{sf}, \Lopt{tt}^,
%^ \Lopt{UP}, \Lopt{IT}, \Lopt{SL}, \Lopt{SC}, \Lopt{MD},
%^ \Lopt{BF}, \Lopt{RM}, \Lopt{SF}, \Lopt{TT}
% &
% \rr (Other options---see package.)
% \end{tabular}
% \MakeShortVerb{\|}
%
% \paragraph{\Lpack{ccaption}}
%
% The \Lpack{ccaption} package provides for all sorts of extensions and
% style options for \Lenv{float} |\captions|. It also provides for the
% use of the |\caption| command outside of a \Lenv{float} environment and
% a mechanism for creating new types of \Lenv{float} environments.
%
% In order to use it with the \Lpack{hhsubfigure} package, you need to
% pass the \Lopt{subfigure} option when loading it:
%
% \begin{quote}
% |\usepackage|[subfigure]\{ccaption\}
% \end{quote}
%
% \paragraph{\Lpack{tocloft}}
%
% The \Lpack{tocloft} package gives the user the ability to easily
% configure the ``List-of'' pages. It takes a \Lopt{subfigure} option
% so it doesn't matter which package is loaded first.
%
% \begin{quote}
% |\usepackage|[subfigure]\{tocloft\}
% \end{quote}
%
% \paragraph{\Lpack{hyperref}}
% \label{sec:hyperref}
%
% \changes{v2.1.2}{26 Mar 2002}{Improved coordination with the hyperref
% package.}
%
% \changes{v2.1.1}{15 Mar 2002}{Added coordination with the hyperref
% package. There is some interaction with the \cmd{label} command as
% pointed out by Martin.Bernreuther@po.uni-stuttgart.de.}
%
% The \Lpack{hyperref} package extends the functionality of all of the
% \LaTeX\ cross-referencing commands to produce hypertext links. In
% addition, it provides new commands to allow the user to insert
% hypertext links. When used with the \Lpack{hhsubfigure} package, they
% may be loaded in any order; however, it might be better if the
% \Lpack{hhsubfigure} package is loaded {\bf first}.
%
% To more fully support the \Lpack{hyperref} package, the |\label|
% \DescribeMacro{\subfloat@label}
% command, when used within the scope of the |\subfigure| or |\subtable|
% commands takes an optional argument (note the parentheses rather than
% square brackets):
% \vspace{-2pt}
% \begin{quote}
% |\label|\parg{bookmark}\marg{key}
% \end{quote}
% \vspace{-2pt}
%
% \noindent
% We would like to use the subcaption as the bookmark text, but the
% |\label| command is often processed before the subcaption. Therefore,
% this optional argument may be used to supply this information if
% desired. By default a bookmark field of the form
% ``Subfigure\textvisiblespace 1(a)'' will be generated.
% \footnote{If the document class is \Lpack{report} or other class that
% defines \cmd{\thechapter}, than the default bookmark field will be of the
% form ``Subfigure\textvisiblespace 1 \textvisiblespace 1(a)''.}
%
%
% \paragraph{\Lpack{captcont}}
%
% This package may be used with or without the \Lpack{hhsubfigure} package
% \DescribeMacro{\caption}
% \DescribeMacro{\caption*}
% \DescribeMacro{\captcont}
% \DescribeMacro{\captcont*}
% to extend figure or table numbering across multiple pages. This
% package knows about how the \Lpack{hhsubfigure} package interacts with
% the List-of-Figures and List-of-Tables and does the right thing when
% used with \Lenv{subfigure}'s and \Lenv{subtable}'s.
%
% The \Lpack{captcont} package may be loaded either {\bf before} or
% {\bf after} the \Lpack{hhsubfigure} and it has four options:
% \Lopt{figbotcap} or \Lopt{figtopcap} and \Lopt{tabbotcap} or
% \Lopt{tabtopcap}. These are the same as the \Lpack{hhsubfigure}
% options. When the \Lpack{captcont} package is used with the
% \Lpack{hhsubfigure} package, only the \Lpack{hhsubfigure} options matter.
% Any given with the \Lpack{captcont} package are ignored.
%
% The thing to remember about the \Lpack{captcont} package is that if
% you normally place the |\caption| {\bf before} your subfigures or
% subtables ({\it i.e.\/}, \Lopt{figtopcap} or \Lopt{tabtopcap}
% respectively), then you start a series of continued \Lenv{figure}'s
% with the |\caption[*]| and use |\contcapt[*]| in each of the rest of
% the figures. If you {\bf follow} your subfigures or subtables with a
% caption ({\it i.e.\/}, \Lopt{figbotcap} or \Lopt{tabbotcap}
% respectively), then you start the series with the |\contcapt[*]| in
% the first \Lenv{figure} environment and all but the last where you use
% the |\caption[*]|.
%
% \subsubsection{Creating a \Lenv{subfigure} Environment}
%
% \changes{v2.1.4}{24 Apr 2002}{Added \cmd{\label} command handling
% example in the \Lenv{subfloat} environment, thanks to Lars Clausen.}
%
% Some people have wanted to use the \Lenv{verbatim} environment within
% \DescribeEnv{subfloat}
% the \cmd{\subfigure} command and run into the restriction that the
% \Lenv{verbatim} environment cannot be nested. To include verbatim text in
% a subfigure, you can define a new environment, in which verbatim
% text may be enclosed, and which calls the \cmd{\subfigure} command.
% \vspace{-2pt}
% \begin{verbatim}
% \newbox\subfigbox % Create a box to hold the subfigure.
% \makeatletter
% \newenvironment{subfloat}% % Create the new environment.
% {\def\caption##1{\gdef\subcapsave{\relax##1}}%
% \let\subcapsave=\@empty % Save the subcaption text.
% \let\sf@oldlabel=\label
% \def\label##1{\xdef\sublabsave{\noexpand\label{##1}}}%
% \let\sublabsave\relax % Save the label key.
% \setbox\subfigbox\hbox
% \bgroup}% % Open the box...
% {\egroup % ... close the box and call \subfigure.
% \let\label=\sf@oldlabel
% \subfigure[\subcapsave]{\box\subfigbox}}%
% \makeatother
% \end{verbatim}
% \enlargethispage{12pt}^finalhack
% \noindent
% The following is an example of this \Lenv{subfloat} environment begin
% used to produce figure~\ref{fig:verbatim}. Note that you need to
% supply the width of the \Lenv{verbatim}; here we use a section using a
% \Lenv{minipage}).
% \begingroup
% \newbox\subfigbox
% \makeatletter
% \newenvironment{subfloat}^
% {\def\caption##1{\gdef\subcapsave{\relax##1}}^
% \let\subcapsave=\@empty
% \let\sf@oldlabel=\label
% \def\label##1{\xdef\sublabsave{\noexpand\label{##1}}}^
% \let\sublabsave\relax
% \setbox\subfigbox\hbox
% \bgroup}^
% {\egroup
% \let\label=\sf@oldlabel
% \subfigure[\subcapsave]{\box\subfigbox\sublabsave}}^
% \makeatother
% \begin{figure}
% \centering
% \subfigtopskip=0pt^
% \subfigcapskip=0pt^
% \subfigbottomskip=0pt^
% \begin{subfloat}^
% \begin{minipage}{2.1in}
% \begin{verbatim}
% This text should be
% verbatim. And not
% messed with in any way !
% \end{verbatim}
% \end{minipage}^
% \caption{First subcaption.}^
% \label{fig:verbone}
% \end{subfloat}^
% \hspace{10pt}^
% \begin{subfloat}^
% \begin{minipage}{2.1in}
% \begin{verbatim}
% This text (also)should be
% verbatim. And not
% messed with in any way !
% \end{verbatim}
% \end{minipage}^
% \caption{Second subcaption.}^
% \label{fig:verbtwo}
% \end{subfloat}
% \caption{Subfigures~\subref{fig:verbone} and \subref{fig:verbtwo}
% show examples of using verbatim text in a subfigure.}
% \label{fig:verbatim}
% \end{figure}
% \endgroup
% \begin{quote}\
% |\begin{figure}| \\
% | \centering|
% | \begin{subfloat}%| \\
% | \begin{minipage}{2.1in}| \\
% | \begin{verbatim}| \\
% | This text should be| \\
% |verbatim. And not| \\
% | messed with in any way !| \\
% | \end{verbatim}| \\
% | \end{minipage}%| \\
% | \caption{First subcaption.}%| \\
% | \label{fig:verbone}| \\
% | \end{subfloat}%| \\
% | \qquad| \\
% | \begin{subfloat}%| \\
% | \begin{minipage}{2.1in}| \\
% | \begin{verbatim}| \\
% | This text (also)should be| \\
% |verbatim. And not| \\
% | messed with in any way !| \\
% | \end{verbatim}| \\
% | \end{minipage}%| \\
% | \caption{Second subcaption.}%| \\
% | \label{fig:verbtwo}| \\
% | \end{subfloat}| \\
% | \caption{Subfigures~\subref{fig:verbone} and \subref{fig:verbtwo}| \\
% | show examples of using verbatim text in a subfigure.}| \\
% | \label{fig:verbatim}| \\
% |\end{figure}|
% \end{quote}
%
%
% \StopEventually{^
% \section{Acknowledgements}
%
% This package was originally written to automatically line up some
% figure boxes and place labels under them for a paper that I was
% writing. I thought it useful and uploaded it to the internet
% community and later to CTAN. Many people have asked questions or
% given comments which collectively have changed and improved the
% usefulness of this package.
%
% A few people have contributed more than most and I want to thank
% them publicly, but in no particular order:
%
% \begin{itemize}\itemsep=-2pt^finalhack
% \item{\bf Harald Axel Sommerfeldt} for the work that he did to adjust
% his \Lpack{caption} and \Lpack{caption2} packages as necessary to
% support the \Lpack{hhsubfigure} package when they are loaded together.
% \item {\bf Peter Wilson} for the work that he did to adjust his
% \Lpack{ccaption} package (and other packages) as necessary to support
% the \Lpack{hhsubfigure} package when they are loaded together.
% \item {\bf William `bil' L. Kleb} for his extensive list of errors and
% suggestions to this documentation.
% \item{\bf Axel Reichert} for his request for a `hang' caption style
% since the subcaptions tend to have a short width. And, for his
% request for some way of referencing the individual subfigures in
% the main caption without the figure number.
% \item{\bf Harald Harders} for his suggestion of the \cmd{\subref}
% command and modifying \cmd{\label} within the \Lpack{hhsubfigure}
% package to save local references to the subfigures that are often
% needed.
% \item{\bf Heiko Oberdiek} and {\bf James A. Bednar} for their help
% with coexisting with the \Lpack{hyperref} and \Lpack{html} packages.
% Also, {\bf Ingele Roelens} for pointing out some further compatibility
% problems when using the \Lpack{hyperref} package with PDF\LaTeX.
% \item{\bf Frederic Darboux} for searching out and finding several
% incompatibilities with other packages.
%
% \end{itemize}
%
% \newpage^finalhack
%
% \begin{thebibliography}{6}^\itemsep=-2pt^finalhack
% \itemsep=0.8pt
% \bibitem{Somm95a}^
% Harald Axel Sommerfeldt,
% \emph{The \Lpack{caption} Package},
% Version 1.4b, 1995/04/05.
% (Available from CTAN as file \texttt{caption.dtx}.)
% \bibitem{Somm95b}^
% Harald Axel Sommerfeldt,
% \emph{The \Lpack{caption} Package},
% Version 2.0(beta), 1995/10/09.
% (Available from CTAN as file \texttt{caption2.dtx}.)
% \bibitem{Wils01}^
% Peter Wilson,
% \emph{The \Lpack{ccaption} Package},
% Version 1.0a, 2001/08/15.
% (Available from CTAN as file \texttt{ccaption.dtx}.)
% \bibitem{Wils01B}^
% Peter Wilson,
% \emph{The \Lpack{tocloft} Package},
% Version 2.2, 2001/14/17.
% (Available from CTAN as file \texttt{ccaption.dtx}.)
% \bibitem{Raht02}^
% Sebastian Rahtz,
% \emph{Hypertext marks in \LaTeX},
% 2002/04/05/.
% (Available from CTAN as file \texttt{hyperref.dtx}.)
% \bibitem{Coch02}^
% Steven Douglas Cochran,
% \emph{The \Lpack{captcont} Package},
% 2002/02/14/.
% (Available from CTAN as file \texttt{captcont.dtx}.)
% \bibitem{Reck97}^
% Keith Reckdahl,
% \emph{Using Imported Graphics in \LaTeXe},
% 1997/12/15.
% (Available from CTAN as file \texttt{epslatex.pdf})
% \bibitem{Lamp94}^
% Leslie Lamport,
% \emph{LaTeX User's Guide and Reference Manual}, 2nd edition,
% Addison-Wesley, Reading, Massachusetts,
% 1994.
% \bibitem{Knut86}^
% Donald Ervin Knuth,
% \emph{The \TeX book},
% Addison-Wesley, Reading, Massachusetts,
% 1986.
% \bibitem{Lamp01}^
% Leslie Lamport, Frank Mittelbach, and Johannes Braams,
% \emph{Standard Document Classes for \LaTeX\ version 2e}
% Version 1.4e, 2001/04/01.
% (Available from CTAN as file \texttt{classes.dtx}.)
% \bibitem{Ling01}^
% Anselm Lingnau,
% \emph{An Improved Environment for Floats.}
% Version 1.3d, 2001/11/08.
% (Available from CTAN as file \texttt{float.dtx}.)
% \end{thebibliography}}
%
% \section{The Code}
% \iffalse
%<*package>
% \fi
% \subsection{Identification}
%
% \changes{v2.1}{23 Jan 2002}{Updated the release date.}
%
% \changes{v2.1}{11 Oct 1996}{Removed compatibility with \LaTeX2.09.}
%
% Announce the \Lpack{hhsubfigure} package.
%
% \begin{macrocode}
\NeedsTeXFormat{LaTeX2e}[1994/12/01]
\ProvidesPackage{hhsubfigure}[2003/09/14 v2.1.4a (hh)subfigure package]
% \end{macrocode}
%
% \subsection{Check for the \Lpack{hyperref} Package}
%
% \changes{v2.1.4}{02 Jul 2002}{Added the \cmd{\theHsubfigure} and
% \cmd{\theHsubtable} commands to avoid duplicate names in a PDF
% file when using the \Lpack{hyperref} Package.}
%
% \changes{v2.1.3}{17 Apr 2002}{Changed \cmd{\newcommand} to
% \cmd{\providecommand} to allow other packages to set the
% \cmd{\toclevel@subfigure} and \cmd{\toclevel@subtable}.}
%
% \changes{v2.1.2}{26 Mar 2002}{Changed to simplify the interaction
% with the hyperref package and avoid loading nameref.}
%
% \changes{v2.1.1}{15 Mar 2002}{Added coordination with the hyperref
% package.}
%
% \begin{macro}{\toclevel@subfigure}
% \begin{macro}{\toclevel@subtable}
%
% After every package is loaded, check to see if the \Lpack{hyperref}
% package was among them, if so, then make sure that the |\ifhyperrefloaded|
% switch is set so that the |\subfloat@label| command will write the correct
% form of the |\newlabel| to the \Lfile{aux} file. Also define the
% ``TOC level'' of the subfigure and subtable. We fix these at one since
% the default figure and table levels are zero. Finally, we add definitions
% for |\theHsubfigure| and |\theHsubtable| to avoid duplicate names in
% the PDF file when using the \Lpack{hyperref} Package.
%
% \begin{macrocode}
\newif\ifhyperrefloaded
\AtBeginDocument{%
\@ifpackageloaded{hyperref}{%
\hyperrefloadedtrue
\providecommand\theHsubfigure{\thefigure.\arabic{subfigure}}%
\providecommand\theHsubtable{\thetable.\arabic{subtable}}%
\providecommand{\toclevel@subfigure}{1}%
\providecommand{\toclevel@subtable}{1}}{}}
% \end{macrocode}
%
% \end{macro}
% \end{macro}
%
% \subsection{Initialization and Shared Constants}
% \begin{macro}{\ifsubcaphang}
% \begin{macro}{\ifsubcapcenter}
% \begin{macro}{\ifsubcapcenterlast}
% \begin{macro}{\ifsubcapnooneline}
% \begin{macro}{\ifsubcapraggedright}
%
% \changes{v2.1}{23 Jan 2002}{Added.}
%
% These five flags control how the style in which the subfloat label and
% caption are printed. The \Lif{subcaphang} flag is first checked and
% if true, causes the subcaption label to be typeset separately and
% placed to the upper left of the space available for the subcaption.
% The \Lif{subcapcenter} flag centers each line of the subcaption. The
% \Lif{subcapcenterlast} centers the last line of the subcaption (this
% is a {\sc nop} if the \Lif{subcapcenter} flag is true. If the
% \Lif{subcapnooneline} is false, then the label plus the text of the
% subcaption are centered. If it is true, than the other flags may
% cause something different to happen. The purpose of this flag,
% generally, is to cause a single line to be left justified when there
% is a very short caption. The last flag is the \Lif{subcapraggedright}
% which typsets its text without lining up the right side. This is
% useful for the subcaptions since they are usually short and prone to
% generating hyphenated words unless allowed to be ragged.
%
% \begin{macrocode}
\newif\ifsubcaphang
\newif\ifsubcapcenter
\newif\ifsubcapcenterlast
\newif\ifsubcapnooneline
\newif\ifsubcapraggedright
\newif\ifsubcapRaggedRight
% \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
%
% \noindent
% Table~\ref{tab:defaults} gives the initial (default) values of the
% internals that are used to control the placement and printing of the
% subfloats.
%
% \changes{v2.1.4}{30 Apr 2002}{Changed the label and caption defaults
% from \cmd{\rmfamily}\cmd{\mdseries}\cmd{\upshape} to
% \cmd{\familydefault}\cmd{\seriesdefault} \cmd{\shapedefault}.}
% \DeleteShortVerb{\|}
% \MakeShortVerb{\/}
% \begin{table}^
% \def\pz{\phantom{0}}^
% \def\M#1{\vspace*{#1}}
% \caption[Default values of the Subfigure constants.]%
% {Default values of the Subfigure constants. These
% values are set during the options processing (see
% section~\ref{sec:startup}).}^
% \label{tab:defaults}^
% \vspace{5pt}^
% \begin{minipage}{4.8in}^
% \setlength\tabcolsep{5pt}^
% \rr
% \begin{tabular}{|l|c|p{1.3in}|p{1.963in}|}\hline
% \multicolumn{1}{|c|}{\raisebox{-1.5ex}{\bf Command}}
% & \multicolumn{1}{c|}{\bf \Lopt{loose}}
% & \multicolumn{1}{c|}{\bf \Lopt{tight}}
% &
% \multicolumn{1}{c|}{\raisebox{-1.5ex}{\bf Description}}
% \\
% & \multicolumn{1}{c|}{\bf Option}
% & \multicolumn{1}{c|}{\bf Option}
% & \\ \hline
% \raisebox{-2.1ex}{\cmd{\subfigtopskip}}
% & \raisebox{-2.1ex}{10 pt}
% & \M{0.6ex}\hfil 5 pt
% & \rr Length from the top of the subfloat
% box to the beginning of the figure.
% \\ \hline
% \raisebox{-1.5ex}{\cmd{\subfigcapskip}}
% & \raisebox{-1.5ex}{10 pt}
% & \M{0.0ex}\hfil 0 pt
% & \rr Length between the baseline of the
% subcaption and the figure.
% \\ \hline
% \raisebox{-2.1ex}{\cmd{\subfigcaptopadj}}
% & \raisebox{-2.1ex}{\pz0 pt}
% & \M{0.4ex}\hfil 3 pt
% & \rr Length added to /\subfigcapskip/
% when the caption is above the figure.
% \\ \hline
% \raisebox{-2.1ex}{\cmd{\subfigbottomskip}}
% & \raisebox{-2.1ex}{10 pt}
% & \M{0.7ex}\hfil 5 pt
% & \rr Length from the bottom of the
% subcaption to the bottom of the
% subfloat.
% \\ \hline
% \raisebox{-3.5ex}{\cmd{\subfigcapmargin}}
% & \raisebox{-3.5ex}{10 pt}
% & \M{2.0ex}\hfil 0 pt
% & \rr Indentation of the subcaption from
% the sides of the subfloat box. (This
% should always be positive or zero.)
% \\ \hline
% \raisebox{-1.5ex}{\cmd{\subfiglabelskip}}
% & \raisebox{-1.5ex}{0.33 em}
% & \raggedleft 0.33 em plus 0.07 em minus 0.03 em
% & \rr Space between the label and the
% text of the subcaption.
% \\ \hline
% \raisebox{-1.5ex}{\cmd{\subcapsize}}
% & \multicolumn{2}{c|}{\raisebox{-1.5ex}{footnotesize}}
% & \rr Size for the text portion of the
% subcaption font.
% \\ \hline
% \raisebox{-1.5ex}{\cmd{\subcaplabelfont}}
% & \multicolumn{2}{c|}{\raisebox{-1.5ex}{(Default family, series and shape)}}
% & \rr Font for the label portion of the
% subcaption.
% \\ \hline
% \raisebox{-1.5ex}{\cmd{\subcapfont}}
% & \multicolumn{2}{c|}{\raisebox{-1.5ex}{(Default family, series and shape)}}
% & \rr Font for the text portion of the
% subcaption.
% \\ \hline
% \end{tabular}
% \end{minipage}
% \end{table}
% \DeleteShortVerb{\/}
% \MakeShortVerb{\|}
%
% \begin{macro}{\subfigtopskip}
% \begin{macro}{\subfigcapskip}
% \begin{macro}{\subfigcaptopadj}
% \begin{macro}{\subfigbottomskip}
%
% \changes{v2.1}{22 Jan 1997}{Reduced the space to the values separating
% subfloat caption and figure box and its top and bottom. Added
% \cmd{\subfigcaptopadj} in case it is needed in styles that with figure
% subcaptions on the bottom and table subcaptions on the top.}
%
% See figure~\ref{fig:layout} for details of where these take effect.
% Generally the |\subfigtopskip| appears between the figure or table and
% the edge of the box. |\subfigbottomskip| appears between the
% subcaption and the edge of the box. If the subcaption follows the
% figure or table, then |\subfigcapskip| is placed before it along with
% ({\it i.e.\/}, in addition to) a |\baselineskip|. If the subcaption
% comes before the figure or table then |\subfigcapskip| is placed
% after it along with |\subfigcaptopadj|. Although several of the above
% are {\tt skip}'s they are typset at their base size and will not
% shrink or expand.
%
% \begin{macrocode}
\newskip\subfigtopskip \subfigtopskip = 5\p@
\newskip\subfigcapskip \subfigcapskip = 0\p@
\newdimen\subfigcaptopadj \subfigcaptopadj = 3\p@
\newskip\subfigbottomskip \subfigbottomskip = 5\p@
% \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\subfigcapmargin}
%
% \changes{v2.1}{22 Jan 1997}{Reduced \cmd{\subfigcapmargin} to zero.}
% \begin{macro}{\subfiglabelskip}
%
% \changes{v2.1}{23 Jan 2002}{Added to replace the space between the
% subcaption label and text.}
%
% These two values are used to typeset the subcaption The width of the
% subcaption is the same as that of its associated figure or table
% width. |\subfigcapmargin| is placed on either side of the caption and
% |\subfiglabelskip| is placed between the subcaption label and the
% subcaption text. Depending on the manner of typesetting the
% subcaption, this may shrink or expand. By default, the
% |\subfigcapmargin| is zero to allow as much room of the subcaption as
% possible.
%
% \begin{macrocode}
\newdimen\subfigcapmargin \subfigcapmargin = \z@
\newskip\subfiglabelskip \subfiglabelskip = 0.33em plus 0.07em minus 0.03em
% \end{macrocode}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\subcapsize}
%
% |\subcapsize| is used to set the size of both the subcaption label and
% the subcaption text. The options allow it to be set to any of the
% following: |\scriptsize|, |\footnotesize|, |\small|, |\normalsize|,
% |\large|, |\Large|. It may also be set to |\tiny|, |\LARGE|, |\huge|
% or |\HUGE| by hand if need be for special instances.
%
% \begin{macrocode}
\newcommand*{\subcapsize}{}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\subcaplabelfont}
% \begin{macro}{\subcaplabelfont@f}
%
% \changes{v2.1.4}{30 Apr 2002}{Changed the \cmd{\subcaplabelfont@f}
% default value to \cmd{\familydefault}.}
%
% \begin{macro}{\subcaplabelfont@c}
%
% \changes{v2.1.4}{30 Apr 2002}{Changed the \cmd{\subcaplabelfont@c}
% default value to \cmd{\seriesdefault}.}
%
% \begin{macro}{\subcaplabelfont@s}
%
% \changes{v2.1.4}{30 Apr 2002}{Changed the \cmd{\subcaplabelfont@s}
% default value to \cmd{\shapedefault}.}
%
% The |\subcaplabelfont| is composed of three parts, the font family,
% such as roman, san serif or typewriter; the font series, such as
% medium or bold; and the font shape, such as italic, slanted, small
% caps or upright. These are combined along with the |\subcapsize| to
% select the font for the subcaption label.
%
% \begin{macrocode}
\newcommand*{\subcaplabelfont}{%
\subcaplabelfont@f\subcaplabelfont@c\subcaplabelfont@s}
\newcommand*{\subcaplabelfont@f}{\fontfamily{\familydefault}\selectfont}
\newcommand*{\subcaplabelfont@c}{\fontseries{\seriesdefault}\selectfont}
\newcommand*{\subcaplabelfont@s}{\fontshape{\shapedefault}\selectfont}
% \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\subcapfont}
%
% \changes{v2.1}{11 Dec 1996}{Added.}
%
% \begin{macro}{\subcapfont@f}
%
% \changes{v2.1.4}{30 Apr 2002}{Changed the \cmd{\subcapfont@f} default
% value to \cmd{\familydefault}.}
%
% \begin{macro}{\subcapfont@c}
%
% \changes{v2.1.4}{30 Apr 2002}{Changed the \cmd{\subcapfont@s} default
% value to \cmd{\seriesdefault}.}
%
% \begin{macro}{\subcapfont@s}
%
% \changes{v2.1.4}{30 Apr 2002}{Changed the \cmd{\subcapfont@s} default
% value to \cmd{\shapedefault}.}
%
% The |\subcapfont| is the same as the |\subcaplabelfont| except that it
% is applied to the subcaption text rather than the label.
%
% \begin{macrocode}
\newcommand*{\subcapfont}{%
\subcapfont@f\subcapfont@c\subcapfont@s}
\newcommand*{\subcapfont@f}{\fontfamily{\familydefault}\selectfont}
\newcommand*{\subcapfont@c}{\fontseries{\seriesdefault}\selectfont}
\newcommand*{\subcapfont@s}{\fontshape{\shapedefault}\selectfont}
% \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\ifsf@tight}
%
% Create an `if' to control whether the check for the top-of-page is
% performed in the |\@subfloat| command. This is necessary to preserve
% the look-and-feel of the older versions of this package. The
% \Lopt{loose} option turns this flag off (no check) and the
% \Lopt{tight} option turns it on (do the check).
%
% \begin{macrocode}
\newif\ifsf@tight \sf@tighttrue
% \end{macrocode}
% \end{macro}
%
% \subsection{Subfigure Constants}
% \label{sec:fig_constants}
% \begin{macro}{\c@subfigure}
% Subfigure counter.
%
% \begin{macrocode}
\newcounter{subfigure}[figure]
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\iffiguretopcap}
%
% \changes{v2.1}{23 Jan 2002}{Added check for existing
% \cmd{\figuretopcaptrue} so that this package will work with the
% captcont package.}
%
% \changes{v2.1}{22 Jan 1997}{Added to control label numbering for
% captions at the top vs.\ at the bottom.}
%
% \begin{macro}{\ifsubfiguretopcap}
%
% \changes{v2.1}{15 Nov 1997}{Added to control placement of the
% subcaption at the top vs.\ at the bottom.}
%
% These control how the \Lpack{hhsubfigure} \Lcount{caption} numbering is
% obtained and where the figure caption and subcaption should appear
% relative to the body of the \Lenv{subfigure}. The boolean
% |\iffiguretopcap| indicates that the \Lcount{caption} counter is
% current and there is no need to increment it. The boolean
% |\ifsubfiguretopcap| indicates that the subcaption will be printed
% above the body portion of the \Lpack{subfigure}.
%
% \begin{macrocode}
\@ifundefined{figuretopcaptrue}{\newif\iffiguretopcap}{}
\newif\ifsubfiguretopcap
% \end{macrocode}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\p@subfigure}
% \begin{macro}{\thesubfigure}
% \begin{macro}{\@thesubfigure}
% \begin{macro}{\@@thesubfigure}
%
% \changes{v2.1}{23 Jan 2002}{Added.}
%
% The |\thesubfigure| command defines the label for text references
% (prefixed by |\p@subfigure|). This is the value saved by the |\label|
% and retrieved by the |\ref| commands. In the case of a
% conflict between this package and a prior one over the definition
% of |\thesubfigure|, this package will win. This is insured by first
% specifying the |\providecommand| for the |\thesubfigure| and then
% |\renewcommand|. This is necessary because some packages incorrectly
% insert this command.
%
% The |\@thesubfigure| value defines the the caption label complete
% offset from the beginning of the caption text. It is used in the
% subfigure caption and normally takes the label portion as defined
% by |\thesubfigure|.
%
% Finally, the value defined by |\@@thesubfigure| is also saved by the
% |\label| command and may be retrieved with the |\subref| command. This is
% often useful in the subcaption or caption text when referring to the
% individual subfigures. This value is also the one that is used in
% the List-of-Figures.
%
% These multiple ``views'' of the \Lcount{subfigure} counter allow a
% style to define the way the label looks in the figure, for example
% ``{\bf (a)}\textvisiblespace''. Then references to it with |\ref|
% have the form ``2.1a'', and with |\subref| ``(a)'' (This latter form
% is also used to label references in the List-of-Figures section).
%
% \begin{macrocode}
\let\p@subfigure=\thefigure
\providecommand*{\thesubfigure}{(\alph{subfigure})}
\renewcommand*{\thesubfigure}{(\alph{subfigure})}
\newcommand*{\@thesubfigure}{\thesubfigure\hskip\subfiglabelskip}
\newcommand*{\@@thesubfigure}{\thesubfigure}
% \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\ext@subfigure}
% \begin{macro}{\l@subfigure}
%
% \changes{v2.1}{11 Oct 1996}{Changed the indentation of the
% List-of-Figures line from 2.3em to 2.5em.}
%
% \begin{macro}{\c@lofdepth}
%
% These values define how and if the subfigure caption will appear in a
% List-of-Figures file. |\ext@subfigure| defines the default subfigure
% file extension (which is the same as |\ext@figure| --- the
% List-of-Figures file, \Lcount{lof}). |\l@subfigure|
% shows how to print an \Lfile{lof} subfigure line and defines that line
% at level two. |\c@lofdepth| is an extension of the Table-of-Contents
% depth value and controls the depth to which captions in the file are
% printed to the actual page. By default, the subcaptions are not.
%
% \begin{macrocode}
\let\ext@subfigure=\ext@figure
% \end{macrocode}
%
% \begin{macrocode}
\newcommand*{\l@subfigure}{%
\@dottedxxxline{\ext@subfigure}{2}{3.8em}{2.5em}}
% \end{macrocode}
%
% \begin{macrocode}
\newcounter{lofdepth}
\setcounter{lofdepth}{1}
% \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
%
% \subsection{Subtable Constants}
% This section is symmetric to section~\ref{sec:fig_constants}.
% \begin{macro}{\c@subtable}
% Subtable counter.
%
% \begin{macrocode}
\newcounter{subtable}[table]
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\iftabletopcap}
%
% \changes{v2.1}{23 Jan 2002}{Added check for existing
% \cmd{\tabeltopcaptrue} so that this package will work with the
% captcont package.}
%
% \changes{v2.1}{22 Jan 1997}{Added to control label numbering for
% captions at the top vs.\ at the bottom.}
%
% \begin{macro}{\ifsubtabletopcap}
% \changes{v2.1}{15 Nov 1997}{Added to control placement of the
% subcaption at the top vs.\ at the bottom.}
%
% These define the form that the subcaption prefix is generated. The
% boolean |\iftabletopcap| works with the numbering of the subcaption
% label and uses the current \Lcount{table} counter value if true and
% the next value if false. The boolean |\ifsubtabletopcap| sets the
% subcaption before the main body of the subfigure, if true; and, after
% it, if false.
%
% \begin{macrocode}
\@ifundefined{tabletopcaptrue}{\newif\iftabletopcap}{}
\newif\ifsubtabletopcap
% \end{macrocode}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\p@subtable}
% \begin{macro}{\thesubtable}
% \begin{macro}{\@thesubtable}
% \begin{macro}{\@@thesubtable}
%
% \changes{v2.1}{23 Jan 2002}{Added.}
%
% The |\thesubtable| command defines the label for text references
% (prefixed by |\p@subtable|), while the |\@thesubtable| command defines
% what appears in the subcaption under or over the subtable. The
% |\@@thesubtable| command defines an alternative reference to the label
% for use in the subcaption and caption of the table (see the discussion
% above for the equivalent figure values). The latter form is also used
% for the List-of-Tables label. As above, the |\thesubtable| command is
% twice specified
%
% \begin{macrocode}
\let\p@subtable=\thetable
\providecommand*{\thesubtable}{(\alph{subtable})}
\renewcommand*{\thesubtable}{(\alph{subtable})}
\newcommand*{\@thesubtable}{\thesubtable\hskip\subfiglabelskip}
\newcommand*{\@@thesubtable}{\thesubtable}
% \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\ext@subtable}
% \begin{macro}{\l@subtable}
%
% \changes{v2.1}{11 Oct 1996}{Changed the indentation of the
% List-of-Tables line from 2.3em to 2.5em.}
%
% \begin{macro}{\c@lotdepth}
%
% These define how and if the subtable caption will appear in a
% List-of-Tables file. |\ext@subtable| defines the default subtable
% file extension (which is the same as |\ext@table| --- the
% List-of-Tables file, \Lcount{lot}). |\l@subtable| shows how to print
% an \Lfile{lot} subtable line and defines that line at level two.
% |\c@lotdepth| is an extension of the table-of-contents depth value and
% controls the depth to which captions in the file are printed to the
% actual page. By default, the subcaptions are not printed.
%
% \begin{macrocode}
\let\ext@subtable=\ext@table
% \end{macrocode}
%
% \begin{macrocode}
\newcommand*{\l@subtable}{%
\@dottedxxxline{\ext@subtable}{2}{3.8em}{2.5em}}
% \end{macrocode}
%
% \begin{macrocode}
\newcounter{lotdepth}
\setcounter{lotdepth}{1}
% \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
%
% \subsection{Declaration of Options}
%
% The following options allow general compatibility with the
% \Lpack{caption} and \Lpack{caption2} packages by H.A. Sommerfeldt
% \cite{Somm95a}. There are six different subcaption layout options
% supported: \Lopt{normal}, \Lopt{hang} (or \Lopt{isu}), \Lopt{center},
% \Lopt{centerlast} (or \Lopt{anne}), \Lopt{nooneline} and
% \Lopt{raggedright}. The \Lopt{hang} subcaption may be combined with
% the \Lopt{center} or \Lopt{centerlast} options. The \Lopt{nooneline}
% may be combined with any of the other options (but it's effect is
% negated or looks bad with either of \Lopt{center} or \Lopt{centerlast}
% unless the \Lopt{hang} option is also used). \Lopt{raggedright}
% overrides the \Lopt{center} or \Lopt{centerlast} options.
%
% \begin{macrocode}
\DeclareOption{normal}{%
\subcaphangfalse
\subcapcenterfalse
\subcapcenterlastfalse
\subcapnoonelinefalse
\subcapraggedrightfalse
\subcapRaggedRightfalse}
% \end{macrocode}
%
% \begin{macrocode}
\DeclareOption{hang}{\subcaphangtrue}
\DeclareOption{center}{\subcapcentertrue}
\DeclareOption{centerlast}{\subcapcenterlasttrue}
\DeclareOption{nooneline}{\subcapnoonelinetrue}
\DeclareOption{raggedright}{\subcapraggedrighttrue}
\DeclareOption{RaggedRight}{\subcapRaggedRighttrue}
% \end{macrocode}
%
% \begin{macrocode}
\DeclareOption{isu}{\ExecuteOption{hang}}
\DeclareOption{anne}{\ExecuteOption{centerlast}}
% \end{macrocode}
%
% \newpage^finalhack
%
% \noindent
% There are options for six different font sizes available.
%
% \begin{macrocode}
\DeclareOption{scriptsize}{\renewcommand*{\subcapsize}{\scriptsize}}
\DeclareOption{footnotesize}{\renewcommand*{\subcapsize}{\footnotesize}}
\DeclareOption{small}{\renewcommand*{\subcapsize}{\small}}
\DeclareOption{normalsize}{\renewcommand*{\subcapsize}{\normalsize}}
\DeclareOption{large}{\renewcommand*{\subcapsize}{\large}}
\DeclareOption{Large}{\renewcommand*{\subcapsize}{\Large}}
% \end{macrocode}
%
% \noindent
% There are eighteen options available to set the font attributes of the
% subcaptions. The first nine affect only the subcaption label
% The last nine affect only the subcaption text.
%
% \changes{v2.1}{22 Jan 1997}{Changed order of font options.}
%
% \changes{v2.1}{15 Nov 1997}{Added nine new options to set the format
% of the caption text separately from the caption label.}
%
% \begin{macrocode}
\DeclareOption{rm}{\renewcommand*{\subcaplabelfont@f}{\rmfamily}}
\DeclareOption{sf}{\renewcommand*{\subcaplabelfont@f}{\sffamily}}
\DeclareOption{tt}{\renewcommand*{\subcaplabelfont@f}{\ttfamily}}
\DeclareOption{md}{\renewcommand*{\subcaplabelfont@c}{\mdseries}}
\DeclareOption{bf}{\renewcommand*{\subcaplabelfont@c}{\bfseries}}
\DeclareOption{up}{\renewcommand*{\subcaplabelfont@s}{\upshape}}
\DeclareOption{it}{\renewcommand*{\subcaplabelfont@s}{\itshape}}
\DeclareOption{sl}{\renewcommand*{\subcaplabelfont@s}{\slshape}}
\DeclareOption{sc}{\renewcommand*{\subcaplabelfont@s}{\scshape}}
% \end{macrocode}
%
% \begin{macrocode}
\DeclareOption{RM}{\renewcommand*{\subcapfont@f}{\rmfamily}}
\DeclareOption{SF}{\renewcommand*{\subcapfont@f}{\sffamily}}
\DeclareOption{TT}{\renewcommand*{\subcapfont@f}{\ttfamily}}
\DeclareOption{MD}{\renewcommand*{\subcapfont@c}{\mdseries}}
\DeclareOption{BF}{\renewcommand*{\subcapfont@c}{\bfseries}}
\DeclareOption{IT}{\renewcommand*{\subcapfont@s}{\itshape}}
\DeclareOption{SL}{\renewcommand*{\subcapfont@s}{\slshape}}
\DeclareOption{SC}{\renewcommand*{\subcapfont@s}{\scshape}}
\DeclareOption{UP}{\renewcommand*{\subcapfont@s}{\upshape}}
% \end{macrocode}
%
% \noindent
% There are eight options available to control the caption placement
% and the proper numbering in association with the figure or table
% caption placement. The first four affect only the caption numbering
% by informing the internals that the associated figure or table
% caption appears before or after the subfloat. The second four do
% this and, in addition, shift the subfloat caption to the bottom or
% top of the subfloat. The |\subfigure| and |\subtable| commands each
% have a set of flags since it is often the case that a document style
% requires that figure captions follow the figure and table captions
% precede the table.
%
% \begin{macrocode}
\DeclareOption{figbotcap}{\figuretopcapfalse}
\DeclareOption{figtopcap}{\figuretopcaptrue}
\DeclareOption{tabbotcap}{\tabletopcapfalse}
\DeclareOption{tabtopcap}{\tabletopcaptrue}
% \end{macrocode}
%
% \begin{macrocode}
\DeclareOption{FIGBOTCAP}{\ExecuteOptions{figbotcap}\subfiguretopcapfalse}
\DeclareOption{FIGTOPCAP}{\ExecuteOptions{figtopcap}\subfiguretopcaptrue}
\DeclareOption{TABBOTCAP}{\ExecuteOptions{tabbotcap}\subtabletopcapfalse}
\DeclareOption{TABTOPCAP}{\ExecuteOptions{tabtopcap}\subtabletopcaptrue}
% \end{macrocode}
%
% \newpage^finalhack
%
% \begin{macro}{\subfigtopskip}
% \begin{macro}{\subfigcapskip}
% \begin{macro}{\subfigcaptopadj}
% \begin{macro}{\subfigbottomskip}
% \begin{macro}{\subfigcapmargin}
% \begin{macro}{\subfiglabelskip}
%
% \noindent
% The last two options control the overall ``look-and-feel'' of the
% subfloat. The \Lopt{loose} option is the default and makes the
% subfloat look like it always has with lots of extra room around the
% subfigure and subcaption.
%
% \begin{macrocode}
\DeclareOption{loose}{%
\subfigtopskip = 10\p@
\subfigcapskip = 10\p@
\subfigcaptopadj = 0\p@
\subfigbottomskip = 10\p@
\subfigcapmargin = 10\p@
\subfiglabelskip = 0.33em
% \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\@thesubfigure}
% \begin{macro}{\@thesubtable}
% Next, it replaces the glue at the end of the subcaption label with a
% |\space| like the older version of the \Lpack{subfigure} package.
%
% \begin{macrocode}
\renewcommand*{\@thesubfigure}{\thesubfigure\space}
\renewcommand*{\@thesubtable}{\thesubtable\space}
% \end{macrocode}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\ifsf@tight}
%
% Finally, set the \Lif{sf@tight} flag to make the |\@subfloat| command
% skip its check for the top of a page or minipage and to always add
% its topmost vertical spacing. (For more details about the
% |\@subfloat| command, see section~\ref{sec:mainmacros}.)
%
% \begin{macrocode}
\sf@tightfalse}
% \end{macrocode}
% \end{macro}
%
%
% \begin{macro}{\subfigtopskip}
% \begin{macro}{\subfigcapskip}
% \begin{macro}{\subfigcaptopadj}
% \begin{macro}{\subfigbottomskip}
% \begin{macro}{\subfigcapmargin}
% \begin{macro}{\subfiglabelskip}
%
% The \Lopt{tight} option is the is the preferred version and has less white
% space around the subfloat. It also will omit the space above the subfloat
% at the top of the page or minipage.
%
% \begin{macrocode}
\DeclareOption{tight}{%
\subfigtopskip = 5\p@
\subfigcapskip = 0\p@
\subfigcaptopadj = 3\p@
\subfigbottomskip = 5\p@
\subfigcapmargin = \z@
\subfiglabelskip = 0.33em plus 0.07em minus 0.03em
% \end{macrocode}
%
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\@thesubfigure}
% \begin{macro}{\@thesubtable}
% Next, it keeps the glue at the end of the subcaption label to allow
% better subcaption fitting.
%
% \begin{macrocode}
\renewcommand*{\@thesubfigure}{\thesubfigure\hskip\subfiglabelskip}
\renewcommand*{\@thesubtable}{\thesubtable\hskip\subfiglabelskip}
% \end{macrocode}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\ifsf@tight}
%
% Finally, set the \Lif{sf@tight} flag to make the |\@subfloat| command
% check for the top of a page or minipage and to skip adding any vertical
% space there. (For more details about the |\@subfloat| command, see
% section~\ref{sec:mainmacros}.)
%
% \begin{macrocode}
\sf@tighttrue}
% \end{macrocode}
% \end{macro}
%
% \subsection{Execution of Options}
% \label{sec:startup}
%
% \changes{v2.1}{11 Oct 1996}{Added a check for a local configuration file.}
%
% \changes{v2.1}{15 Nov 1997}{Added the \Lopt{FIGBOTCAP} and
% \Lopt{TABBOTCAP} options.}
%
% \changes{v2.1.4}{30 Apr 2002}{Changed the subcaption label defaults
% to be hard coded above and no longer in the options list.}
%
% The \Lopt{normal} type of subcaption is preselected, the standard
% subcaption size is set to \Lopt{footnotesize}, and the font for both
% the subcaption label and text is set above to the global defaults for
% family, series, and shape. Also, the subcaptions for the subfigure
% and subtable are placed after the figure box and it is assumed that
% the figure or table caption follows all of the associated subfloats.
% Finally, the \Lopt{loose} form is selected in order to cause minimal
% change to existing papers using the \Lpack{subfigure} package.
%
% The preferred form would be to have the \Lopt{TABTOPCAP} and
% \Lopt{tight} be the defaults, but this would adversely affect the
% existing papers that have used the official releases of this package.
%
% \begin{macrocode}
\ExecuteOptions{normal,footnotesize,FIGBOTCAP,TABBOTCAP,loose}
\InputIfFileExists{subfigure.cfg}{%
\typeout{****************************************^^J%
* Local config file subfigure.cfg used *^^J%
****************************************}}{}
\ProcessOptions
% \end{macrocode}
%
% \subsection{The Subfigure and Subtable Commands}
% \label{sec:mainmacros}
%
% \changes{v2.1}{23 Jan 2002}{Added setting \cmd{\label} to
% \cmd{\subfloat@label}.}
%
% \changes{v2.1}{11 Oct 1996}{Added command lines. The subfigure
% command was updated to allow a second optional argument. This
% causes changes all the way down to the \cmd{\@subcaption} command.}
%
% \begin{macro}{\subfigure}
% \label{sec:subfigure}
%
% \changes{v2.1.2}{26 Mar 2002}{Added check to see if \cmd{\subfig@oldlabel}
% is defined and if not to save the current definition.}
%
% \changes{v2.1}{22 Jan 1997}{Changed the counter advance to occur
% only if the related boolean is false. This allows \cmd{\caption}'s
% to occur before the subfloats rather than after.}
%
% \changes{v2.1}{07 Mar 1997}{Moved \cmd{\leavevmode} to \cmd{\@subfloat}.}
%
% The |\subfigure| command acts as cover function for the |\@subfloat|
% command. It locally changes the |\label| command to our special version
% that supports the |\subref|'s (see section~\ref{sec:patches}). It
% insures that the proper counter is used and has the correct value.
% Since the caption is usually generated later, we must locally
% anticipate the future value of its counter by adding one to it within
% a local group. Upon leaving |\subfigure|, the old value is restored.
%
% \begin{macrocode}
\newcommand*{\subfigure}{%
\bgroup
\let\subfig@oldlabel=\label
\let\label=\subfloat@label
\@nameuse{if\@captype topcap}\else
\advance\@nameuse{c@\@captype}\@ne
\fi
\refstepcounter{sub\@captype}%
\@ifnextchar [%
{\@subfigure}%
{\@subfigure[\@empty]}}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\subtable}
%
% The |\subtable| command is identical to |\subfigure|. The of names
% at the user level is purely cosmetic (and historical).
%
% \begin{macrocode}
\let\subtable=\subfigure
% \end{macrocode}
% \end{macro}
%
%
% \enlargethispage{-24pt}^finalhack
%
% \begin{macro}{\@subfigure}
% \changes{v2.1.4}{07 Jun 2002}{Added curly brackets around the
% argument when passing it on as an optional argument.}
%
% Here we are still setting up for the main |\@subfloat| command. We
% check for a second optional argument. If one is not found, than any
% optional argument from the last |\subfigure| or |\subtable| becomes
% the main caption and we give |\@empty| as the default list-entry
% caption. If we see another optional argument, then we make that one
% the main caption and use any prior optional argument as the list-entry
% caption. See Table~\ref{tab:calling} for how this looks to the user.
%
% \begin{macrocode}
\def\@subfigure[#1]{%
\@ifnextchar [%
{\@subfloat{sub\@captype}[{#1}]}%
{\@subfloat{sub\@captype}[\@empty{#1}][{#1}]}}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@subfloat}
%
% \changes{v2.1.4}{24 Apr 2002}{Changed \cmd{\@subfloat} to globally
% reset the figure/table counter if it was incremented so that any
% subfloat body that resets the counters globally will not cause
% errors ({\it e.g.\/}, the \Lpack{tabularx} package}
%
% \changes{v2.1}{23 Jan 2002}{Now using \cmd{\@nameuse} to build names.
% Made the \cmd{\def} a \cmd{\long}\cmd{\def}.}
%
% \changes{v2.1}{22 Apr 1998}{Added some percents to keep out whitespace}
%
% \changes{v2.1}{07 Mar 1997}{Changed the addition of the
% \cmd{\subfigtopskip} to be added only if not at the top of the
% float and only in vertical mode. Moved \cmd{\leavevmode} from
% \cmd{\subfigure} to after the topskip addition.}
%
% \changes{v2.1}{17 Jan 1997}{Added swap of the top and bottom space
% when in TOPCAP mode.}
%
% This is the common code for setting up the subfloat box and drawing
% the subcaption under it. The two skips are used only here to keep
% track of what vertical space is to be placed before and after the
% figure.
%
% The first argument is the type of object being generated: that is,
% a |subfigure| or a |subtable|. The second and third are the
% \texttt{subcaption} and \texttt{subfigure} arguments from the
% calling |\subfigure| or |\subtable| command.
%
% \begin{macrocode}
\newskip\subfig@top
\newskip\subfig@bottom
% \end{macrocode}
%
% If \Lif{ifsf@tight} is true, then the |\@subfloat| command checks to
% see if it is at the top of a page or a minipage and will suppress the
% top vertical space in that case; otherwise, it always adds the space.
%
% \begin{macrocode}
\long\def\@subfloat#1[#2][#3]#4{%
\@tempcnta=1
\ifsf@tight
\if@minipage
\@tempcnta=\z@
\else\ifdim \lastskip=\z@ \else
\@tempcnta=2
\fi\fi
\fi
% \end{macrocode}
%
% Based on the |\iffiguretopcap| or |\iftabletopcap| flags we
% select which vertical space is to be placed above and below the figure
% or table and save it in |\subfig@top| and |\subfig@bottom|.
%
% \begin{macrocode}
\@nameuse{if\@captype topcap}%
\subfig@top=\subfigbottomskip
\subfig@bottom=\subfigtopskip
\else
\subfig@top=\subfigtopskip
\subfig@bottom=\subfigbottomskip
\fi
% \end{macrocode}
%
% The |\leavevmode| is here to inhibit any \LaTeX\ errors that the
% surreounding environment might generate if we stay in vertical mode.
% Then it determines the width of the figure or table by placing it in a
% box and testing the box.
%
% \begin{macrocode}
\leavevmode
\setbox\@tempboxa \hbox{#4}%
\@tempdima=\wd\@tempboxa
% \end{macrocode}
%
% Finally we put the figure together in a vertical box. At the very top
% goes any vertical space, but only if we are not at the top of the page
% or minipage as determined above.
%
% \begin{macrocode}
\vtop\bgroup
\vbox\bgroup
\ifcase\@tempcnta
\@minipagefalse
\or
\vspace{\subfig@top}%
\or
\ifdim \lastskip=\z@ \else
\@tempskipb\subfig@top\relax\@xaddvskip
\fi
\fi
% \end{macrocode}
%
% Next, based on the `topcap' flags, we check if the subcaption or the
% figure goes next. If it is the subcaption, then we add some extra
% |\subfigcaptopadj| space between the subcaption and the figure and
% table in addtion to the regular |\subfigcapskip| space. This finishes
% off the top box and establishes our baseline.
%
% After that we add in either the figure or subcaption (whichever we
% have not typeset yet and follow it with the bottom vertical space.
% (see figure~\ref{fig:layout-C} for a diagram of this layout).
%
% Finally, we globally ({\bf !}) reset the \Lcount{figure} or
% \Lcount{table} counter, if we incremented it at the beginning of the
% |\subfigure| or |\subtable| command so that any functions used inside
% the command body which globally sets the counters ({\it e.g.\/}, the
% \Lpack{tabularx} package) will not cause problems.
%
% \begin{macrocode}
\@nameuse{if#1topcap}%
\ifx \@empty#3\relax \else
\@subcaption{#1}{#2}{#3}%
\vskip\subfigcapskip
\vskip\subfigcaptopadj
\fi\egroup
\box\@tempboxa
\else
\box\@tempboxa\egroup
\ifx \@empty#3\relax \else
\vskip\subfigcapskip
\@subcaption{#1}{#2}{#3}%
\fi
\fi
\vspace{\subfig@bottom}%
\egroup
\@nameuse{if\@captype topcap}\else
\global\advance\@nameuse{c@\@captype}\m@ne
\fi
\egroup}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@subfigcaptionlist}
%
% \begin{macro}{\@subcaption}
%
% \changes{v2.1}{23 Jan 2002}{Now using \cmd{\@nameuse} to build names.
% Also use \@@thesubfigure and \@@thesubtable stored label.}
%
% \begin{macro}{\listsubcaptions}
%
% \changes{v2.1.4}{09 Jul 2002}{Changed \cmd{\@tempa} to \cmd{\sf@temp}
% at the request of Donald Arseneau to remove the potential of problems
% with others using the same variable.}
% \changes{v2.1}{22 Oct 1996}{Added to allow the user to cause a dump
% of the currently queued subcaptions to the ``List-of'' page. This
% is necessary when the \cmd{caption} is placed before the subfloats
% as is often the case for subtables.}
%
% \changes{v2.1}{11 Oct 1996}{Fixed \cmd{\protect} related bug caused by
% a change in \LaTeX3.}
% \begin{macro}{\@listsubcaptions}
%
% \changes{v2.1}{23 Jan 2002}{Added checks for undefined \cmd{\@captype}
% and \cmd{ext@<\@captype>} just in case the \cmd{caption} is called
% outside the \Lenv{float} or the current float type does not support
% subfigures.}
%
% \changes{v2.1}{11 Oct 1996}{Added to print the queued subcaptions.
% This is also used by the \Lpack{captcont} package to correctly print
% the subcaptions.}
%
% \changes{v2.1}{17 Jan 1997}{Changed the source of the label for the
% ``List-of'' pages to use the \cmd{\thesubfigure} or \cmd{\thesubtable}
% value rather than the \cmd{\@currentlabel}. This usually will be
% cleaner since the figure number won't be repeated.}
%
% \changes{v2.1}{05 Jan 1998}{Changed \cmd{\edef} to \cmd{\def} and added
% back the \cmd{\protect} due to changes in the use of the
% \cmd{\@subcaption}.}
%
% The following series of commands control exactly how the subcaption is
% typeset. The |\@subcaption| command adds the subcaption to the current
% list of subcaptions to be added to the ``List-of'' page as soon as
% the major caption is declared (see |\@caption| below).
% ({\scshape Note}: only one list is kept because that seems right;
% if there is a mix of tables and figures, they will be grouped
% under the next |\caption|\@.) Next |\@subcaption| calls the
% appropriate float-type specific command to decide how to size and shape
% the subcaption text.
%
% \begin{macrocode}
\newcommand*{\@subfigcaptionlist}{}
% \end{macrocode}
% \begin{macrocode}
\newcommand{\@subcaption}[3]{%
\ifx \relax#2\relax \else
\bgroup
\let\label=\@gobble
\let\protect=\string
\def\@subcaplabel{\@nameuse{@@the#1}}%
\xdef\@subfigcaptionlist{%
\@subfigcaptionlist,%
{\protect\numberline{\@subcaplabel}\noexpand{\ignorespaces #2}}}%
\egroup
\fi
\@nameuse{@make#1caption}{\@nameuse{@the#1}}{#3}}
% \end{macrocode}
%
% \begin{macrocode}
\newcommand*{\listsubcaptions}{%
\@ifstar
{\gdef\@subfigcaptionlist{}}%
{\@listsubcaptions{\@captype}}}
% \end{macrocode}
%
% \begin{macrocode}
\newcommand*{\@listsubcaptions}[1]{%
\@ifundefined{@captype}{}{%
\@ifundefined{ext@sub#1}{}{%
\@for \sf@temp:=\@subfigcaptionlist \do {%
\ifx \@empty\sf@temp\relax \else
\addcontentsline
{\@nameuse{ext@sub#1}}%
{sub#1}%
{\sf@temp}%
\fi}}}%
\gdef\@subfigcaptionlist{}}
% \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\@makesubfigurecaption}
% \begin{macro}{\@makesubtablecaption}
%
% \changes{v2.1}{17 Jan 1997}{Added the new font control.}
%
% By default, the |\@subfigurecaption| and |\@subtablecaption|
% commands are identical. Unlike the standard |\@makecaption| command,
% we assume that the first argument (the label number produced by
% the |\@thesubfigure| or the |\@thesubtable|) contains any trailing
% separator characters or spacing (which makes it easier to customize).
%
% \newpage^finalhack
%
% The |\@makesubfigurecaption| command first checks the size of the
% caption typeset as a single line. It knocks off twice the
% |\subfigcapmargin| (at it's regular size) to determine the with of the
% caption and label.
%
% \begin{macrocode}
\newcommand{\@makesubfigurecaption}[2]{%
\setbox\@tempboxa\hbox{%
\subcapsize
{\subcaplabelfont #1}%
{\subcapfont\ignorespaces #2}}%
\@tempdimb=-\subfigcapmargin
\multiply\@tempdimb\tw@
\advance\@tempdimb\@tempdima
% \end{macrocode}
%
% Next it creates a horizontal box of that width and if the label plus
% the text was too wide or if the \Lif{subcapnooneline} flag is true,
% then it sends off the label and subcaption to |\subfig@caption| to
% typset as a paragraph. NOTE: |\subfig@caption| assumes that
% |\@tempbdimb| has the calculated width for the paragraph.
%
% If the label plus the text will fit and the \Lif{subcapnooneline} flag
% is false, then we just return them (from box |\@tempboxa|).
%
% \begin{macrocode}
\hbox to\@tempdima{%
\hss
\ifdim \wd\@tempboxa >\@tempdimb
\subfig@caption{#1}{#2}%
\else\ifsubcapnooneline
\subfig@caption{#1}{#2}%
\else
\box\@tempboxa
\fi\fi
\hss}}
% \end{macrocode}
%
% \begin{macrocode}
\let\@makesubtablecaption=\@makesubfigurecaption
% \end{macrocode}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\subfig@caption}
%
% \changes{v2.1}{23 Jan 2002}{Added \cmd{\subcapfont} and
% \cmd{\ignorespaces} before the caption text. So that it does not
% interfere with the label font settings. This fixes a bug found by
% Axel Sommerfeldt.}
%
% \begin{macro}{\subfig@captionpar}
%
% \changes{v2.1}{23 Jan 2002}{Simplified by removing the font settings.
% It is up to the caller to enforce these! This fixes a bug found by
% Axel Sommerfeldt.}
%
% \changes{v2.1}{17 Jan 1997}{Added the new font control.}
%
% These commands are called to typeset a multiple-line subcaption (or a
% single line when \Lif{subcapnooneline} is true). Depending on the
% \Lif{subcapcenter} and \Lif{subcapcenterlast} flags, the text will be
% justified (both false), centered (\Lif{subcapcenter} true), or
% justified with the last line centered (only the flag
% \Lif{subcapcenterlast} set true).
%
% \begin{macrocode}
\newcommand{\subfig@caption}[2]{%
\ifsubcaphang
\sbox{\@tempboxa}{\subcapsize\subcaplabelfont #1}%
\addtolength{\@tempdimb}{-\wd\@tempboxa}%
\usebox{\@tempboxa}%
\subfig@captionpar{\@tempdimb}{%
{\subcapfont\ignorespaces #2}}%
\else
\subfig@captionpar{\@tempdimb}{%
{\subcaplabelfont #1}%
{\subcapfont\ignorespaces #2}}%
\fi}
% \end{macrocode}
%
% \begin{macrocode}
\newcommand{\subfig@captionpar}[2]{%
\parbox[t]{#1}{%
\subcapsize
\ifsubcapraggedright
\setlength{\leftskip}{\z@}%
\setlength{\@rightskip}{\@flushglue}%
\setlength{\rightskip}{\@rightskip}%
\setlength{\parindent}{\z@}%
\else\ifsubcapRaggedRight
\setlength{\leftskip}{\z@}%
\setlength{\@rightskip}{\z@ plus \tw@ em}%
\setlength{\rightskip}{\@rightskip}%
\setlength{\parfillskip}{\z@ plus \@ne fil}%
\setlength{\parindent}{\z@}%
\else\ifsubcapcenter
\setlength{\leftskip}{\@flushglue}%
\setlength{\rightskip}{\@flushglue}%
\setlength{\parfillskip}{\z@skip}%
\else\ifsubcapcenterlast
\addtolength{\leftskip}{\z@ plus 1fil}%
\addtolength{\rightskip}{\z@ plus -1fil}%
\setlength{\parfillskip}{\z@ plus 2fil}%
\fi\fi\fi\fi
#2}}
% \end{macrocode}
% \end{macro}
% \end{macro}
%
% \subsection{Patches to the Standard Environment}
% \label{sec:patches}
%
% The following adjust the standard environment for the
% \Lpack{subfigure} package. They are designed as wrappers to the
% current definition of the standard commands to minimize any chance of
% conflict with other packages or to extend \LaTeX.
%
% \begin{macro}{\@dottedxxxline}
% \label{sec:dl}
% This is a generalized wrapper for the |\@dottedtocline| command.
% It checks for the level based on the output file (first argument)
% and not using only |\@tocdepth|. (See section~\ref{sec:listof}
% for a description of the arguments.)
%
% \begin{macrocode}
\newcommand*{\@dottedxxxline}[6]{%
\ifnum #2>\@nameuse{c@#1depth}\else
\@dottedtocline{0}{#3}{#4}{#5}{#6}
\fi}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\subfig@end@float}
% \begin{macro}{\subfig@end@dblfloat}
% \begin{macro}{\end@float}
% \begin{macro}{\end@dblfloat}
%
% \changes{v2.1}{05 Jan 1998}{Added this section to minimize the need
% for \cmd{\listofcaptions}.}
%
% These commands patch the end of the \Lenv{float} environment so that it will
% dump out the subcaptions if any remain at this point. This can occur
% when using the \Lopt{TOPCAP} options.
% \begin{macrocode}
\let\subfig@end@float=\end@float
% \end{macrocode}
%
% \begin{macrocode}
\renewcommand*{\end@float}{%
\@listsubcaptions{\@captype}%
\subfig@end@float}
% \end{macrocode}
%
% \begin{macrocode}
\let\subfig@end@dblfloat=\end@dblfloat
% \end{macrocode}
%
% \begin{macrocode}
\renewcommand*{\end@dblfloat}{%
\@listsubcaptions{\@captype}%
\subfig@end@dblfloat}
% \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
%
% \newpage^finalhack
%
% \begin{macro}{\subfig@oldcaption}
% \begin{macro}{\@caption}
%
% \changes{v2.1}{23 Jan 2002}{Now using \cmd{\@nameuse} to build names.
% Added a check for topcap flag. If it is not defined, we assume that
% this float type does not support subfigures.}
%
% \changes{v2.1}{05 Jan 1998}{Changed to print the subcaptions before
% or after the caption, depending on the TOPCAP setting of the current
% environment.}
%
% Next, we redefine the current |\@caption| command to dump any
% subcaptions saved. First the `old' caption command is called to
% add the line to the ``List-of'' file and then the list of
% subcaptions, |\@subfigcaptionlist| is written to the same file.
% Lastly, the |\@subfigcaptionlist| is reinitialized.
%
% \begin{macrocode}
\let\subfig@oldcaption=\@caption
% \end{macrocode}
%
% \begin{macrocode}
\long\def\@caption#1[#2]#3{%
\@ifundefined{if#1topcap}%
{\subfig@oldcaption{#1}[{#2}]{#3}}%
{\@nameuse{if#1topcap}%
\@listsubcaptions{#1}%
\subfig@oldcaption{#1}[{#2}]{#3}%
\else
\subfig@oldcaption{#1}[{#2}]{#3}%
\@listsubcaptions{#1}%
\fi}}
% \end{macrocode}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\subfig@oldlabel}
%
% To support the redefinition of the |\label| command within the body of
% the subfloats, we will use |\subfig@oldlabel| to save the current
% definition of |\label| and create the |\subfloat@label| command to take its
% place during the processing of the |\subfigure| command. Since the
% definition of |\label| may change as packages are loaded, we save the
% definition each time that |\label| is replaced with |\sub@label|
% (see \ref{sec:subfigure} above).
%
% \begin{macrocode}
\let\subfig@oldlabel=\relax
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\subfloat@label}
% \begin{macro}{\sub@label}
%
% \changes{v2.1.4}{02 Jul 2002}{Added reference to this command via
% the name \cmd{subfloat@label} to avoid packages that replace the
% name without the support of the optional argument. The old name
% is still here to decoy the other packages. Added chapter number
% in the automatically generated label to increase uniqueness.}
%
% One difference from the regular |\label| command is that there is an
% optional argument (note with parentheses rather than square brackets)
% that is only used with the \Lpack{hyperref} package to define the
% {\em bookmark\/} argument to the label. Typically, this would be a
% copy or paraphrase of the subcaption text. If this is not given and
% the \Lpack{hyperref} package is being used, then the {\em bookmark\/}
% argument is of the form ``Subfigure\textvisiblespace 1(a)''.
%
% \begin{macrocode}
\newcommand*{\subfloat@label}{%
\@ifnextchar(
{\sf@sub@label}
{\sf@sub@label(Sub\@captype\space
\@ifundefined{thechapter}{}{%
\@nameuse{thechapter}\space}%
\@nameuse{p@sub\@captype}%
\@nameuse{thesub\@captype}.)}}
% \end{macrocode}
% \begin{macrocode}
\let\sub@label\subfloat@label
% \end{macrocode}
%
% \end{macro}
% \end{macro}
%
% \newpage^finalhack
%
% \begin{macro}{\sf@sub@label}
%
% \changes{v2.1.4}{02 Jul 2002}{Moved \cmd{\relax} from the
% \cmd{\sf@@sub@label} to here.}
%
% \changes{v2.1.1}{15 Mar 2002}{Added coordination with the hyperref
% package.}
%
% The |\sf@sub@label| parses the optional argument and (if the
% \Lpack{hyperref} Package is loaded) saves the {\em bookmark\/} text
% as |\@currentlabelname|. It then calls the |\sf@@sub@label| command
% to the real processing of the label.
%
% \begin{macrocode}
\def\sf@sub@label(#1)#2{%
\ifhyperrefloaded
\protected@edef\@currentlabelname{%
\expandafter\strip@period #1\relax.\relax\@@@}%
\fi
\sf@@sub@label{#2}}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\sf@@sub@label}
%
% \changes{v2.1.4}{02 Jul 2002}{Moved \cmd{\relax} from here to the
% \cmd{\sf@sub@label}.}
%
% \changes{v2.1.2}{26 Mar 2002}{Changed to simplify the operation and
% to avoid a bug in the hyperref package.}
%
% \changes{v2.1.1}{15 Mar 2002}{Added coordination with the hyperref
% package.}
%
% In order to support the \Lpack{hyperref} package we check if it was
% loaded and use the proper form of the |\newlabel| command. |\sf@@sub@label|
% operates by first calling the old |\label| definition (which adds a
% |\newlabel| command to the \Lfile{*.aux} file) and then adds another
% |\newlabel| command to the \Lfile{*.aux} file with a similar reference
% name (with `sub@' prepended) and the value of |\@@thesubfigure| or
% |\@@thesubtable|.
%
% If the |\ifhyperrefloaded| flag is set, then the |\newlabel| command
% has three extra fields, the first is the value of |\@currentlabelname|,
% which is either of the form ``Subfigure\textvisiblespace1(a)'' or
% was defined by the optional argument to |\label| (actually
% |\sub@label|). The second extra field is the hypertext anchor name
% and the third is unused. Otherwise, the we us the standard |\newlabel|
% form to write the sub-reference.
%
% \begin{macrocode}
\newcommand*{\sf@@sub@label}[1]{%
\@bsphack
\subfig@oldlabel{#1}%
\ifhyperrefloaded
\protected@write\@auxout{}{%
\string\newlabel{sub@#1}%
{{\@nameuse{@@thesub\@captype}}%
{\thepage}%
{\expandafter\strip@period\@currentlabelname\relax.\relax\@@@}%
{\@currentHref}%
{}}}%
\else
\protected@write\@auxout{}{%
\string\newlabel{sub@#1}%
{{\@nameuse{@@thesub\@captype}}%
{\thepage}}}%
\fi
\@esphack}
% \end{macrocode}
%
% \end{macro}
%
% \enlargethispage{24pt}^finalhack
% \vspace{-10pt}^finalhack
%
% \begin{macro}{\subref}
%
% The |\subref| command is the same as the |\ref| command except that
% |\@@thesubtable| instead of |\p@subfigure\thesubfigure| or
% |\p@subtable\thesubtable|. This is often of use for local references
% within the figure where the figure number may be assumed; or, for ease
% in constructing a range of references within a figure with many
% subfigures.
%
% \begin{macrocode}
\newcommand\subref[1]{%
\ref{sub@#1}}
% \end{macrocode}
%
% \end{macro}
%
% \begin{macro}{\Subref}
%
% \changes{v2.1.2}{26 Mar 2002}{Changed \cmd{\subref*} to \cmd{\Subref} to
% avoid problems in writing to the \Lfile{aux} file.}
%
% \changes{v2.1}{23 Jan 2002}{Added \cmd{\subref*} at the request of Benoit
% Hudson (bhudson\@cs.cmu.edu).}
%
% The |\Subref| command is the same as |\subref|, except that it adds
% |\subcaplabelfont| before the reference so that it uses the same font
% (except that the current font size is maintained).
%
% \begin{macrocode}
\newcommand\Subref[1]{%
{\subcaplabelfont
\ref{sub@#1}}}
% \end{macrocode}
% \end{macro}
%
% \iffalse
%</package>
% \fi
%
% \Finale
%
\endinput
|