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
|
% \iffalse meta-comment
%
% This is file `caption.dtx'.
%
% Copyright (C) 1994-2004 Axel Sommerfeldt (caption@sommerfeldt.net)
%
% --------------------------------------------------------------------------
%
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3
% of this license or (at your option) any later version.
% The latest version of this license is in
% http://www.latex-project.org/lppl.txt
% and version 1.3 or later is part of all distributions of LaTeX
% version 2003/12/01 or later.
%
% This work has the LPPL maintenance status "maintained".
%
% This Current Maintainer of this work is Axel Sommerfeldt.
%
% This work consists of the files caption.ins, caption.dtx,
% caption2.dtx, caption.xml, and anleitung.tex and the derived files
% caption.sty, caption2.sty, and manual.tex.
%
% \fi
% \CheckSum{1667}
%
% \iffalse
%<*driver>
\documentclass{ltxdoc}
\setlength\parindent{0pt}
\setlength\parskip{\smallskipamount}
%
\newcommand\NEWfeature{\NEW{New feature}}
\newcommand\NEWdescription{\NEW{New description}}
\newcommand\NEW[2]{%
\hskip 1sp \marginpar{\footnotesize\sffamily\raggedleft
#1\\#2}}
%
\ifx\pdfoutput\undefined\else
\ifcase\pdfoutput\else
\usepackage{mathptmx,courier}
\usepackage[scaled=0.90]{helvet}
\fi
\fi
%
\usepackage{caption}[2003/12/20]
%\usepackage{float}
\usepackage{longtable}
%\usepackage[raggedright]{sidecap}
%
\DeclareCaptionLabelSeparator{period-newline}{. \newline}
\DeclareCaptionStyle{period-newline}[labelsep=period]{labelsep=period-newline}
\DeclareCaptionStyle{period-newline2}[labelsep=period,justification=centering]{labelsep=period-newline}
\DeclareCaptionFormat{reverse}{#3#2#1}
\DeclareCaptionFormat{llap}{\llap{#1#2}#3\par}
\DeclareCaptionLabelFormat{fullparens}{(\bothIfFirst{#1}{ }#2)}
\DeclareCaptionLabelSeparator{fill}{\hfill}
%
\DeclareRobustCommand{\KOMAScript}{\textsf{K\kern.05em O\kern.05em%
M\kern.05em A\kern.1em-\kern.1em Script}}
%
\begin{document}
\DocInput{caption.dtx}
\end{document}
%</driver>
% \fi
%
% \newcommand*{\purerm}[1]{{\upshape\mdseries\rmfamily #1}}
% \newcommand*{\puresf}[1]{{\upshape\mdseries\sffamily #1}}
% \newcommand*{\purett}[1]{{\upshape\mdseries\ttfamily #1}}
% \let\package\puresf\def\thispackage{\package{caption}}
% \let\env\purett \let\opt\purett
%
% \newenvironment{Options}[1]%
% {\list{}{\renewcommand{\makelabel}[1]{\texttt{##1}\hfil}%
% \settowidth{\labelwidth}{\texttt{#1\space}}%
% \setlength{\leftmargin}{\labelwidth}%
% \addtolength{\leftmargin}{\labelsep}}}%
% {\endlist}
%
% \newenvironment{Example}%
% {\ifvmode\else\unskip\par\fi
% \minipage{\linewidth}\smallskip}%
% {\smallskip\endminipage}
% \newcommand\example[3][figure]{%
% \begingroup
% \captionsetup{#2}%
% \captionof{#1}[]{#3}%
% \endgroup}
%
% \GetFileInfo{caption.sty}
% \title{Typesetting captions with the
% \thispackage\ package\thanks{This package has version number
% \fileversion, last revised \filedate.}}
% \author{Axel Sommerfeldt\\\texttt{caption@sommerfeldt.net}}
% \date{2004/07/16}
% \maketitle
%
%
% \begin{abstract}
% The \thispackage\ package provides many ways to customise the captions
% in floating environments such |figure| and |table| and cooperates with
% many other packages.\footnote{A complete re-work of the user interface
% done together with Steven D. Cochran and Frank Mittelbach has lead to
% this new enhanced version 3.0.}
% \end{abstract}
%
% \iffalse
% \tableofcontents
% \fi
%
%
% \section{Introduction}
%
% \newcommand\figuretext{%
% White sand beaches. The pink smoothness of the conch shell. A sea abundant
% with possibilities. Duty-free shops filled with Europe's finest gifts and
% perfumes. Play your favorite game of golf amidst the tropical greens on one
% of the many championship courses.}
%
% Within the standard \LaTeX\ classes captions haven't received the attention
% they deserve. Simply typeset as an ordinary paragraph there is no
% remarkable visual difference from the rest of the text, like here:
%
% \example{belowskip=\abovecaptionskip}{\figuretext}
%
% There should be possibilities to change this; e.g., it would be nice if you
% can make the text of the caption a little bit smaller as the normal text,
% add an extra margin, typeset the caption label with the same font family and
% shape as your headings etc. Just like this one:
%
% \example{belowskip=\abovecaptionskip,size=small,margin=10pt,labelfont=bf}{\figuretext}
%
% With this package you can do this easily as there are many ready-to-use
% caption formatting options, but you are free to define your very own stuff, too.
%
%
% \pagebreak[4]
% \section{Using the package}
% \label{usage}
%
% \DescribeMacro{\usepackage}
% Insert
% \begin{quote}
% |\usepackage|\oarg{options}|{caption}[|\texttt{\filedate}|]|
% \end{quote}
% into the preamble of your document, i.e.~the part of your document
% between |\documentclass| and |\begin{document}|.
% The options control how your captions will look like; e.g.,
% \begin{quote}
% |\usepackage[margin=10pt,font=small,labelfont=bf]{caption}|
% \end{quote}
% would result in captions looking like the second one in the introduction.
%
% \DescribeMacro{\captionsetup}
% For a later change of options the \thispackage\ package provides the command
% \begin{quote}
% |\captionsetup|\oarg{float type}\marg{options}
% \end{quote}
% So
% \begin{quote}
% |\usepackage[margin=10pt,font=small,labelfont=bf]{caption}|
% \end{quote}
% and
% \begin{quote}
% |\usepackage{caption}|\\
% |\captionsetup{margin=10pt,font=small,labelfont=bf}|
% \end{quote}
% are equal in their results.
%
% It's good to know that |\captionsetup| has an effect on the current
% environment only. So if you want to change some settings for the
% current |figure| or |table| only, just place the |\captionsetup| command
% inside the |figure| or |table| right before the |\caption| command.
% For example
% \begin{quote}
% |\begin{figure}|\\
% | |\ldots\\
% | \captionsetup{singlelinecheck=off}|\\
% | \caption{|\ldots|}|\\
% |\end{figure}|
% \end{quote}
% switches the single-line-check off, but only for this |figure| so all
% the other captions remain untouched.
%
% (For a description of the optional parameter \meta{float type} see
% section \ref{misc}: \textit{``Useful stuff''}.)
%
% \section{Options}
% \def\OptionLabel{RaggedRight}
%
%
% \subsection{Formatting}
%
% \DescribeMacro{format=}
% A figure or table caption mainly consits of three parts: the caption label,
% which says if this object is a `Figure' or `Table' and what number is
% associated with it, the caption text itself, which is normally a short
% description of contents, and the caption separator which separates the text
% from the label.
%
% The \textit{caption format} determines how this information will be presented;
% it is specified with the option
% \begin{quote}
% |format=|\meta{format name}\quad ,
% \end{quote}
% having the name of the caption format as its argument.
%
% There are two standard caption formats:\footnote{You have the option to
% define your own ones, too. See section \ref{declare}:
% \textit{``Do it yourself!''} for details.}
%
% \begin{Options}{\OptionLabel}
% \item[default]
% Typesets the captions as a normal paragraph.
% (This is the default behaviour, it
% is adapted from the standard \LaTeX\ document classes.)
%
% \item[hang]
% Indents the caption text, so it will `hang' under the first line of the text.
% \end{Options}
%
% \begin{Example}
% An example: Specifing the option
% \begin{quote}
% |format=hang|
% \end{quote}
% yields captions like this:
% \example{format=hang}{\figuretext}
% \end{Example}
%
% \DescribeMacro{indention=}
% For both formats (\texttt{default} and \texttt{hang}) you can setup an extra
% indention starting at the second line of the caption. You do this with the
% option
% \begin{quote}
% |indention=|\meta{amount}.
% \end{quote}
%
% Two examples:
%
% \begin{Example}
% \begin{quote}
% |format=default,indention=.5cm|
% \end{quote}
% \captionsetup{aboveskip=0pt}
% \example{format=default,indention=.5cm}{\figuretext}
% \end{Example}
%
% \begin{Example}
% \begin{quote}
% |format=hang,indention=-0.5cm|
% \end{quote}
% \captionsetup{aboveskip=0pt}
% \example{format=hang,indention=-0.5cm}{\figuretext}
% \end{Example}
%
% \DescribeMacro{labelformat=}
% With the option
% \begin{quote}
% |labelformat=|\meta{label format name}
% \end{quote}
% you specify how the caption label will be typeset.
% There are three standard caption label formats:
%
% \begin{Options}{\OptionLabel}
% \item[empty]
% The caption label will be empty. This option only makes sense when used
% together with other options like \texttt{labelsep=none}.
%
% \item[simple]
% The caption label will be typeset as a name and a number.
% (This is the default behaviour.)
%
% \item[parens]
% The number of the caption label will be typeset in parentheses.
% \end{Options}
%
% \begin{Example}
% An example: Using the options
% \begin{quote}
% |labelformat=parens,labelsep=quad|
% \end{quote}
% yields captions like this one:
% \example{labelformat=parens,labelsep=quad}{\figuretext}
% \end{Example}
%
% \DescribeMacro{labelsep=}
% With the options
% \begin{quote}
% |labelsep=|\meta{label separator name}
% \end{quote}
% you specify what caption separator will be used.
% You can choose one of the following:
%
% \begin{Options}{\OptionLabel}
% \item[none]
% There is no caption separator. This option only makes sense when used
% together with other options like \texttt{labelformat=empty}.
%
% \item[colon]
% The caption label and text will be separated by a colon and a space.
% (This is the default one.)
%
% \item[period]
% The caption label and text will be separated by a period and a space.
%
% \item[space]
% The caption label and text will be separated by a single space.
%
% \item[quad]
% The caption label and text will be separated by a |\quad|.
%
% \item[newline]
% The caption label and text will be separated by a line break (|\newline|).
% \end{Options}
%
% Two examples:
% \begin{Example}
% \begin{quote}
% |labelsep=period|
% \end{quote}
% \captionsetup{aboveskip=0pt}
% \example{labelsep=period}{\figuretext}
% \end{Example}
%
% \begin{Example}
% \begin{quote}
% |labelsep=newline,singlelinecheck=false|
% \end{quote}
% \captionsetup{aboveskip=0pt}
% \example{labelsep=newline,singlelinecheck=false}{\figuretext}
% \end{Example}
%
%
% \subsection{Justification}
%
% \DescribeMacro{justification=}
% As addition to the caption format you could also specify a
% \emph{caption justification}; it is specified with the option
% \begin{quote}
% |justification=|\meta{justification name}\quad.
% \end{quote}
%
% You can choose one of the following:
%
% \begin{Options}{\OptionLabel}
% \item[justified]
% Typesets the caption as a normal paragraph. (This is the default.)
%
% \item[centering]
% Each line of the caption will be centered.
%
% \iffalse
% \item[Centering]
% Each line of the caption will be centered, too.
% But this time the command |\Centering| of the \package{ragged2e} package
% will be used to achieve this. This difference is that this time the word
% breaking algorithm of \TeX\ will work inside the caption.
% \fi
%
% \item[centerlast]
% The last line of each paragraph of the caption text will be centered.
%
% \item[centerfirst]
% Only the first line of the caption will be centered.
%
% \item[raggedright]
% Each line of the caption will be moved to the left margin.
%
% \iffalse
% \item[RaggedRight]
% Each line of the caption will be moved to the left margin using
% the command |\RaggedRight| from the \package{ragged2e} package.
% \fi
% \item[RaggedRight]
% Each line of the caption will be moved to the left margin, too.
% But this time the command |\RaggedRight| of the \package{ragged2e} package
% will be used to achieve this. This difference is that this time the word
% breaking algorithm of \TeX\ will work inside the caption.
%
% \item[raggedleft]
% Each line of the caption will be moved to the right margin.
%
% \iffalse
% \item[RaggedLeft]
% Each line of the caption will be moved to the right margin using
% the command |\RaggedLeft| from the \package{ragged2e} package.
% \fi
% \end{Options}
%
% Two examples:
% \begin{Example}
% \begin{quote}
% |justification=centerlast|
% \end{quote}
% \captionsetup{aboveskip=0pt}
% \example{justification=centerlast}{\figuretext}
% \end{Example}
%
% \begin{Example}
% \begin{quote}
% |format=hang,justification=raggedright|
% \end{quote}
% \captionsetup{aboveskip=0pt}
% \example{format=hang,justification=raggedright}{\figuretext}
% \end{Example}
%
% \DescribeMacro{singlelinecheck=}
% If the caption fit in a single line it will always be centered, ignoring
% the justification you set:
%
% \example{belowskip=\abovecaptionskip}{A short caption.}
%
% This behaviour is adapted from the standard \LaTeX\ document classes
% |article|, |report|, and |book|), but using the \thispackage\ package
% you can switch this special treatment of such short captions off
% with the option
% \begin{quote}
% |singlelinecheck=|\marg{bool}\quad.
% \end{quote}
% Using |false|, |no|, |off| or |0| for \meta{bool} you switch off the
% extra centering:
% \begin{quote}
% |singlelinecheck=false|
% \end{quote}
% Doing so the above short caption would look like
%
% \example{belowskip=\abovecaptionskip,singlelinecheck=false}{A short caption.}
%
% Using |true|, |yes|, |on| or |1| for \meta{bool} you switch on the
% extra centering again. (The default is on.)
%
%
% \subsection{Fonts}
%
% \DescribeMacro{font=}
% \DescribeMacro{labelfont=}
% \DescribeMacro{textfont=}
% There are three font options which affects different parts of the caption:
% One affecting the whole caption (|font|), one which only affects the caption
% label and separator (|labelfont|) and at last one which only affects the
% caption text (|testfont|).
% You set them up using the options
% \begin{quote}\begin{tabular}{@{}r@{}ll}
% |font=| & \marg{font options} & ,\\
% |labelfont=| & \marg{font options} & and\\
% |textfont=| & \marg{font options} & .\\
% \end{tabular}\end{quote}
%
% And these are the available font options:
%
% \begin{Options}{\OptionLabel}
% \item[scriptsize] {\scriptsize Very small size}
% \item[footnotesize] {\footnotesize The size usually used for footnotes}
% \item[small] {\small Small size}
% \item[normalsize] {\normalsize Normal size}
% \item[large] {\large Large size}
% \item[Large] {\Large Even larger size}
%
% \item[up] {\upshape Upright shape}
% \item[it] {\itshape Italic shape}
% \item[sl] {\slshape Slanted shape}
% \item[sc] {\scshape Small Caps shape}
%
% \item[md] {\mdseries Medium series}
% \item[bf] {\bfseries Bold series}
%
% \item[rm] {\rmfamily Roman family}
% \item[sf] {\sffamily Sans Serif family}
% \item[tt] {\ttfamily Typewriter family}
% \end{Options}
%
% If you use only one of these options you can omit the braces;
% e.g., the options
% \iffalse
% \begin{quote}
% \fi
% |font={small}|
% \iffalse
% \end{quote}
% \fi
% and
% \iffalse
% \begin{quote}
% \fi
% |font=small|
% \iffalse
% \end{quote}
% \fi
% yield the same result.
%
% Two examples:
% \begin{Example}
% \begin{quote}
% |font={small,it},labelfont=bf|
% \end{quote}
% \captionsetup{aboveskip=0pt}
% \example{font={small,it},labelfont=bf}{\figuretext}
% \end{Example}
%
% \begin{Example}
% \begin{quote}
% |font=small,labelfont=bf,textfont=it|
% \end{quote}
% \captionsetup{aboveskip=0pt}
% \example{font=small,labelfont=bf,textfont=it}{\figuretext}
% \end{Example}
%
%
% \subsection{Margins and further paragraph options}
%
% \DescribeMacro{margin=}
% \DescribeMacro{width=}
% For all captions you can specify \emph{either} an extra margin \emph{or}
% a fixed width. You do this using the options
% \begin{quote}\begin{tabular}{@{}r@{}ll}
% |margin=| & \meta{amount} & \emph{or}\\
% |width=| & \meta{amount} & \\
% \end{tabular}\end{quote}
% Nevertheless what option you use, the left and right margin will be the
% same.
%
% Two examples illustrating this:
% \begin{Example}
% \begin{quote}
% |margin=10pt|
% \end{quote}
% \captionsetup{aboveskip=0pt}
% \example{margin=10pt}{\figuretext}
% \end{Example}
%
% \begin{Example}
% \begin{quote}
% |width=.75\textwidth|
% \end{quote}
% \captionsetup{aboveskip=0pt}
% \example{width=.75\textwidth}{\figuretext}
% \end{Example}
%
% \DescribeMacro{parskip=}
% This option is useful for captions containing more than one paragraph.
% If specifies the extra vertical space inserted between them:
% \begin{quote}
% |parskip=|\meta{amount}
% \end{quote}
% One example:
% \begin{Example}
% \begin{quote}
% |margin=10pt,parskip=5pt|
% \end{quote}
% \captionsetup{aboveskip=0pt}
% \example{margin=10pt,parskip=5pt}{
% First paragraph of the caption. This one contains some test, just to
% show how these options affect the layout of the caption.
%
% Second paragraph of the caption. This one contains some text, too, to
% show how these options affect the layout of the caption.}
% \end{Example}
%
% \DescribeMacro{hangindent=}
% The option
% \begin{quote}
% |hangindent=|\meta{amount}
% \end{quote}
% is for setting up a hanging indention starting from the second line of each
% paragraph. If the caption contains just a single paragraph, using this option
% leads to the same result as the option |indention=| you already know about.
% But if the caption contains multiple paragraphs you will notice the difference:
%
% \begin{Example}
% \begin{quote}
% |format=hang,indention=-.5cm|
% \end{quote}
% \captionsetup{aboveskip=0pt}
% \example{format=hang,indention=-.5cm}{
% First paragraph of the caption. This one contains some test, just to
% show how these options affect the layout of the caption.
%
% Second paragraph of the caption. This one contains some text, too, to
% show how these options affect the layout of the caption.}
% \end{Example}
%
% \begin{Example}
% \begin{quote}
% |format=hang,hangindent=-.5cm|
% \end{quote}
% \captionsetup{aboveskip=0pt}
% \example{format=hang,hangindent=-.5cm}{
% First paragraph of the caption. This one contains some test, just to
% show how these options affect the layout of the caption.
%
% Second paragraph of the caption. This one contains some text, too, to
% show how these options affect the layout of the caption.}
% \end{Example}
%
%
% \subsection{Styles}
% \label{style}
%
% \DescribeMacro{style=}
% A suitable combination of caption options is called \emph{caption style}.
% You can compare them more or less to page styles which you set up with
% |\pagestyle|: The caption style provides all settings for a whole caption layout.
%
% You switch to an already defined caption style with the option
% \begin{quote}
% |style=|\meta{style name}\quad.
% \end{quote}
% The \thispackage\ package usually defines only the style |default| which
% puts all options you already know about to the default ones.
% This means that specifing the option
% \begin{quote}
% |style=default|
% \end{quote}
% has the same effect as specifing all these options:
% \begin{quote}
% |format=default,labelformat=simple,labelsep=colon,|\\
% |justification=justified,font=default,labelfont=default,|\\
% |textfont=default,margin=0pt,indention=0pt,parindent=0pt|\\
% |hangindent=0pt,singlelinecheck=true|
% \end{quote}
%
%
% \subsection{Skips}
%
% \DescribeMacro{aboveskip=}
% \DescribeMacro{belowskip=}
% The spaces above and below the caption are controlled by the skips
% |\abovecaptionskip| and |\belowcaptionskip|. The standard \LaTeX\ document
% classes |article|, |report| and |book| set |\abovecaptionskip| to |10pt|
% and |\belowcaptionskip| to |0pt|.
%
% \pagebreak[3]
% Both skips can be changed with the command |\setlength|, but you can
% use these options, too:
% \nopagebreak[3]
% \begin{quote}\begin{tabular}{@{}r@{}ll}
% |aboveskip=| & \meta{amount} & and\\
% |belowskip=| & \meta{amount} & .\\
% \end{tabular}\end{quote}
%
% \DescribeMacro{position=}
% Using |\abovecaptionskip| and |\belowcaptionskip| has a major design flaw:
% If the caption is typeset \emph{above} (and not \emph{below}) the figure
% or table they are not set up very useful at default, because there will be
% some extra space above the caption but no space between the caption and the
% figure or table itself. (Remember: |\belowcaptionskip| is usually set to |0pt|.)
%
% Please compare the spacing in these small tables:
% \begin{Example}
% \begin{minipage}[c]{.5\linewidth}
% \iffalse
% \captionsetup{aboveskip=0pt}%
% \fi
% \captionof{table}{A table}
% \centering\begin{tabular}{ll}
% A & B \\
% C & D \\
% \end{tabular}
% \end{minipage}
% \begin{minipage}[c]{.5\linewidth}
% \centering\begin{tabular}{ll}
% A & B \\
% C & D \\
% \end{tabular}
% \captionof{table}{A table}
% \end{minipage}
% \end{Example}
%
% But you can fix this by using the option |position=|: It specifies how the
% spacing above and below the caption will be used:
% \begin{quote}
% |position=top|\quad(or |position=above|)
% \end{quote}
% tells the \thispackage\ package to use the spacing useful for caption
% \emph{above} the figure or table and
% \begin{quote}
% |position=bottom|\quad(or |position=below|)
% \end{quote}
% tells the \thispackage\ package to use the spacing useful for captions
% \emph{below} the figure or table. (The last one is the default setting.)
%
% So adding an extra |\captionsetup{position=top}| to the left example
% table gives you proper spacing around both captions:
% \begin{Example}
% \begin{minipage}[c]{.5\linewidth}
% \captionsetup{position=top}
% \captionof{table}{A table}
% \centering\begin{tabular}{ll}
% A & B \\
% C & D \\
% \end{tabular}
% \end{minipage}
% \begin{minipage}[c]{.5\linewidth}
% \centering\begin{tabular}{ll}
% A & B \\
% C & D \\
% \end{tabular}
% \captionof{table}{A table}
% \end{minipage}
% \end{Example}
%
% (Technically speaking |\abovecaptionskip| and |\belowcaptionskip| will
% be swapped if you specify the option |position=top|, so in both cases
% |\abovecaptionskip| will be used between the caption and the figure or
% table itself.)
%
% \DescribeMacro{tableposition=}
% This option is especially useful when used together with the optional
% argument of the |\captionsetup| command. (See section \ref{misc}:
% \textit{``Useful stuff''} for details.) E.g.,
% \begin{quote}
% |\captionsetup[table]{position=top}|
% \end{quote}
% causes all captions within tables to be treated as captions \emph{above}
% the table (regarding spacing around it).
% \NEWfeature{v3.0a}
% Because this is a very common setting the \thispackage\ package offers
% an abbreviating option for the use with |\usepackage|:
% \begin{quote}
% |\usepackage[|\ldots|,tableposition=top]{caption}|
% \end{quote}
% is equivalent to
% \begin{quote}
% |\usepackage[|\ldots|]{caption}|\\
% |\captionsetup[table]{position=top}|
% \end{quote}
%
%
% \pagebreak[4]
% \section{Useful stuff}
% \label{misc}
%
% \DescribeMacro{\caption}
% The command
% \nopagebreak[3]
% \begin{quote}
% |\caption|\oarg{lst\_entry}\marg{heading}
% \end{quote}
% \nopagebreak[3]
% typesets the caption inside a floating environment like |figure| or |table|.
% Well, you already know this, but what is new is the fact then when you leave
% the argument \meta{lst\_entry} empty, no entry in the list of figures or
% tables will be made; e.g.,
% \begin{quote}
% |\caption[]{A figure without entry in the list of figures.}|
% \end{quote}
%
% \DescribeMacro{\caption*}
% The \package{longtable} package defines the command |\caption*| which
% typesets the caption without label and without entry in the list of tables.
% An example:
% \begin{quote}
% |\begin{longtable}{cc}|\\
% | \caption*{A table}\\|\\
% | A & B \\|\\
% | C & D \\|\\
% |\end{longtable}|
% \end{quote}
% looks like
% \begin{longtable}{cc}
% \caption*{A table}\\
% A & B \\
% C & D \\
% \end{longtable}
%
% This package does it, too, so you can use this command now within every
% floating environment like |figure| or |table|. Additionally you can specify
% an entry for the list of figures or tables within square brackets, like here:
% \begin{quote}
% |\begin{table}|\\
% | \caption*[List entry for the table]{A table}|\\
% | \begin{tabular}{cc}|\\
% | A & B \\|\\
% | C & D \\|\\
% | \end{longtable}|\\
% |\end{table}|
% \end{quote}
%
% \DescribeMacro{\captionof}
% \DescribeMacro{\captionof*}
% Sometimes you want to typeset a caption \emph{outside} a floating environment,
% putting a figure within a |minipage| for instance. For this purpose the
% \thispackage\ package offers the command
% \begin{quote}
% |\captionof|\marg{float type}\oarg{lst\_entry}\marg{heading}\quad.
% \end{quote}
% Note that the first argument, the \meta{float type}, is mandatory here, because
% the |\captionof| command needs to know which name to put into the caption label
% (e.g. ``Figure'' or ``Table'') and in which list to put the contents entry.
% An example:
% \begin{quote}
% |\captionof{figure}{A figure}|\\
% |\captionof{table}{A table}|
% \end{quote}
% typesets captions like this:
% \begin{Example}
% \captionof{figure}{A figure}
% \captionsetup{belowskip=\abovecaptionskip}
% \captionof{table}{A table}
% \end{Example}
%
% The star variant |\captionof*| has the same behaviour as the |\caption*| command:
% it typesets the caption without label and without entry to the list of figures
% or tables (if not specified otherwise).
%
% Please use both |\captionof| and |\captionof*| only \emph{inside} environments
% (like |minipage| or |\parbox|), otherwise a page break can appear between content
% and caption. Furthermore some strange effects could occur (e.g., wrong spacing
% around captions).
%
% \DescribeMacro{\ContinuedFloat}
% Sometimes you want to split figures or tables without giving them
% their own reference number. This is what the command
% \begin{quote}
% |\ContinuedFloat|
% \end{quote}
% is for; it should be used as first command inside the floating environment.
% It prevents the increment of the relevant counter so a figure or table
% with a |\ContinuedFloat| in it gets the same reference number as the figure
% or table before.
%
% An example:
% \begin{quote}
% |\begin{table}|\\
% |\caption{A table}|\\
% \ldots\\
% |\end{table}|\\
% \ldots\\
% |\begin{table}\ContinuedFloat|\\
% |\caption{A table (cont.)}|\\
% \ldots\\
% |\end{table}|
% \end{quote}
% gives the following result:
% \begin{Example}
% \makeatletter\def\@captype{table}\makeatother
% \caption[]{A table}
% \centerline{\ldots}
% \ContinuedFloat
% \captionsetup{aboveskip=0pt}
% \caption[]{A table (cont.)}
% \end{Example}
%
% \DescribeMacro{\captionsetup}
% We already know the |\captionsetup| command (see section \ref{usage}:
% \textit{``Using the package''}), but this time we get enlighten about
% the optional argument \meta{float type}.
%
% Remember, the syntax of this command is
% \begin{quote}
% |\captionsetup|\oarg{float type}\marg{options}\quad.
% \end{quote}
%
% If a \meta{float type} gets specified, all the \meta{options} don't
% change anything at this time. Instead they only get marked for a later use,
% when a caption inside of a floating environment of the particular type
% \meta{float type} gets typeset.
% For example
% \begin{quote}
% |\captionsetup[figure]|\marg{options}
% \end{quote}
% forces captions within a |figure| environment to use the given \meta{options}.
%
% Here comes an example to illustrate this:
% \begin{quote}
% |\captionsetup{font=small}|\\
% |\captionsetup[figure]{labelfont=bf}|
% \end{quote}
% gives captions like this:
% \begin{Example}
% \captionsetup{font=small}
% \captionsetup[figure]{labelfont=bf}
% \captionof{figure}[]{A figure}
% \captionsetup{belowskip=\abovecaptionskip}
% \captionof{table}[]{A table}
% \end{Example}
%
% As you see the command |\captionsetup[figure]{labelfont=bf}| only changed
% the font of the figure caption labels, not touching all other ones.
%
% \DescribeMacro{\clearcaptionsetup}
% If you want to get rid of these parameters marked for an automatic use within
% a particular environment you can use the command
% \begin{quote}
% |\clearcaptionsetup|\marg{Typ}\quad.
% \end{quote}
%
% For example |\clearcaptionsetup{figure}| would clear the extra handling in the
% example above:
% \begin{Example}
% \captionsetup{font=small}
% \captionof{figure}[]{A figure}
% \captionsetup{belowskip=\abovecaptionskip}
% \captionof{table}[]{A table}
% \end{Example}
%
% As \meta{float type} you can usually give one of these only two:
% |figure| and |table|.
% But as we will see later some \LaTeX\ packages exist (like the \package{float}
% package for example) who can define additional floating enviroments and these two
% commands also works with them.
%
%
% \pagebreak[3]
% \section{Do it yourself!}
% \label{declare}
%
% A family of commands is provided to allow users to define their own formats.
% This enables information on separators, justification, fonts, and styles to
% be associated with a name and kept in one place
% (these commands need to appear in the document preamble,
% this is the part between |\documentclass| and |\begin{document}|).
%
% \pagebreak[2]
% \DescribeMacro{\DeclareCaptionFormat}
% You can define your own caption formats using the command
% \begin{quote}
% |\DeclareCaptionFormat|\marg{name}\marg{code using \#1, \#2 and \#3}\quad.
% \end{quote}
% At usage the system replaces \#1 with the caption label, \#2 with the
% separator and \#3 with the text. So the standard format |default| is defined
% inside |caption.sty| as
% \begin{quote}
% |\DeclareCaptionFormat{default}{#1#2#3\par}|
% \end{quote}
%
% \DescribeMacro{\DeclareCaptionLabelFormat}
% Likewise you can define your own caption label formats:
% \begin{quote}
% |\DeclareCaptionLabelFormat|\marg{name}\marg{code using \#1 and \#2}
% \end{quote}
% At usage \#1 gets replaced with the name (e.g. ``figure'') and \#2
% gets replaced with the reference number (e.g. ``12'').
%
% \DescribeMacro{\bothIfFirst}
% \DescribeMacro{\bothIfSecond}
% When you define your own caption label formats and use the \package{subfig}
% package\cite{subfig}, too, you must take care of empty caption label names.
% For this purpose the commands
% \begin{quote}
% |\bothIfFirst|\marg{first arg}\marg{second arg}\quad and\\
% |\bothIfSecond|\marg{first arg}\marg{second arg}
% \end{quote}
% are offered. |\bothIfFirst| tests if the first argument is empty,
% |\bothIfSecond| tests if the second argument is empty. If it is so
% both arguments get typeset, otherwise none of them.
%
% For example the standard label format |simple| isn't defined as
% \begin{quote}
% |\DeclareCaptionLabelFormat{simple}{#1 #2}|\quad,
% \end{quote}
% because this could cause an extra space if \#1 is empty. Instead |simple|
% is defined as
% \begin{quote}
% |\DeclareCaptionLabelFormat{simple}{\bothIfFirst{#1}{ }#2}|\quad,
% \end{quote}
% causing the space to appear only if the label name is present.
%
% \pagebreak[3]
% \DescribeMacro{\DeclareCaptionLabelSeparator}
% You can define your own caption label separators with
% \nopagebreak[3]
% \begin{quote}
% |\DeclareCaptionLabelSeparator|\marg{name}\marg{code}\quad.
% \end{quote}
% \nopagebreak[3]
% Again an easy example taken from |caption.sty| itself:
% \nopagebreak[3]
% \begin{quote}
% |\DeclareCaptionLabelSeparator{colon}{: }|
% \end{quote}
% \pagebreak[3]
%
% \DescribeMacro{\DeclareCaptionJustification}
% You can define your own caption justifications with
% \begin{quote}
% |\DeclareCaptionJustification|\marg{name}\marg{code}\quad.
% \end{quote}
% The \meta{code} simply gets typeset just before the caption.
% E.g.~using the justification |raggedright|, which is defined as
% \begin{quote}
% |\DeclareCaptionJustification{raggedright}{\raggedright}|\quad,
% \end{quote}
% yields captions with all lines moved to the left margin.
%
% \DescribeMacro{\DeclareCaptionFont}
% You can define your own caption fonts with
% \begin{quote}
% |\DeclareCaptionFont|\marg{name}\marg{code}\quad.
% \end{quote}
% For example this package defines the options |small| and |bf| as
% \begin{quote}
% |\DeclareCaptionFont{small}{\small}|\quad and\\
% |\DeclareCaptionFont{bf}{\bfseries}|\quad.
% \end{quote}
%
% \DescribeMacro{\DeclareCaptionStyle}
% The best one comes at last: You can define your own caption styles with
% \begin{quote}
% |\DeclareCaptionStyle|\marg{name}\oarg{additional options}\marg{options}
% \end{quote}
% Remember, caption styles are just a collection of suitable options, saved
% under a given name. You can wake up these options at any time with the
% option |style=|\meta{style name}.
%
% All caption styles are based on the default set of options. (See section
% \ref{style}: \textit{``Styles''} for a complete list.) So you only need
% to specify options which are different to them.
%
% If you specify \meta{additional options} they get used in addition when
% the caption fits into a single line and this check was not disabled with
% the option |singlelinecheck=off|.
%
% Again a very easy example taken from |caption.sty|:
% \begin{quote}
% |\DeclareCaptionStyle{default}[justification=centering]{}|
% \end{quote}
%
%
% \subsection{Examples}
%
% If you would like to have a colon \emph{and} a line break as caption
% separator you could define it this way:
% \begin{quote}
% |\DeclareCaptionLabelSeparator{period-newline}{. \newline}|
% \end{quote}
% Selecting this separator with |\captionsetup{labelsep=period-newline}| you
% get captions like this:
% \begin{Example}
% \captionsetup{labelsep=period-newline,labelfont=bf,margin=10pt}
% \captionsetup{aboveskip=0pt}
% \captionof{figure}[]{\figuretext}
% \end{Example}
%
% For short captions---which fit into one single line---this separator
% may not be satisfying, even when the automatically centering process
% is switched off (with |singlelinecheck=off|):
% \begin{Example}
% \captionsetup{labelsep=period-newline,labelfont=bf,margin=10pt,singlelinecheck=0}
% \captionsetup{aboveskip=0pt}
% \captionof{figure}[]{A figure.}
% \end{Example}
%
% An own caption style which selects another caption separator automatically
% puts this right:
% \begin{quote}
% |\DeclareCaptionStyle{period-newline}%|\\
% | [labelsep=period]{labelsep=period-newline}|
% \end{quote}
% \begin{Example}
% \captionsetup{style=period-newline,labelfont=bf,margin=10pt}
% \captionsetup{aboveskip=0pt}
% \captionof{figure}[]{A figure.}
% \end{Example}
% If you would like to keep the centering of these captions an appropriate
% definition is
% \begin{quote}
% |\DeclareCaptionStyle{period-newline}%|\\
% | [labelsep=period,justification=centering]%|\\
% | {labelsep=period-newline}|
% \end{quote}
% Using this definition short captions look like
% \begin{Example}
% \captionsetup{style=period-newline2,labelfont=bf,margin=10pt}
% \captionsetup{aboveskip=0pt}
% \captionof{figure}[]{A figure.}
% \end{Example}
% while long ones still have a line break after the caption label.
%
% \pagebreak[3]
% Another example: You want captions to look like this:
% \begin{Example}
% \captionsetup{format=reverse,labelformat=fullparens,labelsep=fill,font=small,labelfont=it}
% \captionsetup{aboveskip=0pt}
% \captionof{figure}[]{\figuretext}
% \end{Example}
% \pagebreak[2]
% You could do it this way:
% \nopagebreak[3]
% {\leftmargini=10pt
% \begin{quote}
% |\DeclareCaptionFormat{reverse}{#3#2#1}|\\
% |\DeclareCaptionLabelFormat{fullparens}{(\bothIfFirst{#1}{ }#2)}|\\
% |\DeclareCaptionLabelSeparator{fill}{\hfill}|\\
% |\captionsetup{format=reverse,labelformat=fullparens,|\\
% | labelsep=fill,font=small,labelfont=it}|
% \end{quote}}
%
% \pagebreak[3]
% Another example: The caption text should go into the left margin; a possible
% solution would be:
% {\leftmargini=10pt
% \begin{quote}
% |\DeclareCaptionFormat{llap}{\llap{#1#2}#3\par}|\\
% |\captionsetup{format=llap,singlelinecheck=no,|\\
% | labelsep=quad}|
% \end{quote}}
% As a result you would get captions like this:
% \begin{Example}
% \captionsetup{format=llap,singlelinecheck=no,labelsep=quad}
% \captionsetup{aboveskip=0pt}
% \captionof{figure}[]{\figuretext}
% \end{Example}
%
%
% \pagebreak[3]
% \section{Using non-standard document classes}
%
% \NEWdescription{v3.0c}
% The \thispackage\ package was developed using the standard document classes
% |article|, |report| and |book|. But it should work with other document
% classes, too. (If there are any difficulties about a special document class
% please don't hesitate to write me an e-mail. Thank you.)
%
% If you would like to use the \thispackage\ package with the
% \KOMAScript\ classes or with the \package{memoir} class, you have to take
% into consideration that all the possibilities for customization of the
% captions the \KOMAScript\ classes or \package{memoir} class have
% to offer will get lost. (And they have a lot of possibilites to offer!)
% So commands like |\captionabove|, |\captionbelow|, |\captionformat|,
% |\figureformat|, |\tableformat|, |\setcapindent|, |\setcaphanging|,
% |\captionstyle| etc.\ will not work anymore.
% So make a wise decision!
%
%
% \section{Using other packages}
% \label{packages}
%
% The \thispackage\ package contains special adaptions to other packages who
% handle with captions, too, so the captions always should look like you
% have specified them to look like.
%
% These are the packages the \thispackage\ package is adapted to:
%
% \begin{tabular}{ll}
% |float| & Gives you the possibility to define new floating environments\\
% |listings| & Typesets source code listings\\
% |longtable| & Typesets tables spanned over multiple pages\\
% |rotating| & Supports rotated figures and tables\\
% |sidecap| & Offers captions \emph{beside} figures or tables\\
% |supertabular| & Typesets tables spanned over multiple pages\\
% \end{tabular}
%
% \NEWfeature{v3.0b}
% If you use one of the above packages together with the {\thispackage} package
% you get the additional possibility to set up captions with
% \begin{quote}|\captionsetup|\oarg{environment}\marg{options}\quad.\end{quote}
% These options will apply for captions inside these environments automatically.
% For example
% \begin{quote}|\captionsetup[lstlisting]{labelfont=bf}|\end{quote}
% forces captions inside the |lstlisting| environment to have bold labels.
% (Please note that this do not work with the |sideways| environments offered by
% the \package{rotating} package.)
%
% If a certain support is not desired you can switch it off using the
% \thispackage\ package option
% \begin{quote}
% |\usepackage[|\ldots|,|\meta{package}|=no]{caption}|\quad.
% \end{quote}
% For example specifing the option |float=no| means you don't like the
% \thispackage\ package to support the \package{float} package.
% (Note: You can specify these options only within the |\usepackage| command,
% especially \emph{not} at a later time with |\captionsetup|.)
%
% For further information about the supported packages please take a look
% at the documentation belonging to it or buy yourself
% The \LaTeX\ Companion\cite{companion}.
%
%
% \subsection{The \package{float} package}
%
% A very useful feature is provided by the \package{float} package\cite{float}:
% It offers the float placement specifier |H| which is much more restrictive
% than the specifier |h| offered by \LaTeX. While the latter one is only a
% recommendation to \LaTeX\ to set the float ``here'', the |H| forces the
% float to appear exactly at the spot where it occurs in your input file
% and nowhere else.
%
% Furthermore it offers different styles for floating environments, these
% styles are |plain|, |plaintop|, |ruled|, and |boxed|.
% You can link one of these styles to either new floating environments or
% to one of the existing environments |figure| and |table|.
%
% If you are using the \thispackage\ package together with the \package{float}
% package this caption style called |ruled| gets defined automatically:
% \begin{quote}
% |\DeclareCaptionStyle{ruled}{labelfont=bf,labelsep=space}|
% \end{quote}
% This style represents the caption layout in |ruled| styled floats.
% For you as an end user this means that captions within |ruled| floats will
% always look like this, nevertheless what generic caption options do you
% specify:
%
% \ifx\floatstyle\undefined
%
% \begin{Example}
% \hrule height.8pt depth0pt \kern2pt
% \vbox{\strut{\bfseries Program \ref{packages}.1}
% The first program. This hasn't got anything to do with the package
% but is included as an example. Note the \texttt{ruled} float style.}
% \kern2pt\hrule\kern2pt
% \begin{verbatim}
% #include <stdio.h>
%
% int main(int argc, char **argv)
% {
% for (int i = 0; i < argc; ++i)
% printf("argv[%d] = %s\n", i, argv[i]);
% return 0;
% }
% \end{verbatim}
% \kern2pt\hrule\relax
% \end{Example}
%
% \else
%
% \floatstyle{ruled}
% \newfloat{Program}{tbp}{lop}[section]
% \floatname{Program}{Program}
%
% \begin{Program}[H]
% \begin{verbatim}
% #include <stdio.h>
%
% int main(int argc, char **argv)
% {
% for (int i = 0; i < argc; ++i)
% printf("argv[%d] = %s\n", i, argv[i]);
% return 0;
% }
% \end{verbatim}
% \caption{The first program. This hasn't got anything to do with the package
% but is included as an example. Note the \texttt{ruled} float style.}
% \end{Program}
%
% \fi
%
% If you want a different layout for |ruled| captions you have to define
% your own one using the command
% \begin{quote}
% |\DeclareCaptionStyle{ruled}|\marg{options}\quad.
% \end{quote}
%
% This mechanism also works with all other float styles. If you want a special
% caption layout for |plain| or |boxed| floats for example you can simply define
% a suitable caption style with the same name as the float style.
%
%
% \subsection{The \package{listings} package}
%
% \NEWdescription{v3.0b}
% The \package{listings} package\cite{listings} is a source code printer for \LaTeX.
% You can typeset stand alone files as well as listings with an environment
% similar to \texttt{verbatim} as well as you can print code snippets using
% a command similar to |\verb|.
% Many parameters control the output and if your preferred programming
% language isn't already supported, you can make your own definition.
%
% \textbf{Note:} For successful cooperation you need the listings package
% version 1.2 or higher. You'll get an error message when using an
% older version!
%
%
% \subsection{The \package{longtable} package}
%
% The \package{longtable} package\cite{longtable} offers the environment
% |longtable| which behaves similar to the |tabular| environment, but
% the table itself can span multiple pages.
%
%
% \subsection{The \package{rotating} package}
%
% The \package{rotating} package\cite{rotating} offers the floating
% environments \texttt{sideways\-figure} and \texttt{sideways\-table}
% which are just like normal figures and tables but rotated by 90 degree.
% Furthermore they always use a full page on their own.
%
%
% \subsection{The \package{sidecap} package}
%
% \NEWdescription{v3.0b}
% The \package{sidecap} package\cite{sidecap} offers the floating
% environments |SCfigure| and |SCtable| which are like normal figures
% and tables but the caption will be put \emph{beside} the contents.
%
% The \package{sidecap} package offers it's own options for justification.
% If set, they will override the one specified with the caption option
% |justification=| for captions beside their contents.
%
% \DescribeMacro{listof=}
% Using the \package{sidecap} package you will probably notice that
% suppressing the entry in the list of figures or tables with
% |\caption[]{|\ldots|}| won't work inside these environments.
% This is caused by the implementation design of the \package{sidecap}
% package, but you can use |\captionsetup{listof=false}| inside the
% figure or table as an alternative here.
%
% \ifx\SCfigure\undefined
%
% \begin{Example}
% \newsavebox\scbox
% \begin{lrbox}{\scbox}
% \setlength{\unitlength}{.75cm}
% \setlength{\fboxsep}{0pt}
% \fbox{\begin{picture}(4,4)
% \put(1,3){\circle{1}}
% \put(3,3){\circle{1}}
% \put(2,2){\circle{1}}
% \put(1,1){\circle{1}}
% \put(3,1){\circle{1}}
% \end{picture}}
% \end{lrbox}
% \newlength\scboxwidth
% \setlength\scboxwidth{\wd\scbox}
% \makebox[\linewidth][c]{
% \parbox[b]{\scboxwidth}{\unhbox\scbox}
% \hspace\marginparsep
% \parbox[b]{1.5\scboxwidth}{
% \captionsetup{justification=RaggedRight,labelfont=bf}
% \captionof{figure}[]{A small example with the caption beside the figure.}
% }
% }
% \end{Example}
%
% \else
%
% \captionsetup{labelfont=bf}
% \begin{SCfigure}[1.5][!ht]
% \setlength{\unitlength}{.75cm}
% \setlength{\fboxsep}{0pt}
% \fbox{\begin{picture}(4,4)
% \put(1,3){\circle{1}}
% \put(3,3){\circle{1}}
% \put(2,2){\circle{1}}
% \put(1,1){\circle{1}}
% \put(3,1){\circle{1}}
% \end{picture}}
% \iffalse
% \captionsetup{labelfont=bf}
% \fi
% \caption[]{A small example with the caption beside the figure.}
% \end{SCfigure}
% \captionsetup{labelfont=default}
%
% \fi
%
%
% \subsection{The \package{supertabular} package}
%
% The \package{supertabular} package\cite{supertabular} offers the environment
% |supertabular| which is quite similar to the |longtable| environment provided
% by the \package{longtable} package. Both offers the typesetting of tables
% which can span multiple pages. For a detailed discussion about the
% differences between these powerful packages please take a look at
% The \LaTeX\ Companion\cite{companion}.
%
%
% \subsection{Known incompatibilities}
%
% \NEWdescription{v3.0b}
% Using the \thispackage\ package together with one of the following packages
% is not recommended; usually this would cause unwanted side effects or even
% errors:
% \begin{quote}
% \package{ccaption}, \package{hvfloat}, \package{nonfloat}
% \end{quote}
%
% Furthermore using the \package{hypcap} package will cause major limitations:
% All extensions to the |\caption| command gets lost, the option |labelformat=|
% is not working at all and local settings done with
% |\captionsetup[|\ldots|]{|\ldots|}| lead not to the desired results.
% This is caused by the implementation design of the \package{hypcap} package,
% see section 1.3 ``Limitations'' of the \package{hypcap} documentation for
% details.
%
%
% \section{Compatibility to older versions}
%
% \subsection{\thispackage\ version $1.x$}
%
% This version of the \thispackage\ package still supports the old options
% and commands provided by the version $1.x$ of this package. So there
% shouldn't occur any problems compiling old documents, but please don't mix
% old options and commands with the new ones. This isn't supported and can
% yield to ugly side effects.
%
% Here comes a short oversight of the old options and commands and how they
% are replaced within this version of the \thispackage\ package:
%
% \begin{small}\begin{longtable}{ll}
% \thispackage\ $1.\mathit{x}$ & \thispackage\ $3.\mathit{x}$\\
% \hline
% \endhead
% |normal| & |format=default|\\
% |hang| & |format=hang|\\
% |isu| & |format=hang|\\
% |center| & |justification=centering|\\
% |centerlast| & |justification=centerlast|\\
% |anne| & |justification=centerlast|\\
% |nooneline| & |singlelinecheck=off|\\
% |scriptsize| & |font=scriptsize|\\
% |footnotesize| & |font=footnotesize|\\
% |small| & |font=small|\\
% |normalsize| & |font=normalsize|\\
% |large| & |font=large|\\
% |Large| & |font=Large|\\
% |up| & |labelfont=up|\\
% |it| & |labelfont=it|\\
% |sl| & |labelfont=sl|\\
% |sc| & |labelfont=sc|\\
% |md| & |labelfont=md|\\
% |bf| & |labelfont=bf|\\
% |rm| & |labelfont=rm|\\
% |sf| & |labelfont=sf|\\
% |tt| & |labelfont=tt|\\
% |\setlength{\captionmargin}| & |margin=|\meta{amount}\\
% |\renewcommand{\captionfont}| & |\DeclareCaptionFont|\\
% & $+$ |\captionsetup{font=|\meta{name}|}|\\
% |\renewcommand{\captionsize}| & |\DeclareCaptionFont|\\
% & $+$ |\captionsetup{font=|\meta{name}|}|\\
% |\renewcommand{\captionlabelfont}| & |\DeclareCaptionLabelFont|\\
% & $+$ |\captionsetup{labelfont=|\meta{name}|}|\\
% \end{longtable}\end{small}
%
%
% \subsection{\package{caption2} version $2.x$}
%
% Although they do very similar stuff the packages \package{caption} and
% \package{caption2} have a very different implementation design. So this
% version of the \thispackage\ package isn't compatible to the
% \package{caption2} package at all. Of course for compiling old documents
% you can still use the \package{caption2} package, the latest version
% is provided with this package. But newly created documents shouldn't use
% the \package{caption2} package, please use the \thispackage\ package
% instead as described in this manual.
%
% \iffalse
% TODO: Table like the "caption 1.x => caption 3.x" one
% \fi
%
%
% \pagebreak[3]
% \section{Further reading}
%
% I recommend the following documents for further reading:
%
% \begin{itemize}
% \item
% The \TeX\ FAQ - Frequently asked questions about \TeX\ and \LaTeX :
% \begin{quote}\texttt{http://faq.tug.org/}\end{quote}
%
% \item
% A French FAQ can be found at
% \begin{quote}\texttt{http://www.grappa.univ-lille3.fr/FAQ-LaTeX/}\end{quote}
%
% \item
% \textsf{epslatex} from Keith Reckdahl contains many tips around
% graphics in \LaTeXe. You will find this document in the directory
% \begin{quote}\texttt{ftp://ftp.ctan.org/pub/tex/info/}\end{quote}
% as \texttt{epslatex.ps} and \texttt{epslatex.pdf}.
%
% There is also a french translation available:
% \begin{quote}\texttt{ftp://ftp.ctan.org/pub/tex/info/fepslatex.ps}\end{quote}
% \end{itemize}
%
%
% \section{Thanks}
%
% I would like to thank Katja Melzner, Steven D. Cochran,
% Frank Mittelbach, David Carlisle, and Ivor Tiefenbrun.
%
%
% \changes{v1.0}{27 Oct 94}{First release}
% \changes{v1.1}{ 3 Nov 94}{New captiontype \cs{centerlast}}
% \changes{v1.2}{28 Nov 94}{Support of the {\sf float} package}
% \changes{v1.3}{ 8 Jan 95}{Support of \cs{captionlabelfont} in subcaptions}
% \changes{v1.4}{30 Jan 95}{New option \cs{nooneline}}
% \changes{v3.0}{10 Jul 03}{Rewritten; many new commands and features}
% \changes{v3.0a}{22 Jan 04}{Some bugfixes and small design changes}
% \changes{v3.0b}{14 May 04}{Some bugfixes and small improvements}
% \changes{v3.0c}{15 Jul 04}{Bugfix regarding rotating and sidecap package support}
%
% \StopEventually{\begin{thebibliography}{9}
% \bibitem{companion}
% Frank Mittelbach and Michel Goossens:
% \newblock {\em The {\LaTeX} Companion (2nd.~Ed.)},
% \newblock Addison-Wesley, 2004.
%
% \bibitem{float}
% Anselm Lingnau:
% \emph{An Improved Environment for Floats},
% 2001/11/08
%
% \bibitem{listings}
% Carsten Heinz:
% \emph{The Listings Package},
% 2004/02/13
%
% \bibitem{longtable}
% David Carlisle:
% \emph{The longtable package},
% 2000/10/22
%
% \bibitem{rotating}
% Sebastian Rahtz and Leonor Barroca:
% \emph{A style option for rotated objects in \LaTeX},
% 1997/09/26
%
% \bibitem{sidecap}
% Rolf Niepraschk und Hubert G\"a\ss lein:
% \emph{The sidecap package},
% 2003/06/06
%
% \bibitem{subfig}
% Steven D. Cochran:
% \emph{The subfig package},
% 2004/01/16
%
% \bibitem{supertabular}
% Johannes Braams und Theo Jurriens:
% \emph{The supertabular environment},
% 2002/07/19
% \end{thebibliography}}
%
% \DoNotIndex{\\,\_,\ ,\@@par}
% \DoNotIndex{\@classoptionslist,\@currext,\@currname}
% \DoNotIndex{\@ehc,\@ehd,\@empty,\@expandtwoargs}
% \DoNotIndex{\@for,\@firstofone,\@firstoftwo}
% \DoNotIndex{\@gobble,\@gobblefour,\@gobbletwo,\@hangfrom}
% \DoNotIndex{\@ifnextchar,\@ifstar,\@ifundefined,\@latex@error}
% \DoNotIndex{\@namedef,\@nameuse}
% \DoNotIndex{\@onlypreamble,\@parboxrestore,\@plus,\@ptionlist}
% \DoNotIndex{\@removeelement,\@restorepar,\@secondoftwo,\@setpar}
% \DoNotIndex{\@tempa,\@tempboxa,\@tempdima,\@tempb,\@tempc}
% \DoNotIndex{\@undefined,\@unprocessedoptions,\@unusedoptionlist}
% \DoNotIndex{\p@,\z@}
% \DoNotIndex{\active,\addtocounter,\addtolength,\advance}
% \DoNotIndex{\baselineskip,\begin,\begingroup,\bfseries,\box}
% \DoNotIndex{\catcode,\centering,\changes,\csname,\def,\divide,\do,\downarrow}
% \DoNotIndex{\edef,\else,\empty,\end,\endcsname,\endgraf,\endgroup,\expandafter}
% \DoNotIndex{\fi,\footnotesize,\global}
% \DoNotIndex{\hangindent,\hbox,\hfil,\hsize,\hskip,\hspace,\hss}
% \DoNotIndex{\ifcase,\ifdim,\ifnum,\ifodd,\ifvoid,\ifvmode}
% \DoNotIndex{\ifx,\ignorespaces,\itshape}
% \DoNotIndex{\Large,\large,\leavevmode,\leftmargini,\leftskip,\let,\linewidth}
% \DoNotIndex{\llap,\long,\m@ne,\margin,\mdseries,\message}
% \DoNotIndex{\newcommand,\newdimen,\newlength,\newline,\newif,\newsavebox}
% \DoNotIndex{\next,\nobreakspace,\noexpand,\noindent,\numberline}
% \DoNotIndex{\normalsize,\or,\par,\parbox,\parfillskip}
% \DoNotIndex{\parindent,\parskip,\prevdepth,\protect,\protected@edef,\providecommand}
% \DoNotIndex{\quad}
% \DoNotIndex{\raggedleft,\raggedright,\relax,\renewcommand,\RequirePackage}
% \DoNotIndex{\rightskip,\rmfamily}
% \DoNotIndex{\sbox,\scriptsize,\scshape,\setbox,\setlength,\sffamily,\slshape}
% \DoNotIndex{\small,\string,\space,\strut}
% \DoNotIndex{\textheight,\the,\toks@,\typeout,\ttfamily}
% \DoNotIndex{\unvbox,\uparrow,\upshape,\usebox,\usepackage}
% \DoNotIndex{\vbox,\vsize,\vskip,\wd,\width,\z@skip}
% \DoNotIndex{\AtBeginDocument,\AtEndOfPackage,\CurrentOption,\DeclareOption}
% \DoNotIndex{\ExecuteOptions,\GenericWarning,\IfFileExists,\InputIfFileExists}
% \DoNotIndex{\NeedsTeXFormat,\MessageBreak}
% \DoNotIndex{\PackageError,\PackageInfo,\PackageWarning,\PackageWarningNoLine}
% \DoNotIndex{\ProcessOptions,\ProvidesPackage}
%
% \clearpage
% \setlength{\parskip}{0pt plus 1pt}
%
% \section{The Implementation}
% \iffalse
%<*package>
% \fi
%
% I'm sorry for the missing code documentation, I will do this ASAP.
%
% \begin{macrocode}
%
% Identification
%
\NeedsTeXFormat{LaTeX2e}[1994/12/01]
\ProvidesPackage{caption}[2004/07/16 v3.0c Customising captions (AS)]
% \end{macrocode}
%
% \subsection{Kernel}
%
% \begin{macrocode}
%\NeedsTeXFormat{LaTeX2e}[1994/12/01]
%\ProvidesPackage{caption3}[2004/xx/xx v3.1 caption3 kernel (AS)]
%
% Helpers
%
\providecommand*\@nameundef[1]{%
\expandafter\let\csname #1\endcsname\@undefined}
%
\providecommand\l@addto@macro[2]{%
\begingroup
\toks@\expandafter{#1#2}%
\edef\@tempa{\endgroup\def\noexpand#1{\the\toks@}}%
\@tempa}
%
\def\bothIfFirst#1#2{%
\protected@edef\caption@tempa{#1}%
\ifx\caption@tempa\@empty\else
#1#2%
\fi}
\def\bothIfSecond#1#2{%
\protected@edef\caption@tempa{#2}%
\ifx\caption@tempa\@empty\else
#1#2%
\fi}
%
\def\caption@ifinlist#1#2{%
\let\next\@secondoftwo
\edef\caption@tempa{#1}%
\@for\caption@tempb:={#2}\do{%
\ifx\caption@tempa\caption@tempb
\let\next\@firstoftwo
\fi}%
\next}
%
% Setting boolean options:
% \caption@setbool{<name>}{<value> = false/true/no/yes/off/on/0/1}
% \caption@ifbool{<name>}{<if-clause>}{<else-clause>}
%
\def\caption@setbool#1#2{%
\caption@ifinlist{#2}{1,true,yes,on}{%
\expandafter\let\csname caption@if#1\endcsname\@firstoftwo
}{\caption@ifinlist{#2}{0,false,no,off}{%
\expandafter\let\csname caption@if#1\endcsname\@secondoftwo
}{%
\PackageError{caption}{Undefined boolean value `#2'}{\caption@eh}%
}}}
%
\def\caption@ifbool#1{\@nameuse{caption@if#1}}
%
% Obsolete stuff for compatiblity to caption.sty v1.3
%
% \changes{v3.0a}{16 Jul 04}{Minimum adaption to the memoir class}
\providecommand\captionsize{}% changed v3.0a+c
%
% Margin resp. width
%
\newdimen\captionmargin
\newdimen\captionwidth
\newif\ifcaption@width
\newcommand\caption@setmargin{%
\caption@widthfalse
\setlength\captionmargin}
\newcommand\caption@setwidth{%
\caption@widthtrue
\setlength\captionwidth}
%
% Indentions
%
\newdimen\captionindent
\newdimen\captionparindent
\newdimen\captionhangindent
%
% Support of \caption*
%
\newif\ifcaption@star
%
% Vertical spaces before/after captions
%
\@ifundefined{abovecaptionskip}{%
\newlength\abovecaptionskip\setlength\abovecaptionskip{10\p@}}{}
\@ifundefined{belowcaptionskip}{%
\newlength\belowcaptionskip\setlength\belowcaptionskip{0\p@}}{}
%
% Error
%
\newcommand\caption@eh{%
If you do not understand this error, please take a closer look\MessageBreak
at the documentation of the `caption' package.\MessageBreak
\@ehc}
%
% Loading the keyval package
% (We need it for option handling)
%
\RequirePackage{keyval}[1997/11/10]
\providecommand*\undefine@key[2]{%
\@nameundef{KV@#1@#2}\@nameundef{KV@#1@#2@default}}
%
% Reset to default parameters
% (Note that this does not touch the skips and the positioning.)
%
\newcommand\caption@setdefault{\captionsetup{%
format=default,labelformat=default,labelsep=default,justification=default,%
font=default,labelfont=default,textfont=default,%
margin=0pt,indention=0pt,parindent=0pt,hangindent=0pt,singlelinecheck}}
%
% \DeclareCaptionStyle{<name>}[<additional(!) single-line-list-of-KV>]{<list-of-KV>}
% \caption@setstyle{<name>}
%
% (Bugfix v3.0a: We pass through argument #3 so extra spaces between the
% arguments do make any harm.)
%
\newcommand*\DeclareCaptionStyle[1]{%
\@ifnextchar[{\caption@declarestyle{#1}}{\caption@declarestyle{#1}[]}}
\def\caption@declarestyle#1[#2]#3{% bugfixed v3.0a
\global\@namedef{caption@sls@#1}{#2}%
\global\@namedef{caption@sty@#1}{#3}}
\@onlypreamble\DeclareCaptionStyle
\@onlypreamble\caption@declarestyle
%
\newcommand*\caption@setstyle[1]{%
\@ifundefined{caption@sty@#1}%
{\PackageError{caption}{Undefined caption style `#1'}{\caption@eh}}%
{\expandafter\let\expandafter\caption@sls\csname caption@sls@#1\endcsname
\caption@setdefault\caption@esetup{\csname caption@sty@#1\endcsname}}}
%
% Pre-defined styles
%
\DeclareCaptionStyle{default}[justification=centering]{}
%
% \DeclareCaptionFormat{<name>}{<code with #1, #2, and #3>}
% \caption@setformat{<name>}
%
\newcommand\DeclareCaptionFormat[2]{% bugfixed v3.0a
\global\long\expandafter\def\csname caption@fmt@#1\endcsname##1##2##3{#2}}
\@onlypreamble\DeclareCaptionFormat
%
\newcommand*\caption@setformat[1]{%
\@ifundefined{caption@fmt@#1}%
{\PackageError{caption}{Undefined caption format `#1'}{\caption@eh}}%
{\expandafter\let\expandafter\caption@fmt\csname caption@fmt@#1\endcsname}}
%
% Pre-defined formats
%
\DeclareCaptionFormat{normal}{#1#2#3\par}
\DeclareCaptionFormat{hang}{%
\@hangfrom{#1#2}%
\advance\captionparindent\hangindent
\advance\captionhangindent\hangindent
\caption@@par
#3\par}
\def\caption@fmt@default{\caption@fmt@normal}
%
% \DeclareCaptionLabelFormat{<name>}{<code with #1 and #2>}
% \caption@setlabelformat{<name>}
%
\newcommand*\DeclareCaptionLabelFormat[2]{% bugfixed v3.0a
\global\expandafter\def\csname caption@lfmt@#1\endcsname##1##2{#2}}
\@onlypreamble\DeclareCaptionLabelFormat
%
\newcommand*\caption@setlabelformat[1]{%
\@ifundefined{caption@lfmt@#1}%
{\PackageError{caption}{Undefined caption label format `#1'}{\caption@eh}}%
{\expandafter\let\expandafter\caption@lfmt\csname caption@lfmt@#1\endcsname}}
%
% Pre-defined label formats
%
\DeclareCaptionLabelFormat{empty}{}
\DeclareCaptionLabelFormat{simple}{\bothIfFirst{#1}{\nobreakspace}#2}
\DeclareCaptionLabelFormat{parens}{\bothIfFirst{#1}{\nobreakspace}(#2)}
\def\caption@lfmt@default{\caption@lfmt@simple}
%
% \DeclareCaptionLabelSeparator{<name>}{<code>}
% \caption@setlabelseparator{<name>}
%
\newcommand\DeclareCaptionLabelSeparator[2]{% bugfixed v3.0a
\global\long\@namedef{caption@lsep@#1}{#2}}
\@onlypreamble\DeclareCaptionLabelSeparator
%
\newcommand*\caption@setlabelseparator[1]{%
\@ifundefined{caption@lsep@#1}%
{\PackageError{caption}{Undefined caption label separator `#1'}{\caption@eh}}%
{\expandafter\let\expandafter\caption@lsep\csname caption@lsep@#1\endcsname}}
%
% Pre-defined label separators
%
\DeclareCaptionLabelSeparator{none}{}
\DeclareCaptionLabelSeparator{colon}{: }
\DeclareCaptionLabelSeparator{period}{. }
\DeclareCaptionLabelSeparator{space}{ }
\DeclareCaptionLabelSeparator{quad}{\quad}
\DeclareCaptionLabelSeparator{newline}{\newline}
\DeclareCaptionLabelSeparator{widespace}{\hspace{1em plus .3em}}% obsolete, do not use!
\def\caption@lsep@default{\caption@lsep@colon}
%
% \DeclareCaptionJustification{<name>}{<code>}
% \caption@setjustification{<name>}
%
\newcommand*\DeclareCaptionJustification[2]{% bugfixed v3.0a
\global\@namedef{caption@hj@#1}{#2}}
\@onlypreamble\DeclareCaptionJustification
%
\newcommand*\caption@setjustification[1]{%
\@ifundefined{caption@hj@#1}%
{\PackageError{caption}{Undefined caption justification `#1'}{\caption@eh}}%
{\expandafter\let\expandafter\caption@hj\csname caption@hj@#1\endcsname}}
%
% Pre-defined justifications
%
\newcommand\caption@centerfirst{%
\edef\caption@normaladjust{%
\leftskip\the\leftskip
\rightskip\the\rightskip
\parfillskip\the\parfillskip\relax}%
\leftskip\z@\@plus -1fil%
\rightskip\z@\@plus 1fil%
\parfillskip\z@skip
\noindent\hskip\z@\@plus 2fil%
\@setpar{\@@par\@restorepar\caption@normaladjust}}
\newcommand\caption@centerlast{%
\leftskip\z@\@plus 1fil%
\rightskip\z@\@plus -1fil%
\parfillskip\z@\@plus 2fil\relax}
%
\DeclareCaptionJustification{justified}{}
\DeclareCaptionJustification{centering}{\centering}
\DeclareCaptionJustification{centerfirst}{\caption@centerfirst}
\DeclareCaptionJustification{centerlast}{\caption@centerlast}
\DeclareCaptionJustification{raggedleft}{\raggedleft}
\DeclareCaptionJustification{raggedright}{\raggedright}
\def\caption@hj@default{\caption@hj@justified}
%
% ragged2e package support (improved for v3.0b)
% ---------------------------------------------
\DeclareCaptionJustification{Centering}{%
\caption@ragged\Centering\centering}
\DeclareCaptionJustification{RaggedLeft}{%
\caption@ragged\RaggedLeft\raggedleft}
\DeclareCaptionJustification{RaggedRight}{%
\caption@ragged\RaggedRight\raggedright}
%
\newcommand*\caption@ragged[2]{%
\@ifundefined{caption\string#1}{%
\PackageWarning{caption}{%
Cannot locate the `ragged2e' package, therefore\MessageBreak
substituting \string#2 for \string#1\MessageBreak}%
\global\@namedef{caption\string#1}}{}%
#2}
%
\AtBeginDocument{\IfFileExists{ragged2e.sty}{%
\RequirePackage{ragged2e}\let\caption@ragged\@firstoftwo}{}}
% ---------------------------------------------
%
% \DeclareCaptionFont{<name>}{<code>}
% \caption@setfont{<command>}{<keyval-list of names>}
%
\newcommand\DeclareCaptionFont[2]{% bugfixed v3.0a
\define@key{caption@fnt}{#1}[]{\g@addto@macro\caption@tempa{#2}}}
\@onlypreamble\DeclareCaptionFont
%
\newcommand*\caption@setfont[2]{%
\let\caption@tempa\@empty
\begingroup
\setkeys{caption@fnt}{#2}%
\endgroup
\expandafter\let\csname caption#1\endcsname\caption@tempa}
%
% Pre-defined fonts
%
\DeclareCaptionFont{default}{}
%
\DeclareCaptionFont{scriptsize}{\scriptsize}
\DeclareCaptionFont{footnotesize}{\footnotesize}
\DeclareCaptionFont{small}{\small}
\DeclareCaptionFont{normalsize}{\normalsize}
\DeclareCaptionFont{large}{\large}
\DeclareCaptionFont{Large}{\Large}
%
\DeclareCaptionFont{up}{\upshape}
\DeclareCaptionFont{it}{\itshape}
\DeclareCaptionFont{sl}{\slshape}
\DeclareCaptionFont{sc}{\scshape}
\DeclareCaptionFont{md}{\mdseries}
\DeclareCaptionFont{bf}{\bfseries}
\DeclareCaptionFont{rm}{\rmfamily}
\DeclareCaptionFont{sf}{\sffamily}
\DeclareCaptionFont{tt}{\ttfamily}
%
% Position (default(=bottom)/bottom/top/auto)
% ONLY DEFAULT, BOTTOM AND TOP ARE DOCUMENTED YET!
%
\newcommand*\caption@setposition[1]{% improved v3.0a
\caption@ifinlist{#1}{t,top,above}{%
\let\caption@position\@firstoftwo
}{\caption@ifinlist{#1}{b,bottom,below,default}{%
\let\caption@position\@secondoftwo
}{\caption@ifinlist{#1}{a,auto}{%
\let\caption@position\@undefined
}{%
\PackageError{caption}{Undefined caption position `#1'}{\caption@eh}%
}}}}
%
% \captionsetup[<type>]{<keyval-list of options>}
% \caption@settype{<type>}
%
% If `type' is set, we simply save or append the option list,
% otherwise we `execute' it with \setkeys
% \changes{v3.0a}{17 Jan 04}{Missing percent added}
%
\def\captionsetup{\@ifnextchar[\caption@setuptype\caption@setup}
\def\caption@setuptype[#1]#2{% bugfixed v3.0a
\@ifundefined{caption@typ@#1}%
{\@namedef{caption@typ@#1}{#2}}%
{\expandafter\l@addto@macro\csname caption@typ@#1\endcsname{,#2}}}
\def\caption@setup{\setkeys{caption}}
%
\def\caption@esetup#1{%
\edef\caption@tempa{\noexpand\caption@setup{#1}}%
\caption@tempa}
%
% Setting up caption type: Simply execute the saved option list
% (For use inside \@caption, \LT@makecaption etc.)
%
\def\caption@settype#1{%
\@ifundefined{caption@typ@#1}{}{%
\caption@esetup{\csname caption@typ@#1\endcsname}}}%
\let\caption@setfloattype\caption@settype% new v3.0a
%
% \clearcaptionsetup{<type>}
%
\newcommand*\clearcaptionsetup[1]{\@nameundef{caption@typ@#1}}
%
% \showcaptionsetup[<package>]{<type>}
% (Note: The optional argument is not documented!)
%
\newcommand*\showcaptionsetup[2][]{%
\def\caption@tempa{#1}%
\ifx\caption@tempa\@empty
\def\caption@tempa{Caption\space}%
\else
\def\caption@tempa{#1 Caption\space}%
\fi
\GenericWarning{\caption@tempa}{%
\caption@tempa Info: KV list on `#2'\MessageBreak
Data: (%
\@ifundefined{caption@typ@#2}{%
% Empty -- print nothing.
}{%
\@nameuse{caption@typ@#2}%
}%
)}}
%
% Hooks (not documented yet...)
%
\newcommand\caption@beginhook{}
\newcommand\caption@endhook{}
\newcommand\AtBeginCaption{\l@addto@macro\caption@beginhook}
\newcommand\AtEndCaption{\l@addto@macro\caption@endhook}
%
% We declare options using the keyval package...
%
% \DeclareCaptionOption{<option>}{<code>}
% \DeclareCaptionOption*{<option>}{<code>}
%
\newcommand\DeclareCaptionOption{%
\@ifstar{\caption@declareoption\AtEndOfPackage}{\caption@declareoption\@gobble}}
\newcommand*\caption@declareoption[2]{%
#1{\undefine@key{caption}{#2}}\define@key{caption}{#2}}
\@onlypreamble\DeclareCaptionOption
\@onlypreamble\caption@declareoption
%
% ...and here comes the options
%
\DeclareCaptionOption{default}[]{%
\caption@setup{style=default,position=default,aboveskip=10pt,belowskip=0pt}}
%
\DeclareCaptionOption{style}{\caption@setstyle{#1}}
\DeclareCaptionOption{format}{\caption@setformat{#1}}
\DeclareCaptionOption{labelformat}{\caption@setlabelformat{#1}}
\DeclareCaptionOption{labelsep}{\caption@setlabelseparator{#1}}
\DeclareCaptionOption{labelseparator}{\caption@setlabelseparator{#1}}
\DeclareCaptionOption{justification}{\caption@setjustification{#1}}
\DeclareCaptionOption{size}{\caption@setfont{size}{#1}}% changed v3.0a
\DeclareCaptionOption{font}{\caption@setfont{font}{#1}}
\DeclareCaptionOption{labelfont}{\caption@setfont{labelfont}{#1}}
\DeclareCaptionOption{textfont}{\caption@setfont{textfont}{#1}}
\DeclareCaptionOption{margin}{\caption@setmargin{#1}}
\DeclareCaptionOption{width}{\caption@setwidth{#1}}
\DeclareCaptionOption{indent}[\leftmargini]{\setlength\captionindent{#1}}
\DeclareCaptionOption{indention}[\leftmargini]{\setlength\captionindent{#1}}
\DeclareCaptionOption{parindent}[\parindent]{\setlength\captionparindent{#1}}% changed v3.0b
\DeclareCaptionOption{hangindent}[0pt]{\setlength\captionhangindent{#1}}% changed v3.0b
\DeclareCaptionOption{parskip}[5pt]{\AtBeginCaption{\setlength\parskip{#1}}}
%
\DeclareCaptionOption{singlelinecheck}[1]{\caption@setbool{slc}{#1}}
\DeclareCaptionOption{aboveskip}{\setlength\abovecaptionskip{#1}}
\DeclareCaptionOption{belowskip}{\setlength\belowcaptionskip{#1}}
\DeclareCaptionOption{position}{\caption@setposition{#1}}
\DeclareCaptionOption{listof}{\caption@setbool{lof}{#1}}% new v3.0b
%
\DeclareCaptionOption{debug}{\def\caption@debug{#1}}
%
% Initialize options
%
\captionsetup{style=default,position=default,listof=1,debug=0}
%
% \caption@fixposition
% \caption@autoposition (new in 3.0b)
%
\newcommand\caption@fixposition{%
\ifx\caption@position\@undefined
\caption@autoposition
\fi}
\newcommand\caption@autoposition{% bugfixed v3.0a
\ifvmode
\ifodd\caption@debug\relax
\edef\caption@tempa{\the\prevdepth}%
\PackageInfo{caption}{\protect\prevdepth=\caption@tempa}%
\fi
%
% \caption@setposition{\ifdim\prevdepth>-\p@ b\else t\fi}%
\ifdim\prevdepth>-\p@
\let\caption@position\@secondoftwo
\else
\let\caption@position\@firstoftwo
\fi
\else
\ifodd\caption@debug\relax
\PackageInfo{caption}{no \protect\prevdepth}%
\fi
%
% \caption@setposition{b}%
\let\caption@position\@secondoftwo
\fi}
%
% \caption@iftop{<true-code>}{<false-code>}
% (If \caption@position is not set we assume a "bottom" position.)
%
\newcommand\caption@iftop{% bugfixed v3.0a
\ifx\caption@position\@firstoftwo
\expandafter\@firstoftwo
\else
\expandafter\@secondoftwo
\fi}
%
% Typeset caption
%
\newcommand\caption@make[2]{%
\caption@@make{\caption@lfmt{#1}{#2}}}
%
\newcommand\caption@@make[2]{%
\caption@beginhook
%
\caption@calcmargin
\advance\captionmargin by \captionindent
\advance\captionwidth by -\captionindent
\hskip\captionmargin
\vbox{\hsize=\captionwidth
% Bugfix v3.0b
\ifdim\captionindent=\z@\else
\hskip-\captionindent
\fi
%
% Special single-line treatment
%
\caption@ifslc{%
\ifx\caption@sls\@empty\else
\caption@beginslc
\sbox\@tempboxa{\caption@@@make{#1}{#2}}%
\ifdim\wd\@tempboxa >\hsize
\caption@endslc
\else
\caption@endslc
\caption@esetup\caption@sls
\fi
\fi}{}%
%
\captionsize\captionfont\strut
\caption@@@make{#1}{#2}}%
%
\caption@endhook
\global\caption@starfalse}
%
% Calculate \captionmargin & \captionwidth
%
\newcommand\caption@calcmargin{%
\ifcaption@width
\captionmargin\hsize
\advance\captionmargin by -\captionwidth
\divide\captionmargin by 2
\else
\captionwidth\hsize
\advance\captionwidth by -2\captionmargin
\fi
%
\ifodd\caption@debug\relax
\PackageInfo{caption}{\protect\hsize=\the\hsize,
\protect\margin=\the\captionmargin,
\protect\width=\the\captionwidth}%
\fi}
%
% Re-define anything which would disturb the single line check
% Bugfix v3.0b: re-definition of \label was missing here
% Improvement v3.0b: Better solution
%
\newcommand\caption@beginslc{%
\begingroup
\let\label\@gobble\let\@footnotetext\@gobble
\def\stepcounter##1{\advance\csname c@##1\endcsname\@ne\relax}}
% - or -
% \edef\caption@restore{%
% \noexpand\setcounter{footnote}{\the\value{footnote}}%
% \noexpand\setcounter{mpfootnote}{\the\value{mpfootnote}}}
\newcommand\caption@endslc{%
% \caption@restore
\endgroup}
%
% Typeset caption paragraph
%
\newcommand\caption@@@make[2]{%
%
% |\caption*|? Use no caption label and separator!
%
\ifcaption@star
\let\caption@lfmt\@gobbletwo
\let\caption@lsep\relax
\fi
%
% Empty text? Use no caption label separator!
%
\def\caption@tempa{#2}%
\def\caption@tempb{\ignorespaces}%
\ifx\caption@tempa\caption@tempb
\let\caption@tempa\@empty
\fi
\ifx\caption@tempa\@empty
\let\caption@lsep\relax
\fi
%
% Typeset the caption!
%
\def\caption@@par{%
\parindent\captionparindent\hangindent\captionhangindent}%
\@setpar{\@@par\caption@@par}\caption@@par
%
% (Bugfixed in v3.0b: \allowhyphens added)
\caption@hj\captionsize\captionfont
\caption@fmt{{\captionlabelfont#1}}%
{{\captionlabelfont\caption@lsep}}%
{{\captiontextfont\nobreak\hskip\z@skip#2\par}}}
% \end{macrocode}
%
% \subsection{Package}
%
% \begin{macrocode}
%\NeedsTeXFormat{LaTeX2e}[1994/12/01]
%\ProvidesPackage{caption}[2004/xx/xx v3.1 Customising captions (AS)]
%\RequirePackage{caption3}
%
% Add option for loading configuration file
%
\DeclareCaptionOption{config}[caption]{%
\InputIfFileExists{#1.cfg}{\typeout{*** Local configuration file
#1.cfg used ***}}%
{\PackageWarning{caption}{Configuration
file #1.cfg not found}}}
%
% \changes{v3.0a}{9 Jan 04}{Options `figureposition' and `tableposition' added}
\DeclareCaptionOption*{figureposition}{\captionsetup[figure]{position=#1}}% new v3.0a
\DeclareCaptionOption*{tableposition}{\captionsetup[table]{position=#1}}% new v3.0a
%
% Simulation of the old (caption v1.x) options:
%
\DeclareCaptionOption*{normal}[]{\caption@setformat{normal}}
\DeclareCaptionOption*{isu}[]{\caption@setformat{hang}}
\DeclareCaptionOption*{hang}[]{\caption@setformat{hang}}
\DeclareCaptionOption*{center}[]{\caption@setjustification{centering}}
\DeclareCaptionOption*{anne}[]{\caption@setjustification{centerlast}}
\DeclareCaptionOption*{centerlast}[]{\caption@setjustification{centerlast}}
%
\DeclareCaptionOption*{nooneline}[]{\caption@setbool{slc}{0}}
%
\DeclareCaptionOption*{scriptsize}[]{\def\captionfont{\scriptsize}}
\DeclareCaptionOption*{footnotesize}[]{\def\captionfont{\footnotesize}}
\DeclareCaptionOption*{small}[]{\def\captionfont{\small}}
\DeclareCaptionOption*{normalsize}[]{\def\captionfont{\normalsize}}
\DeclareCaptionOption*{large}[]{\def\captionfont{\large}}
\DeclareCaptionOption*{Large}[]{\def\captionfont{\Large}}
%
\DeclareCaptionOption*{up}[]{\l@addto@macro\captionlabelfont\upshape}
\DeclareCaptionOption*{it}[]{\l@addto@macro\captionlabelfont\itshape}
\DeclareCaptionOption*{sl}[]{\l@addto@macro\captionlabelfont\slshape}
\DeclareCaptionOption*{sc}[]{\l@addto@macro\captionlabelfont\scshape}
\DeclareCaptionOption*{md}[]{\l@addto@macro\captionlabelfont\mdseries}
\DeclareCaptionOption*{bf}[]{\l@addto@macro\captionlabelfont\bfseries}
\DeclareCaptionOption*{rm}[]{\l@addto@macro\captionlabelfont\rmfamily}
\DeclareCaptionOption*{sf}[]{\l@addto@macro\captionlabelfont\sffamily}
\DeclareCaptionOption*{tt}[]{\l@addto@macro\captionlabelfont\ttfamily}
%
\caption@setbool{ruled}{0}
\DeclareCaptionOption*{ruled}[]{\caption@setbool{ruled}{1}}
%
% Options for foreign package support
%
\newcommand*\DeclareCaptionPackage[1]{%
\caption@setbool{pkt@#1}{1}%
\DeclareCaptionOption*{#1}{\caption@setbool{pkt@#1}{##1}}}
%
% Compatible packages
% (new in v3.0b: The listings package)
%
\DeclareCaptionPackage{caption}
\DeclareCaptionPackage{float}
\DeclareCaptionPackage{listings}
\DeclareCaptionPackage{longtable}
\DeclareCaptionPackage{rotating}
\DeclareCaptionPackage{sidecap}
\DeclareCaptionPackage{supertabular}
%
\let\DeclareCaptionPackage\@undefined
%
% We process our options using the keyval package
%
\def\ProcessOptionsWithKV#1{% bugfixed v3.0a
\let\@tempc\relax
\let\caption@tempa\@empty
\@for\CurrentOption:=\@classoptionslist\do{%
\@ifundefined{KV@#1@\CurrentOption}%
{}%
{%
\edef\caption@tempa{\caption@tempa,\CurrentOption,}%
\@expandtwoargs\@removeelement\CurrentOption
\@unusedoptionlist\@unusedoptionlist
}%
}%
\edef\caption@tempa{%
\noexpand\setkeys{#1}{%
\caption@tempa\@ptionlist{\@currname.\@currext}%
}%
}%
\caption@tempa
% Bugfix, see <400D360C.9678329F@gmx.net> for details
\let\CurrentOption\@empty
\AtEndOfPackage{\let\@unprocessedoptions\relax}}
\ProcessOptionsWithKV{caption}
\let\ProcessOptionsWithKV\@undefined
%
% \captionof(*)
%
\def\captionof{\@ifstar{\caption@of{\caption*}}{\caption@of\caption}}
\newcommand*\caption@of[2]{\def\@captype{#2}#1}
%
% ContinuedFloat
%
\providecommand\ContinuedFloat{%
\ifx\@captype\@undefined
\@latex@error{\noexpand\ContinuedFloat outside float}\@ehd
\else
\addtocounter{\@captype}{\m@ne}%
\fi}%
%
% \caption@floatname{<type>}
% \caption@thefloat{<type>}
%
\newcommand*\caption@floatname[1]{\@nameuse{#1name}}
\newcommand*\caption@thefloat[1]{\@nameuse{the#1}}
%
% \caption@letfloattype{<type>}
% (new in caption 3.0b)
%
\def\caption@letfloattype#1{%
\def\caption@setfloattype##1{%
\caption@settype{##1}\caption@settype{#1}}}
%
% \caption@begin{<type>} (changed in v3.0b)
% \caption@beginex{<type>}{<list entry>}
% \caption@end
%
\newcommand*\caption@begin[1]{%
\begingroup
\caption@setfloattype{#1}%
\@namedef{fnum@#1}{%
\caption@lfmt{\caption@floatname{#1}}{\caption@thefloat{#1}}}%
%
\caption@fixposition
\global\let\caption@fixedposition\caption@position
%
\caption@@begin{#1}}
\newcommand*\caption@beginex[1]{%
\caption@begin{#1}%
\caption@preparelof}
\newcommand*\caption@end{%
\caption@@end
\endgroup
%
\let\caption@position\caption@fixedposition}
%
% \caption@@begin{<type>}
% \caption@@end
%
\let\caption@@begin\@gobble% new v3.0a
\let\caption@@end\@empty% new v3.0a
%
% \caption@preparelof{<list entry>}
%
\newcommand*\caption@preparelof[1]{% changed v3.0b
\caption@ifbool{lof}%
{\def\caption@tempa{#1}}%
{\let\caption@tempa\@empty}%
\ifx\caption@tempa\@empty
\def\addcontentsline##1##2##3{}%
\fi}
%
% CAPTION SUPPORT
% ===============
%
\caption@ifpkt@caption{
%
% \@makecaption{<label>}{<text>}
% Original code:
% \long\def\@makecaption#1#2{%
% \vskip\abovecaptionskip
% \sbox\@tempboxa{#1: #2}%
% \ifdim \wd\@tempboxa >\hsize
% #1: #2\par
% \else
% \global \@minipagefalse
% \hb@xt@\hsize{\hfil\box\@tempboxa\hfil}%
% \fi
% \vskip\belowcaptionskip}
%
\renewcommand\@makecaption[2]{%
\caption@iftop{\vskip\belowcaptionskip}{\vskip\abovecaptionskip}%
\ifnum\caption@debug>1 %
\llap{$\caption@iftop\downarrow\uparrow$ }%
\fi
\caption@@make{#1}{#2}%
\caption@iftop{\vskip\abovecaptionskip}{\vskip\belowcaptionskip}}
%
\AtBeginDocument{%
\@ifundefined{cc@caption}{%
%
% Define \caption* ...
% (07/18/03: \global added, so this works with sidecap)
%
\def\caption@caption#1{%
\@ifstar{\global\caption@startrue\@ifnextchar[{#1}{#1[]}}{#1}}%
%
\let\caption@old\caption
\def\caption{\caption@caption\caption@old}%
%
% Define \caption[]{...} ...
%
\let\caption@@old\@caption
\long\def\@caption#1[#2]#3{%
\caption@beginex{#1}{#2}%
\caption@@old{#1}[{#2}]{#3}%
\caption@end}%
}{%
% Minimum captcont package support (bugfixed v3.0c)
% --------------------------------
\PackageInfo{caption}{captcont package v2.0 detected}%
\def\caption@caption#1{#1}% added v3.0c
}%
}}{}
\AtEndOfPackage{\let\caption@ifpkt@caption\@undefined}% bugfixed v3.0a
%
% GENERIC PACKAGE SUPPORT
% =======================
%
\newcommand*\caption@ifpackage[2]{%
\let\next\@gobble
%
\caption@ifpkt@caption{%
\caption@ifbool{pkt@#1}{%
\@ifundefined{#2}%
{\let\next\AtBeginDocument}%
{\let\next\@firstofone}}{}%
%
\ifodd\caption@debug\relax
\edef\caption@tempa{%
\caption@ifbool{pkt@#1}{%
\@ifundefined{#2}{AtBeginDocument}{firstofone}%
}{gobble}}%
\PackageInfo{caption}{#1 = \caption@ifbool{pkt@#1}{1}{0} %
(\@ifundefined{#2}{not }{}loaded -> \caption@tempa)}%
\fi
}{}%
%
\@nameundef{caption@ifpkt@#1}% bugfixed v3.0a
\next}
\AtEndOfPackage{\let\caption@ifpackage\@undefined}
%
% FLOAT PACKAGE SUPPORT
% =====================
%
\def\caption@setfloatposition{%
\caption@setposition{\@fs@iftopcapt t\else b\fi}}
%
\caption@ifpackage{float}{float@caption}{%
\ifx\float@caption\relax
\else
\PackageInfo{caption}{float package v1.2 (or newer) detected}%
%
% Note that this version of \captionof works only with float 1.3 (or newer)
%
\let\caption@of@float\@gobble
\renewcommand*\caption@of[2]{%
\@ifundefined{fst@#2}{}{%
\let\caption@of@float\@firstofone
\@nameuse{fst@#2}\@float@setevery{#2}}%
%
\def\@captype{#2}#1}%
%
\renewcommand*\caption@floatname[1]{%
\@nameuse{\@ifundefined{fname@#1}{#1name}{fname@#1}}}%
%
\let\caption@@float\float@caption
\long\def\float@caption#1[#2]#3{%
\caption@beginex{#1}{#2}%
\let\@fs@capt\caption@@make
\caption@@float{#1}[{#2}]{#3}%
%
\caption@of@float{%
\def\caption@@make##1##2{\unvbox\@floatcapt}%
\@makecaption{}{}}%
\caption@end}%
%
\renewcommand*\caption@setfloattype[1]{% improved v3.0a
\caption@fixfloat@c{#1}%
\expandafter\ifx\csname @float@c@#1\endcsname\float@caption
% This float is defined with \newfloat or \restylefloat, not with \restylefloat*
\expandafter\let\expandafter\caption@fst\csname fst@#1\endcsname
\edef\caption@fst{\noexpand\string\expandafter\noexpand\caption@fst}%
\edef\caption@fst{\noexpand\@gobblefour\caption@fst}%
% \edef\caption@fst{\caption@fst}%
% |\caption@fst| now contains the float style (e.g. ``ruled'')
\@ifundefined{caption@sty@\caption@fst}{}{\caption@setstyle\caption@fst}%
\caption@setfloatposition% changed v3.0b
\fi
\caption@settype{#1}}%
%
% If you think this works fine, you are in a big error!
% The problem is that \newfloat and \restylefloat (of float 1.3) saves the
% *ACTUAL* definition of \@caption and \float@caption with \let, so our own
% \@caption (and of course our own \float@caption) will never been called if
% the \newfloat or \restylefloat takes place in the preamble of the document!
%
% So we have to correct this for ourself:
% We patch \caption again, this time we determine if the user has used
% \restylefloat or \restylefloat*. This is quite easy, if \@float@c@<captype>
% is the same as the original or our own definition of \float@caption, the
% user has used \restylefloat (and \float@caption should be used), otherwise
% we assume he has used \restylefloat* (and \@caption should be used).
% (This test will only fail if some other package re-defines \float@caption,
% too.)
%
\let\caption@float\caption
\def\caption{%
\ifx\@captype\@undefined
\@latex@error{\noexpand\caption outside float}\@ehd
\expandafter\@gobble
\else
% Let's bring \@float@c@<captype> up-to-date!
\caption@fixfloat@c\@captype
\fi
\caption@float}%
%
\def\caption@fixfloat@c#1{%
\expandafter\let\expandafter\caption@tempa\csname @float@c@#1\endcsname
\ifx\caption@tempa\relax
\else\ifx\caption@tempa\float@caption
\else\ifx\caption@tempa\@caption
\else\ifx\caption@tempa\caption@@float
\ifodd\caption@debug\relax
\PackageInfo{caption}{\protect\@float@c@#1\space := \protect\float@caption}%
\fi
\expandafter\let\csname @float@c@#1\endcsname\float@caption
\else
\ifodd\caption@debug\relax
\PackageInfo{caption}{\protect\@float@c@#1\space := \protect\@caption}%
\fi
\expandafter\let\csname @float@c@#1\endcsname\@caption
\fi\fi\fi\fi}%
%
\fi}
%
\caption@ifbool{ruled}{}{%
\DeclareCaptionStyle{ruled}{labelfont=bf,labelsep=space}}
\let\caption@ifruled\@undefined
%
% LISTINGS PACKAGE SUPPORT (new in 3.0b)
% ========================
%
\caption@ifpackage{listings}{lst@MakeCaption}{%
\ifx\lst@MakeCaption\relax
\else
\PackageInfo{caption}{listings package v1.2 (or newer) detected}%
%
\let\caption@lst@MakeCaption\lst@MakeCaption
\def\lst@MakeCaption#1{%
\let\caption@setfloattype\caption@settype
\def\caption@autoposition{\caption@setposition{#1}}%
\caption@begin{lstlisting}%
\caption@lst@MakeCaption{#1}%
\caption@end}%
%
\fi}
%
% LONGTABLE PACKAGE SUPPORT
% =========================
%
\caption@ifpackage{longtable}{LT@makecaption}{%
\ifx\LT@makecaption\relax
\else
\PackageInfo{caption}{longtable package v3.15 (or newer) detected}%
%
% Original code:
% \def\LT@makecaption#1#2#3{%
% \LT@mcol\LT@cols c{\hbox to\z@{\hss\parbox[t]\LTcapwidth{%
% % Based on article class "\@makecaption", "#1" is "\@gobble" in star
% % form, and "\@firstofone" otherwise.
% \sbox\@tempboxa{#1{#2: }#3}%
% \ifdim\wd\@tempboxa>\hsize
% #1{#2: }#3%
% \else
% \hbox to\hsize{\hfil\box\@tempboxa\hfil}%
% \fi
% \endgraf\vskip\baselineskip}%
% \hss}}}
%
\def\LT@makecaption#1#2#3{%
\LT@mcol\LT@cols c{\hbox to\z@{\hss\parbox[t]\linewidth{%
%
\caption@letfloattype{longtable}%
\caption@begin{table}%
\ifdim\LTcapwidth=4in \else
\caption@setwidth\LTcapwidth
\fi
\caption@startrue#1\caption@starfalse
\caption@@make{#2}{#3}%
\endgraf\vskip\baselineskip
% \endgraf\vskip\abovecaptionskip% always `position=top'
\caption@end}%
%
\hss}}}%
%
\fi}
%
% ROTATING PACKAGE SUPPORT
% ========================
%
\caption@ifpackage{rotating}{@rotcaption}{%
\ifx\@rotcaption\relax
\else
\PackageInfo{caption}{rotating package v2.0 (or newer) detected}%
%
\let\caption@rot\rotcaption
\def\rotcaption{\caption@caption\caption@rot}%
%
\let\caption@@rot\@rotcaption
\long\def\@rotcaption#1[#2]#3{%
\caption@beginex{#1}{#2}%
\caption@@rot{#1}[{#2}]{#3}%
\caption@end}%
%
% Original code:
% \long\def\@makerotcaption#1#2{%
% \setbox\@tempboxa\hbox{#1: #2}%
% \ifdim \wd\@tempboxa > .8\vsize
% \rotatebox{90}{%
% \begin{minipage}{.8\textheight}#1: #2\end{minipage}%
% }\par
% \else%
% \rotatebox{90}{\box\@tempboxa}%
% \fi
% \hspace{12pt}%
% }
%
\long\def\@makerotcaption#1#2{%
\rotatebox{90}{%
\begin{minipage}{.8\textheight}%
\caption@@make{#1}{#2}%
\end{minipage}%
}\par
\hspace{12pt}}%
%
\fi}
%
% SIDECAP PACKAGE SUPPORT
% =======================
%
\caption@ifpackage{sidecap}{endSC@FLOAT}{%
\ifx\endSC@FLOAT\relax
\else
\PackageInfo{caption}{sidecap package v1.4d (or newer) detected}%
%
% First of all, we let sidecap use an actual definition of \caption:
% (This is only required for version 1.5d of the sidecap package.)
%
\let\SC@caption=\caption
%
% Make \caption* and local settings (\captionsetup) work
%
\let\caption@SC@zfloat\SC@zfloat
\def\SC@zfloat#1#2#3[#4]{%
\caption@SC@zfloat{#1}{#2}{#3}[#4]%
%
\global\let\SC@CAPsetup\@empty
\renewcommand\captionsetup[1]{\g@addto@macro\SC@CAPsetup{,##1}}%
%
\let\caption@old\caption
% \def\caption{\renewcommand\captionsetup[1]{}\caption@caption\caption@old}%
\def\caption{\caption@caption\caption@old}%
}%
%
% Before typesetting the caption, we set the captionmargin to zero
% because the extra margin is only disturbing here.
% (We don't need to take care about the caption position because
% the sidecap package set both \abovecaptionskip and \belowcaptionskip
% to a skip of zero anyway.)
% Furthermore \SC@justify will override the caption justification, if set.
%
% Very old version (1.4): \SC@justify is not defined
% Older versions (1.5): \SC@justify is \relax when not set
% Newer versions (1.6): \SC@justify is \@empty when not set
%
\let\caption@endSC@FLOAT\endSC@FLOAT
\def\endSC@FLOAT{%
\caption@setmargin\z@
%
\@ifundefined{SC@justify}{}{%
\ifx\SC@justify\@empty\else
\let\caption@hj\SC@justify
\let\SC@justify\@empty
\fi}%
%
\caption@esetup\SC@CAPsetup
\caption@letfloattype{SC\@captype}%
%
\caption@endSC@FLOAT}%
%
\fi}
%
% SUPERTABULAR PACKAGE SUPPORT
% ============================
%
\def\caption@setSTposition{%
\caption@setposition{\if@topcaption t\else b\fi}}
%
\caption@ifpackage{supertabular}{ST@caption}{%
\ifx\ST@caption\relax
\else
\PackageInfo{caption}{supertabular package detected}%
%
% Original code:
% \long\def\ST@caption#1[#2]#3{\par%
% \addcontentsline{\csname ext@#1\endcsname}{#1}%
% {\protect\numberline{%
% \csname the#1\endcsname}{\ignorespaces #2}}
% \begingroup
% \@parboxrestore
% \normalsize
% \if@topcaption \vskip -10\p@ \fi
% \@makecaption{\csname fnum@#1\endcsname}{\ignorespaces #3}\par
% \if@topcaption \vskip 10\p@ \fi
% \endgroup}
%
\let\caption@ST\ST@caption
\long\def\ST@caption#1[#2]#3{\par% bugfixed v3.0a
\caption@letfloattype{supertabular}%
\let\caption@fixposition\caption@setSTposition
\caption@beginex{#1}{#2}%
\addcontentsline{\csname ext@#1\endcsname}{#1}%
{\protect\numberline{%
\csname the#1\endcsname}{\ignorespaces #2}}%
\@parboxrestore
\normalsize
\@makecaption{\csname fnum@#1\endcsname}{\ignorespaces #3}\par
\caption@end}%
%
\fi}
%
% KOMA-SCRIPT CLASSES SUPPORT (new in 3.0a)
% ===========================
%
% \changes{v3.0a}{18 Jan 04}{Minimum adaption to KOMA-Script}
\AtBeginDocument{\let\scr@caption\caption}
% \end{macrocode}
%
% \iffalse
%</package>
% \fi
%
% \clearpage
% \Finale
%
\endinput
|