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
|
% \iffalse meta-comment
%
% Parts of this file, Copyright (C) 1994 by Jerry Leichter
% Copyright (C) 2016-2021 by Pieter van Oostrum <pieter@vanoostrum.org>
% -------------------------------------------------------
%
% This file 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 2005/12/01 or later.
%
% \fi
%
% \iffalse
%<*driver>
\ProvidesFile{\jobname.dtx}
%</driver>
% This is the variable part of the preamble
%
%<multirow|bigstrut>%% Copyright (C) 1994 by Jerry Leichter
%<bigdelim>%% Copyright (C) 1994 by \O ystein Bache
%% Copyright (C) 2016-2021 by Pieter van Oostrum <pieter@vanoostrum.org>
%%
%
% \begin{macrocode}
%<multirow|bigstrut|bigdelim>\NeedsTeXFormat{LaTeX2e}
%<multirow>\ProvidesPackage{multirow}%
%<bigstrut>\ProvidesPackage{bigstrut}
%<bigdelim>\ProvidesPackage{bigdelim}
%<multirow|bigstrut|bigdelim> [2021/03/15 v2.8
%<multirow> Span multiple rows of a table]%
%<bigstrut> Provide larger struts in tabulars]
%<bigdelim> Create big delimiters in tabular or array]
% \end{macrocode}
%
%<*driver>
\documentclass[a4paper]{ltxdoc}
\usepackage[T1]{fontenc}
\usepackage{multirow,bigstrut,bigdelim,colortbl}
\usepackage[table]{xcolor}
\usepackage{tabulary}
\usepackage{longtable}
\usepackage{booktabs}
\usepackage{calc}
\usepackage{url}
\usepackage[colorlinks, urlcolor=blue, linktocpage]{hyperref}
\usepackage{tikz}
\usepackage{hhline}
\usepackage{etoolbox}
\AtBeginEnvironment{macrocode}{\color{red}}
\newcommand{\minitab}[2][l]{\begin{tabular}{#1}#2\end{tabular}}
\DisableCrossrefs
\CodelineIndex
\RecordChanges
\newcommand{\env}[1]{\texttt{#1}}
\newcommand{\Package}[1]{\textsf{#1}}
\def\bsbs{\cs{\char`\\}}
\begin{document}
\DeleteShortVerb{\|}
\DocInput{\jobname.dtx}
\end{document}
%</driver>
% \fi
%
% \CheckSum{0}
%
% \CharacterTable
% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
% Digits \0\1\2\3\4\5\6\7\8\9
% Exclamation \! Double quote \" Hash (number) \#
% Dollar \$ Percent \% Ampersand \&
% Acute accent \' Left paren \( Right paren \)
% Asterisk \* Plus \+ Comma \,
% Minus \- Point \. Solidus \/
% Colon \: Semicolon \; Less than \<
% Equals \= Greater than \> Question mark \?
% Commercial at \@ Left bracket \[ Backslash \\
% Right bracket \] Circumflex \^ Underscore \_
% Grave accent \` Left brace \{ Vertical bar \|
% Right brace \} Tilde \~}
%
% \changes{v1.7}{2016/09/13}{Give all the files the same version number}
% \changes{v2.0}{2016/09/27}{Release v2.0}
% \changes{v2.3}{2018/08/03}{Small bugfix}
% \changes{v2.4}{2018/12/30}{Add \leavevmode in bigstrut.sty}
% \changes{v2.4}{2019/01/01}{Make \meta{width} and \meta{vmove} in \cs{multirow}
% \Package{calc} compatible}
% \changes{v2.5}{2019/05/31}{Solve a clash with the \Package{colortbl} package}
%
% \GetFileInfo{multirow.sty}
%
% \DoNotIndex{\#,\$,\%,\&,\@,\\,\{,\},\^,\_,\~,\ }
% \DoNotIndex{\@ne}
% \DoNotIndex{\advance,\begingroup,\catcode,\closein}
% \DoNotIndex{\closeout,\day,\def,\edef,\else,\empty,\endgroup}
%
% \title{The \Package{multirow},
% \Package{bigstrut} and
% \Package{bigdelim} packages}
% \author{Pieter van Oostrum\thanks{catalogued ``active author''}\\
% \O ystein Bache\\
% Jerry Leichter\thanks{Documentation originally put together by Robin
% Fairbairns}}
%
% \date{Released \filedate, version \fileversion}
%
% \maketitle
%
% \tableofcontents
%
% \section{Introduction}
% These packages offer a series of extensions to the standard \LaTeX{}
% \env{tabular} environment. Their respective functions are:
% \begin{description}
% \item[\Package{multirow}] which provides a construction for table cells
% that span more than one row of the table;
% \item[\Package{bigstrut}] which creates struts which (slightly) stretch
% the table row in which they sit.
% \item[\Package{bigdelim}] which creates an appropriately-sized
% delimiter (for example, brace, parenthesis or bracket) to fit in a
% single multirow, to indicate a relationship between other rows; and
% \end{description}
%
% \section{Changes in version 2}
% \label{sec:changes-2}
%
%\subsection*{version 2.8}
%
%\begin{itemize}
%\item Optional argument \meta{vmove} for \cs{ldelim} and \cs{rdelim}.
%\end{itemize}
%
%\subsection*{version 2.7}
%
%\begin{itemize}
%\item Make \cs{@xmultirow} and \cs{multirow@setcolwidth} \cs{long} to allow
% multi-paragraph text.
% See \url{https://github.com/pietvo/multirow/issues/1}
%\end{itemize}
%
%\subsection*{version 2.6}
%
% \begin{itemize}
% \item Make the \texttt{supertabular} option compatible with newer
% versions of the \Package{supertabular} package
% \item Initialize \cs{@arstrutbox} when not defined, to enable some
% uses of the big delims outside of an \env{array} or \env{tabular}.
% \end{itemize}
%
%\subsection*{version 2.5a}
%
% \begin{itemize}
% \item Changed contact information
% \end{itemize}
%
%\subsection*{version 2.5}
%
% \begin{itemize}
% \item Solve a clash with the \Package{colortbl} package, when multirow
% uses the \texttt{longtable} option. There was a clash with both
% packages redefining \cs{@cline}.
% \end{itemize}
%
%\subsection*{version 2.4}
%
% \begin{itemize}
% \item Add a \cs{leavevmode} in \Package{bigstrut} to force horizontal mode
% \item Make \meta{width} and \meta{vmove} in \cs{multirow} \Package{calc} compatible
% \end{itemize}
%
%\subsection*{version 2.3}
%
% \begin{itemize}
% \item Replaced \cs{textrm} with \cs{textnormal} in text beside big braces in bigdelim.sty.
% \end{itemize}
%
%\subsection*{version 2.2}
%
% \begin{itemize}
% \item Support for fractional values of \meta{nrows}.
% \end{itemize}
%
%\subsection*{version 2.0}
%
% \begin{itemize}
% \item \cs{multirow} now has an first optional parameter \oarg{vpos}.
% \item The \meta{width} parameter can be specified as \texttt{=} to use
% the defined width of the column in which the \cs{multirow} appears.
% \item Optional prefix letters (\texttt{t}, \texttt{b}) for
% the \meta{bigstruts} parameter (see section~\ref{sect-refine-bigstrut}).
% \item Package option \texttt{debug}.
% \item Package option \texttt{longtable} to work around a bug in
% \Package{longtable}. See section~\ref{sec:use-with-longtable}.
% \item Package option \texttt{supertabular} to better support \Package{supertabular}. See
% section~\ref{sec:use-with-supertabular}.
% \item Better positioning in some cases.
% \item Lots of documentation.
% \item The distribution is now based on a \texttt{.dtx} file.
% \item Backwards compatible with v1.6.
% \end{itemize}
%
% \section{Using \Package{multirow}}\label{sec:multirow}
%
% \DescribeMacro{\multirow}
% \cs{multirow} sets a piece of text in a \env{tabular} or
% similar environment, spanning multiple rows. We will call the block of
% rows and columns that the text spans the multirow block. Usually this
% covers one column, but by combining it with \cs{multicolumn} more
% columns can be covered.
% \changes{v2.1}{2016/10/06}{Rename \meta{fixup} to \meta{vmove} in the
% documentation as in The LaTeX Companion.}
%
% The basic syntax is:
% \begin{quote}
% \cmd{\multirow}\oarg{vpos}\marg{nrows}\oarg{bigstruts}\marg{width}\oarg{vmove}\marg{text}
% \end{quote}
% where
% \begin{description}
% \item[\meta{vpos}] defines the vertical positioning of the text in the multirow block.
% The default is \texttt{[c]} which means the text will be vertically centered.
% Other options are \texttt{[t]} for top alignment and \texttt{[b]} for bottom alignment.
% \item[\meta{nrows}] is the number of rows to span. You should
% leave the other rows empty at this column, otherwise the stuff created by \cs{multirow}
% will over-write it. With a positive value of \meta{nrows} the
% spanned columns are this row and (\meta{nrows}-1) rows below
% it. With a negative value of \meta{nrows} they are this row and
% (1-\meta{nrows}) above it. Fractional values are permitted for
% \meta{nrows}; this allows for some fine-tuning.
%
% \item[\meta{bigstruts}] is mainly used if you've used the
% \Package{bigstrut} package. In that case it is the total number of uses of
% \cs{bigstrut} within the rows being spanned. Count 2 uses for each
% \cs{bigstrut}, 1 for each \cs{bigstrut}\oarg{x} where \meta{x} is
% either \texttt{t} or \texttt{b}. The default is 0.
%
% The \meta{bigstruts} parameter can optionally be preceded by a prefix
% letter \texttt{t}, \texttt{b} or \texttt{tb} for finer control. See
% section \ref{sect-refine-bigstrut} for details. The letter may be
% separated from the number by a space character.
%
% \item[\meta{width}] is the width to which the text is to be set.
% Special values are \texttt{*} to indicate that the text parameter's natural width is to
% be used, and \texttt{=} to indicate that the specified width of the column in
% which the \cs{multirow} entry is set should be used.
%
% \item[\meta{vmove}] is a length used for fine-tuning: the text will be
% raised (or lowered, if \meta{vmove} is negative) by that length
% above (below) wherever it would otherwise have gone.
%
% \item[\meta{text}] is the actual text of the construct. If the width
% was set explicitly, the text will be set in a \cs{parbox} of that
% width; you can use \bsbs{} to force linebreaks where you like.
%
% If the width was given as \texttt{*} the text will be set in LR
% mode. If you want a multiline entry in this case you could use a
% \env{tabular} or \env{array} environment in the text
% parameter. See for example the \env{minitab} below.
%
% The width can also be given as \texttt{=} when the \cs{multirow} entry is given in a
% column that has a defined width, for example in a \texttt{p\{\}} column, an
% \texttt{X} column in \env{tabularx} or a \texttt{L}, \texttt{C},
% \texttt{R} or \texttt{J} column in a \env{tabulary} environment.
% The text will be set in a \cs{parbox} of that width.
% If you give ``\texttt{=}'' in other situations, you will get strange
% results (usually a too wide column).
%
% \end{description}
%
% In \Package{multirow} version 2.4 and later, the \meta{width} and
% \meta{vmove} arguments can be given as \Package{calc} expressions if
% the \Package{calc} package is loaded. It is the responsibility of the
% document writer to include the \Package{calc} package;
% \Package{multirow} does not do this.
%
% N.B. \cs{multirow} can be used in the \env{tabular} environment and
% most derivatives of it, for example \env{tabularx},
% \env{tabulary}, \env{supertabular}, \env{ltablex},
% \env{xtab}, \env{longtable}, \env{tabu},
% \env{booktabs} and \env{ctable}. For some of these you
% have to pay special attention to certain cases, see below.
%
% \DescribeMacro{\multirowsetup}
% Just before \meta{text} is expanded, the \cs{multirowsetup} macro is
% expanded to set up any special environment. Initially,
% \cs{multirowsetup} contains just \cs{raggedright}. It may be
% redefined with \cs{renewcommand}.
%
% If you want to use both \cs{multirow} and \cs{multicolumn}
% \index{multicolumn=\verb!*+\multicolumn+|usage}
% on the same entry, you must put the \cs{multirow} inside the
% \cs{multicolumn}. The other way around will not work.
% For example:
% \begin{verbatim}
% \multicolumn{2}{c}{\multirow{3}{*}{Multi-multi}}
% \end{verbatim}
%
% \subsection{Package Options}
% \label{sec:package-options}
%
% \DescribeMacro{multirowdebugtrue}
% \DescribeMacro{multirowdebugfalse}
% The following options are defined:
% \begin{description}
% \item[debug]
% This option causes information about multirow boxes
% to be written to the log file. This is done by the \TeX{} \cs{showbox}
% command. Note: this will cause the \LaTeX{} compilation to be considered
% failed, even if there is no real error.
% This option can also be activated anywhere in the document with the
% command \cs{multirowdebugtrue} and deactivated with
% \cs{multirowdebugfalse}. When such a command is placed just before a
% \cs{multirow}, it applies only to that specific \cs{multirow} entry.
% \item[longtable]
% The \texttt{longtable} option redefines the \cs{cline} macro to work
% around a bug in the \Package{longtable} package. See section \ref{sec:use-with-longtable}.
% \end{description}
%
%\subsection{Examples}
%\label{sec:examples}
%
% An example with both \Package{multirow} and \Package{bigstrut}):
%
% \begin{quote}
% \begin{verbatim}
% \newcommand{\minitab}[2][l]{\begin{tabular}{#1}#2\end{tabular}}
% \begin{tabular}{|c|c|}
% \hline
% \multirow{4}{1in}{Common g text} & Column g2a\\
% & Column g2b \\
% & Column g2c \\
% & Column g2d \\
% \hline
% \multirow{3}[6]*{Common g text} & Column g2a\bigstrut\\\cline{2-2}
% & Column g2b \bigstrut\\\cline{2-2}
% & Column g2c \bigstrut\\
% \hline
% \multirow{4}[8]{1in}{Common g text, but a bit longer.} &
% Column g2a\bigstrut\\\cline{2-2}
% & Column g2b \bigstrut\\\cline{2-2}
% & Column g2c \bigstrut\\\cline{2-2}
% & Column g2d \bigstrut\\
% \hline
% \multirow{4}*{\minitab[c]{Common \\ g text}} & Column g2a\\
% & Column g2b \\
% & Column g2c \\
% & Column g2d \\
% \hline
% \end{tabular}
% \end{verbatim}
% \end{quote}
% which will appear as:
% \begin{quote}
% \begin{tabular}{|c|c|}
% \hline
% \multirow{4}{1in}{Common g text} & Column g2a\\
% & Column g2b \\
% & Column g2c \\
% & Column g2d \\
% \hline
% \multirow{3}[6]*{Common g text} & Column g2a\bigstrut\\\cline{2-2}
% & Column g2b \bigstrut\\\cline{2-2}
% & Column g2c \bigstrut\\
% \hline
% \multirow{4}[8]{1in}{Common g text, but a bit longer.} &
% Column g2a\bigstrut\\\cline{2-2}
% & Column g2b \bigstrut\\\cline{2-2}
% & Column g2c \bigstrut\\\cline{2-2}
% & Column g2d \bigstrut\\
% \hline
% \multirow{4}*{\minitab[c]{Common \\ g text}} & Column g2a\\
% & Column g2b \\
% & Column g2c \\
% & Column g2d \\
% \hline
% \end{tabular}
% \quad
% \begin{tabular}{ll}
% \multirow{4}{*}{Normal case} & \\
% & \\
% & \\
% & \\
% \multirow{3}[6]*{With \cs{bigstrut}s and \texttt{*} as \meta{width}} & \bigstrut\\
% & \bigstrut\\
% & \bigstrut\\
% \multirow{4}[8]{*}{With \cs{bigstrut}s and normal \meta{width}} & \bigstrut\\
% & \bigstrut\\
% & \bigstrut\\
% & \bigstrut\\
% \multirow{4}*{Multiline text in \cs{multirow}} & \\
% & \\
% & \\
% & \\
% \end{tabular}
%
% \end{quote}
% \vspace{1ex}
% An example with the ``\texttt{=}'' \meta{width} specifier in a
% \env{tabulary} (Note: The braces around the \texttt{=} may be omitted):
%
% \begin{quote}
% \index{extrarowheight=\verb!*+\extrarowheight+|usage}
% \begin{verbatim}
% \setlength{\extrarowheight}{2pt}
% \begin{tabulary}{11cm}{|L|L|L|}
% \hline
% All human beings are born free and equal in dignity and rights. &
% \multirow{2}{=}{Everyone is entitled to all the rights and
% freedoms set forth in this Declaration, without distinction of
% any kind, such as race, colour, sex, language, religion,
% political or other opinion, national or social origin, property,
% birth or other status.}
% & Everyone has the right to life, liberty and security of person. \\
% \cline{1-1}\cline{3-3}
% No one shall be held in slavery or servitude; slavery and the
% slave trade shall be prohibited in all their forms. &
% & No one shall be subjected to torture or to cruel, inhuman or
% degrading treatment or punishment. \\
% \hline
% \end{tabulary}
% \end{verbatim}
% \end{quote}
%
% \begin{quote}
% \index{extrarowheight=\verb!*+\extrarowheight+|usage}
% \setlength{\extrarowheight}{2pt}
% \begin{tabulary}{11cm}{|L|L|L|}
% \hline
% All human beings are born free and equal in dignity and rights. &
% \multirow{2}{=}{Everyone is entitled to all the rights and
% freedoms set forth in this Declaration, without distinction of
% any kind, such as race, colour, sex, language, religion,
% political or other opinion, national or social origin, property,
% birth or other status.}
% & Everyone has the right to life, liberty and security of person. \\
% \cline{1-1}\cline{3-3}
% No one shall be held in slavery or servitude; slavery and the
% slave trade shall be prohibited in all their forms. &
% & No one shall be subjected to torture or to cruel, inhuman or
% degrading treatment or punishment. \\
% \hline
% \end{tabulary}
% \end{quote}
%
% A few observations about this example:
% \begin{enumerate}
% \item The middle column is the \cs{multirow}. You would expect it to
% be vertically centered, but it isn't. This is because \cs{multirow}
% doesn't know the height of the box. The only estimate \cs{multirow}
% can make about the height is the number of rows${}\times{}$the normal
% height of a row. It tries to center the text in that space, but that space
% is too low in this example. Therefore the text is at the top of the
% box. If you want it to be centered, you have to supply a \meta{vmove}
% argument to shift it down.
% \item We have used an \cs{extrarowheight}\footnote{This is only
% available with the \Package{array} package, which \Package{tabulary}
% includes automatically.} of 2pt, to make a bit room between the
% \cs{hline} and the following text. However, this is not applied to the
% \cs{multirow}, because this is thought to be centered. In this case
% you can give the \meta{vpos} argument as \texttt{[t]}, in which case
% \cs{multirow} will do the proper positioning.
% \end{enumerate}
%
% Now with a negative \meta{nrows}.
%
% \begin{quote}
% \index{extrarowheight=\verb!*+\extrarowheight+|usage}
% \begin{verbatim}
% \setlength{\extrarowheight}{2pt}
% \begin{tabulary}{11cm}{|L|L|L|}
% \hline
% All human beings are born free and equal in dignity and rights. &
% & Everyone has the right to life, liberty and security of person. \\
% \cline{1-1}\cline{3-3}
% No one shall be held in slavery or servitude; slavery and the
% slave trade shall be prohibited in all their forms. &
% \multirow{-2}{=}[12mm]{Everyone is entitled to all the rights and
% freedoms set forth in this Declaration, without distinction of
% any kind, such as race, colour, sex, language, religion,
% political or other opinion, national or social origin, property,
% birth or other status.}
% & No one shall be subjected to torture or to cruel, inhuman or
% degrading treatment or punishment. \\
% \hline
% \end{tabulary}
% \end{verbatim}
% \end{quote}
%
% \begin{quote}
% \index{extrarowheight=\verb!*+\extrarowheight+|usage}
% \setlength{\extrarowheight}{2pt}
% \begin{tabulary}{11cm}{|L|L|L|}
% \hline
% All human beings are born free and equal in dignity and rights. &
% & Everyone has the right to life, liberty and security of person. \\
% \cline{1-1}\cline{3-3}
% No one shall be held in slavery or servitude; slavery and the
% slave trade shall be prohibited in all their forms. &
% \multirow{-2}{=}[12mm]{Everyone is entitled to all the rights and
% freedoms set forth in this Declaration, without distinction of
% any kind, such as race, colour, sex, language, religion,
% political or other opinion, national or social origin, property,
% birth or other status.}
% & No one shall be subjected to torture or to cruel, inhuman or
% degrading treatment or punishment. \\
% \hline
% \end{tabulary}
% \end{quote}
%
% In this case the text would be centered somewhere in the
% bottom row, which would make it stick out of the bottom. Therefore we
% applied a \meta{vmove} of 12mm. The \meta{vmove} usually requires some experimentation.
%
% \subsection{Fine-Tuning}
% \label{sec:fine-tuning}
%
% If any of the spanned rows are unusually large, or if you're using the
% \Package{bigstrut} package and \cs{bigstrut}s are used asymetrically about the
% centerline of the spanned rows, the vertical centering may not come
% out right. Use the \meta{vmove} parameter in this case. Sometimes it
% may be more helpful to just use a larger value for \meta{nrows},
% including fractional values. See an example in section~\ref{sec:dealing-with-tall}.
%
% It's just about impossible to deal correctly with descenders. The
% text will be set up centered, but it may then have a baseline that
% doesn't match the baseline of the stuff beside it, in particular if
% the stuff beside it has descenders and \meta{text} does not. This may
% result in a small misalignment. About all that can be done is to do a
% final touchup on \meta{text}, using the \meta{vmove} optional parameter.
% (Hint: If you use a measure like \texttt{.1ex}, there's a reasonable
% chance that the \meta{vmove} will still be correct if you change the point
% size.)
%
% \cs{multirow} is mainly designed for use with \env{tabular}, as
% opposed to \env{array}, environments. It might not work well in an
% array environment if there are big formulas in some rows; in that case you can use the
% \meta{vmove} parameter to refine the result.
%
% In some cases you might want to align the multirow entry with the top
% of the other row cells, for example if you have a large capital in it.
% when you use \meta{vpos} = \texttt{[t]}, the baselines will be
% aligned, which is the wrong thing in this case. You can then do the
% positioning with the \meta{vmove} parameter and let \LaTeX{} calculate
% the amount. For example:
%
% \begin{quote}
% \begin{verbatim}
% \usepackage{calc}
% \newlength{\shiftdown}
% \setlength{\shiftdown}{\heightof{\Huge\bfseries B}-\heightof{f}}
% . . .
% \begin{tabular}{cll}
% \toprule
% \multirow[t]{5}{*}[-\shiftdown]{\Huge\bfseries B}
% & foo & Lorem ipsum dolor sit \\
% & bar & Maecenas sed purus \\
% & baz & Nullam luctus id tellus \\
% & qux & Aenean consequat commodo \\
% \bottomrule
% \end{tabular}
% \end{verbatim}
% \end{quote}
%
% \begin{quote}
% \newlength{\shiftdown}
% \setlength{\shiftdown}{\heightof{\Huge\bfseries B}-\heightof{f}}
% \begin{tabular}{cll}
% \toprule
% \multirow[t]{5}{*}[-\shiftdown]{\Huge\bfseries B}
% & foo & Lorem ipsum dolor sit \\
% & bar & Maecenas sed purus \\
% & baz & Nullam luctus id tellus \\
% & qux & Aenean consequat commodo \\
% \bottomrule
% \end{tabular}
% \end{quote}
% In \Package{multirow} version 2.4 and later you can also directly use the expression
% \verb|-\heightof{\Huge\bfseries B}-\heightof{f}| instead of \verb|-\shiftdown| for the \meta{vmove} argument.
%
% \subsection{Multirow and colored cells}\label{sec:mult-color-cells}
%
% If you use \cs{multirow} with the \Package{colortbl} package (or the
% \index{colortbl=\Package{colortbl}|usage}
% \Package{xcolor} package with the \texttt{[table]} option) you have
% \index{xcolor=\Package{xcolor}|usage}
% to take precautions if you want to color the column that has the
% \cs{multirow} in it. The \Package{colortbl} package works by coloring each cell
% separately. So if you use \cs{multirow} with a positive \meta{nrows}
% value, \Package{colortbl} will first color the top cell, then
% \cs{multirow} will typeset \meta{nrows} cells starting with this cell,
% and later \Package{colortbl} will color the other cells, effectively
% hiding the text in that area. This can be solved by putting the
% \cs{multirow} in the last row with a negative \meta{nrows} value.
% See, for example:
% \begin{quote}
% \begin{verbatim}
% \begin{tabular}{l>{\columncolor{yellow}}l}
% aaaa & \\
% cccc & \\
% dddd & \multirow{-3}*{bbbb}\\
% \end{tabular}
% \end{verbatim}
% \end{quote}
% which will produce:
% \begin{quote}
% \begin{tabular}{l>{\columncolor{yellow}}l}
% aaaa & \\
% cccc & \\
% dddd & \multirow{-3}*{bbbb}\\
% \end{tabular}
% \end{quote}
%
% \index{hhline=\Package{hhline}|usage}
% When you use colored multirow cells together with the
% \Package{hhline} package you may find some white stripes in your
% colored multirow cell. For example:
% \begin{quote}
% \begin{verbatim}
% \begin{tabular}{|>{\columncolor{red}}c|c|}
% \hline
% \bfseries ColumnOne & \bfseries ColumnTwo\\ \hline
% First data & 932\\ \hline
% & 239\\ \hhline{|~|-|}
% & 137\\ \hhline{|~|-|}
% \multirow{-3}{*}{More data} & 319\\ \hline
% Last data & 132\\ \hline
% \end{tabular}
% \end{verbatim}
% \end{quote}
%
% \begin{quote}
% \begin{tabular}{|>{\columncolor{red}}c|c|}
% \hline
% \bfseries ColumnOne & \bfseries ColumnTwo\\ \hline
% First data & 932\\ \hline
% & 239\\ \hhline{|~|-|}
% & 137\\ \hhline{|~|-|}
% \multirow{-3}{*}{More data} & 319\\ \hline
% Last data & 132\\ \hline
% \end{tabular}
% \end{quote}
%
% This can be solved by putting colored horizontal rules with the same
% color in the colored multirow cell.
% \begin{quote}
% \begin{verbatim}
% \begin{tabular}{|>{\columncolor{red}}c|c|}
% \hline
% \bfseries ColumnOne & \bfseries ColumnTwo\\ \hline
% First data & 932\\ \hline
% & 239\\ \hhline{|>{\arrayrulecolor{red}}->{\arrayrulecolor{black}}|-|}
% & 137\\ \hhline{|>{\arrayrulecolor{red}}->{\arrayrulecolor{black}}|-|}
% \multirow{-3}{*}{More data} & 319\\ \hline
% Last data & 132\\ \hline
% \end{tabular}
% \end{verbatim}
% \end{quote}
%
% \begin{quote}
% \begin{tabular}{|>{\columncolor{red}}c|c|}
% \hline
% \bfseries ColumnOne & \bfseries ColumnTwo\\ \hline
% First data & 932\\ \hline
% & 239\\ \hhline{|>{\arrayrulecolor{red}}->{\arrayrulecolor{black}}|-|}
% & 137\\ \hhline{|>{\arrayrulecolor{red}}->{\arrayrulecolor{black}}|-|}
% \multirow{-3}{*}{More data} & 319\\ \hline
% Last data & 132\\ \hline
% \end{tabular}
% \end{quote}
%
% \subsection{Fine-tuning the \meta{bigstruts} argument}
% \label{sect-refine-bigstrut}
%
% \cs{multirow} can calculate the height of the required multirow box
% from \meta{nrows} and \meta{bigstruts}, supposed that all the rows
% don't have ``unusual'' heights. However, there are cases when this is
% not enough to properly position the box, especially when there is a
% \cs{bigstrut} on top of the first row and/or one on the bottom of the
% last row. In that case \cs{multirow} should be given additional
% information. This is done by prefixing the \meta{bigstruts} argument
% with a letter (or two) indicating which of these two are present.
%
% See the following examples:\\ (in these examples we have
% \verb+\setlength{\bigstrutjot}{10pt}+ to make the effect clearly visible)\\[5mm]
% \begin{minipage}[c]{0.23\linewidth}
% \setlength{\bigstrutjot}{10pt}
% \begin{tabular}{|c|c|}
% \hline
% \multirow{3}[1]{*}{Multirow} & T \bigstrut[t] \\
% \cline{2-2}
% & X \\
% \cline{2-2}
% & B \\
% \hline
% \end{tabular} \\[2mm]
% \begin{tabular}{|c|c|}
% \hline
% \multirow{3}[t 1]{*}{Multirow} & T \bigstrut[t] \\
% \cline{2-2}
% & X \\
% \cline{2-2}
% & B \\
% \hline
% \end{tabular}
% \end{minipage}
% \begin{minipage}[c]{0.75\linewidth}
% \begin{verbatim}
% \begin{tabular}{|c|c|}
% \hline
% \multirow{3}[1]{*}{Multirow} & T \bigstrut[t] \\
% \cline{2-2}
% & X \\
% \cline{2-2}
% & B \\
% \hline
% \end{tabular}
% \end{verbatim}
% \end{minipage}
% \\[5mm]
% In the top box in the above example the text ``Multirow'' should be centered, but it
% is a bit below the center, because of the \cs{bigstrut[t]} in the top
% row. We can correct this by giving the \meta{bigstruts} parameter as
% ``t 1'', indicating a bigstrut in the top. This is done in the bottom box, where
% \verb+\multirow{3}[t 1]{*}{Multirow}+ is used.
%
% A second example:\\[5mm]
% \begin{minipage}{0.23\linewidth}
% \setlength{\bigstrutjot}{10pt}
% \begin{tabular}{|c|c|}
% \hline
% & T \\
% \cline{2-2}
% & X \\
% \cline{2-2}
% \multirow[t]{-3}[1]{*}{Multirow} & B \bigstrut[b] \\
% \hline
% \end{tabular} \\[2mm]
% \begin{tabular}{|c|c|}
% \hline
% & T \\
% \cline{2-2}
% & X \\
% \cline{2-2}
% \multirow[t]{-3}[b 1]{*}{Multirow} & B \bigstrut[b] \\
% \hline
% \end{tabular}
% \end{minipage}
% \begin{minipage}{0.75\linewidth}
% \begin{verbatim}
% \begin{tabular}{|c|c|}
% \hline
% & T \\
% \cline{2-2}
% & X \\
% \cline{2-2}
% \multirow[t]{-3}[1]{*}{Multirow} & B \bigstrut[b] \\
% \hline
% \end{tabular}
% \end{verbatim}
% \end{minipage}
% \\[5mm]
% In the top box the \verb+\multirow[t]+ should be positioned on the
% same height as the \texttt{T}, but it is too high, because there is a
% \cs{bigstrut} in the bottom. We can correct that by specifying the
% \meta{bigstruts} argument as ``b 1'', i.e. using
% \verb+\multirow[t]{-3}[b 1]{*}{Multirow}+.
% \\[5mm]
% The possibilities for the prefix are:
% \begin{description}
% \item[\texttt{t}] There is a bigstrut in the top, i.e. a \cs{bigstrut}
% or \cs{bigstrut[t]} in the top row.
% \item[\texttt{b}] There is a bigstrut in the bottom, i.e. a \cs{bigstrut}
% or \cs{bigstrut[b]} in the bottom row.
% \item[\texttt{tb}] They are both present. Note: this cannot be given
% as \texttt{bt}.
% \end{description}
% The space between the letter(s) and the number is optional.
% Please note that the prefix does not depend on whether the
% \cs{multirow} is in the top or the bottom row.
%
% \subsection{Use with \Package{longtable}}
% \label{sec:use-with-longtable}
%
% \index{longtable=\env{longtable}|usage}
% \index{longtabu=\env{longtabu}|usage}
% It is possible to use \cs{multirow} in a \env{longtable}
% environment (as well as in its descendent \env{longtabu}).
% However, care must be taken that the longtable doesn't break the
% multirow entry when it is near the bottom of the page. For example:
%
% \noindent
% \begin{minipage}[t]{0.4\linewidth}
% \begin{longtable}{|l|l|l|}
% \ldots & \ldots & \ldots \\
% \hline
% Sept. 21 & 09:00 & event 1 \\
% \hline
% Sept. 22 & 10:00 & event 2 \\
% \hline
% \multirow{3}*{Sept. 23} & 10:00 & event 3 \\
% & 12:00 & event 4 \\
% & 15:00 & event 5 \\
% \hline
% Sept. 24 & 09:00 & event 6 \\
% \hline
% \ldots & \ldots & \ldots \\
% \end{longtable}
% \end{minipage}
% \begin{minipage}[t]{0.58\linewidth}
% \begin{verbatim}
% \begin{longtable}{|l|l|l|}
% \ldots & \ldots & \ldots \\
% \hline
% Sept. 21 & 09:00 & event 1 \\
% \hline
% Sept. 22 & 10:00 & event 2 \\
% \hline
% \multirow{3}*{Sept. 23} & 10:00 & event 3 \\
% & 12:00 & event 4 \\
% & 15:00 & event 5 \\
% \hline
% Sept. 24 & 09:00 & event 6 \\
% \hline
% \ldots & \ldots & \ldots \\
% \end{longtable}
% \end{verbatim}
% \end{minipage}
%
% In this case if the ``Sept. 23'' entry comes close to the bottom of the
% page, you want to prevent the pagebreak to occur in the middle of this
% entry. You can do this by ending the intermediate rows with \verb+\\*+ instead of \verb+\\+.
%
% \begin{verbatim}
% \multirow{3}*{Sept. 23} & 10:00 & event 3 \\*
% & 12:00 & event 4 \\*
% & 15:00 & event 5 \\
% \end{verbatim}
%
% There is, however, a bug in \Package{longtable}, that causes the
% \verb+\\*+ not to work if it is followed by a \cs{cline}, like in the
% following example:
%
% \begin{verbatim}
% \multirow{3}*{Sept. 23} & 10:00 & event 3 \\*
% \cline{2-3}
% & 12:00 & event 4 \\*
% \cline{2-3}
% & 15:00 & event 5 \\
% \end{verbatim}
%
% \Package{multirow} has a package option \texttt{longtable} that redefines
% \cs{cline} so that the \verb+\\*+ will also work when followed by
% \cs{cline}. The code comes from David Carlisle.
%
% \subsection{Use with \Package{supertabular}}
% \label{sec:use-with-supertabular}
%
% \index{supertabular=\env{supertabular}|usage}
% \index{xtab=\env{xtab}|usage}
% With the package \Package{supertabular} (or the augmented version
% \Package{xtab}) there is the same requirement
% to keep the rows of a multirow together when a pagebreak occurs.
% Unfortunately, \Package{supertabular} does not have a way to specify
% that a pagebreak should be suppressed. I.e. \verb+\\*+ does not
% suppress a pagebreak.
% Therefore \Package{multirow} provides a package option
% \texttt{supertabular} that redefines \verb+\\*+ inside a
% \env{supertabular} to suppress the pagebreak. You should use
% this to end the intermediate rows in a multirow block. However, this
% does not cause \env{supertabular} to consider breaking the
% page before the \cs{multirow}, contrary to \env{longtable}.
% Thus the table may become too long.
%
% \DescribeMacro{\STneed}
% Therefore when the \texttt{supertabular} option is given,
% \Package{multirow} also provides a command \cs{STneed} to be used
% in a \env{supertabular} that specifies how much space we need
% on the page. Then if there is not enough space, a pagebreak will occur
% at that place. For example:
% \begin{verbatim}
% \tabletail{\hline}
% \begin{supertabular}{|l|l|l|}
% \ldots & \ldots & \ldots \\
% \hline
% Sept. 20 & 10:00 & event 1\\
% \hline
% Sept. 21 & 10:00 & event 2\\
% \hline
% Sept. 22 & 10:00 & event 3\\
% \hline
% \STneed {2cm}
% \multirow{3}*{Sept. 23} & 10:00 & event 4\\*
% \cline{2-3}
% & 12:00 & event 5 \\*
% \cline{2-3}
% & 15:00 & event 6 \\
% \hline
% Sept. 24 & 09:00 & event 7 \\
% \hline
% \ldots & \ldots & \ldots \\
% \end{verbatim}
%
% You will have to experiment a bit with the value to see
% what works. Sometimes it is better to exaggerate the required space a bit.
%
% \subsection{Dealing with tall entries}
% \label{sec:dealing-with-tall}
%
% Sometimes there are rows that are taller than what is expected. This
% section gives some hints how to deal with these situations. There are
% two cases:
% \begin{enumerate}
% \item When there is an exceptionally tall row outside of the multirow
% block the positioning of the \cs{multirow} might be wrong. This is
% because \cs{multirow} does not have information about the heights
% of the rows. This can happen for example when a large formula is
% entered in a cell, or a multi-line paragraph in a \texttt{[\{\}]}
% column. An example:
%
% \begin{quote}
% \begin{verbatim}
% \begin{tabular}{| l | l | p{4cm} |}
% \hline
% \multirow{3}*{Week 38} & Monday & Rain most of the day\\
% \cline{2-3}
% & Tuesday & Sunny with some clouds\\
% \cline{2-3}
% & Wednesday & A clear day with a lot of sunshine.
% However, the strong wind will bring down the
% temperature. \\
% \hline
% \end{tabular}
% \end{verbatim}
% \end{quote}
% \begin{quote}
% \begin{tabular}{| l | l | p{4cm} |}
% \hline
% \multirow{3}*{Week 38} & Monday & Rain most of the day\\
% \cline{2-3}
% & Tuesday & Sunny with some clouds\\
% \cline{2-3}
% & Wednesday & A clear day with a lot of sunshine.
% However, the strong wind will bring down the
% temperature. \\
% \hline
% \end{tabular}
% \end{quote}
% The \cs{multirow} is positioned on the second row, because it
% specifies that it should cover 3 rows. However, the second row is not
% the vertical center in this case because the third row is much taller.
%
% To remedy this, the \meta{vmove} parameter could be used. However, in
% this case it would be easier to pretend that \cs{multirow} spans 6
% rows (the total number of lines in the last column). So use
% \verb+\multirow{6}+\ldots{} and we get:
% \begin{quote}
% \begin{tabular}{| l | l | p{4cm} |}
% \hline
% \multirow{6}*{Week 38} & Monday & Rain most of the day\\
% \cline{2-3}
% & Tuesday & Sunny with some clouds\\
% \cline{2-3}
% & Wednesday & A clear day with a lot of sunshine.
% However, the strong wind will bring down the
% temperature. \\
% \hline
% \end{tabular}
% \end{quote}
% \item The second case is when the \cs{multirow} entry is taller than
% the surrounding normal rows. In that case the multirow text will stick
% out of its block. We must now enlarge the other rows, and that is
% something \cs{multirow} cannot do.
%
% An example:
% (Don't take this as a medical advice. The names are fake anyway.)
% \begin{verbatim}
% \begin{tabular}{| p{2mm} l | p{5cm} |}
% \hline
% \multicolumn{2}{|l|}{\textbf{Medicine \& dose}}
% & \textbf{Possible Side effects} \\
% \hline
% \multicolumn{2}{|l|}{Spirino}
% & \multirow{3}={Confusion,
% hallucinations, rapid breathing,
% seizure (convulsions);
% upset stomach, heartburn; severe nausea,
% vomiting, or stomach pain or mild headache.} \\
% \cline{1-2}
% & initial: 200 mg/day & \\
% \cline{1-2}
% & maintenance: 100-400 mg/day & \\
% \hline
% \multicolumn{2}{|l|}{Conzac}
% & \multirow{3}={Anxiety; nervousness;
% insomnia; anorexia; mild bradycardia;
% SA node slowing; weight loss;
% solar photosensitivity; hyponatremia;
% sexual dysfunction (both genders); may
% alter glycemic control in diabetic patients.} \\
% \cline{1-2}
% & initial: 10 mg/day & \\
% \cline{1-2}
% & maintenance: 10-40 mg/day & \\
% \hline
% \end{tabular}
% \end{verbatim}
% \begin{tabular}{| p{2mm} l | p{5cm} |}
% \hline
% \multicolumn{2}{|l|}{\textbf{Medicine \& dose}}
% & \textbf{Possible Side effects} \\
% \hline
% \multicolumn{2}{|l|}{Spirino}
% & \multirow{3}={Confusion,
% hallucinations, rapid breathing,
% seizure (convulsions);
% upset stomach, heartburn; severe nausea,
% vomiting, or stomach pain or mild headache.} \\
% \cline{1-2}
% & initial: 200 mg/day & \\
% \cline{1-2}
% & maintenance: 100-400 mg/day & \\
% \hline
% \multicolumn{2}{|l|}{Conzac}
% & \multirow{3}={Anxiety; nervousness;
% insomnia; anorexia; mild bradycardia;
% SA node slowing; weight loss;
% solar photosensitivity; hyponatremia;
% sexual dysfunction (both genders); may
% alter glycemic control in diabetic patients.} \\
% \cline{1-2}
% & initial: 10 mg/day & \\
% \cline{1-2}
% & maintenance: 10-40 mg/day & \\
% \hline
% \end{tabular}
% \\[2cm]
% Both \cs{multirow} entries are too high; the first sticks out into the
% second entry, and the second one sticks out of the table.
%
% There are two ways we can correct this:
% The simplest would be to add extra empty rows to cover the overlapping
% space. For the first entry that would be 2 extra rows; for the second
% 4. So we add twice \verb+ & & \\+ before the third \verb+\hline+,
% and four of these before the last \verb+\hline+.
% This gives us just the correct table:
% \\[5mm]
% \begin{tabular}{| p{2mm} l | p{5cm} |}
% \hline
% \multicolumn{2}{|l|}{\textbf{Medicine \& dose}}
% & \textbf{Possible Side effects} \\
% \hline
% \multicolumn{2}{|l|}{Spirino}
% & \multirow{3}={Confusion,
% hallucinations, rapid breathing,
% seizure (convulsions);
% upset stomach, heartburn; severe nausea,
% vomiting, or stomach pain or mild headache.} \\
% \cline{1-2}
% & initial: 200 mg/day & \\
% \cline{1-2}
% & maintenance: 100-400 mg/day & \\
% & & \\
% & & \\
% \hline
% \multicolumn{2}{|l|}{Conzac}
% & \multirow{3}={Anxiety; nervousness;
% insomnia; anorexia; mild bradycardia;
% SA node slowing; weight loss;
% solar photosensitivity; hyponatremia;
% sexual dysfunction (both genders); may
% alter glycemic control in diabetic patients.} \\
% \cline{1-2}
% & initial: 10 mg/day & \\
% \cline{1-2}
% & maintenance: 10-40 mg/day & \\
% & & \\
% & & \\
% & & \\
% & & \\
% \hline
% \end{tabular}
%
% The second way is to stretch the normal rows vertically, such that
% they fit with the multirow entry. In this table, where the font size
% is 10pt, each row has a total
% height of 12pt. For the first entry we need 24pt extra (2 rows),
% Because this space must be divided over 3 rows that is 8pt per row,
% making the total height of the row 20pt.
% The normal row has a height of 8.4pt and a depth of 3.6pt (total
% 12pt). We can add 4pt on the top and 4pt on the bottom, or any other
% combination that adds up to 8pt. In this case I have chosen to make
% the height 12pt and the depth 8pt. We do this with a \cs{rule} with 0 width.
% \DescribeMacro{\mystrut}
% \verb+\newcommand{\mystrut}{\rule[-8pt]{0pt}{20pt}}+
% and put \cs{mystrut} in each of the first 3 rows. By defining your own
% struts you have complete control over the layout. You can choose to
% give some rows more space than others, or to put all the space is the
% last row, for example.
%
% For the second entry we need 48pt extra (4 rows). We will use
% \cs{bigstrut} in each row, that is 16pt per row, and as a \cs{bigstrut} is
% 2\cs{bigstrutjot}s, we set \cs{bigstrutjot} to 8pt. The
% \Package{booktabs} package adds some extra vertical space around the rules,
% therefore when using the normal \env{tabular} environment, it
% is probably better to make the struts a little bit bigger, or a bit
% smaller with \Package{booktabs}. After some experimentation it appeared
% that a \cs{bigstrutjot} of \texttt{7pt} was enough. Of course we added
% the \meta{bigstruts} argument of \texttt{[tb6]} to the second
% multirow. Please note that this is not possible with our own struts,
% unless we cheat.
%
% \index{booktabs=\env{booktabs}|usage}
% Now with \Package{booktabs} the code becomes:
% \begin{verbatim}
% \newcommand{\mystrut}{\rule[-8pt]{0pt}{20pt}}
% \setlength{\bigstrutjot}{7pt}
% \begin{tabular}{ p{2mm} l p{5cm} }
% \toprule
% \multicolumn{2}{l}{\textbf{Medicine \& dose}}
% & \textbf{Possible Side effects} \\
% \cmidrule(r){1-2} \cmidrule(l){3-3}
% \multicolumn{2}{l}{Spirino} \mystrut
% & \multirow{3}={Confusion,
% hallucinations, rapid breathing,
% seizure (convulsions);
% upset stomach, heartburn; severe nausea,
% vomiting, or stomach pain or mild headache.} \\
% \cmidrule(r){1-2}
% & initial: 200 mg/day \mystrut & \\
% \cmidrule(r){1-2}
% & maintenance: 100-400 mg/day \mystrut & \\
% \midrule
% \multicolumn{2}{l}{Conzac} \bigstrut
% & \multirow{3}[tb6]={Anxiety; nervousness;
% insomnia; anorexia; mild bradycardia;
% SA node slowing; weight loss;
% solar photosensitivity; hyponatremia;
% sexual dysfunction (both genders); may
% alter glycemic control in diabetic patients.} \\
% \cmidrule(r){1-2}
% & initial: 10 mg/day \bigstrut & \\
% \cmidrule(r){1-2}
% & maintenance: 10-40 mg/day \bigstrut & \\
% \bottomrule
% \end{tabular}
% \end{verbatim}
%
% \newcommand{\mystrut}{\rule[-8pt]{0pt}{20pt}}
% \setlength{\bigstrutjot}{7pt}
% \begin{tabular}{ p{2mm} l p{5cm} }
% \toprule
% \multicolumn{2}{l}{\textbf{Medicine \& dose}}
% & \textbf{Possible Side effects} \\
% \cmidrule(r){1-2} \cmidrule(l){3-3}
% \multicolumn{2}{l}{Spirino} \mystrut
% & \multirow{3}={Confusion,
% hallucinations, rapid breathing,
% seizure (convulsions);
% upset stomach, heartburn; severe nausea,
% vomiting, or stomach pain or mild headache.} \\
% \cmidrule(r){1-2}
% & initial: 200 mg/day \mystrut & \\
% \cmidrule(r){1-2}
% & maintenance: 100-400 mg/day \mystrut & \\
% \midrule
% \multicolumn{2}{l}{Conzac} \bigstrut
% & \multirow{3}[tb6]={Anxiety; nervousness;
% insomnia; anorexia; mild bradycardia;
% SA node slowing; weight loss;
% solar photosensitivity; hyponatremia;
% sexual dysfunction (both genders); may
% alter glycemic control in diabetic patients.} \\
% \cmidrule(r){1-2}
% & initial: 10 mg/day \bigstrut & \\
% \cmidrule(r){1-2}
% & maintenance: 10-40 mg/day \bigstrut & \\
% \bottomrule
% \end{tabular}
% \end{enumerate}
%
% \section{Using \Package{bigstrut}}
%
% \DescribeMacro{\bigstrut}
% \DescribeMacro{\bigstrutjot}
% \cs{bigstrut}\oarg{x} produces a strut (a rule with width 0) which is \cs{bigstrutjot}
% (\texttt{2pt} by default) higher, lower, or both than the standard
% \env{array}/\env{tabular} strut. Use it in table entries that are adjacent to
% \cs{hline}s to leave an extra bit of space\,---\,according to the
% TeXbook (page 246), ``This is a little touch that improves the
% appearance of boxed tables; look for it as a mark of quality.''
%
% Although you could use \cs{bigstrut} in an array, there isn't normally
% much point since arrays are `opened up' by \cs{jot} anyway.
%
% \cs{bigstrut[t]} adds height; \cs{bigstrut[b]} adds
% depth. Just \cs{bigstrut} adds both. So: Use
% \cs{bigstrut[t]} in the row just \emph{after} an \cs{hline};
% \cs{bigstrut[b]} in the row just \emph{before}; and
% \cs{bigstrut} if there are \cs{hline}s both before and after.
%
% Spaces after the \cs{bigstrut} are ignored, even if it has an optional
% argument. Spaces before the \cs{bigstrut} are generally ignored (by a
% single \cs{unskip}).
%
% \DescribeMacro{\bigstrutjot}
% Note: The \Package{multirow} package makes use of \cs{bigstrutjot}. If
% both packages are used, they can be used in either order, as each checks
% to see if the other has already defined \cs{bigstrutjot}. However,
% the default values they set are different: if only \Package{multirow}
% is used, \cs{bigstrutjot} will be set to \texttt{3pt}.
% If \Package{bigstrut} is used, with or without \Package{multirow},
% \cs{bigstrutjot} will be \texttt{2pt}.
%
% \section{Using \Package{bigdelim}}
%
% The package is for working in a \env{tabular} or \env{array}
% environment, in which the \Package{multirow} package is also used.
%
% \DescribeMacro{\ldelim}
% \DescribeMacro{\rdelim}
% Syntax of use is
% \begin{quote}
% \cs{ldelim} ( \marg{n}\oarg{vmove}\marg{width}\oarg{text}\\
% \cs{rdelim} ) \marg{n}\oarg{vmove}\marg{width}\oarg{text}
% \end{quote}
% The commands are used in a column of a \env{tabular} or
% \env{array}; they create a big parenthesis, brace or whatever
% delimiter that extends over the \meta{n} rows starting at the one
% containing the command. Corresponding cells in the following rows
% must be explicitly given as empty cells.
%
% The first parameter is a delimiter to be used, e.g., \cs{\char`\{}
% \cs{\char`\}} \texttt{[} \texttt{]} \texttt{(} \texttt{)}\,---\,in fact,
% anything that can be used with \cs{left} or \cs{right}, as appropriate.
%
% Here is an example:
% \begin{quote}
% \begin{verbatim}
% \begin{equation}
% \begin{array}{ccccccc}
% \ldelim({4}{4mm} & x & x & x & x & \rdelim){4}{4mm} \\
% & x & x & x & x & & i \\
% & x & x & x & x & & j \\
% & x & x & x & x & \\
% & & u & v & &
% \end{array}
% \end{equation}
% \end{verbatim}
% \end{quote}
%
% \begin{quote}
% \begin{equation}
% \begin{array}{ccccccc}
% \ldelim({4}{4mm} & x & x & x & x & \rdelim){4}{4mm} \\
% & x & x & x & x & & i \\
% & x & x & x & x & & j \\
% & x & x & x & x & \\
% & & u & v & &
% \end{array}
% \end{equation}
% \end{quote}
%
% The optional parameter \meta{vmove} is a length used for fine-tuning: the
% delimiter (with the optional \meta{text}) will be raised (or lowered, if
% \meta{vmove} is negative) by that length above (below) wherever it would
% otherwise have gone. This is just like with \cs{multirow}, but note that
% here the \meta{vmove} goes before the \meta{width}.
%
% When \cs{ldelim} is used, the optional \meta{text} is set centred to the left of \cs{ldelim}.
% If \cs{rdelim} is used it is set to the right of \cs{rdelim}. The
% \meta{width} parameter is the space that is reserved for
% the delimiter and its text; as with the
% \Package{multirow} package, the \meta{width} may be given as
% \texttt{*}. Compare for example these:
% \begin{quote}
% \begin{minipage}{0.6\linewidth}
% \begin{verbatim}
% \begin{tabular}{p{2em}l}
% \ldelim\{{3}{*}[type] & dvi \\
% & ps \\
% & pdf \\
% \end{tabular}
% \end{verbatim}
% \end{minipage}
% \begin{minipage}{0.35\linewidth}
% \begin{tabular}{p{2em}l}
% \ldelim\{{3}{*}[type] & dvi \\
% & ps \\
% & pdf \\
% \end{tabular}
% \\[2ex]
% \end{minipage}
%
% \begin{minipage}{0.6\linewidth}
% \begin{verbatim}
% \begin{tabular}{l@{\,}l}
% \ldelim\{{3}{*}[type] & dvi \\
% & ps \\
% & pdf \\
% \end{tabular}
% \end{verbatim}
% \end{minipage}
% \begin{minipage}{0.35\linewidth}
% \begin{tabular}{l@{\,}l}
% \ldelim\{{3}{*}[type] & dvi \\
% & ps \\
% & pdf \\
% \end{tabular}
% \\[2ex]
% \end{minipage}
% \end{quote}
% In the first example we cheated: by using a column width that is too
% small, we swallowed up some of the intercolumn space, at the cost of
% an ``Overfull \cs{hbox}'' message. In the second example we did it the
% proper way by inserting \verb+@{\,}+ to replace the default
% intercolumn space with a narrow space.
%
% Also the commands may be
% used in the last row of the extension with a negative \meta{n}
% \index{colortbl=\Package{colortbl}|usage}
% argument. This is useful in combination with the \Package{colortbl}
% \index{xcolor=\Package{xcolor}|usage}
% or \Package{xcolor} packages
% (see the discussion in section \ref{sec:multirow} on \Package{multirow}).
% If there are unusually tall rows you may have to enlarge \meta{n}
% (you can use fractional values).
% If you have horizontal lines that interact with the braces you are
% \index{hhline=\Package{hhline}|usage}
% advised to use the \Package{hhline} package to make the lines.
%
% If you decrease or eliminate the intercolumn space with \verb|@{}| and
% use colored backgrounds with the \Package{colortbl} or
% \Package{xcolor} packages (commands \verb|\columncolor|,
% \verb|\rowcolor|, \verb|\rowcolors| or \verb|\cellcolor|),
% \index{columncolor=\verb!*+\columncolor+|usage}
% \index{rowcolor=\verb!*+\rowcolor+|usage}
% \index{rowcolors=\verb!*+\rowcolors+|usage}
% \index{cellcolor=\verb!*+\cellcolor+|usage}
% you will notice that part of the brace will be cut off. In reality it
% will be overwritten with the color of the next cell. See this example:
%
% \begin{quote}
% \begin{minipage}{0.6\linewidth}
% \begin{verbatim}
% \rowcolors{2}{green!25}{green!75}
% \begin{tabular}{ c @{}c c c }
% & 1 & 2 & 3 \\
% & 4 & 5 & 6 \\
% \ldelim\{{-3}{*} & 7 & 8 & 9 \\
% \end{tabular}
% \end{verbatim}
% \end{minipage}
% \begin{minipage}{0.35\linewidth}
% \rowcolors{2}{green!25}{green!75}
% \begin{tabular}{ c @{}c c c }
% & 1 & 2 & 3 \\
% & 4 & 5 & 6 \\
% \ldelim\{{-3}{*} & 7 & 8 & 9 \\
% \end{tabular}
% \\[2ex]
% \end{minipage}
% \end{quote}
%
% This is not a problem of \Package{multirow} or \Package{bigdelim};
% it will also happen if there is normal text in the column before the
% \verb|@{}|. The reason is that these color commands extend the color
% to cover the intercolumn spaces on both sides to prevent gaps in the
% color. The size of these so-called \textit{overhangs} is \verb|\tabcolsep| (or
% \verb|\arraycolsep| when an \env{array} is used) on each side.
% However, when \verb|@{}| is used there is no such intercolumn space
% and the extension covers parts of the previous column.
% This can be cured by setting the left \textit{overhang} explicitly to
% 0pt with a \verb|\columncolor| command in the tabular header, like
% \verb|>{\columncolor{white}[0pt][\tabcolsep]}|. Unfortunately the
% explicit color \texttt{white}, removes the transparency of the column,
% so if there are cells in that column that have no explicit color,
% these cells are affected. If the background of the \env{tabular} is
% white, this normally will not be noticed, but if the background color
% is changed, for example with the \verb|\pagecolor| command, then that color
% should be used rather than \texttt{white}. Unfortunately, there is no
% command to specify the \textit{overhangs} without also specifying a
% color.
%
% In the following example we have done this. In order to keep the table
% header compact, we put the deinition in a \verb|\newcolumn| command
% (using the \Package{array} package).
%
% \begin{quote}
% \begin{minipage}{0.6\linewidth}
% \begin{verbatim}
% \newcolumntype{z}{@{}>{\columncolor{white}[0pt][\tabcolsep]}}
% \rowcolors{2}{green!25}{green!75}
% \begin{tabular}{ c zc c c }
% & 1 & 2 & 3 \\
% & 4 & 5 & 6 \\
% \ldelim\{{-3}{*} & 7 & 8 & 9 \\
% \end{tabular}
% \end{verbatim}
% \end{minipage}
% \begin{minipage}{0.35\linewidth}
% \newcolumntype{z}{@{}>{\columncolor{white}[0pt][\tabcolsep]}}
% \rowcolors{2}{green!25}{green!75}
% \begin{tabular}{ c zc c c }
% & 1 & 2 & 3 \\
% & 4 & 5 & 6 \\
% \ldelim\{{-3}{*} & 7 & 8 & 9 \\
% \end{tabular}
% \\[2ex]
% \end{minipage}
% \end{quote}
%
% In case you want to have a paragraph type text as optional parameter you could put it in a \cs{parbox}.
% Alternatively you could add an extra column with the text in a \cs{multirow}, like in
% \begin{quote}
% \begin{verbatim}
% \begin{tabular}{l@{}l@{}l}
% dvi & \rdelim\}{3}{1em} & \multirow{3}{4cm}{These are the output types,
% that are commonly used for \TeX.} \\
% ps & & \\
% pdf & & \\
% \end{tabular}
% \end{verbatim}
% \end{quote}
% \begin{quote}
% \begin{tabular}{l@{}l@{}l}
% dvi & \rdelim\}{3}{1em} & \multirow{3}{4cm}{These are the output types,
% that are commonly used for \TeX.} \\
% ps & & \\
% pdf & & \\
% \end{tabular}
% \end{quote}
% Note that we used \texttt{@\{\}} to eliminate the intercolumn space to
% get the text tight to the brace.
% \section{Contact Information}
%
% Pieter van Oostrum\\
% email: \texttt{pieter@vanoostrum.org}\\
% www: \url{http://pieter.vanoostrum.org}
% \\[1ex]
% The source code can be found on Github:\\
% \url{https://github.com/pietvo/multirow}\\
% Bugs can be reported at\\
% \url{https://github.com/pietvo/multirow/issues}
%
% \StopEventually{%
% \PrintChanges
% \PrintIndex}
%
% \section{Implementation}
%
%
%\subsection{The \Package{multirow} package}
%\label{sec:pack-multirow}
% \iffalse
%<*multirow>
% \fi
%
% \changes{multirow v1.0}{}{distributed anonymously, based on a Usenet posting}
% \changes{multirow v1.1}{}{allow it to work without bigstrut.sty (Pieter van Oostrum)}
% \changes{multirow v1.2}{}{modified by Jerry Leichter for the same goal, but using a
% different approach which will work properly with bigstrut.sty}
% \changes{multirow v1.2a}{}{modified by Pieter van Oostrum to use \cs{vskip}
% instead of \cs{raise} in positioning, avoiding making rows too high
% when the adjustment is large}
% \changes{multirow v1.3}{}{modified by Pieter van Oostrum to work properly in a p{} column
% (\cs{leavevmode} added)}
% \changes{multirow v1.4}{}{modified by Pieter van Oostrum to check for the special case that
% the width is given as an *. In this case the natural
% width of the text argument will be used and the argument
% is processed in LR-mode.}
% \changes{multirow v1.5}{}{modified by Pieter van Oostrum: Added a \texttt{\%} after \texttt{\cs{hbox}\{\#5\}\cs{vfill}}.\\
% Added \cs{strut}s around \#5 for better vertical positioning.
% Additional coding for negative value of \meta{nrows}.}
% \changes{multirow v1.6}{2004/05/05}{modified by Pieter van Oostrum: Replace a space by \cs{relax} after
% \texttt{\cs{advance}\cs{multirow@dima}\#4}}
%
% \changes{v1.9a}{2016/09/23}{Implement the \texttt{debug} option.}
%
% \begin{macro}{\ifmultirowdebug}
% \begin{macro}{\multirowdebugtrue}
% \begin{macro}{\multirowdebugfalse}
% This is a boolean to [de]activate debugging (showing the generated box
% contents). It is activated by the \texttt{debug} package option. The
% \cs{newif} initializes it to false.
% \begin{macrocode}
\newif\ifmultirowdebug
\DeclareOption{debug}{\multirowdebugtrue}
% \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
%
% \changes{v1.9b}{2016/09/24}{Implement the \texttt{longtable} option.}
% \changes{v2.5}{2019/05/31}{Make the redefinition of \cs{@cline}
% compatible with the \Package{colortbl} package.}
% \begin{macro}{\cline}
% The package option \texttt{longtable} redefines the \cs{cline} macro to
% work around a bug in \Package{longtable}. See section \ref{sec:use-with-longtable}\footnote{%
% Thanks to David Carlisle. See
% \href{http://tex.stackexchange.com/questions/52100/longtable-multirow-problem-with-cline-and-nopagebreak\#answer-52101}{his answer on stackexchange}.}.
% First we check if the macro \cs{CT@arc} is defined. If so, this
% indocates that the \Package{colortbl} package is loaded. As
% \Package{colortbl} also redefines \cs{@cline}, we must take this into
% account with our own redefinition of \cs{@cline}.
% \begin{macrocode}
\DeclareOption{longtable}{%
\AtBeginDocument{%
\@ifundefined{CT@arc}
{\def\@cline#1-#2\@nil{%
\omit
\@multicnt#1%
\advance\@multispan\m@ne
\ifnum\@multicnt=\@ne\@firstofone{&\omit}\fi
\@multicnt#2%
\advance\@multicnt-#1%
\advance\@multispan\@ne
\leaders\hrule\@height\arrayrulewidth\hfill
\cr
\noalign{\nobreak\vskip-\arrayrulewidth}}}
{\def\@cline#1-#2\@nil{%
\omit
\@multicnt#1%
\advance\@multispan\m@ne
\ifnum\@multicnt=\@ne\@firstofone{&\omit}\fi
\@multicnt#2%
\advance\@multicnt-#1%
\advance\@multispan\@ne
{\CT@arc@\leaders\hrule\@height\arrayrulewidth\hfill}%
\cr
\noalign{\nobreak\vskip-\arrayrulewidth}}}
}}
% \end{macrocode}
% \end{macro}
%
% \changes{v1.9b}{2016/09/26}{Implement the \texttt{supertabular} option
% and the \cs{STneed} command.}
% The package option \texttt{supertabular} redefines \verb+\\*+ inside a
% \env{supertabular}.
% The redefinition is delayed until the \verb+\begin{document}+.
%
% \changes{v2.6}{2020/12/26}{Adapt the definition to be compatible with
% modern versions of \texttt{supertabular}}
% \texttt{Supertabular} version 4.1f and later need a call to
% \cs{ST@save@lineno} to function properly, but earlier versions cannot
% use this as it doesn't exist in these versions. So the definitions of
% both \cs{ST@tabularcr} and \cs{MRST@cr} are different depending on whether
% \cs{ST@save@lineno} is defined. There are also some other differences,
% so some intermediate versions of \texttt{supertabular} might need more
% subtle adaptations, but for now we leave it at that.
%
% \begin{macrocode}
\DeclareOption{supertabular}{%
\AtBeginDocument{%
% \end{macrocode}
% \begin{macro}{\ST@tabularcr}
% This macro is the definition of \verb+\\+ inside a
% \env{supertabular}. We check for a \verb+*+, and if it is
% present we call our own version, otherwise the
% \env{supertabular} version. First we get the older version for
% pre-4.1f \texttt{supertabular}, then the newer version.
% \begin{macrocode}
\ifx\ST@save@lineno\undefined
\def\ST@tabularcr{%
{\ifnum0=`}\fi
\@ifstar{\MRST@xtabularcr}{\ST@xtabularcr}}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\MRST@cr}
% \cs{MRST@cr} is a truncated copy of \cs{ST@cr}. It does all the bookkeeping
% about the space the \env{longtable} occupies, but it doesn't
% do the pagebreaking part.
% \begin{macrocode}
\def\MRST@cr{%
\noalign{%
\ifnum\ST@pboxht<\ST@lineht
\global\advance\ST@pageleft -\ST@lineht
\global\ST@prevht\ST@lineht
\else
\global\advance\ST@pageleft -\ST@pboxht
\global\advance\ST@pageleft -0.1\ST@pboxht
\global\advance\ST@pageleft -\ST@stretchht
\global\ST@prevht\ST@pboxht
\global\ST@pboxht\z@
\fi
\global\advance\ST@pageleft -\ST@toadd
\global\ST@toadd=\z@}}
\else
% \end{macrocode}
% These are the newer versions.
% \begin{macrocode}
\def\ST@tabularcr{%
{\ifnum0=`}\fi
\ST@save@lineno
\@ifstar{\MRST@xtabularcr}{\ST@xtabularcr}}
\def\MRST@cr{%
\noalign{%
\ifnum\ST@pboxht<\ST@lineht
\global\advance\ST@pageleft -\ST@lineht
\global\ST@prevht\ST@lineht
\else
\ST@trace@cr\thr@@{Added par box with height \the\ST@pboxht}%
\global\advance\ST@pageleft -\ST@pboxht
\global\advance\ST@pageleft -0.1\ST@pboxht
\global\ST@prevht\ST@pboxht
\global\ST@pboxht\z@
\fi
\global\advance\ST@pageleft -\ST@toadd
\global\ST@toadd=\z@
\ST@trace@cr\thr@@{Space left for tabular: \the\ST@pageleft}}}
\fi
% \end{macrocode}
% \end{macro}
% \begin{macro}{\MRST@xtabularc}
% \begin{macro}{\MRST@argtabularc}
% \begin{macro}{\MRST@xargtabularc}
% \begin{macro}{\MRST@yargtabularc}
% These are copies of the corresponding macros from
% \Package{supertabular}, but instead of \cs{ST@cr} they call \cs{MRST@cr}.
% \begin{macrocode}
\def\MRST@xtabularcr{%
\@ifnextchar[%]
{\MRST@argtabularcr}%
{\ifnum0=`{\fi}\cr\MRST@cr}}
\def\MRST@argtabularcr[#1]{%
\ifnum0=`{\fi}%
\ifdim #1>\z@
\unskip\MRST@xargarraycr{#1}
\else
\MRST@yargarraycr{#1}%
\fi}
\def\MRST@xargarraycr#1{%
\@tempdima #1\advance\@tempdima \dp \@arstrutbox
\vrule \@height\z@ \@depth\@tempdima \@width\z@ \cr
\noalign{\global\ST@toadd=#1}\MRST@cr}
\def\MRST@yargarraycr#1{%
\cr\noalign{\vskip #1\global\MRST@toadd=#1}\MRST@cr}
}
% \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \begin{macro}{\STneed}
% This macro can be used in a \env{supertabular} to indicate how
% much space a multirow entry needs. See section~\ref{sec:use-with-supertabular}.
% \begin{macrocode}
\def\STneed#1{\ifdim\ST@pageleft<#1\ST@newpage\ST@next\fi}
}
% \end{macrocode}
% \end{macro}
% \begin{macrocode}
\ProcessOptions
% \end{macrocode}
%
% \cs{multirow@colwidth} is a length that is used to implement the ``\texttt{=}'' variant of \meta{width}.
%
% \changes{v1.9}{2016/09/15}{Implement the ``\texttt{!=}'' option for \cs{multirow}'s \meta{width} parameter.}
% \begin{macro}{\multirow@colwidth}
% \cs{multirow@colwidth} is a length that is used to implement the ``\texttt{=}'' variant of \meta{width}.
% \begin{macrocode}
\newlength{\multirow@colwidth}
% \end{macrocode}
% \end{macro}
%
% \changes{v1.9}{2016/09/15}{Give \Package{multirow} its own temp
% registers, so that we can safely pass the box height to \Package{bigdelim}.}
% \changes{v2.2}{2016/11/25}{Eliminate \cs{multirow@cnta.}}
% \begin{macro}{\multirow@cntb}
% \begin{macro}{\multirow@dima}
% Define two counters and a length for internal use in \cs{multirow}.
% \begin{macrocode}
\newcount\multirow@cntb
\newlength\multirow@dima
% \end{macrocode}
% \end{macro}
% \end{macro}
% \begin{macro}{\multirow@setcolwidth}
% This macro calculates \cs{multirow@colwidth} for an entry that has the
% \meta{width} given as ``\texttt{=}''. We check if we are inside a
% \env{tabulary} environment, by checking if \cs{TY@final} is defined.
% If not, then \cs{multirow@colwidth} = \cs{hsize}. The \env{tabulary}
% environment will make two passes. On the first pass, we set \cs{multirow@colwidth}
% to the size that the text would have in LR mode (with newlines replaced
% by spaces), so that \env{tabulary} will gives us enough space.
% On the second pass (characterized by \cs{TY@box} = \cs{TY@box@v}) we use
% the value that \env{tabulary} has given us in \cs{hsize}.
% This algorithm is not perfect, but good enough in most cases.
% \changes{v2.7}{2021/01/29}{Make \cs{multirow@setcolwidth} \cs{long} to allow
% multi-paragraph text}
% \begin{macrocode}
\long\def\multirow@setcolwidth#1{%
\ifx\TY@final\multirow@undefined \multirow@colwidth=\hsize
\else
\ifx\TY@box\TY@box@v\multirow@colwidth=\hsize
\else \setbox0\hbox
{\let\\\space\let\newline\space #1}\multirow@colwidth=\wd0
\fi
\fi}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\multirowsetup}
% \cs{multirowsetup} is executed at the beginning of each \cs{multirow}.
% \begin{macrocode}
\newcommand\multirowsetup{\raggedright}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\multirow@vbox}
% This creates the \cs{vbox}. Parameters:\\
% \texttt{\#1} = \meta{vpos}, \texttt{\#2} = initialization code (for
% example to set the width of the \cs{parbox}), \texttt{\#3} = box contents.\\
% Depending on the \meta{vpos} parameter, it will be top-aligned,
% vertically centered, or bottom-aligned. This is done by inserting
% \cs{vfill} in the proper places.\\
% Note: the \cs{relax} is to protect against an empty \meta{vpos}
% argument.
% \begin{macrocode}
\long\def\multirow@vbox#1#2#3{\setbox0\vtop to \multirow@dima{#2%
\if #1t\relax\else\vfill\fi
\multirowsetup #3\if #1b\relax\else\vfill\fi}}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\multirow}
% Make an entry that will span multiple rows of a table.\\
% First collect all the arguments and replace missing optional arguments by their default values.
% \changes{v1.8}{2016/09/14}{Add the optional first parameter \meta{vpos}.}
% \begin{macrocode}
%% \multirow [vpos] {nrows} [bigstruts] {width} [vmove] {text}
\newcommand\multirow[2][c]{\@multirow[#1]{#2}}
\def\@multirow[#1]#2{\@ifnextchar[{\@@multirow[#1]#2}{\@@multirow[#1]#2[0]}}
\def\@@multirow[#1]#2[#3]#4{\@ifnextchar[{\@xmultirow[#1]{#2}[#3]{#4}}%
{\@xmultirow[#1]{#2}[#3]{#4}[0pt]}}
% \end{macrocode}
% \changes{v1.9a}{2016/09/23}{Add the optional prefix to the \meta{bigstruts} parameter.}
% \begin{macro}{\multirow@piii}
% \begin{macro}{\ifmultirow@prefixt}
% \begin{macro}{\multirow@prefixttrue}
% \begin{macro}{\multirow@prefixtfalse}
% \begin{macro}{\ifmultirow@prefixb}
% \begin{macro}{\multirow@prefixbtrue}
% \begin{macro}{\multirow@prefixbfalse}
% This macro splits off a \texttt{t}, \texttt{b}, or \texttt{tb} prefix
% of the \meta{bigstruts} argument, and sets \cs{multirow@cntb} to
% the numerical value. The prefix is remembered in two booleans:
% \cs{ifmultirow@prefixt} and \cs{ifmultirow@prefixb}.
% \begin{macrocode}
\newif\ifmultirow@prefixt
\newif\ifmultirow@prefixb
\def\multirow@piii#1#2#3\end{\multirow@prefixtfalse\multirow@prefixbfalse
\if t#1\multirow@prefixttrue
\if b#2\multirow@prefixbtrue \multirow@cntb=#3%
\else \multirow@cntb=#2#3%
\fi
\else
\if b#1\multirow@prefixbtrue \multirow@cntb=#2#3%
\else \multirow@cntb=#1#2#3%
\fi
\fi}
% \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
%
% This is the real workhorse. It starts with splitting the
% \meta{bigstruts} argument, and then calculating the height of the multirow box.
% \changes{v2.2}{2016/11/25}{Support fractional values for \meta{nrows}.}
% Because \meta{nrows} (\verb+#2+) can be fractional, we cannot use
% \cs{ifnum} to test for positive or negative. Therefore we use
% \cs{ifdim} by putting a unit (\texttt{pt}) after the number.
% \changes{v2.4}{2019/01/01}{Support calc compatible expressions for \meta{width} and
% \meta{vmove}.}
% \changes{v2.7}{2021/01/29}{Make \cs{@xmultirow} \cs{long} to allow
% multi-paragraph text}
% \begin{macrocode}
\long\def\@xmultirow[#1]#2[#3]#4[#5]#6{%
\expandafter\multirow@piii#3\relax\end%
\setlength\multirow@dima{#2\ht\@arstrutbox}%
\addtolength\multirow@dima{#2\dp\@arstrutbox}%
\ifdim#2pt<\z@\setlength\multirow@dima{-\multirow@dima}\fi
\addtolength\multirow@dima{\multirow@cntb\bigstrutjot}%
% \end{macrocode}
% \changes{v1.9a}{2016/09/23}{Redo the \cs{vbox} calculation and positioning.}
% The text is set in a \cs{vbox} by calling \cs{multirow@vbox}. \\
% If the \meta{width} argument is \texttt{*} set just the text in the \cs{vbox}.
% \begin{macrocode}
\if*#4\multirow@vbox{#1}{}{\hbox{\strut#6\strut}}%
% \end{macrocode}
% Otherwise set it in a \cs{parbox} inside a \cs{vbox}. \\
% If the \meta{width} argument is given as ``\texttt{=}'', we calculate
% \cs{multirow@colwidth} and use that as width of the \cs{parbox}.
% \begin{macrocode}
\else \if=#4\multirow@setcolwidth{#6}%
\multirow@vbox{#1}{\setlength\hsize{\multirow@colwidth}\@parboxrestore}{\strut#6\strut\par}%
% \end{macrocode}
% Otherwise the given argument is used as the width of the \cs{parbox}.
% \begin{macrocode}
\else \multirow@vbox{#1}{\setlength\hsize{#4}\@parboxrestore}{\strut#6\strut\par}%
\fi \fi
% \end{macrocode}
% Now position the \cs{vbox} properly. More details are given in the
% appendix. The overview of the calculation of the shift amount can be
% found in section~\ref{sec:overview}.
%
% If \meta{nrows}${}> 0$: \\
% If \meta{vpos} = \texttt{[t]}, then the box is already positioned
% correctly (the baseline is on the baseline of the row). However, later
% the top of the box will be taken as the reference point (instead
% of the baseline), therefore we take
% the height of the box (h) as the shift amount. See fig.~\ref{fig:top-t}.\\
% If \meta{vpos} = \texttt{[c]} we shift it up h1 (see fig.~\ref{fig:top-c}), where h1 = \cs{ht}\cs{@arstrutbox}
% + (\cs{bigstrutjot} \cs{ifmultirow@prefixt}).\\
% If \meta{vpos} = \texttt{[b]} we shift it up h1 + h2 (see fig.~\ref{fig:top-b}), where h2 = \cs{dp}\cs{@arstrutbox}
% + (\cs{bigstrutjot} \cs{ifmultirow@prefixb}).\\
% We calculate the required shift in \cs{multirow@dima}.
% \begin{macrocode}
\ifdim#2pt>\z@
\if#1t\relax\setlength\multirow@dima{\ht0}\else
\setlength\multirow@dima{\ht\@arstrutbox}%
\ifmultirow@prefixt \addtolength\multirow@dima{\bigstrutjot}\fi
\if#1b\relax \addtolength\multirow@dima{\dp\@arstrutbox}%
\ifmultirow@prefixb \addtolength\multirow@dima{\bigstrutjot}\fi
\fi
\fi
% \end{macrocode}
% If \meta{nrows}${}< 0$: \\
% If \meta{vpos} = \texttt{[t]}, shift the box up $\textrm{H} -
% \textrm{h1} -\textrm{h2} + \textrm{h}$. See fig.~\ref{fig:bot-t}.\\
% If \meta{vpos} = \texttt{[c]}, shift the box up $\textrm{H} - \textrm{h2}$. See fig.~\ref{fig:bot-c}.\\
% If \meta{vpos} = \texttt{[b]}, shift the box up H. See fig.~\ref{fig:bot-b}.\\
% H is the current value of \cs{multirow@dima}.
% \begin{macrocode}
\else
\if#1b\relax\else
\addtolength\multirow@dima{-\dp\@arstrutbox}%
\ifmultirow@prefixb \addtolength\multirow@dima{-\bigstrutjot}\fi
\if#1t\relax\addtolength\multirow@dima{-\ht\@arstrutbox}%
\ifmultirow@prefixt \addtolength\multirow@dima{-\bigstrutjot}\fi
\addtolength\multirow@dima{\ht0}%
\fi
\fi
\fi
% \end{macrocode}
% \changes{v2.1}{2016/10/11}{Set depth of final \cs{vbox} to 0, to
% prevent a tall multirow line to push the following rows downwards.}
% Finally, we add the \meta{vmove} argument (\verb+#5+), and go into
% horizontal mode. Then we shift the box up by putting a \cs{vskip} above it,
% and add it to the output. Because of the \cs{vskip} the resulting box
% will have a height 0. We set the depth of the \cs{vbox}
% to 0, so that it will not influence the depth of the current row.\\
% If \cs{multirowdebug} is true, we show the box.
% \begin{macrocode}
\addtolength\multirow@dima{#5}%
\leavevmode
\setbox0\vtop{\vskip-\multirow@dima\box0\vss}\dp0=\z@
\ifmultirowdebug{\showboxdepth=5 \showboxbreadth=10 \showbox0}\fi
\box0
}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\bigstrutjot}
% Define \cs{bigstrutjot} if not already defined.
% \begin{macrocode}
\@ifundefined{bigstrutjot}{\newdimen\bigstrutjot \bigstrutjot=\jot}{}
% \end{macrocode}
% \end{macro}
% \iffalse
%</multirow>
% \fi
%
% \subsection{The \Package{bigstrut} package}
% \label{sec:pack-bigstrut}
%
% \iffalse
%<*bigstrut>
% \fi
% \changes{bigstrut v1.0}{1994/05/31}{Initial version}
% \begin{macro}{\bigstrutjot}
% This is a length. By default it is set to 2pt. You can change it
% with the \cs{setlength} command.
% \begin{macrocode}
\@ifundefined{bigstrutjot}{\newdimen\bigstrutjot}{}\bigstrutjot=2pt
% \end{macrocode}
% \end{macro}
%
% \changes{bigstrut v2.4}{2018/12/30}{Add \cs{leavevmode}
% at the beginning to force horizontal mode}
% \begin{macro}{\bigstrut}
% This macro inserts a strut. Depending on the optional parameter it extends
% above and/or below the standard \env{array}/\env{tabular} strut.
% \begin{macrocode}
\newcommand\bigstrut[1][x]{%
\leavevmode\unskip\@tempdima=\ht\@arstrutbox \@tempdimb=\dp\@arstrutbox
\ifx #1b\relax \else \advance\@tempdima by \bigstrutjot\fi
\ifx #1t\relax \else \advance\@tempdimb by \bigstrutjot\fi
\hbox{\vrule \@height\@tempdima \@depth\@tempdimb \@width\z@}\ignorespaces}
% \end{macrocode}
% \end{macro}
%
% \iffalse
%</bigstrut>
% \fi
%
% \subsection{The \Package{bigdelim} package}
% \label{sec:pack-bigdelim}
% \iffalse
%<*bigdelim>
% \fi
% \changes{bigdelim v0.0}{1994/10/02}{bigbrace.sty by \O ystein Bache}
% \changes{bigdelim v1.0}{1999/11/05}{Initial version bigdelim.sty}
% \begin{macrocode}
\RequirePackage{multirow}
% \end{macrocode}
% \begin{macro}{\ldelim}
% This macro typesets a left delimiter. It calls \cs{multirow} with the proper arguments.
% The size of the delimiter is determined by putting a \cs{vbox} with the proper height and
% zero width next to it. The height is the one that \cs{multirow}
% already has calculated in \cs{multirow@dima}. That calculation uses
% the size of \cs{@arstrutbox}, which is set by \texttt{tabular} or
% \texttt{array} environments. In case it is not set, we initialize it
% to a default value.
% \changes{bigdelim v2.3}{2018/08/03}{Replace \cs{textrm} by \cs{textnormal}}
% \changes{bigdelim v2.6}{2020/12/26}{Initialize \cs{@arstrutbox} if not defined}
% \changes{bigdelim v2.8}{2021/03/15}{Add optional argument \meta{vmove}}
% \begin{macrocode}
\newcommand\ldelim[2]{\@ifnextchar[{\@ldelim{#1}{#2}}{\@ldelim{#1}{#2}[0pt]}}
\def\@ldelim#1#2[#3]#4{\@ifnextchar[{\@@ldelim{#1}{#2}{#3}{#4}}{\@@ldelim{#1}{#2}{#3}{#4}[\null]}}
\def\@@ldelim#1#2#3#4[#5]%
{\ifvoid\@arstrutbox\setbox\@arstrutbox\hbox{\strut}\fi
\multirow{#2}{#4}[#3]{%
\ensuremath
{\left.\vcenter{\hsize=0pt\vrule height \multirow@dima width 0pt}%
\textnormal{#5}\right#1}}}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\rdelim}
% This macro typesets a right delimiter. It calls \cs{multirow} with the
% proper arguments, similar to \cs{ldelim}.
% \changes{bigdelim v2.3}{2018/08/03}{Replace \cs{textrm} by \cs{textnormal}}
% \changes{bigdelim v2.6}{2020/12/26}{Initialize \cs{@arstrutbox} if not defined}
% \changes{bigdelim v2.8}{2021/03/15}{Add optional argument \meta{vmove}}
% \begin{macrocode}
\newcommand\rdelim[2]{\@ifnextchar[{\@rdelim{#1}{#2}}{\@rdelim{#1}{#2}[0pt]}}
\def\@rdelim#1#2[#3]#4{\@ifnextchar[{\@@rdelim{#1}{#2}{#3}{#4}}{\@@rdelim{#1}{#2}{#3}{#4}[\null]}}
\def\@@rdelim#1#2#3#4[#5]%
{\ifvoid\@arstrutbox\setbox\@arstrutbox\hbox{\strut}\fi
\multirow{#2}{#4}[#3]{%
\ensuremath
{\left#1\vcenter{\hsize=0pt\vrule height \multirow@dima width 0pt}%
\textnormal{#5}\right.}}}
% \end{macrocode}
% \end{macro}
% \iffalse
%</bigdelim>
% \fi
%
% \appendix
%
% \section{Appendix}
% \label{sec:appendix}
%
% \index{vbox=\verb!*+\vbox+|usage}
%
% In this section we explain the \cs{vbox} positioning in \cs{multirow}.
% The positioning depends on the \meta{nrows}, \meta{vpos},
% \meta{bigstruts} and \meta{vmove} arguments. The box is constructed with \cs{vtop}. The
% algorithm of \cs{vtop} is described in \emph{The \TeX{}book}, p.~81.
%
% Each case is described by a figure. In the figure the lefthand column
% indicates the context of the tabular in which the multirow appears,
% i.e \meta{nrows} rows. The righthand column is the multirow box that
% is to be inserted. The baseline is the natural position where the material will be
% positioned in the first place. Later it will be shifted up
% to the desired location.
%
% H is the calculated height of the box: $\meta{nrows} \times
% \textrm{the natural height of a row} + \meta{bigstruts} \times
% \mathrm{\cs{bigstrutjot}} $.
%
% {topstrut} = \cs{bigstrutjot} if there is a \cs{bigstrut} on the top of
% the first row (as indicated by the \texttt{t} prefix in the
% \meta{bigstruts} argument), otherwise 0.
%
% {botstrut} = \cs{bigstrutjot} if there is a \cs{bigstrut} on bottom of
% the last row (as indicated by the \texttt{b} prefix in the
% \meta{bigstruts} argument), otherwise 0.
%
% h1 = $\textrm{height of a tabular row} + \textrm{topstrut}$
%
% h2 = $\textrm{depth of a tabular row} + \textrm{botstrut}$
%
% Note: the following descriptions describe the vertical shift of the
% box without taking the \meta{vmove} into account. In all cases
% \meta{vmove} has to be added if it is given.
%
% \subsection{Case \meta{nrows}${}> 0$}
%
% \subsubsection*{\meta{vpos} = [t]}
%
% In this case the \cs{vbox} contains the text followed by a \cs{vfill}.
% Such a \cs{vbox} has a height that is the height of the top line of
% the text (h). H = height + depth of the box. This means that the box is
% already positioned correctly. However, later we will put the box
% inside another \cs{vbox}, with a \cs{vskip} on to of it, and this will
% make the top of the box its reference point. Therefore we will
% have to shift it up again over a distance h
% (which probably will be different from the height of the tabular row).
% So the total shift becomes h. See fig.~\ref{fig:top-t}.
%
% Alternatively, we could have omitted the \cs{vskip} in this case,
% thereby leaving the baseline undisturbed, but this would make the code
% unsymmetrical. Moreover, this would not work when a non-zero
% \meta{vmove} is present. Therefore we choose to set the shift amount to h here.
%
% \begin{figure}[htpb]
% \centering
% \begin{tikzpicture}
% \draw (2, -0.5) rectangle (5,4.5);
% \foreach \y in {0,...,4} \draw (2, \y) -- (5, \y);
% \draw (0, 4.2) node (topstrut) {topstrut};
% \draw[->] (topstrut) -- (2, 4.2);
% \draw (0, -0.25) node (botstrut) {botstrut};
% \draw[->] (botstrut) -- (2, -0.25);
% \draw[<->] (5.3, -0.5) -- (5.3, 4.5);
% \draw (5.5, 2) node {H};
% \draw (0, 3.3) node (baseline) {baseline};
% \draw[dashed] (1.7, 3.3) -- (5.9, 3.3);
% \draw[<->] (5.5, 3.3) -- (5.5, 4.5);
% \draw (5.9, 3.9) node {h1};
%
% \draw (6.5, 4) rectangle (9.5, -1);
% \draw[<->] (9.7, -1) -- (9.7, 4);
% \draw (10, 1.5) node {H};
% \draw[<->] (10, 3.3) -- (10, 4);
% \draw (10.3, 3.7) node {h};
% \draw[fill=lightgray] (6.6, 1) rectangle (9.4, 3.9);
% \draw (8, 0) node[align=center] {\cs{vfill}};
% \draw (8, 2) node[align=center] {text};
% \draw[draw=gray] (6.6, 3) -- (9.4, 3);
% \draw[dashed] (6.2, 3.3) -- (9.8, 3.3);
% \draw[->, line width=4pt, draw=gray] (8, 3.3) -- (8, 4);
% \end{tikzpicture}
% \caption{Case \meta{nrows}${}> 0$, \meta{vpos} = [t]}
% \label{fig:top-t}
% \end{figure}
%
% \subsubsection*{\meta{vpos} = [c]}
%
% In this case the \cs{vbox} contains a \cs{vfill}, the text, and another \cs{vfill}.
% Such a \cs{vbox} has a height 0, i.e. the top of the box is on the
% baseline. Because both boxes have the same size (H), they can be
% aligned by shifting the \cs{vbox} up over h1. See fig.~\ref{fig:top-c}.
%
% \begin{figure}[htpb]
% \centering
%\begin{tikzpicture}
% \draw (2, -0.5) rectangle (5,4.5);
% \foreach \y in {0,...,4} \draw (2, \y) -- (5, \y);
% \draw (0, 4.2) node (topstrut) {topstrut};
% \draw[->] (topstrut) -- (2, 4.2);
% \draw (0, -0.25) node (botstrut) {botstrut};
% \draw[->] (botstrut) -- (2, -0.25);
% \draw[<->] (5.3, -0.5) -- (5.3, 4.5);
% \draw (5.5, 2) node {H};
% \draw (0, 3.3) node (baseline) {baseline};
% \draw[dashed] (1.7, 3.3) -- (5.9, 3.3);
% \draw[<->] (5.5, 3.3) -- (5.5, 4.5);
% \draw (5.9, 3.9) node {h1};
%
% \draw (6.5, 3.3) rectangle (9.5, -1.7);
% \draw[<->] (9.7, -1.7) -- (9.7, 3.3);
% \draw (10, 0.8) node {H};
% \draw[fill=lightgray] (6.6, -0.5) rectangle (9.4, 2.1);
% \draw (8, 2.7) node[align=center] {\cs{vfill}};
% \draw (8, 0.8) node[align=center] {text};
% \draw (8, -1) node[align=center] {\cs{vfill}};
% \draw[->, line width=4pt, draw=gray] (8, 3.3) -- (8, 4.5);
% \draw[draw=gray] (6.5, 4.5) -- (9.5, 4.5);
% \end{tikzpicture}
% \caption{Case \meta{nrows}${}> 0$, \meta{vpos} = [c]}
% \label{fig:top-c}
% \end{figure}
%
% \subsubsection*{\meta{vpos} = [b]}
%
% Now the \cs{vbox} contains a \cs{vfill}, followed by the text.
% Because it ends with the text, it gets an additional depth equal to
% the depth of the last line of the text.
% Such a \cs{vbox} has a height 0, i.e. the top of the box is on the
% baseline, but its depth is H + that depth. In other words the baseline
% of the last text line is H below the top.
%
% Because \meta{vpos} = \texttt{[b]} we want the baseline of the last
% textline to shift to the baseline of the last tabular row. The amount
% of the shift is h1 + h2. See fig.~\ref{fig:top-b}.
%
% \begin{figure}[htpb]
% \centering
%\begin{tikzpicture}
% \draw (2, -0.5) rectangle (5,4.5);
% \foreach \y in {0,...,4} \draw (2, \y) -- (5, \y);
% \draw (0, 4.2) node (topstrut) {topstrut};
% \draw[->] (topstrut) -- (2, 4.2);
% \draw (0, -0.25) node (botstrut) {botstrut};
% \draw[->] (botstrut) -- (2, -0.25);
% \draw[<->] (5.3, -0.5) -- (5.3, 4.5);
% \draw (5.5, 2) node {H};
% \draw (0, 3.3) node (baseline) {baseline};
% \draw[dashed] (1.7, 3.3) -- (5.9, 3.3);
% \draw[<->] (5.5, 3.3) -- (5.5, 4.5);
% \draw (5.9, 3.9) node {h1};
% \draw[<->] (5.5, -0.5) -- (5.5, 0.3);
% \draw (5.9, -0.1) node {h2};
%
% \draw (6.5, 3.3) rectangle (9.5, -2.1);
% \draw[<->] (9.7, -1.7) -- (9.7, 3.3);
% \draw (10, 0.8) node {H};
% \draw[fill=lightgray] (6.6, -2) rectangle (9.4, 1);
% \draw (8, 2) node[align=center] {{\cs{vfill}}};
% \draw (8, -0.5) node[align=center] {text};
% \draw (0, 0.3) node (baseline) {baseline};
% \draw[dashed] (6.3, -1.7) -- (10, -1.7);
% \draw (3.5, -1.7) node (baseline) {baseline of last text line};
% \draw[dashed] (1.7, 0.3) -- (10, 0.3);
% \draw[->, line width=4pt, draw=gray] (8.5, -1.7) -- (8.5, 0.3);
% \end{tikzpicture}
% \caption{Case \meta{nrows}${}> 0$, \meta{vpos} = [b]}
% \label{fig:top-b}
% \end{figure}
%
% \subsection{Case \meta{nrows}${}<0$}
%
% \meta{nrows}${}<0$ when the multirow is positioned in the last row of
% the multirow block.
%
% \subsubsection*{\meta{vpos} = [t]}
%
% In this case the \cs{vbox} contains the text followed by a \cs{vfill}.
% Such a \cs{vbox} has a height that is the height of the top line of
% the text. The baseline is aligned with the baseline of the last row.
% Because \meta{vpos} = [t], we want it to be aligned with the baseline
% of the first row. Therefore it has to be shifted up $\textrm{H} -
% \textrm{h1} - \textrm{h2}$. But because later the height of the box
% will be set to 0, we must also add the current height h. Therefore the
% total shift becomes $\textrm{H} - \textrm{h1} - \textrm{h2} +
% \textrm{h}$. See fig.~\ref{fig:bot-t}.
%
% \begin{figure}[htpb]
% \centering
% \begin{tikzpicture}
% \draw (2, -0.5) rectangle (5,4.5);
% \foreach \y in {0,...,4} \draw (2, \y) -- (5, \y);
% \draw (0, 4.2) node (topstrut) {topstrut};
% \draw[->] (topstrut) -- (2, 4.2);
% \draw (0, -0.25) node (botstrut) {botstrut};
% \draw[->] (botstrut) -- (2, -0.25);
% \draw[<->] (5.3, -0.5) -- (5.3, 4.5);
% \draw (5.5, 2) node {H};
% \draw (0, 3.3) node (baseline) {baseline};
% \draw[dashed] (1.7, 3.3) -- (9, 3.3);
% \draw[<->] (5.5, 3.3) -- (5.5, 4.5);
% \draw (5.9, 3.9) node {h1};
% \draw[<->] (5.5, -0.5) -- (5.5, 0.3);
% \draw (5.9, -0.1) node {h2};
% \draw (0, 0.3) node (baseline) {baseline};
% \draw[dashed] (1.7, 0.3) -- (5.9, 0.3);
%
% \draw (6.5, 1) rectangle (9.5, -4);
% \draw[<->] (9.7, -4) -- (9.7, 1);
% \draw (10, -1.5) node {H};
% \draw[<->] (10, 0.3) -- (10, 1);
% \draw (10.3, 0.7) node {h};
% \draw[fill=lightgray] (6.6, -2) rectangle (9.4, 0.9);
% \draw (8, -3) node[align=center] {\cs{vfill}};
% \draw (8, -1) node[align=center] {text};
% \draw[draw=gray] (6.6, 0) -- (9.4, 0);
% \draw[dashed] (6.2, 0.3) -- (10.3, 0.3);
% \draw[->, line width=4pt, draw=gray] (8, 0.3) -- (8, 3.3);
% \end{tikzpicture}
% \caption{Case \meta{nrows}${} < 0$, \meta{vpos} = [t]}
% \label{fig:bot-t}
% \end{figure}
%
% \subsubsection*{\meta{vpos} = [c]}
%
% In this case the \cs{vbox} contains a \cs{vfill}, the text, and another \cs{vfill}.
% Such a \cs{vbox} has a height 0, i.e. the top of the box is on the
% baseline. Because both boxes have the same size (H), they can be
% aligned by shifting the \cs{vbox} up over $\textrm{H} - \textrm{h2}$.
% See fig.~\ref{fig:bot-c}.
%
% \begin{figure}[htpb]
% \begin{tikzpicture}
% \draw (2, -0.5) rectangle (5,4.5);
% \foreach \y in {0,...,4} \draw (2, \y) -- (5, \y);
% \draw (0, 4.2) node (topstrut) {topstrut};
% \draw[->] (topstrut) -- (2, 4.2);
% \draw (0, -0.25) node (botstrut) {botstrut};
% \draw[->] (botstrut) -- (2, -0.25);
% \draw[<->] (5.3, -0.5) -- (5.3, 4.5);
% \draw (5.5, 2) node {H};
% \draw (0, 3.3) node {baseline};
% \draw[dashed] (1.7, 3.3) -- (5.8, 3.3);
% \draw[<->] (5.5, 3.3) -- (5.5, 4.5);
% \draw (5.9, 3.9) node {h1};
% \draw[<->] (5.5, -0.5) -- (5.5, 0.3);
% \draw (5.9, -0.1) node {h2};
% \draw (0, 0.3) node {baseline};
% \draw[dashed] (1.7, 0.3) -- (5.9, 0.3);
%
% \draw (6.5, 0.3) rectangle (9.5, -4.7);
% \draw[<->] (9.7, -4.7) -- (9.7, 0.3);
% \draw (10, -3.2) node {H};
% \draw[fill=lightgray] (6.6, -3.5) rectangle (9.4, -0.9);
% \draw (8, -0.3) node[align=center] {\cs{vfill}};
% \draw (8, -2.2) node[align=center] {text};
% \draw (8, -4) node[align=center] {\cs{vfill}};
% \draw[->, line width=4pt, draw=gray] (8, 0.3) -- (8, 4.5);
% \draw[draw=gray] (6.5, 4.5) -- (9.5, 4.5);
% \end{tikzpicture}
% \caption{Case \meta{nrows}${} < 0$, \meta{vpos} = [c]}
% \label{fig:bot-c}
% \end{figure}
%
% \subsubsection*{\meta{vpos} = [b]}
%
% The \cs{vbox} contains a \cs{vfill}, followed by the text.
% Because it ends with the text, it gets an additional depth equal to
% the depth of the last line of the text.
% Such a \cs{vbox} has a height 0, i.e. the top of the box is on the
% baseline, but its depth is H + that depth. In other words the baseline
% of the last text line is H below the top.
%
% Because \meta{vpos} = \texttt{[b]} we want the baseline of the last
% textline to shift to the baseline of the last tabular row. The amount
% of the shift is H. See fig.~\ref{fig:bot-b}.
%
% \begin{figure}[htpb]
% \begin{tikzpicture}
% \draw (2, -0.5) rectangle (5,4.5);
% \foreach \y in {0,...,4} \draw (2, \y) -- (5, \y);
% \draw (0, 4.2) node (topstrut) {topstrut};
% \draw[->] (topstrut) -- (2, 4.2);
% \draw (0, -0.25) node (botstrut) {botstrut};
% \draw[->] (botstrut) -- (2, -0.25);
% \draw[<->] (5.3, -0.5) -- (5.3, 4.5);
% \draw (5.5, 2) node {H};
% \draw (0, 3.3) node {baseline};
% \draw[dashed] (1.7, 3.3) -- (5.8, 3.3);
% \draw[<->] (5.5, 3.3) -- (5.5, 4.5);
% \draw (5.9, 3.9) node {h1};
% \draw[<->] (5.5, -0.5) -- (5.5, 0.3);
% \draw (5.9, -0.1) node {h2};
% \draw (0, 0.3) node {baseline};
% \draw[dashed] (1.7, 0.3) -- (5.9, 0.3);
%
% \draw (6.5, 0.3) rectangle (9.5, -5.1);
% \draw[<->] (9.7, -4.7) -- (9.7, 0.3);
% \draw (10, -3.2) node {H};
% \draw[fill=lightgray] (6.6, -5) rectangle (9.4, -2);
% \draw (8, -1) node[align=center] {{vfill}};
% \draw (8, -3.5) node[align=center] {text};
% \draw (0, 0.3) node (baseline) {baseline};
% \draw[dashed] (1.7, 0.3) -- (10, 0.3);
% \draw[dashed] (6.3, -4.7) -- (10, -4.7);
% \draw (3.5, -4.7) node {baseline of last text line};
% \draw[->, line width=4pt, draw=gray] (8.5, -4.7) -- (8.5, 0.3);
% \end{tikzpicture}
% \caption{Case \meta{nrows}${} < 0$, \meta{vpos} = [b]}
% \label{fig:bot-b}
% \end{figure}
%
% \subsection{Overview}
% \label{sec:overview}
%
% \begin{tabular}{| l | l | l |}
% \hline
% \meta{vpos} & \meta{nrows} > 0 & \meta{nrows} < 0 \\
% \hline
% \texttt{[t]} & h & $\textrm{H} - \textrm{h1} -\textrm{h2} + \textrm{h}$ \\
% \texttt{[c]} & h1 & $\textrm{H} - \textrm{h2}$ \\
% \texttt{[b]} & h1 + h2 & H \\
% \hline
% & x & $\textrm{H} - \textrm{h1} -\textrm{h2} + x$ \\
% \hline
% \end{tabular}
%
% \Finale
\endinput
|