| 1 |
% \iffalse meta-comment |
| 2 |
% |
| 3 |
% Parts of this file, Copyright (C) 1994 by Jerry Leichter |
| 4 |
% Copyright (C) 2016-2024 by Pieter van Oostrum <[email protected]> |
| 5 |
% ------------------------------------------------------- |
| 6 |
% |
| 7 |
% This file may be distributed and/or modified under the |
| 8 |
% conditions of the LaTeX Project Public License, either version 1.3 |
| 9 |
% of this license or (at your option) any later version. |
| 10 |
% The latest version of this license is in: |
| 11 |
% |
| 12 |
% http://www.latex-project.org/lppl.txt |
| 13 |
% |
| 14 |
% and version 1.3 or later is part of all distributions of LaTeX |
| 15 |
% version 2005/12/01 or later. |
| 16 |
% |
| 17 |
% \fi |
| 18 |
% |
| 19 |
% \iffalse |
| 20 |
%<*driver> |
| 21 |
\ProvidesFile{\jobname.dtx} |
| 22 |
%</driver> |
| 23 |
% This is the variable part of the preamble |
| 24 |
% |
| 25 |
%<multirow|bigstrut>%% Copyright (C) 1994 by Jerry Leichter |
| 26 |
%<bigdelim>%% Copyright (C) 1994 by \O ystein Bache |
| 27 |
%% Copyright (C) 2016-2024 by Pieter van Oostrum <[email protected]> |
| 28 |
%% |
| 29 |
% |
| 30 |
% \begin{macrocode} |
| 31 |
%<multirow|bigstrut|bigdelim>\NeedsTeXFormat{LaTeX2e} |
| 32 |
%<multirow>\ProvidesPackage{multirow}% |
| 33 |
%<bigstrut>\ProvidesPackage{bigstrut} |
| 34 |
%<bigdelim>\ProvidesPackage{bigdelim} |
| 35 |
%<multirow|bigstrut|bigdelim> [2024/11/12 v2.9 |
| 36 |
%<multirow> Span multiple rows of a table]% |
| 37 |
%<bigstrut> Provide larger struts in tabulars] |
| 38 |
%<bigdelim> Create big delimiters in tabular or array] |
| 39 |
% \end{macrocode} |
| 40 |
% |
| 41 |
%<*driver> |
| 42 |
\documentclass[a4paper]{ltxdoc} |
| 43 |
\usepackage[T1]{fontenc} |
| 44 |
\usepackage{multirow,bigstrut,bigdelim,colortbl} |
| 45 |
\usepackage[table]{xcolor} |
| 46 |
\usepackage{tabulary} |
| 47 |
\usepackage{longtable} |
| 48 |
\usepackage{booktabs} |
| 49 |
\usepackage{calc} |
| 50 |
\usepackage{url} |
| 51 |
\usepackage[colorlinks, urlcolor=blue, linktocpage]{hyperref} |
| 52 |
\usepackage{tikz} |
| 53 |
\usepackage{hhline} |
| 54 |
\usepackage{etoolbox} |
| 55 |
\AtBeginEnvironment{macrocode}{\color{red}} |
| 56 |
\newcommand{\minitab}[2][l]{\begin{tabular}{#1}#2\end{tabular}} |
| 57 |
\DisableCrossrefs |
| 58 |
\CodelineIndex |
| 59 |
\RecordChanges |
| 60 |
\newcommand{\env}[1]{\texttt{#1}} |
| 61 |
\newcommand{\Package}[1]{\textsf{#1}} |
| 62 |
\def\bsbs{\cs{\char`\\}} |
| 63 |
\begin{document} |
| 64 |
\DeleteShortVerb{\|} |
| 65 |
\DocInput{\jobname.dtx} |
| 66 |
\end{document} |
| 67 |
%</driver> |
| 68 |
% \fi |
| 69 |
% |
| 70 |
% \CheckSum{0} |
| 71 |
% |
| 72 |
% \CharacterTable |
| 73 |
% {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 |
| 74 |
% 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 |
| 75 |
% Digits \0\1\2\3\4\5\6\7\8\9 |
| 76 |
% Exclamation \! Double quote \" Hash (number) \# |
| 77 |
% Dollar \$ Percent \% Ampersand \& |
| 78 |
% Acute accent \' Left paren \( Right paren \) |
| 79 |
% Asterisk \* Plus \+ Comma \, |
| 80 |
% Minus \- Point \. Solidus \/ |
| 81 |
% Colon \: Semicolon \; Less than \< |
| 82 |
% Equals \= Greater than \> Question mark \? |
| 83 |
% Commercial at \@ Left bracket \[ Backslash \\ |
| 84 |
% Right bracket \] Circumflex \^ Underscore \_ |
| 85 |
% Grave accent \` Left brace \{ Vertical bar \| |
| 86 |
% Right brace \} Tilde \~} |
| 87 |
% |
| 88 |
% \changes{v1.7}{2016/09/13}{Give all the files the same version number} |
| 89 |
% \changes{v2.0}{2016/09/27}{Release v2.0} |
| 90 |
% \changes{v2.3}{2018/08/03}{Small bugfix} |
| 91 |
% \changes{v2.4}{2018/12/30}{Add \leavevmode in bigstrut.sty} |
| 92 |
% \changes{v2.4}{2019/01/01}{Make \meta{width} and \meta{vmove} in \cs{multirow} |
| 93 |
% \Package{calc} compatible} |
| 94 |
% \changes{v2.5}{2019/05/31}{Solve a clash with the \Package{colortbl} package} |
| 95 |
% |
| 96 |
% \GetFileInfo{multirow.sty} |
| 97 |
% |
| 98 |
% \DoNotIndex{\#,\$,\%,\&,\@,\\,\{,\},\^,\_,\~,\ } |
| 99 |
% \DoNotIndex{\@ne} |
| 100 |
% \DoNotIndex{\advance,\begingroup,\catcode,\closein} |
| 101 |
% \DoNotIndex{\closeout,\day,\def,\edef,\else,\empty,\endgroup} |
| 102 |
% |
| 103 |
% \title{The \Package{multirow}, |
| 104 |
% \Package{bigstrut} and |
| 105 |
% \Package{bigdelim} packages} |
| 106 |
% \author{Pieter van Oostrum\thanks{catalogued ``active author''}\\ |
| 107 |
% \O ystein Bache\\ |
| 108 |
% Jerry Leichter\thanks{Documentation originally put together by Robin |
| 109 |
% Fairbairns}} |
| 110 |
% |
| 111 |
% \date{Released \filedate, version \fileversion} |
| 112 |
% |
| 113 |
% \maketitle |
| 114 |
% |
| 115 |
% \tableofcontents |
| 116 |
% |
| 117 |
% \section{Introduction} |
| 118 |
% These packages offer a series of extensions to the standard \LaTeX{} |
| 119 |
% \env{tabular} environment. Their respective functions are: |
| 120 |
% \begin{description} |
| 121 |
% \item[\Package{multirow}] which provides a construction for table cells |
| 122 |
% that span more than one row of the table; |
| 123 |
% \item[\Package{bigstrut}] which creates struts which (slightly) stretch |
| 124 |
% the table row in which they sit. |
| 125 |
% \item[\Package{bigdelim}] which creates an appropriately-sized |
| 126 |
% delimiter (for example, brace, parenthesis or bracket) to fit in a |
| 127 |
% single multirow, to indicate a relationship between other rows; and |
| 128 |
% \end{description} |
| 129 |
% |
| 130 |
% \section{Changes in version 2} |
| 131 |
% \label{sec:changes-2} |
| 132 |
% |
| 133 |
%\subsection*{version 2.9} |
| 134 |
% |
| 135 |
% \begin{itemize} |
| 136 |
% \item Documentation correction: the description of the meaning of a |
| 137 |
% negative value of \meta{nrows} was wrong. |
| 138 |
% \item Make \texttt{multirow.sty} compatible with |
| 139 |
% \texttt{supertabular} version 4.2a or later. |
| 140 |
% \end{itemize} |
| 141 |
% |
| 142 |
%\subsection*{version 2.8} |
| 143 |
% |
| 144 |
%\begin{itemize} |
| 145 |
%\item Optional argument \meta{vmove} for \cs{ldelim} and \cs{rdelim}. |
| 146 |
%\end{itemize} |
| 147 |
% |
| 148 |
%\subsection*{version 2.7} |
| 149 |
% |
| 150 |
%\begin{itemize} |
| 151 |
%\item Make \cs{@xmultirow} and \cs{multirow@setcolwidth} \cs{long} to allow |
| 152 |
% multi-paragraph text. |
| 153 |
% See \url{https://github.com/pietvo/multirow/issues/1} |
| 154 |
%\end{itemize} |
| 155 |
% |
| 156 |
%\subsection*{version 2.6} |
| 157 |
% |
| 158 |
% \begin{itemize} |
| 159 |
% \item Make the \texttt{supertabular} option compatible with newer |
| 160 |
% versions of the \Package{supertabular} package |
| 161 |
% \item Initialize \cs{@arstrutbox} when not defined, to enable some |
| 162 |
% uses of the big delims outside of an \env{array} or \env{tabular}. |
| 163 |
% \end{itemize} |
| 164 |
% |
| 165 |
%\subsection*{version 2.5a} |
| 166 |
% |
| 167 |
% \begin{itemize} |
| 168 |
% \item Changed contact information |
| 169 |
% \end{itemize} |
| 170 |
% |
| 171 |
%\subsection*{version 2.5} |
| 172 |
% |
| 173 |
% \begin{itemize} |
| 174 |
% \item Solve a clash with the \Package{colortbl} package, when multirow |
| 175 |
% uses the \texttt{longtable} option. There was a clash with both |
| 176 |
% packages redefining \cs{@cline}. |
| 177 |
% \end{itemize} |
| 178 |
% |
| 179 |
%\subsection*{version 2.4} |
| 180 |
% |
| 181 |
% \begin{itemize} |
| 182 |
% \item Add a \cs{leavevmode} in \Package{bigstrut} to force horizontal mode |
| 183 |
% \item Make \meta{width} and \meta{vmove} in \cs{multirow} \Package{calc} compatible |
| 184 |
% \end{itemize} |
| 185 |
% |
| 186 |
%\subsection*{version 2.3} |
| 187 |
% |
| 188 |
% \begin{itemize} |
| 189 |
% \item Replaced \cs{textrm} with \cs{textnormal} in text beside big braces in bigdelim.sty. |
| 190 |
% \end{itemize} |
| 191 |
% |
| 192 |
%\subsection*{version 2.2} |
| 193 |
% |
| 194 |
% \begin{itemize} |
| 195 |
% \item Support for fractional values of \meta{nrows}. |
| 196 |
% \end{itemize} |
| 197 |
% |
| 198 |
%\subsection*{version 2.0} |
| 199 |
% |
| 200 |
% \begin{itemize} |
| 201 |
% \item \cs{multirow} now has an first optional parameter \oarg{vpos}. |
| 202 |
% \item The \meta{width} parameter can be specified as \texttt{=} to use |
| 203 |
% the defined width of the column in which the \cs{multirow} appears. |
| 204 |
% \item Optional prefix letters (\texttt{t}, \texttt{b}) for |
| 205 |
% the \meta{bigstruts} parameter (see section~\ref{sect-refine-bigstrut}). |
| 206 |
% \item Package option \texttt{debug}. |
| 207 |
% \item Package option \texttt{longtable} to work around a bug in |
| 208 |
% \Package{longtable}. See section~\ref{sec:use-with-longtable}. |
| 209 |
% \item Package option \texttt{supertabular} to better support \Package{supertabular}. See |
| 210 |
% section~\ref{sec:use-with-supertabular}. |
| 211 |
% \item Better positioning in some cases. |
| 212 |
% \item Lots of documentation. |
| 213 |
% \item The distribution is now based on a \texttt{.dtx} file. |
| 214 |
% \item Backwards compatible with v1.6. |
| 215 |
% \end{itemize} |
| 216 |
% |
| 217 |
% \section{Using \Package{multirow}}\label{sec:multirow} |
| 218 |
% |
| 219 |
% \DescribeMacro{\multirow} |
| 220 |
% \cs{multirow} sets a piece of text in a \env{tabular} or |
| 221 |
% similar environment, spanning multiple rows. We will call the block of |
| 222 |
% rows and columns that the text spans the multirow block. Usually this |
| 223 |
% covers one column, but by combining it with \cs{multicolumn} more |
| 224 |
% columns can be covered. |
| 225 |
% \changes{v2.1}{2016/10/06}{Rename \meta{fixup} to \meta{vmove} in the |
| 226 |
% documentation as in The LaTeX Companion.} |
| 227 |
% |
| 228 |
% The basic syntax is: |
| 229 |
% \begin{quote} |
| 230 |
% \cmd{\multirow}\oarg{vpos}\marg{nrows}\oarg{bigstruts}\marg{width}\oarg{vmove}\marg{text} |
| 231 |
% \end{quote} |
| 232 |
% where |
| 233 |
% \begin{description} |
| 234 |
% \item[\meta{vpos}] defines the vertical positioning of the text in the multirow block. |
| 235 |
% The default is \texttt{[c]} which means the text will be vertically centered. |
| 236 |
% Other options are \texttt{[t]} for top alignment and \texttt{[b]} for bottom alignment. |
| 237 |
% \item[\meta{nrows}] is the number of rows to span. You should |
| 238 |
% leave the other rows empty at this column, otherwise the stuff created by \cs{multirow} |
| 239 |
% will over-write it. With a positive value of \meta{nrows} the |
| 240 |
% spanned columns are this row and (\meta{nrows}-1) rows below |
| 241 |
% it. With a negative value of \meta{nrows} they are this row and |
| 242 |
% (-\meta{nrows}-1) above it. Fractional values are permitted for |
| 243 |
% \meta{nrows}; this allows for some fine-tuning. |
| 244 |
% |
| 245 |
% \item[\meta{bigstruts}] is mainly used if you've used the |
| 246 |
% \Package{bigstrut} package. In that case it is the total number of uses of |
| 247 |
% \cs{bigstrut} within the rows being spanned. Count 2 uses for each |
| 248 |
% \cs{bigstrut}, 1 for each \cs{bigstrut}\oarg{x} where \meta{x} is |
| 249 |
% either \texttt{t} or \texttt{b}. The default is 0. |
| 250 |
% |
| 251 |
% The \meta{bigstruts} parameter can optionally be preceded by a prefix |
| 252 |
% letter \texttt{t}, \texttt{b} or \texttt{tb} for finer control. See |
| 253 |
% section \ref{sect-refine-bigstrut} for details. The letter may be |
| 254 |
% separated from the number by a space character. |
| 255 |
% |
| 256 |
% \item[\meta{width}] is the width to which the text is to be set. |
| 257 |
% Special values are \texttt{*} to indicate that the text parameter's natural width is to |
| 258 |
% be used, and \texttt{=} to indicate that the specified width of the column in |
| 259 |
% which the \cs{multirow} entry is set should be used. |
| 260 |
% |
| 261 |
% \item[\meta{vmove}] is a length used for fine-tuning: the text will be |
| 262 |
% raised (or lowered, if \meta{vmove} is negative) by that length |
| 263 |
% above (below) wherever it would otherwise have gone. |
| 264 |
% |
| 265 |
% \item[\meta{text}] is the actual text of the construct. If the width |
| 266 |
% was set explicitly, the text will be set in a \cs{parbox} of that |
| 267 |
% width; you can use \bsbs{} to force linebreaks where you like. |
| 268 |
% |
| 269 |
% If the width was given as \texttt{*} the text will be set in LR |
| 270 |
% mode. If you want a multiline entry in this case you could use a |
| 271 |
% \env{tabular} or \env{array} environment in the text |
| 272 |
% parameter. See for example the \env{minitab} below. |
| 273 |
% |
| 274 |
% The width can also be given as \texttt{=} when the \cs{multirow} entry is given in a |
| 275 |
% column that has a defined width, for example in a \texttt{p\{\}} column, an |
| 276 |
% \texttt{X} column in \env{tabularx} or a \texttt{L}, \texttt{C}, |
| 277 |
% \texttt{R} or \texttt{J} column in a \env{tabulary} environment. |
| 278 |
% The text will be set in a \cs{parbox} of that width. |
| 279 |
% If you give ``\texttt{=}'' in other situations, you will get strange |
| 280 |
% results (usually a too wide column). |
| 281 |
% |
| 282 |
% \end{description} |
| 283 |
% |
| 284 |
% In \Package{multirow} version 2.4 and later, the \meta{width} and |
| 285 |
% \meta{vmove} arguments can be given as \Package{calc} expressions if |
| 286 |
% the \Package{calc} package is loaded. It is the responsibility of the |
| 287 |
% document writer to include the \Package{calc} package; |
| 288 |
% \Package{multirow} does not do this. |
| 289 |
% |
| 290 |
% N.B. \cs{multirow} can be used in the \env{tabular} environment and |
| 291 |
% most derivatives of it, for example \env{tabularx}, |
| 292 |
% \env{tabulary}, \env{supertabular}, \env{ltablex}, |
| 293 |
% \env{xtab}, \env{longtable}, \env{tabu}, |
| 294 |
% \env{booktabs} and \env{ctable}. For some of these you |
| 295 |
% have to pay special attention to certain cases, see below. |
| 296 |
% |
| 297 |
% \DescribeMacro{\multirowsetup} |
| 298 |
% Just before \meta{text} is expanded, the \cs{multirowsetup} macro is |
| 299 |
% expanded to set up any special environment. Initially, |
| 300 |
% \cs{multirowsetup} contains just \cs{raggedright}. It may be |
| 301 |
% redefined with \cs{renewcommand}. |
| 302 |
% |
| 303 |
% If you want to use both \cs{multirow} and \cs{multicolumn} |
| 304 |
% \index{multicolumn=\verb!*+\multicolumn+|usage} |
| 305 |
% on the same entry, you must put the \cs{multirow} inside the |
| 306 |
% \cs{multicolumn}. The other way around will not work. |
| 307 |
% For example: |
| 308 |
% \begin{verbatim} |
| 309 |
% \multicolumn{2}{c}{\multirow{3}{*}{Multi-multi}} |
| 310 |
% \end{verbatim} |
| 311 |
% |
| 312 |
% \subsection{Package Options} |
| 313 |
% \label{sec:package-options} |
| 314 |
% |
| 315 |
% \DescribeMacro{multirowdebugtrue} |
| 316 |
% \DescribeMacro{multirowdebugfalse} |
| 317 |
% The following options are defined: |
| 318 |
% \begin{description} |
| 319 |
% \item[debug] |
| 320 |
% This option causes information about multirow boxes |
| 321 |
% to be written to the log file. This is done by the \TeX{} \cs{showbox} |
| 322 |
% command. Note: this will cause the \LaTeX{} compilation to be considered |
| 323 |
% failed, even if there is no real error. |
| 324 |
% This option can also be activated anywhere in the document with the |
| 325 |
% command \cs{multirowdebugtrue} and deactivated with |
| 326 |
% \cs{multirowdebugfalse}. When such a command is placed just before a |
| 327 |
% \cs{multirow}, it applies only to that specific \cs{multirow} entry. |
| 328 |
% \item[longtable] |
| 329 |
% The \texttt{longtable} option redefines the \cs{cline} macro to work |
| 330 |
% around a bug in the \Package{longtable} package. See section \ref{sec:use-with-longtable}. |
| 331 |
% \end{description} |
| 332 |
% |
| 333 |
%\subsection{Examples} |
| 334 |
%\label{sec:examples} |
| 335 |
% |
| 336 |
% An example with both \Package{multirow} and \Package{bigstrut}): |
| 337 |
% |
| 338 |
% \begin{quote} |
| 339 |
% \begin{verbatim} |
| 340 |
% \newcommand{\minitab}[2][l]{\begin{tabular}{#1}#2\end{tabular}} |
| 341 |
% \begin{tabular}{|c|c|} |
| 342 |
% \hline |
| 343 |
% \multirow{4}{1in}{Common g text} & Column g2a\\ |
| 344 |
% & Column g2b \\ |
| 345 |
% & Column g2c \\ |
| 346 |
% & Column g2d \\ |
| 347 |
% \hline |
| 348 |
% \multirow{3}[6]*{Common g text} & Column g2a\bigstrut\\\cline{2-2} |
| 349 |
% & Column g2b \bigstrut\\\cline{2-2} |
| 350 |
% & Column g2c \bigstrut\\ |
| 351 |
% \hline |
| 352 |
% \multirow{4}[8]{1in}{Common g text, but a bit longer.} & |
| 353 |
% Column g2a\bigstrut\\\cline{2-2} |
| 354 |
% & Column g2b \bigstrut\\\cline{2-2} |
| 355 |
% & Column g2c \bigstrut\\\cline{2-2} |
| 356 |
% & Column g2d \bigstrut\\ |
| 357 |
% \hline |
| 358 |
% \multirow{4}*{\minitab[c]{Common \\ g text}} & Column g2a\\ |
| 359 |
% & Column g2b \\ |
| 360 |
% & Column g2c \\ |
| 361 |
% & Column g2d \\ |
| 362 |
% \hline |
| 363 |
% \end{tabular} |
| 364 |
% \end{verbatim} |
| 365 |
% \end{quote} |
| 366 |
% which will appear as: |
| 367 |
% \begin{quote} |
| 368 |
% \begin{tabular}{|c|c|} |
| 369 |
% \hline |
| 370 |
% \multirow{4}{1in}{Common g text} & Column g2a\\ |
| 371 |
% & Column g2b \\ |
| 372 |
% & Column g2c \\ |
| 373 |
% & Column g2d \\ |
| 374 |
% \hline |
| 375 |
% \multirow{3}[6]*{Common g text} & Column g2a\bigstrut\\\cline{2-2} |
| 376 |
% & Column g2b \bigstrut\\\cline{2-2} |
| 377 |
% & Column g2c \bigstrut\\ |
| 378 |
% \hline |
| 379 |
% \multirow{4}[8]{1in}{Common g text, but a bit longer.} & |
| 380 |
% Column g2a\bigstrut\\\cline{2-2} |
| 381 |
% & Column g2b \bigstrut\\\cline{2-2} |
| 382 |
% & Column g2c \bigstrut\\\cline{2-2} |
| 383 |
% & Column g2d \bigstrut\\ |
| 384 |
% \hline |
| 385 |
% \multirow{4}*{\minitab[c]{Common \\ g text}} & Column g2a\\ |
| 386 |
% & Column g2b \\ |
| 387 |
% & Column g2c \\ |
| 388 |
% & Column g2d \\ |
| 389 |
% \hline |
| 390 |
% \end{tabular} |
| 391 |
% \quad |
| 392 |
% \begin{tabular}{ll} |
| 393 |
% \multirow{4}{*}{Normal case} & \\ |
| 394 |
% & \\ |
| 395 |
% & \\ |
| 396 |
% & \\ |
| 397 |
% \multirow{3}[6]*{With \cs{bigstrut}s and \texttt{*} as \meta{width}} & \bigstrut\\ |
| 398 |
% & \bigstrut\\ |
| 399 |
% & \bigstrut\\ |
| 400 |
% \multirow{4}[8]{*}{With \cs{bigstrut}s and normal \meta{width}} & \bigstrut\\ |
| 401 |
% & \bigstrut\\ |
| 402 |
% & \bigstrut\\ |
| 403 |
% & \bigstrut\\ |
| 404 |
% \multirow{4}*{Multiline text in \cs{multirow}} & \\ |
| 405 |
% & \\ |
| 406 |
% & \\ |
| 407 |
% & \\ |
| 408 |
% \end{tabular} |
| 409 |
% |
| 410 |
% \end{quote} |
| 411 |
% \vspace{1ex} |
| 412 |
% An example with the ``\texttt{=}'' \meta{width} specifier in a |
| 413 |
% \env{tabulary} (Note: The braces around the \texttt{=} may be omitted): |
| 414 |
% |
| 415 |
% \begin{quote} |
| 416 |
% \index{extrarowheight=\verb!*+\extrarowheight+|usage} |
| 417 |
% \begin{verbatim} |
| 418 |
% \setlength{\extrarowheight}{2pt} |
| 419 |
% \begin{tabulary}{11cm}{|L|L|L|} |
| 420 |
% \hline |
| 421 |
% All human beings are born free and equal in dignity and rights. & |
| 422 |
% \multirow{2}{=}{Everyone is entitled to all the rights and |
| 423 |
% freedoms set forth in this Declaration, without distinction of |
| 424 |
% any kind, such as race, colour, sex, language, religion, |
| 425 |
% political or other opinion, national or social origin, property, |
| 426 |
% birth or other status.} |
| 427 |
% & Everyone has the right to life, liberty and security of person. \\ |
| 428 |
% \cline{1-1}\cline{3-3} |
| 429 |
% No one shall be held in slavery or servitude; slavery and the |
| 430 |
% slave trade shall be prohibited in all their forms. & |
| 431 |
% & No one shall be subjected to torture or to cruel, inhuman or |
| 432 |
% degrading treatment or punishment. \\ |
| 433 |
% \hline |
| 434 |
% \end{tabulary} |
| 435 |
% \end{verbatim} |
| 436 |
% \end{quote} |
| 437 |
% |
| 438 |
% \begin{quote} |
| 439 |
% \index{extrarowheight=\verb!*+\extrarowheight+|usage} |
| 440 |
% \setlength{\extrarowheight}{2pt} |
| 441 |
% \begin{tabulary}{11cm}{|L|L|L|} |
| 442 |
% \hline |
| 443 |
% All human beings are born free and equal in dignity and rights. & |
| 444 |
% \multirow{2}{=}{Everyone is entitled to all the rights and |
| 445 |
% freedoms set forth in this Declaration, without distinction of |
| 446 |
% any kind, such as race, colour, sex, language, religion, |
| 447 |
% political or other opinion, national or social origin, property, |
| 448 |
% birth or other status.} |
| 449 |
% & Everyone has the right to life, liberty and security of person. \\ |
| 450 |
% \cline{1-1}\cline{3-3} |
| 451 |
% No one shall be held in slavery or servitude; slavery and the |
| 452 |
% slave trade shall be prohibited in all their forms. & |
| 453 |
% & No one shall be subjected to torture or to cruel, inhuman or |
| 454 |
% degrading treatment or punishment. \\ |
| 455 |
% \hline |
| 456 |
% \end{tabulary} |
| 457 |
% \end{quote} |
| 458 |
% |
| 459 |
% A few observations about this example: |
| 460 |
% \begin{enumerate} |
| 461 |
% \item The middle column is the \cs{multirow}. You would expect it to |
| 462 |
% be vertically centered, but it isn't. This is because \cs{multirow} |
| 463 |
% doesn't know the height of the box. The only estimate \cs{multirow} |
| 464 |
% can make about the height is the number of rows${}\times{}$the normal |
| 465 |
% height of a row. It tries to center the text in that space, but that space |
| 466 |
% is too low in this example. Therefore the text is at the top of the |
| 467 |
% box. If you want it to be centered, you have to supply a \meta{vmove} |
| 468 |
% argument to shift it down. |
| 469 |
% \item We have used an \cs{extrarowheight}\footnote{This is only |
| 470 |
% available with the \Package{array} package, which \Package{tabulary} |
| 471 |
% includes automatically.} of 2pt, to make a bit room between the |
| 472 |
% \cs{hline} and the following text. However, this is not applied to the |
| 473 |
% \cs{multirow}, because this is thought to be centered. In this case |
| 474 |
% you can give the \meta{vpos} argument as \texttt{[t]}, in which case |
| 475 |
% \cs{multirow} will do the proper positioning. |
| 476 |
% \end{enumerate} |
| 477 |
% |
| 478 |
% Now with a negative \meta{nrows}. |
| 479 |
% |
| 480 |
% \begin{quote} |
| 481 |
% \index{extrarowheight=\verb!*+\extrarowheight+|usage} |
| 482 |
% \begin{verbatim} |
| 483 |
% \setlength{\extrarowheight}{2pt} |
| 484 |
% \begin{tabulary}{11cm}{|L|L|L|} |
| 485 |
% \hline |
| 486 |
% All human beings are born free and equal in dignity and rights. & |
| 487 |
% & Everyone has the right to life, liberty and security of person. \\ |
| 488 |
% \cline{1-1}\cline{3-3} |
| 489 |
% No one shall be held in slavery or servitude; slavery and the |
| 490 |
% slave trade shall be prohibited in all their forms. & |
| 491 |
% \multirow{-2}{=}[12mm]{Everyone is entitled to all the rights and |
| 492 |
% freedoms set forth in this Declaration, without distinction of |
| 493 |
% any kind, such as race, colour, sex, language, religion, |
| 494 |
% political or other opinion, national or social origin, property, |
| 495 |
% birth or other status.} |
| 496 |
% & No one shall be subjected to torture or to cruel, inhuman or |
| 497 |
% degrading treatment or punishment. \\ |
| 498 |
% \hline |
| 499 |
% \end{tabulary} |
| 500 |
% \end{verbatim} |
| 501 |
% \end{quote} |
| 502 |
% |
| 503 |
% \begin{quote} |
| 504 |
% \index{extrarowheight=\verb!*+\extrarowheight+|usage} |
| 505 |
% \setlength{\extrarowheight}{2pt} |
| 506 |
% \begin{tabulary}{11cm}{|L|L|L|} |
| 507 |
% \hline |
| 508 |
% All human beings are born free and equal in dignity and rights. & |
| 509 |
% & Everyone has the right to life, liberty and security of person. \\ |
| 510 |
% \cline{1-1}\cline{3-3} |
| 511 |
% No one shall be held in slavery or servitude; slavery and the |
| 512 |
% slave trade shall be prohibited in all their forms. & |
| 513 |
% \multirow{-2}{=}[12mm]{Everyone is entitled to all the rights and |
| 514 |
% freedoms set forth in this Declaration, without distinction of |
| 515 |
% any kind, such as race, colour, sex, language, religion, |
| 516 |
% political or other opinion, national or social origin, property, |
| 517 |
% birth or other status.} |
| 518 |
% & No one shall be subjected to torture or to cruel, inhuman or |
| 519 |
% degrading treatment or punishment. \\ |
| 520 |
% \hline |
| 521 |
% \end{tabulary} |
| 522 |
% \end{quote} |
| 523 |
% |
| 524 |
% In this case the text would be centered somewhere in the |
| 525 |
% bottom row, which would make it stick out of the bottom. Therefore we |
| 526 |
% applied a \meta{vmove} of 12mm. The \meta{vmove} usually requires some experimentation. |
| 527 |
% |
| 528 |
% \subsection{Fine-Tuning} |
| 529 |
% \label{sec:fine-tuning} |
| 530 |
% |
| 531 |
% If any of the spanned rows are unusually large, or if you're using the |
| 532 |
% \Package{bigstrut} package and \cs{bigstrut}s are used asymetrically about the |
| 533 |
% centerline of the spanned rows, the vertical centering may not come |
| 534 |
% out right. Use the \meta{vmove} parameter in this case. Sometimes it |
| 535 |
% may be more helpful to just use a larger value for \meta{nrows}, |
| 536 |
% including fractional values. See an example in section~\ref{sec:dealing-with-tall}. |
| 537 |
% |
| 538 |
% It's just about impossible to deal correctly with descenders. The |
| 539 |
% text will be set up centered, but it may then have a baseline that |
| 540 |
% doesn't match the baseline of the stuff beside it, in particular if |
| 541 |
% the stuff beside it has descenders and \meta{text} does not. This may |
| 542 |
% result in a small misalignment. About all that can be done is to do a |
| 543 |
% final touchup on \meta{text}, using the \meta{vmove} optional parameter. |
| 544 |
% (Hint: If you use a measure like \texttt{.1ex}, there's a reasonable |
| 545 |
% chance that the \meta{vmove} will still be correct if you change the point |
| 546 |
% size.) |
| 547 |
% |
| 548 |
% \cs{multirow} is mainly designed for use with \env{tabular}, as |
| 549 |
% opposed to \env{array}, environments. It might not work well in an |
| 550 |
% array environment if there are big formulas in some rows; in that case you can use the |
| 551 |
% \meta{vmove} parameter to refine the result. |
| 552 |
% |
| 553 |
% In some cases you might want to align the multirow entry with the top |
| 554 |
% of the other row cells, for example if you have a large capital in it. |
| 555 |
% when you use \meta{vpos} = \texttt{[t]}, the baselines will be |
| 556 |
% aligned, which is the wrong thing in this case. You can then do the |
| 557 |
% positioning with the \meta{vmove} parameter and let \LaTeX{} calculate |
| 558 |
% the amount. For example: |
| 559 |
% |
| 560 |
% \begin{quote} |
| 561 |
% \begin{verbatim} |
| 562 |
% \usepackage{calc} |
| 563 |
% \newlength{\shiftdown} |
| 564 |
% \setlength{\shiftdown}{\heightof{\Huge\bfseries B}-\heightof{f}} |
| 565 |
% . . . |
| 566 |
% \begin{tabular}{cll} |
| 567 |
% \toprule |
| 568 |
% \multirow[t]{5}{*}[-\shiftdown]{\Huge\bfseries B} |
| 569 |
% & foo & Lorem ipsum dolor sit \\ |
| 570 |
% & bar & Maecenas sed purus \\ |
| 571 |
% & baz & Nullam luctus id tellus \\ |
| 572 |
% & qux & Aenean consequat commodo \\ |
| 573 |
% \bottomrule |
| 574 |
% \end{tabular} |
| 575 |
% \end{verbatim} |
| 576 |
% \end{quote} |
| 577 |
% |
| 578 |
% \begin{quote} |
| 579 |
% \newlength{\shiftdown} |
| 580 |
% \setlength{\shiftdown}{\heightof{\Huge\bfseries B}-\heightof{f}} |
| 581 |
% \begin{tabular}{cll} |
| 582 |
% \toprule |
| 583 |
% \multirow[t]{5}{*}[-\shiftdown]{\Huge\bfseries B} |
| 584 |
% & foo & Lorem ipsum dolor sit \\ |
| 585 |
% & bar & Maecenas sed purus \\ |
| 586 |
% & baz & Nullam luctus id tellus \\ |
| 587 |
% & qux & Aenean consequat commodo \\ |
| 588 |
% \bottomrule |
| 589 |
% \end{tabular} |
| 590 |
% \end{quote} |
| 591 |
% In \Package{multirow} version 2.4 and later you can also directly use the expression |
| 592 |
% \verb|-\heightof{\Huge\bfseries B}-\heightof{f}| instead of \verb|-\shiftdown| for the \meta{vmove} argument. |
| 593 |
% |
| 594 |
% \subsection{Multirow and colored cells}\label{sec:mult-color-cells} |
| 595 |
% |
| 596 |
% If you use \cs{multirow} with the \Package{colortbl} package (or the |
| 597 |
% \index{colortbl=\Package{colortbl}|usage} |
| 598 |
% \Package{xcolor} package with the \texttt{[table]} option) you have |
| 599 |
% \index{xcolor=\Package{xcolor}|usage} |
| 600 |
% to take precautions if you want to color the column that has the |
| 601 |
% \cs{multirow} in it. The \Package{colortbl} package works by coloring each cell |
| 602 |
% separately. So if you use \cs{multirow} with a positive \meta{nrows} |
| 603 |
% value, \Package{colortbl} will first color the top cell, then |
| 604 |
% \cs{multirow} will typeset \meta{nrows} cells starting with this cell, |
| 605 |
% and later \Package{colortbl} will color the other cells, effectively |
| 606 |
% hiding the text in that area. This can be solved by putting the |
| 607 |
% \cs{multirow} in the last row with a negative \meta{nrows} value. |
| 608 |
% See, for example: |
| 609 |
% \begin{quote} |
| 610 |
% \begin{verbatim} |
| 611 |
% \begin{tabular}{l>{\columncolor{yellow}}l} |
| 612 |
% aaaa & \\ |
| 613 |
% cccc & \\ |
| 614 |
% dddd & \multirow{-3}*{bbbb}\\ |
| 615 |
% \end{tabular} |
| 616 |
% \end{verbatim} |
| 617 |
% \end{quote} |
| 618 |
% which will produce: |
| 619 |
% \begin{quote} |
| 620 |
% \begin{tabular}{l>{\columncolor{yellow}}l} |
| 621 |
% aaaa & \\ |
| 622 |
% cccc & \\ |
| 623 |
% dddd & \multirow{-3}*{bbbb}\\ |
| 624 |
% \end{tabular} |
| 625 |
% \end{quote} |
| 626 |
% |
| 627 |
% \index{hhline=\Package{hhline}|usage} |
| 628 |
% When you use colored multirow cells together with the |
| 629 |
% \Package{hhline} package you may find some white stripes in your |
| 630 |
% colored multirow cell. For example: |
| 631 |
% \begin{quote} |
| 632 |
% \begin{verbatim} |
| 633 |
% \begin{tabular}{|>{\columncolor{red}}c|c|} |
| 634 |
% \hline |
| 635 |
% \bfseries ColumnOne & \bfseries ColumnTwo\\ \hline |
| 636 |
% First data & 932\\ \hline |
| 637 |
% & 239\\ \hhline{|~|-|} |
| 638 |
% & 137\\ \hhline{|~|-|} |
| 639 |
% \multirow{-3}{*}{More data} & 319\\ \hline |
| 640 |
% Last data & 132\\ \hline |
| 641 |
% \end{tabular} |
| 642 |
% \end{verbatim} |
| 643 |
% \end{quote} |
| 644 |
% |
| 645 |
% \begin{quote} |
| 646 |
% \begin{tabular}{|>{\columncolor{red}}c|c|} |
| 647 |
% \hline |
| 648 |
% \bfseries ColumnOne & \bfseries ColumnTwo\\ \hline |
| 649 |
% First data & 932\\ \hline |
| 650 |
% & 239\\ \hhline{|~|-|} |
| 651 |
% & 137\\ \hhline{|~|-|} |
| 652 |
% \multirow{-3}{*}{More data} & 319\\ \hline |
| 653 |
% Last data & 132\\ \hline |
| 654 |
% \end{tabular} |
| 655 |
% \end{quote} |
| 656 |
% |
| 657 |
% This can be solved by putting colored horizontal rules with the same |
| 658 |
% color in the colored multirow cell. |
| 659 |
% \begin{quote} |
| 660 |
% \begin{verbatim} |
| 661 |
% \begin{tabular}{|>{\columncolor{red}}c|c|} |
| 662 |
% \hline |
| 663 |
% \bfseries ColumnOne & \bfseries ColumnTwo\\ \hline |
| 664 |
% First data & 932\\ \hline |
| 665 |
% & 239\\ \hhline{|>{\arrayrulecolor{red}}->{\arrayrulecolor{black}}|-|} |
| 666 |
% & 137\\ \hhline{|>{\arrayrulecolor{red}}->{\arrayrulecolor{black}}|-|} |
| 667 |
% \multirow{-3}{*}{More data} & 319\\ \hline |
| 668 |
% Last data & 132\\ \hline |
| 669 |
% \end{tabular} |
| 670 |
% \end{verbatim} |
| 671 |
% \end{quote} |
| 672 |
% |
| 673 |
% \begin{quote} |
| 674 |
% \begin{tabular}{|>{\columncolor{red}}c|c|} |
| 675 |
% \hline |
| 676 |
% \bfseries ColumnOne & \bfseries ColumnTwo\\ \hline |
| 677 |
% First data & 932\\ \hline |
| 678 |
% & 239\\ \hhline{|>{\arrayrulecolor{red}}->{\arrayrulecolor{black}}|-|} |
| 679 |
% & 137\\ \hhline{|>{\arrayrulecolor{red}}->{\arrayrulecolor{black}}|-|} |
| 680 |
% \multirow{-3}{*}{More data} & 319\\ \hline |
| 681 |
% Last data & 132\\ \hline |
| 682 |
% \end{tabular} |
| 683 |
% \end{quote} |
| 684 |
% |
| 685 |
% \subsection{Fine-tuning the \meta{bigstruts} argument} |
| 686 |
% \label{sect-refine-bigstrut} |
| 687 |
% |
| 688 |
% \cs{multirow} can calculate the height of the required multirow box |
| 689 |
% from \meta{nrows} and \meta{bigstruts}, supposed that all the rows |
| 690 |
% don't have ``unusual'' heights. However, there are cases when this is |
| 691 |
% not enough to properly position the box, especially when there is a |
| 692 |
% \cs{bigstrut} on top of the first row and/or one on the bottom of the |
| 693 |
% last row. In that case \cs{multirow} should be given additional |
| 694 |
% information. This is done by prefixing the \meta{bigstruts} argument |
| 695 |
% with a letter (or two) indicating which of these two are present. |
| 696 |
% |
| 697 |
% See the following examples:\\ (in these examples we have |
| 698 |
% \verb+\setlength{\bigstrutjot}{10pt}+ to make the effect clearly visible)\\[5mm] |
| 699 |
% \begin{minipage}[c]{0.23\linewidth} |
| 700 |
% \setlength{\bigstrutjot}{10pt} |
| 701 |
% \begin{tabular}{|c|c|} |
| 702 |
% \hline |
| 703 |
% \multirow{3}[1]{*}{Multirow} & T \bigstrut[t] \\ |
| 704 |
% \cline{2-2} |
| 705 |
% & X \\ |
| 706 |
% \cline{2-2} |
| 707 |
% & B \\ |
| 708 |
% \hline |
| 709 |
% \end{tabular} \\[2mm] |
| 710 |
% \begin{tabular}{|c|c|} |
| 711 |
% \hline |
| 712 |
% \multirow{3}[t 1]{*}{Multirow} & T \bigstrut[t] \\ |
| 713 |
% \cline{2-2} |
| 714 |
% & X \\ |
| 715 |
% \cline{2-2} |
| 716 |
% & B \\ |
| 717 |
% \hline |
| 718 |
% \end{tabular} |
| 719 |
% \end{minipage} |
| 720 |
% \begin{minipage}[c]{0.75\linewidth} |
| 721 |
% \begin{verbatim} |
| 722 |
% \begin{tabular}{|c|c|} |
| 723 |
% \hline |
| 724 |
% \multirow{3}[1]{*}{Multirow} & T \bigstrut[t] \\ |
| 725 |
% \cline{2-2} |
| 726 |
% & X \\ |
| 727 |
% \cline{2-2} |
| 728 |
% & B \\ |
| 729 |
% \hline |
| 730 |
% \end{tabular} |
| 731 |
% \end{verbatim} |
| 732 |
% \end{minipage} |
| 733 |
% \\[5mm] |
| 734 |
% In the top box in the above example the text ``Multirow'' should be centered, but it |
| 735 |
% is a bit below the center, because of the \cs{bigstrut[t]} in the top |
| 736 |
% row. We can correct this by giving the \meta{bigstruts} parameter as |
| 737 |
% ``t 1'', indicating a bigstrut in the top. This is done in the bottom box, where |
| 738 |
% \verb+\multirow{3}[t 1]{*}{Multirow}+ is used. |
| 739 |
% |
| 740 |
% A second example:\\[5mm] |
| 741 |
% \begin{minipage}{0.23\linewidth} |
| 742 |
% \setlength{\bigstrutjot}{10pt} |
| 743 |
% \begin{tabular}{|c|c|} |
| 744 |
% \hline |
| 745 |
% & T \\ |
| 746 |
% \cline{2-2} |
| 747 |
% & X \\ |
| 748 |
% \cline{2-2} |
| 749 |
% \multirow[t]{-3}[1]{*}{Multirow} & B \bigstrut[b] \\ |
| 750 |
% \hline |
| 751 |
% \end{tabular} \\[2mm] |
| 752 |
% \begin{tabular}{|c|c|} |
| 753 |
% \hline |
| 754 |
% & T \\ |
| 755 |
% \cline{2-2} |
| 756 |
% & X \\ |
| 757 |
% \cline{2-2} |
| 758 |
% \multirow[t]{-3}[b 1]{*}{Multirow} & B \bigstrut[b] \\ |
| 759 |
% \hline |
| 760 |
% \end{tabular} |
| 761 |
% \end{minipage} |
| 762 |
% \begin{minipage}{0.75\linewidth} |
| 763 |
% \begin{verbatim} |
| 764 |
% \begin{tabular}{|c|c|} |
| 765 |
% \hline |
| 766 |
% & T \\ |
| 767 |
% \cline{2-2} |
| 768 |
% & X \\ |
| 769 |
% \cline{2-2} |
| 770 |
% \multirow[t]{-3}[1]{*}{Multirow} & B \bigstrut[b] \\ |
| 771 |
% \hline |
| 772 |
% \end{tabular} |
| 773 |
% \end{verbatim} |
| 774 |
% \end{minipage} |
| 775 |
% \\[5mm] |
| 776 |
% In the top box the \verb+\multirow[t]+ should be positioned on the |
| 777 |
% same height as the \texttt{T}, but it is too high, because there is a |
| 778 |
% \cs{bigstrut} in the bottom. We can correct that by specifying the |
| 779 |
% \meta{bigstruts} argument as ``b 1'', i.e. using |
| 780 |
% \verb+\multirow[t]{-3}[b 1]{*}{Multirow}+. |
| 781 |
% \\[5mm] |
| 782 |
% The possibilities for the prefix are: |
| 783 |
% \begin{description} |
| 784 |
% \item[\texttt{t}] There is a bigstrut in the top, i.e. a \cs{bigstrut} |
| 785 |
% or \cs{bigstrut[t]} in the top row. |
| 786 |
% \item[\texttt{b}] There is a bigstrut in the bottom, i.e. a \cs{bigstrut} |
| 787 |
% or \cs{bigstrut[b]} in the bottom row. |
| 788 |
% \item[\texttt{tb}] They are both present. Note: this cannot be given |
| 789 |
% as \texttt{bt}. |
| 790 |
% \end{description} |
| 791 |
% The space between the letter(s) and the number is optional. |
| 792 |
% Please note that the prefix does not depend on whether the |
| 793 |
% \cs{multirow} is in the top or the bottom row. |
| 794 |
% |
| 795 |
% \subsection{Use with \Package{longtable}} |
| 796 |
% \label{sec:use-with-longtable} |
| 797 |
% |
| 798 |
% \index{longtable=\env{longtable}|usage} |
| 799 |
% \index{longtabu=\env{longtabu}|usage} |
| 800 |
% It is possible to use \cs{multirow} in a \env{longtable} |
| 801 |
% environment (as well as in its descendent \env{longtabu}). |
| 802 |
% However, care must be taken that the longtable doesn't break the |
| 803 |
% multirow entry when it is near the bottom of the page. For example: |
| 804 |
% |
| 805 |
% \noindent |
| 806 |
% \begin{minipage}[t]{0.4\linewidth} |
| 807 |
% \begin{longtable}{|l|l|l|} |
| 808 |
% \ldots & \ldots & \ldots \\ |
| 809 |
% \hline |
| 810 |
% Sept. 21 & 09:00 & event 1 \\ |
| 811 |
% \hline |
| 812 |
% Sept. 22 & 10:00 & event 2 \\ |
| 813 |
% \hline |
| 814 |
% \multirow{3}*{Sept. 23} & 10:00 & event 3 \\ |
| 815 |
% & 12:00 & event 4 \\ |
| 816 |
% & 15:00 & event 5 \\ |
| 817 |
% \hline |
| 818 |
% Sept. 24 & 09:00 & event 6 \\ |
| 819 |
% \hline |
| 820 |
% \ldots & \ldots & \ldots \\ |
| 821 |
% \end{longtable} |
| 822 |
% \end{minipage} |
| 823 |
% \begin{minipage}[t]{0.58\linewidth} |
| 824 |
% \begin{verbatim} |
| 825 |
% \begin{longtable}{|l|l|l|} |
| 826 |
% \ldots & \ldots & \ldots \\ |
| 827 |
% \hline |
| 828 |
% Sept. 21 & 09:00 & event 1 \\ |
| 829 |
% \hline |
| 830 |
% Sept. 22 & 10:00 & event 2 \\ |
| 831 |
% \hline |
| 832 |
% \multirow{3}*{Sept. 23} & 10:00 & event 3 \\ |
| 833 |
% & 12:00 & event 4 \\ |
| 834 |
% & 15:00 & event 5 \\ |
| 835 |
% \hline |
| 836 |
% Sept. 24 & 09:00 & event 6 \\ |
| 837 |
% \hline |
| 838 |
% \ldots & \ldots & \ldots \\ |
| 839 |
% \end{longtable} |
| 840 |
% \end{verbatim} |
| 841 |
% \end{minipage} |
| 842 |
% |
| 843 |
% In this case if the ``Sept. 23'' entry comes close to the bottom of the |
| 844 |
% page, you want to prevent the pagebreak to occur in the middle of this |
| 845 |
% entry. You can do this by ending the intermediate rows with \verb+\\*+ instead of \verb+\\+. |
| 846 |
% |
| 847 |
% \begin{verbatim} |
| 848 |
% \multirow{3}*{Sept. 23} & 10:00 & event 3 \\* |
| 849 |
% & 12:00 & event 4 \\* |
| 850 |
% & 15:00 & event 5 \\ |
| 851 |
% \end{verbatim} |
| 852 |
% |
| 853 |
% There is, however, a bug in \Package{longtable}, that causes the |
| 854 |
% \verb+\\*+ not to work if it is followed by a \cs{cline}, like in the |
| 855 |
% following example: |
| 856 |
% |
| 857 |
% \begin{verbatim} |
| 858 |
% \multirow{3}*{Sept. 23} & 10:00 & event 3 \\* |
| 859 |
% \cline{2-3} |
| 860 |
% & 12:00 & event 4 \\* |
| 861 |
% \cline{2-3} |
| 862 |
% & 15:00 & event 5 \\ |
| 863 |
% \end{verbatim} |
| 864 |
% |
| 865 |
% \Package{multirow} has a package option \texttt{longtable} that redefines |
| 866 |
% \cs{cline} so that the \verb+\\*+ will also work when followed by |
| 867 |
% \cs{cline}. The code comes from David Carlisle. |
| 868 |
% |
| 869 |
% \subsection{Use with \Package{supertabular}} |
| 870 |
% \label{sec:use-with-supertabular} |
| 871 |
% |
| 872 |
% \index{supertabular=\env{supertabular}|usage} |
| 873 |
% \index{xtab=\env{xtab}|usage} |
| 874 |
% With the package \Package{supertabular} (or the augmented version |
| 875 |
% \Package{xtab}) there is the same requirement |
| 876 |
% to keep the rows of a multirow together when a pagebreak occurs. |
| 877 |
% Unfortunately, \Package{supertabular} does not have a way to specify |
| 878 |
% that a pagebreak should be suppressed. I.e. \verb+\\*+ does not |
| 879 |
% suppress a pagebreak. |
| 880 |
% Therefore \Package{multirow} provides a package option |
| 881 |
% \texttt{supertabular} that redefines \verb+\\*+ inside a |
| 882 |
% \env{supertabular} to suppress the pagebreak. You should use |
| 883 |
% this to end the intermediate rows in a multirow block. However, this |
| 884 |
% does not cause \env{supertabular} to consider breaking the |
| 885 |
% page before the \cs{multirow}, contrary to \env{longtable}. |
| 886 |
% Thus the table may become too long. |
| 887 |
% |
| 888 |
% \DescribeMacro{\STneed} |
| 889 |
% Therefore when the \texttt{supertabular} option is given, |
| 890 |
% \Package{multirow} also provides a command \cs{STneed} to be used |
| 891 |
% in a \env{supertabular} that specifies how much space we need |
| 892 |
% on the page. Then if there is not enough space, a pagebreak will occur |
| 893 |
% at that place. For example: |
| 894 |
% \begin{verbatim} |
| 895 |
% \tabletail{\hline} |
| 896 |
% \begin{supertabular}{|l|l|l|} |
| 897 |
% \ldots & \ldots & \ldots \\ |
| 898 |
% \hline |
| 899 |
% Sept. 20 & 10:00 & event 1\\ |
| 900 |
% \hline |
| 901 |
% Sept. 21 & 10:00 & event 2\\ |
| 902 |
% \hline |
| 903 |
% Sept. 22 & 10:00 & event 3\\ |
| 904 |
% \hline |
| 905 |
% \STneed {2cm} |
| 906 |
% \multirow{3}*{Sept. 23} & 10:00 & event 4\\* |
| 907 |
% \cline{2-3} |
| 908 |
% & 12:00 & event 5 \\* |
| 909 |
% \cline{2-3} |
| 910 |
% & 15:00 & event 6 \\ |
| 911 |
% \hline |
| 912 |
% Sept. 24 & 09:00 & event 7 \\ |
| 913 |
% \hline |
| 914 |
% \ldots & \ldots & \ldots \\ |
| 915 |
% \end{verbatim} |
| 916 |
% |
| 917 |
% You will have to experiment a bit with the value to see |
| 918 |
% what works. Sometimes it is better to exaggerate the required space a bit. |
| 919 |
% |
| 920 |
% \subsection{Dealing with tall entries} |
| 921 |
% \label{sec:dealing-with-tall} |
| 922 |
% |
| 923 |
% Sometimes there are rows that are taller than what is expected. This |
| 924 |
% section gives some hints how to deal with these situations. There are |
| 925 |
% two cases: |
| 926 |
% \begin{enumerate} |
| 927 |
% \item When there is an exceptionally tall row outside of the multirow |
| 928 |
% block the positioning of the \cs{multirow} might be wrong. This is |
| 929 |
% because \cs{multirow} does not have information about the heights |
| 930 |
% of the rows. This can happen for example when a large formula is |
| 931 |
% entered in a cell, or a multi-line paragraph in a \texttt{[\{\}]} |
| 932 |
% column. An example: |
| 933 |
% |
| 934 |
% \begin{quote} |
| 935 |
% \begin{verbatim} |
| 936 |
% \begin{tabular}{| l | l | p{4cm} |} |
| 937 |
% \hline |
| 938 |
% \multirow{3}*{Week 38} & Monday & Rain most of the day\\ |
| 939 |
% \cline{2-3} |
| 940 |
% & Tuesday & Sunny with some clouds\\ |
| 941 |
% \cline{2-3} |
| 942 |
% & Wednesday & A clear day with a lot of sunshine. |
| 943 |
% However, the strong wind will bring down the |
| 944 |
% temperature. \\ |
| 945 |
% \hline |
| 946 |
% \end{tabular} |
| 947 |
% \end{verbatim} |
| 948 |
% \end{quote} |
| 949 |
% \begin{quote} |
| 950 |
% \begin{tabular}{| l | l | p{4cm} |} |
| 951 |
% \hline |
| 952 |
% \multirow{3}*{Week 38} & Monday & Rain most of the day\\ |
| 953 |
% \cline{2-3} |
| 954 |
% & Tuesday & Sunny with some clouds\\ |
| 955 |
% \cline{2-3} |
| 956 |
% & Wednesday & A clear day with a lot of sunshine. |
| 957 |
% However, the strong wind will bring down the |
| 958 |
% temperature. \\ |
| 959 |
% \hline |
| 960 |
% \end{tabular} |
| 961 |
% \end{quote} |
| 962 |
% The \cs{multirow} is positioned on the second row, because it |
| 963 |
% specifies that it should cover 3 rows. However, the second row is not |
| 964 |
% the vertical center in this case because the third row is much taller. |
| 965 |
% |
| 966 |
% To remedy this, the \meta{vmove} parameter could be used. However, in |
| 967 |
% this case it would be easier to pretend that \cs{multirow} spans 6 |
| 968 |
% rows (the total number of lines in the last column). So use |
| 969 |
% \verb+\multirow{6}+\ldots{} and we get: |
| 970 |
% \begin{quote} |
| 971 |
% \begin{tabular}{| l | l | p{4cm} |} |
| 972 |
% \hline |
| 973 |
% \multirow{6}*{Week 38} & Monday & Rain most of the day\\ |
| 974 |
% \cline{2-3} |
| 975 |
% & Tuesday & Sunny with some clouds\\ |
| 976 |
% \cline{2-3} |
| 977 |
% & Wednesday & A clear day with a lot of sunshine. |
| 978 |
% However, the strong wind will bring down the |
| 979 |
% temperature. \\ |
| 980 |
% \hline |
| 981 |
% \end{tabular} |
| 982 |
% \end{quote} |
| 983 |
% \item The second case is when the \cs{multirow} entry is taller than |
| 984 |
% the surrounding normal rows. In that case the multirow text will stick |
| 985 |
% out of its block. We must now enlarge the other rows, and that is |
| 986 |
% something \cs{multirow} cannot do. |
| 987 |
% |
| 988 |
% An example: |
| 989 |
% (Don't take this as a medical advice. The names are fake anyway.) |
| 990 |
% \begin{verbatim} |
| 991 |
% \begin{tabular}{| p{2mm} l | p{5cm} |} |
| 992 |
% \hline |
| 993 |
% \multicolumn{2}{|l|}{\textbf{Medicine \& dose}} |
| 994 |
% & \textbf{Possible Side effects} \\ |
| 995 |
% \hline |
| 996 |
% \multicolumn{2}{|l|}{Spirino} |
| 997 |
% & \multirow{3}={Confusion, |
| 998 |
% hallucinations, rapid breathing, |
| 999 |
% seizure (convulsions); |
| 1000 |
% upset stomach, heartburn; severe nausea, |
| 1001 |
% vomiting, or stomach pain or mild headache.} \\ |
| 1002 |
% \cline{1-2} |
| 1003 |
% & initial: 200 mg/day & \\ |
| 1004 |
% \cline{1-2} |
| 1005 |
% & maintenance: 100-400 mg/day & \\ |
| 1006 |
% \hline |
| 1007 |
% \multicolumn{2}{|l|}{Conzac} |
| 1008 |
% & \multirow{3}={Anxiety; nervousness; |
| 1009 |
% insomnia; anorexia; mild bradycardia; |
| 1010 |
% SA node slowing; weight loss; |
| 1011 |
% solar photosensitivity; hyponatremia; |
| 1012 |
% sexual dysfunction (both genders); may |
| 1013 |
% alter glycemic control in diabetic patients.} \\ |
| 1014 |
% \cline{1-2} |
| 1015 |
% & initial: 10 mg/day & \\ |
| 1016 |
% \cline{1-2} |
| 1017 |
% & maintenance: 10-40 mg/day & \\ |
| 1018 |
% \hline |
| 1019 |
% \end{tabular} |
| 1020 |
% \end{verbatim} |
| 1021 |
% \begin{tabular}{| p{2mm} l | p{5cm} |} |
| 1022 |
% \hline |
| 1023 |
% \multicolumn{2}{|l|}{\textbf{Medicine \& dose}} |
| 1024 |
% & \textbf{Possible Side effects} \\ |
| 1025 |
% \hline |
| 1026 |
% \multicolumn{2}{|l|}{Spirino} |
| 1027 |
% & \multirow{3}={Confusion, |
| 1028 |
% hallucinations, rapid breathing, |
| 1029 |
% seizure (convulsions); |
| 1030 |
% upset stomach, heartburn; severe nausea, |
| 1031 |
% vomiting, or stomach pain or mild headache.} \\ |
| 1032 |
% \cline{1-2} |
| 1033 |
% & initial: 200 mg/day & \\ |
| 1034 |
% \cline{1-2} |
| 1035 |
% & maintenance: 100-400 mg/day & \\ |
| 1036 |
% \hline |
| 1037 |
% \multicolumn{2}{|l|}{Conzac} |
| 1038 |
% & \multirow{3}={Anxiety; nervousness; |
| 1039 |
% insomnia; anorexia; mild bradycardia; |
| 1040 |
% SA node slowing; weight loss; |
| 1041 |
% solar photosensitivity; hyponatremia; |
| 1042 |
% sexual dysfunction (both genders); may |
| 1043 |
% alter glycemic control in diabetic patients.} \\ |
| 1044 |
% \cline{1-2} |
| 1045 |
% & initial: 10 mg/day & \\ |
| 1046 |
% \cline{1-2} |
| 1047 |
% & maintenance: 10-40 mg/day & \\ |
| 1048 |
% \hline |
| 1049 |
% \end{tabular} |
| 1050 |
% \\[2cm] |
| 1051 |
% Both \cs{multirow} entries are too high; the first sticks out into the |
| 1052 |
% second entry, and the second one sticks out of the table. |
| 1053 |
% |
| 1054 |
% There are two ways we can correct this: |
| 1055 |
% The simplest would be to add extra empty rows to cover the overlapping |
| 1056 |
% space. For the first entry that would be 2 extra rows; for the second |
| 1057 |
% 4. So we add twice \verb+ & & \\+ before the third \verb+\hline+, |
| 1058 |
% and four of these before the last \verb+\hline+. |
| 1059 |
% This gives us just the correct table: |
| 1060 |
% \\[5mm] |
| 1061 |
% \begin{tabular}{| p{2mm} l | p{5cm} |} |
| 1062 |
% \hline |
| 1063 |
% \multicolumn{2}{|l|}{\textbf{Medicine \& dose}} |
| 1064 |
% & \textbf{Possible Side effects} \\ |
| 1065 |
% \hline |
| 1066 |
% \multicolumn{2}{|l|}{Spirino} |
| 1067 |
% & \multirow{3}={Confusion, |
| 1068 |
% hallucinations, rapid breathing, |
| 1069 |
% seizure (convulsions); |
| 1070 |
% upset stomach, heartburn; severe nausea, |
| 1071 |
% vomiting, or stomach pain or mild headache.} \\ |
| 1072 |
% \cline{1-2} |
| 1073 |
% & initial: 200 mg/day & \\ |
| 1074 |
% \cline{1-2} |
| 1075 |
% & maintenance: 100-400 mg/day & \\ |
| 1076 |
% & & \\ |
| 1077 |
% & & \\ |
| 1078 |
% \hline |
| 1079 |
% \multicolumn{2}{|l|}{Conzac} |
| 1080 |
% & \multirow{3}={Anxiety; nervousness; |
| 1081 |
% insomnia; anorexia; mild bradycardia; |
| 1082 |
% SA node slowing; weight loss; |
| 1083 |
% solar photosensitivity; hyponatremia; |
| 1084 |
% sexual dysfunction (both genders); may |
| 1085 |
% alter glycemic control in diabetic patients.} \\ |
| 1086 |
% \cline{1-2} |
| 1087 |
% & initial: 10 mg/day & \\ |
| 1088 |
% \cline{1-2} |
| 1089 |
% & maintenance: 10-40 mg/day & \\ |
| 1090 |
% & & \\ |
| 1091 |
% & & \\ |
| 1092 |
% & & \\ |
| 1093 |
% & & \\ |
| 1094 |
% \hline |
| 1095 |
% \end{tabular} |
| 1096 |
% |
| 1097 |
% The second way is to stretch the normal rows vertically, such that |
| 1098 |
% they fit with the multirow entry. In this table, where the font size |
| 1099 |
% is 10pt, each row has a total |
| 1100 |
% height of 12pt. For the first entry we need 24pt extra (2 rows), |
| 1101 |
% Because this space must be divided over 3 rows that is 8pt per row, |
| 1102 |
% making the total height of the row 20pt. |
| 1103 |
% The normal row has a height of 8.4pt and a depth of 3.6pt (total |
| 1104 |
% 12pt). We can add 4pt on the top and 4pt on the bottom, or any other |
| 1105 |
% combination that adds up to 8pt. In this case I have chosen to make |
| 1106 |
% the height 12pt and the depth 8pt. We do this with a \cs{rule} with 0 width. |
| 1107 |
% \DescribeMacro{\mystrut} |
| 1108 |
% \verb+\newcommand{\mystrut}{\rule[-8pt]{0pt}{20pt}}+ |
| 1109 |
% and put \cs{mystrut} in each of the first 3 rows. By defining your own |
| 1110 |
% struts you have complete control over the layout. You can choose to |
| 1111 |
% give some rows more space than others, or to put all the space is the |
| 1112 |
% last row, for example. |
| 1113 |
% |
| 1114 |
% For the second entry we need 48pt extra (4 rows). We will use |
| 1115 |
% \cs{bigstrut} in each row, that is 16pt per row, and as a \cs{bigstrut} is |
| 1116 |
% 2\cs{bigstrutjot}s, we set \cs{bigstrutjot} to 8pt. The |
| 1117 |
% \Package{booktabs} package adds some extra vertical space around the rules, |
| 1118 |
% therefore when using the normal \env{tabular} environment, it |
| 1119 |
% is probably better to make the struts a little bit bigger, or a bit |
| 1120 |
% smaller with \Package{booktabs}. After some experimentation it appeared |
| 1121 |
% that a \cs{bigstrutjot} of \texttt{7pt} was enough. Of course we added |
| 1122 |
% the \meta{bigstruts} argument of \texttt{[tb6]} to the second |
| 1123 |
% multirow. Please note that this is not possible with our own struts, |
| 1124 |
% unless we cheat. |
| 1125 |
% |
| 1126 |
% \index{booktabs=\env{booktabs}|usage} |
| 1127 |
% Now with \Package{booktabs} the code becomes: |
| 1128 |
% \begin{verbatim} |
| 1129 |
% \newcommand{\mystrut}{\rule[-8pt]{0pt}{20pt}} |
| 1130 |
% \setlength{\bigstrutjot}{7pt} |
| 1131 |
% \begin{tabular}{ p{2mm} l p{5cm} } |
| 1132 |
% \toprule |
| 1133 |
% \multicolumn{2}{l}{\textbf{Medicine \& dose}} |
| 1134 |
% & \textbf{Possible Side effects} \\ |
| 1135 |
% \cmidrule(r){1-2} \cmidrule(l){3-3} |
| 1136 |
% \multicolumn{2}{l}{Spirino} \mystrut |
| 1137 |
% & \multirow{3}={Confusion, |
| 1138 |
% hallucinations, rapid breathing, |
| 1139 |
% seizure (convulsions); |
| 1140 |
% upset stomach, heartburn; severe nausea, |
| 1141 |
% vomiting, or stomach pain or mild headache.} \\ |
| 1142 |
% \cmidrule(r){1-2} |
| 1143 |
% & initial: 200 mg/day \mystrut & \\ |
| 1144 |
% \cmidrule(r){1-2} |
| 1145 |
% & maintenance: 100-400 mg/day \mystrut & \\ |
| 1146 |
% \midrule |
| 1147 |
% \multicolumn{2}{l}{Conzac} \bigstrut |
| 1148 |
% & \multirow{3}[tb6]={Anxiety; nervousness; |
| 1149 |
% insomnia; anorexia; mild bradycardia; |
| 1150 |
% SA node slowing; weight loss; |
| 1151 |
% solar photosensitivity; hyponatremia; |
| 1152 |
% sexual dysfunction (both genders); may |
| 1153 |
% alter glycemic control in diabetic patients.} \\ |
| 1154 |
% \cmidrule(r){1-2} |
| 1155 |
% & initial: 10 mg/day \bigstrut & \\ |
| 1156 |
% \cmidrule(r){1-2} |
| 1157 |
% & maintenance: 10-40 mg/day \bigstrut & \\ |
| 1158 |
% \bottomrule |
| 1159 |
% \end{tabular} |
| 1160 |
% \end{verbatim} |
| 1161 |
% |
| 1162 |
% \newcommand{\mystrut}{\rule[-8pt]{0pt}{20pt}} |
| 1163 |
% \setlength{\bigstrutjot}{7pt} |
| 1164 |
% \begin{tabular}{ p{2mm} l p{5cm} } |
| 1165 |
% \toprule |
| 1166 |
% \multicolumn{2}{l}{\textbf{Medicine \& dose}} |
| 1167 |
% & \textbf{Possible Side effects} \\ |
| 1168 |
% \cmidrule(r){1-2} \cmidrule(l){3-3} |
| 1169 |
% \multicolumn{2}{l}{Spirino} \mystrut |
| 1170 |
% & \multirow{3}={Confusion, |
| 1171 |
% hallucinations, rapid breathing, |
| 1172 |
% seizure (convulsions); |
| 1173 |
% upset stomach, heartburn; severe nausea, |
| 1174 |
% vomiting, or stomach pain or mild headache.} \\ |
| 1175 |
% \cmidrule(r){1-2} |
| 1176 |
% & initial: 200 mg/day \mystrut & \\ |
| 1177 |
% \cmidrule(r){1-2} |
| 1178 |
% & maintenance: 100-400 mg/day \mystrut & \\ |
| 1179 |
% \midrule |
| 1180 |
% \multicolumn{2}{l}{Conzac} \bigstrut |
| 1181 |
% & \multirow{3}[tb6]={Anxiety; nervousness; |
| 1182 |
% insomnia; anorexia; mild bradycardia; |
| 1183 |
% SA node slowing; weight loss; |
| 1184 |
% solar photosensitivity; hyponatremia; |
| 1185 |
% sexual dysfunction (both genders); may |
| 1186 |
% alter glycemic control in diabetic patients.} \\ |
| 1187 |
% \cmidrule(r){1-2} |
| 1188 |
% & initial: 10 mg/day \bigstrut & \\ |
| 1189 |
% \cmidrule(r){1-2} |
| 1190 |
% & maintenance: 10-40 mg/day \bigstrut & \\ |
| 1191 |
% \bottomrule |
| 1192 |
% \end{tabular} |
| 1193 |
% \end{enumerate} |
| 1194 |
% |
| 1195 |
% \section{Using \Package{bigstrut}} |
| 1196 |
% |
| 1197 |
% \DescribeMacro{\bigstrut} |
| 1198 |
% \DescribeMacro{\bigstrutjot} |
| 1199 |
% \cs{bigstrut}\oarg{x} produces a strut (a rule with width 0) which is \cs{bigstrutjot} |
| 1200 |
% (\texttt{2pt} by default) higher, lower, or both than the standard |
| 1201 |
% \env{array}/\env{tabular} strut. Use it in table entries that are adjacent to |
| 1202 |
% \cs{hline}s to leave an extra bit of space\,---\,according to the |
| 1203 |
% TeXbook (page 246), ``This is a little touch that improves the |
| 1204 |
% appearance of boxed tables; look for it as a mark of quality.'' |
| 1205 |
% |
| 1206 |
% Although you could use \cs{bigstrut} in an array, there isn't normally |
| 1207 |
% much point since arrays are `opened up' by \cs{jot} anyway. |
| 1208 |
% |
| 1209 |
% \cs{bigstrut[t]} adds height; \cs{bigstrut[b]} adds |
| 1210 |
% depth. Just \cs{bigstrut} adds both. So: Use |
| 1211 |
% \cs{bigstrut[t]} in the row just \emph{after} an \cs{hline}; |
| 1212 |
% \cs{bigstrut[b]} in the row just \emph{before}; and |
| 1213 |
% \cs{bigstrut} if there are \cs{hline}s both before and after. |
| 1214 |
% |
| 1215 |
% Spaces after the \cs{bigstrut} are ignored, even if it has an optional |
| 1216 |
% argument. Spaces before the \cs{bigstrut} are generally ignored (by a |
| 1217 |
% single \cs{unskip}). |
| 1218 |
% |
| 1219 |
% \DescribeMacro{\bigstrutjot} |
| 1220 |
% Note: The \Package{multirow} package makes use of \cs{bigstrutjot}. If |
| 1221 |
% both packages are used, they can be used in either order, as each checks |
| 1222 |
% to see if the other has already defined \cs{bigstrutjot}. However, |
| 1223 |
% the default values they set are different: if only \Package{multirow} |
| 1224 |
% is used, \cs{bigstrutjot} will be set to \texttt{3pt}. |
| 1225 |
% If \Package{bigstrut} is used, with or without \Package{multirow}, |
| 1226 |
% \cs{bigstrutjot} will be \texttt{2pt}. |
| 1227 |
% |
| 1228 |
% \section{Using \Package{bigdelim}} |
| 1229 |
% |
| 1230 |
% The package is for working in a \env{tabular} or \env{array} |
| 1231 |
% environment, in which the \Package{multirow} package is also used. |
| 1232 |
% |
| 1233 |
% \DescribeMacro{\ldelim} |
| 1234 |
% \DescribeMacro{\rdelim} |
| 1235 |
% Syntax of use is |
| 1236 |
% \begin{quote} |
| 1237 |
% \cs{ldelim} ( \marg{n}\oarg{vmove}\marg{width}\oarg{text}\\ |
| 1238 |
% \cs{rdelim} ) \marg{n}\oarg{vmove}\marg{width}\oarg{text} |
| 1239 |
% \end{quote} |
| 1240 |
% The commands are used in a column of a \env{tabular} or |
| 1241 |
% \env{array}; they create a big parenthesis, brace or whatever |
| 1242 |
% delimiter that extends over the \meta{n} rows starting at the one |
| 1243 |
% containing the command. Corresponding cells in the following rows |
| 1244 |
% must be explicitly given as empty cells. |
| 1245 |
% |
| 1246 |
% The first parameter is a delimiter to be used, e.g., \cs{\char`\{} |
| 1247 |
% \cs{\char`\}} \texttt{[} \texttt{]} \texttt{(} \texttt{)}\,---\,in fact, |
| 1248 |
% anything that can be used with \cs{left} or \cs{right}, as appropriate. |
| 1249 |
% |
| 1250 |
% Here is an example: |
| 1251 |
% \begin{quote} |
| 1252 |
% \begin{verbatim} |
| 1253 |
% \begin{equation} |
| 1254 |
% \begin{array}{ccccccc} |
| 1255 |
% \ldelim({4}{4mm} & x & x & x & x & \rdelim){4}{4mm} \\ |
| 1256 |
% & x & x & x & x & & i \\ |
| 1257 |
% & x & x & x & x & & j \\ |
| 1258 |
% & x & x & x & x & \\ |
| 1259 |
% & & u & v & & |
| 1260 |
% \end{array} |
| 1261 |
% \end{equation} |
| 1262 |
% \end{verbatim} |
| 1263 |
% \end{quote} |
| 1264 |
% |
| 1265 |
% \begin{quote} |
| 1266 |
% \begin{equation} |
| 1267 |
% \begin{array}{ccccccc} |
| 1268 |
% \ldelim({4}{4mm} & x & x & x & x & \rdelim){4}{4mm} \\ |
| 1269 |
% & x & x & x & x & & i \\ |
| 1270 |
% & x & x & x & x & & j \\ |
| 1271 |
% & x & x & x & x & \\ |
| 1272 |
% & & u & v & & |
| 1273 |
% \end{array} |
| 1274 |
% \end{equation} |
| 1275 |
% \end{quote} |
| 1276 |
% |
| 1277 |
% The optional parameter \meta{vmove} is a length used for fine-tuning: the |
| 1278 |
% delimiter (with the optional \meta{text}) will be raised (or lowered, if |
| 1279 |
% \meta{vmove} is negative) by that length above (below) wherever it would |
| 1280 |
% otherwise have gone. This is just like with \cs{multirow}, but note that |
| 1281 |
% here the \meta{vmove} goes before the \meta{width}. |
| 1282 |
% |
| 1283 |
% When \cs{ldelim} is used, the optional \meta{text} is set centred to the left of \cs{ldelim}. |
| 1284 |
% If \cs{rdelim} is used it is set to the right of \cs{rdelim}. The |
| 1285 |
% \meta{width} parameter is the space that is reserved for |
| 1286 |
% the delimiter and its text; as with the |
| 1287 |
% \Package{multirow} package, the \meta{width} may be given as |
| 1288 |
% \texttt{*}. Compare for example these: |
| 1289 |
% \begin{quote} |
| 1290 |
% \begin{minipage}{0.6\linewidth} |
| 1291 |
% \begin{verbatim} |
| 1292 |
% \begin{tabular}{p{2em}l} |
| 1293 |
% \ldelim\{{3}{*}[type] & dvi \\ |
| 1294 |
% & ps \\ |
| 1295 |
% & pdf \\ |
| 1296 |
% \end{tabular} |
| 1297 |
% \end{verbatim} |
| 1298 |
% \end{minipage} |
| 1299 |
% \begin{minipage}{0.35\linewidth} |
| 1300 |
% \begin{tabular}{p{2em}l} |
| 1301 |
% \ldelim\{{3}{*}[type] & dvi \\ |
| 1302 |
% & ps \\ |
| 1303 |
% & pdf \\ |
| 1304 |
% \end{tabular} |
| 1305 |
% \\[2ex] |
| 1306 |
% \end{minipage} |
| 1307 |
% |
| 1308 |
% \begin{minipage}{0.6\linewidth} |
| 1309 |
% \begin{verbatim} |
| 1310 |
% \begin{tabular}{l@{\,}l} |
| 1311 |
% \ldelim\{{3}{*}[type] & dvi \\ |
| 1312 |
% & ps \\ |
| 1313 |
% & pdf \\ |
| 1314 |
% \end{tabular} |
| 1315 |
% \end{verbatim} |
| 1316 |
% \end{minipage} |
| 1317 |
% \begin{minipage}{0.35\linewidth} |
| 1318 |
% \begin{tabular}{l@{\,}l} |
| 1319 |
% \ldelim\{{3}{*}[type] & dvi \\ |
| 1320 |
% & ps \\ |
| 1321 |
% & pdf \\ |
| 1322 |
% \end{tabular} |
| 1323 |
% \\[2ex] |
| 1324 |
% \end{minipage} |
| 1325 |
% \end{quote} |
| 1326 |
% In the first example we cheated: by using a column width that is too |
| 1327 |
% small, we swallowed up some of the intercolumn space, at the cost of |
| 1328 |
% an ``Overfull \cs{hbox}'' message. In the second example we did it the |
| 1329 |
% proper way by inserting \verb+@{\,}+ to replace the default |
| 1330 |
% intercolumn space with a narrow space. |
| 1331 |
% |
| 1332 |
% Also the commands may be |
| 1333 |
% used in the last row of the extension with a negative \meta{n} |
| 1334 |
% \index{colortbl=\Package{colortbl}|usage} |
| 1335 |
% argument. This is useful in combination with the \Package{colortbl} |
| 1336 |
% \index{xcolor=\Package{xcolor}|usage} |
| 1337 |
% or \Package{xcolor} packages |
| 1338 |
% (see the discussion in section \ref{sec:multirow} on \Package{multirow}). |
| 1339 |
% If there are unusually tall rows you may have to enlarge \meta{n} |
| 1340 |
% (you can use fractional values). |
| 1341 |
% If you have horizontal lines that interact with the braces you are |
| 1342 |
% \index{hhline=\Package{hhline}|usage} |
| 1343 |
% advised to use the \Package{hhline} package to make the lines. |
| 1344 |
% |
| 1345 |
% If you decrease or eliminate the intercolumn space with \verb|@{}| and |
| 1346 |
% use colored backgrounds with the \Package{colortbl} or |
| 1347 |
% \Package{xcolor} packages (commands \verb|\columncolor|, |
| 1348 |
% \verb|\rowcolor|, \verb|\rowcolors| or \verb|\cellcolor|), |
| 1349 |
% \index{columncolor=\verb!*+\columncolor+|usage} |
| 1350 |
% \index{rowcolor=\verb!*+\rowcolor+|usage} |
| 1351 |
% \index{rowcolors=\verb!*+\rowcolors+|usage} |
| 1352 |
% \index{cellcolor=\verb!*+\cellcolor+|usage} |
| 1353 |
% you will notice that part of the brace will be cut off. In reality it |
| 1354 |
% will be overwritten with the color of the next cell. See this example: |
| 1355 |
% |
| 1356 |
% \begin{quote} |
| 1357 |
% \begin{minipage}{0.6\linewidth} |
| 1358 |
% \begin{verbatim} |
| 1359 |
% \rowcolors{2}{green!25}{green!75} |
| 1360 |
% \begin{tabular}{ c @{}c c c } |
| 1361 |
% & 1 & 2 & 3 \\ |
| 1362 |
% & 4 & 5 & 6 \\ |
| 1363 |
% \ldelim\{{-3}{*} & 7 & 8 & 9 \\ |
| 1364 |
% \end{tabular} |
| 1365 |
% \end{verbatim} |
| 1366 |
% \end{minipage} |
| 1367 |
% \begin{minipage}{0.35\linewidth} |
| 1368 |
% \rowcolors{2}{green!25}{green!75} |
| 1369 |
% \begin{tabular}{ c @{}c c c } |
| 1370 |
% & 1 & 2 & 3 \\ |
| 1371 |
% & 4 & 5 & 6 \\ |
| 1372 |
% \ldelim\{{-3}{*} & 7 & 8 & 9 \\ |
| 1373 |
% \end{tabular} |
| 1374 |
% \\[2ex] |
| 1375 |
% \end{minipage} |
| 1376 |
% \end{quote} |
| 1377 |
% |
| 1378 |
% This is not a problem of \Package{multirow} or \Package{bigdelim}; |
| 1379 |
% it will also happen if there is normal text in the column before the |
| 1380 |
% \verb|@{}|. The reason is that these color commands extend the color |
| 1381 |
% to cover the intercolumn spaces on both sides to prevent gaps in the |
| 1382 |
% color. The size of these so-called \textit{overhangs} is \verb|\tabcolsep| (or |
| 1383 |
% \verb|\arraycolsep| when an \env{array} is used) on each side. |
| 1384 |
% However, when \verb|@{}| is used there is no such intercolumn space |
| 1385 |
% and the extension covers parts of the previous column. |
| 1386 |
% This can be cured by setting the left \textit{overhang} explicitly to |
| 1387 |
% 0pt with a \verb|\columncolor| command in the tabular header, like |
| 1388 |
% \verb|>{\columncolor{white}[0pt][\tabcolsep]}|. Unfortunately the |
| 1389 |
% explicit color \texttt{white}, removes the transparency of the column, |
| 1390 |
% so if there are cells in that column that have no explicit color, |
| 1391 |
% these cells are affected. If the background of the \env{tabular} is |
| 1392 |
% white, this normally will not be noticed, but if the background color |
| 1393 |
% is changed, for example with the \verb|\pagecolor| command, then that color |
| 1394 |
% should be used rather than \texttt{white}. Unfortunately, there is no |
| 1395 |
% command to specify the \textit{overhangs} without also specifying a |
| 1396 |
% color. |
| 1397 |
% |
| 1398 |
% In the following example we have done this. In order to keep the table |
| 1399 |
% header compact, we put the deinition in a \verb|\newcolumn| command |
| 1400 |
% (using the \Package{array} package). |
| 1401 |
% |
| 1402 |
% \begin{quote} |
| 1403 |
% \begin{minipage}{0.6\linewidth} |
| 1404 |
% \begin{verbatim} |
| 1405 |
% \newcolumntype{z}{@{}>{\columncolor{white}[0pt][\tabcolsep]}} |
| 1406 |
% \rowcolors{2}{green!25}{green!75} |
| 1407 |
% \begin{tabular}{ c zc c c } |
| 1408 |
% & 1 & 2 & 3 \\ |
| 1409 |
% & 4 & 5 & 6 \\ |
| 1410 |
% \ldelim\{{-3}{*} & 7 & 8 & 9 \\ |
| 1411 |
% \end{tabular} |
| 1412 |
% \end{verbatim} |
| 1413 |
% \end{minipage} |
| 1414 |
% \begin{minipage}{0.35\linewidth} |
| 1415 |
% \newcolumntype{z}{@{}>{\columncolor{white}[0pt][\tabcolsep]}} |
| 1416 |
% \rowcolors{2}{green!25}{green!75} |
| 1417 |
% \begin{tabular}{ c zc c c } |
| 1418 |
% & 1 & 2 & 3 \\ |
| 1419 |
% & 4 & 5 & 6 \\ |
| 1420 |
% \ldelim\{{-3}{*} & 7 & 8 & 9 \\ |
| 1421 |
% \end{tabular} |
| 1422 |
% \\[2ex] |
| 1423 |
% \end{minipage} |
| 1424 |
% \end{quote} |
| 1425 |
% |
| 1426 |
% In case you want to have a paragraph type text as optional parameter you could put it in a \cs{parbox}. |
| 1427 |
% Alternatively you could add an extra column with the text in a \cs{multirow}, like in |
| 1428 |
% \begin{quote} |
| 1429 |
% \begin{verbatim} |
| 1430 |
% \begin{tabular}{l@{}l@{}l} |
| 1431 |
% dvi & \rdelim\}{3}{1em} & \multirow{3}{4cm}{These are the output types, |
| 1432 |
% that are commonly used for \TeX.} \\ |
| 1433 |
% ps & & \\ |
| 1434 |
% pdf & & \\ |
| 1435 |
% \end{tabular} |
| 1436 |
% \end{verbatim} |
| 1437 |
% \end{quote} |
| 1438 |
% \begin{quote} |
| 1439 |
% \begin{tabular}{l@{}l@{}l} |
| 1440 |
% dvi & \rdelim\}{3}{1em} & \multirow{3}{4cm}{These are the output types, |
| 1441 |
% that are commonly used for \TeX.} \\ |
| 1442 |
% ps & & \\ |
| 1443 |
% pdf & & \\ |
| 1444 |
% \end{tabular} |
| 1445 |
% \end{quote} |
| 1446 |
% Note that we used \texttt{@\{\}} to eliminate the intercolumn space to |
| 1447 |
% get the text tight to the brace. |
| 1448 |
% \section{Contact Information} |
| 1449 |
% |
| 1450 |
% Pieter van Oostrum\\ |
| 1451 |
% email: \texttt{[email protected]}\\ |
| 1452 |
% www: \url{http://pieter.vanoostrum.org} |
| 1453 |
% \\[1ex] |
| 1454 |
% The source code can be found on Github:\\ |
| 1455 |
% \url{https://github.com/pietvo/multirow}\\ |
| 1456 |
% Bugs can be reported at\\ |
| 1457 |
% \url{https://github.com/pietvo/multirow/issues} |
| 1458 |
% |
| 1459 |
% \StopEventually{% |
| 1460 |
% \PrintChanges |
| 1461 |
% \PrintIndex} |
| 1462 |
% |
| 1463 |
% \section{Implementation} |
| 1464 |
% |
| 1465 |
% |
| 1466 |
%\subsection{The \Package{multirow} package} |
| 1467 |
%\label{sec:pack-multirow} |
| 1468 |
% \iffalse |
| 1469 |
%<*multirow> |
| 1470 |
% \fi |
| 1471 |
% |
| 1472 |
% \changes{multirow v1.0}{}{distributed anonymously, based on a Usenet posting} |
| 1473 |
% \changes{multirow v1.1}{}{allow it to work without bigstrut.sty (Pieter van Oostrum)} |
| 1474 |
% \changes{multirow v1.2}{}{modified by Jerry Leichter for the same goal, but using a |
| 1475 |
% different approach which will work properly with bigstrut.sty} |
| 1476 |
% \changes{multirow v1.2a}{}{modified by Pieter van Oostrum to use \cs{vskip} |
| 1477 |
% instead of \cs{raise} in positioning, avoiding making rows too high |
| 1478 |
% when the adjustment is large} |
| 1479 |
% \changes{multirow v1.3}{}{modified by Pieter van Oostrum to work properly in a p{} column |
| 1480 |
% (\cs{leavevmode} added)} |
| 1481 |
% \changes{multirow v1.4}{}{modified by Pieter van Oostrum to check for the special case that |
| 1482 |
% the width is given as an *. In this case the natural |
| 1483 |
% width of the text argument will be used and the argument |
| 1484 |
% is processed in LR-mode.} |
| 1485 |
% \changes{multirow v1.5}{}{modified by Pieter van Oostrum: Added a \texttt{\%} after \texttt{\cs{hbox}\{\#5\}\cs{vfill}}.\\ |
| 1486 |
% Added \cs{strut}s around \#5 for better vertical positioning. |
| 1487 |
% Additional coding for negative value of \meta{nrows}.} |
| 1488 |
% \changes{multirow v1.6}{2004/05/05}{modified by Pieter van Oostrum: Replace a space by \cs{relax} after |
| 1489 |
% \texttt{\cs{advance}\cs{multirow@dima}\#4}} |
| 1490 |
% |
| 1491 |
% \changes{v1.9a}{2016/09/23}{Implement the \texttt{debug} option.} |
| 1492 |
% |
| 1493 |
% \begin{macro}{\ifmultirowdebug} |
| 1494 |
% \begin{macro}{\multirowdebugtrue} |
| 1495 |
% \begin{macro}{\multirowdebugfalse} |
| 1496 |
% This is a boolean to [de]activate debugging (showing the generated box |
| 1497 |
% contents). It is activated by the \texttt{debug} package option. The |
| 1498 |
% \cs{newif} initializes it to false. |
| 1499 |
% \begin{macrocode} |
| 1500 |
\newif\ifmultirowdebug |
| 1501 |
\DeclareOption{debug}{\multirowdebugtrue} |
| 1502 |
% \end{macrocode} |
| 1503 |
% \end{macro} |
| 1504 |
% \end{macro} |
| 1505 |
% \end{macro} |
| 1506 |
% |
| 1507 |
% \changes{v1.9b}{2016/09/24}{Implement the \texttt{longtable} option.} |
| 1508 |
% \changes{v2.5}{2019/05/31}{Make the redefinition of \cs{@cline} |
| 1509 |
% compatible with the \Package{colortbl} package.} |
| 1510 |
% \begin{macro}{\cline} |
| 1511 |
% The package option \texttt{longtable} redefines the \cs{cline} macro to |
| 1512 |
% work around a bug in \Package{longtable}. See section \ref{sec:use-with-longtable}\footnote{% |
| 1513 |
% Thanks to David Carlisle. See |
| 1514 |
% \href{http://tex.stackexchange.com/questions/52100/longtable-multirow-problem-with-cline-and-nopagebreak\#answer-52101}{his answer on stackexchange}.}. |
| 1515 |
% First we check if the macro \cs{CT@arc} is defined. If so, this |
| 1516 |
% indocates that the \Package{colortbl} package is loaded. As |
| 1517 |
% \Package{colortbl} also redefines \cs{@cline}, we must take this into |
| 1518 |
% account with our own redefinition of \cs{@cline}. |
| 1519 |
% \begin{macrocode} |
| 1520 |
\DeclareOption{longtable}{% |
| 1521 |
\AtBeginDocument{% |
| 1522 |
\@ifundefined{CT@arc} |
| 1523 |
{\def\@cline#1-#2\@nil{% |
| 1524 |
\omit |
| 1525 |
\@multicnt#1% |
| 1526 |
\advance\@multispan\m@ne |
| 1527 |
\ifnum\@multicnt=\@ne\@firstofone{&\omit}\fi |
| 1528 |
\@multicnt#2% |
| 1529 |
\advance\@multicnt-#1% |
| 1530 |
\advance\@multispan\@ne |
| 1531 |
\leaders\hrule\@height\arrayrulewidth\hfill |
| 1532 |
\cr |
| 1533 |
\noalign{\nobreak\vskip-\arrayrulewidth}}} |
| 1534 |
{\def\@cline#1-#2\@nil{% |
| 1535 |
\omit |
| 1536 |
\@multicnt#1% |
| 1537 |
\advance\@multispan\m@ne |
| 1538 |
\ifnum\@multicnt=\@ne\@firstofone{&\omit}\fi |
| 1539 |
\@multicnt#2% |
| 1540 |
\advance\@multicnt-#1% |
| 1541 |
\advance\@multispan\@ne |
| 1542 |
{\CT@arc@\leaders\hrule\@height\arrayrulewidth\hfill}% |
| 1543 |
\cr |
| 1544 |
\noalign{\nobreak\vskip-\arrayrulewidth}}} |
| 1545 |
}} |
| 1546 |
% \end{macrocode} |
| 1547 |
% \end{macro} |
| 1548 |
% |
| 1549 |
% \changes{v1.9b}{2016/09/26}{Implement the \texttt{supertabular} option |
| 1550 |
% and the \cs{STneed} command.} |
| 1551 |
% The package option \texttt{supertabular} redefines \verb+\\*+ inside a |
| 1552 |
% \env{supertabular}. |
| 1553 |
% The redefinition is delayed until the \verb+\begin{document}+. |
| 1554 |
% |
| 1555 |
% \texttt{Supertabular} version 4.1f and later need a call to |
| 1556 |
% \cs{ST@save@lineno} to function properly, but earlier versions cannot |
| 1557 |
% use this as it doesn't exist in these versions. So the definitions of |
| 1558 |
% both \cs{ST@tabularcr} and \cs{MRST@cr} are different depending on whether |
| 1559 |
% \cs{ST@save@lineno} is defined. There are also some other differences, |
| 1560 |
% so some intermediate versions of \texttt{supertabular} might need more |
| 1561 |
% subtle adaptations, but for now we leave it at that. |
| 1562 |
% \begin{macrocode} |
| 1563 |
\DeclareOption{supertabular}{% |
| 1564 |
\AtBeginDocument{% |
| 1565 |
% \end{macrocode} |
| 1566 |
% \begin{macro}{\ST@tabularcr} |
| 1567 |
% \changes{v2.6}{2020/12/26}{Adapt the definition to be compatible with |
| 1568 |
% modern versions of \texttt{supertabular}} |
| 1569 |
% This macro is the definition of \verb+\\+ inside a |
| 1570 |
% \env{supertabular}. We check for a \verb+*+, and if it is |
| 1571 |
% present we call our own version, otherwise the |
| 1572 |
% \env{supertabular} version. First we get the older version for |
| 1573 |
% pre-4.1f \texttt{supertabular}, then the newer version. |
| 1574 |
% \begin{macrocode} |
| 1575 |
\ifx\ST@save@lineno\undefined |
| 1576 |
\def\ST@tabularcr{% |
| 1577 |
{\ifnum0=`}\fi |
| 1578 |
\@ifstar{\MRST@xtabularcr}{\ST@xtabularcr}} |
| 1579 |
% \end{macrocode} |
| 1580 |
% \end{macro} |
| 1581 |
% \begin{macro}{\MRST@cr} |
| 1582 |
% \cs{MRST@cr} is a truncated copy of \cs{ST@cr}. It does all the bookkeeping |
| 1583 |
% about the space the \env{supertabular} occupies, but it doesn't |
| 1584 |
% do the pagebreaking part. |
| 1585 |
% \changes{v2.9}{2024/11/1}{Adapt the definition to be compatible with |
| 1586 |
% \texttt{supertabular} version 4.2a or later.} |
| 1587 |
% \begin{macrocode} |
| 1588 |
\def\MRST@cr{% |
| 1589 |
\noalign{% |
| 1590 |
\ifnum\ST@pboxht<\ST@lineht |
| 1591 |
\global\advance\ST@pageleft -\ST@lineht |
| 1592 |
\global\ST@prevht\ST@lineht |
| 1593 |
\else |
| 1594 |
\global\advance\ST@pageleft -\ST@pboxht |
| 1595 |
\global\advance\ST@pageleft -0.1\ST@pboxht |
| 1596 |
\global\advance\ST@pageleft -\ST@stretchht |
| 1597 |
\global\ST@prevht\ST@pboxht |
| 1598 |
\global\ST@pboxht\z@ |
| 1599 |
\fi |
| 1600 |
\global\advance\ST@pageleft -\ST@toadd |
| 1601 |
\global\ST@toadd=\z@}} |
| 1602 |
\else |
| 1603 |
% \end{macrocode} |
| 1604 |
% These are the newer versions. However, in version 4.2a and later of \texttt{supertabular}, |
| 1605 |
% \cs{ST@lineht} is renamed \cs{ST@rowht}. |
| 1606 |
% \begin{macrocode} |
| 1607 |
\def\ST@tabularcr{% |
| 1608 |
{\ifnum0=`}\fi |
| 1609 |
\ST@save@lineno |
| 1610 |
\@ifstar{\MRST@xtabularcr}{\ST@xtabularcr}} |
| 1611 |
\ifx\ST@rowht\undefined |
| 1612 |
\def\MRST@cr{% |
| 1613 |
\noalign{% |
| 1614 |
\ifnum\ST@pboxht<\ST@lineht |
| 1615 |
\global\advance\ST@pageleft -\ST@lineht |
| 1616 |
\global\ST@prevht\ST@lineht |
| 1617 |
\else |
| 1618 |
\ST@trace@cr\thr@@{Added par box with height \the\ST@pboxht}% |
| 1619 |
\global\advance\ST@pageleft -\ST@pboxht |
| 1620 |
\global\advance\ST@pageleft -0.1\ST@pboxht |
| 1621 |
\global\ST@prevht\ST@pboxht |
| 1622 |
\global\ST@pboxht\z@ |
| 1623 |
\fi |
| 1624 |
\global\advance\ST@pageleft -\ST@toadd |
| 1625 |
\global\ST@toadd=\z@ |
| 1626 |
\ST@trace@cr\thr@@{Space left for tabular: \the\ST@pageleft}}} |
| 1627 |
\else |
| 1628 |
% \end{macrocode} |
| 1629 |
% Now the post 4.2a version. |
| 1630 |
% \begin{macrocode} |
| 1631 |
\def\MRST@cr{% |
| 1632 |
\noalign{% |
| 1633 |
\ifnum\ST@pboxht<\ST@rowht |
| 1634 |
\global\advance\ST@pageleft -\ST@rowht |
| 1635 |
\global\ST@prevht\ST@rowht |
| 1636 |
\else |
| 1637 |
\ST@trace@cr\thr@@{Added par box with height \the\ST@pboxht}% |
| 1638 |
\global\advance\ST@pageleft -\ST@pboxht |
| 1639 |
\global\advance\ST@pageleft -0.1\ST@pboxht |
| 1640 |
\global\ST@prevht\ST@pboxht |
| 1641 |
\global\ST@pboxht\z@ |
| 1642 |
\fi |
| 1643 |
\global\advance\ST@pageleft -\ST@toadd |
| 1644 |
\global\ST@toadd=\z@ |
| 1645 |
\ST@trace@cr\thr@@{Space left for tabular: \the\ST@pageleft}}} |
| 1646 |
\fi |
| 1647 |
\fi |
| 1648 |
% \end{macrocode} |
| 1649 |
% \end{macro} |
| 1650 |
% \begin{macro}{\MRST@xtabularc} |
| 1651 |
% \begin{macro}{\MRST@argtabularc} |
| 1652 |
% \begin{macro}{\MRST@xargtabularc} |
| 1653 |
% \begin{macro}{\MRST@yargtabularc} |
| 1654 |
% These are copies of the corresponding macros from |
| 1655 |
% \Package{supertabular}, but instead of \cs{ST@cr} they call \cs{MRST@cr}. |
| 1656 |
% \begin{macrocode} |
| 1657 |
\def\MRST@xtabularcr{% |
| 1658 |
\@ifnextchar[%] |
| 1659 |
{\MRST@argtabularcr}% |
| 1660 |
{\ifnum0=`{\fi}\cr\MRST@cr}} |
| 1661 |
\def\MRST@argtabularcr[#1]{% |
| 1662 |
\ifnum0=`{\fi}% |
| 1663 |
\ifdim #1>\z@ |
| 1664 |
\unskip\MRST@xargarraycr{#1} |
| 1665 |
\else |
| 1666 |
\MRST@yargarraycr{#1}% |
| 1667 |
\fi} |
| 1668 |
\def\MRST@xargarraycr#1{% |
| 1669 |
\@tempdima #1\advance\@tempdima \dp \@arstrutbox |
| 1670 |
\vrule \@height\z@ \@depth\@tempdima \@width\z@ \cr |
| 1671 |
\noalign{\global\ST@toadd=#1}\MRST@cr} |
| 1672 |
\def\MRST@yargarraycr#1{% |
| 1673 |
\cr\noalign{\vskip #1\global\MRST@toadd=#1}\MRST@cr} |
| 1674 |
} |
| 1675 |
% \end{macrocode} |
| 1676 |
% \end{macro} |
| 1677 |
% \end{macro} |
| 1678 |
% \end{macro} |
| 1679 |
% \end{macro} |
| 1680 |
% \begin{macro}{\STneed} |
| 1681 |
% This macro can be used in a \env{supertabular} to indicate how |
| 1682 |
% much space a multirow entry needs. See section~\ref{sec:use-with-supertabular}. |
| 1683 |
% \begin{macrocode} |
| 1684 |
\def\STneed#1{\ifdim\ST@pageleft<#1\ST@newpage\ST@next\fi} |
| 1685 |
} |
| 1686 |
% \end{macrocode} |
| 1687 |
% \end{macro} |
| 1688 |
% \begin{macrocode} |
| 1689 |
\ProcessOptions |
| 1690 |
% \end{macrocode} |
| 1691 |
% |
| 1692 |
% \cs{multirow@colwidth} is a length that is used to implement the ``\texttt{=}'' variant of \meta{width}. |
| 1693 |
% |
| 1694 |
% \changes{v1.9}{2016/09/15}{Implement the ``\texttt{!=}'' option for \cs{multirow}'s \meta{width} parameter.} |
| 1695 |
% \begin{macro}{\multirow@colwidth} |
| 1696 |
% \cs{multirow@colwidth} is a length that is used to implement the ``\texttt{=}'' variant of \meta{width}. |
| 1697 |
% \begin{macrocode} |
| 1698 |
\newlength{\multirow@colwidth} |
| 1699 |
% \end{macrocode} |
| 1700 |
% \end{macro} |
| 1701 |
% |
| 1702 |
% \changes{v1.9}{2016/09/15}{Give \Package{multirow} its own temp |
| 1703 |
% registers, so that we can safely pass the box height to \Package{bigdelim}.} |
| 1704 |
% \changes{v2.2}{2016/11/25}{Eliminate \cs{multirow@cnta.}} |
| 1705 |
% \begin{macro}{\multirow@cntb} |
| 1706 |
% \begin{macro}{\multirow@dima} |
| 1707 |
% Define two counters and a length for internal use in \cs{multirow}. |
| 1708 |
% \begin{macrocode} |
| 1709 |
\newcount\multirow@cntb |
| 1710 |
\newlength\multirow@dima |
| 1711 |
% \end{macrocode} |
| 1712 |
% \end{macro} |
| 1713 |
% \end{macro} |
| 1714 |
% \begin{macro}{\multirow@setcolwidth} |
| 1715 |
% This macro calculates \cs{multirow@colwidth} for an entry that has the |
| 1716 |
% \meta{width} given as ``\texttt{=}''. We check if we are inside a |
| 1717 |
% \env{tabulary} environment, by checking if \cs{TY@final} is defined. |
| 1718 |
% If not, then \cs{multirow@colwidth} = \cs{hsize}. The \env{tabulary} |
| 1719 |
% environment will make two passes. On the first pass, we set \cs{multirow@colwidth} |
| 1720 |
% to the size that the text would have in LR mode (with newlines replaced |
| 1721 |
% by spaces), so that \env{tabulary} will gives us enough space. |
| 1722 |
% On the second pass (characterized by \cs{TY@box} = \cs{TY@box@v}) we use |
| 1723 |
% the value that \env{tabulary} has given us in \cs{hsize}. |
| 1724 |
% This algorithm is not perfect, but good enough in most cases. |
| 1725 |
% \changes{v2.7}{2021/01/29}{Make \cs{multirow@setcolwidth} \cs{long} to allow |
| 1726 |
% multi-paragraph text} |
| 1727 |
% \begin{macrocode} |
| 1728 |
\long\def\multirow@setcolwidth#1{% |
| 1729 |
\ifx\TY@final\multirow@undefined \multirow@colwidth=\hsize |
| 1730 |
\else |
| 1731 |
\ifx\TY@box\TY@box@v\multirow@colwidth=\hsize |
| 1732 |
\else \setbox0\hbox |
| 1733 |
{\let\\\space\let\newline\space #1}\multirow@colwidth=\wd0 |
| 1734 |
\fi |
| 1735 |
\fi} |
| 1736 |
% \end{macrocode} |
| 1737 |
% \end{macro} |
| 1738 |
% |
| 1739 |
% \begin{macro}{\multirowsetup} |
| 1740 |
% \cs{multirowsetup} is executed at the beginning of each \cs{multirow}. |
| 1741 |
% \begin{macrocode} |
| 1742 |
\newcommand\multirowsetup{\raggedright} |
| 1743 |
% \end{macrocode} |
| 1744 |
% \end{macro} |
| 1745 |
% |
| 1746 |
% \begin{macro}{\multirow@vbox} |
| 1747 |
% This creates the \cs{vbox}. Parameters:\\ |
| 1748 |
% \texttt{\#1} = \meta{vpos}, \texttt{\#2} = initialization code (for |
| 1749 |
% example to set the width of the \cs{parbox}), \texttt{\#3} = box contents.\\ |
| 1750 |
% Depending on the \meta{vpos} parameter, it will be top-aligned, |
| 1751 |
% vertically centered, or bottom-aligned. This is done by inserting |
| 1752 |
% \cs{vfill} in the proper places.\\ |
| 1753 |
% Note: the \cs{relax} is to protect against an empty \meta{vpos} |
| 1754 |
% argument. |
| 1755 |
% \begin{macrocode} |
| 1756 |
\long\def\multirow@vbox#1#2#3{\setbox0\vtop to \multirow@dima{#2% |
| 1757 |
\if #1t\relax\else\vfill\fi |
| 1758 |
\multirowsetup #3\if #1b\relax\else\vfill\fi}} |
| 1759 |
% \end{macrocode} |
| 1760 |
% \end{macro} |
| 1761 |
% |
| 1762 |
% \begin{macro}{\multirow} |
| 1763 |
% Make an entry that will span multiple rows of a table.\\ |
| 1764 |
% First collect all the arguments and replace missing optional arguments by their default values. |
| 1765 |
% \changes{v1.8}{2016/09/14}{Add the optional first parameter \meta{vpos}.} |
| 1766 |
% \begin{macrocode} |
| 1767 |
%% \multirow [vpos] {nrows} [bigstruts] {width} [vmove] {text} |
| 1768 |
\newcommand\multirow[2][c]{\@multirow[#1]{#2}} |
| 1769 |
\def\@multirow[#1]#2{\@ifnextchar[{\@@multirow[#1]#2}{\@@multirow[#1]#2[0]}} |
| 1770 |
\def\@@multirow[#1]#2[#3]#4{\@ifnextchar[{\@xmultirow[#1]{#2}[#3]{#4}}% |
| 1771 |
{\@xmultirow[#1]{#2}[#3]{#4}[0pt]}} |
| 1772 |
% \end{macrocode} |
| 1773 |
% \changes{v1.9a}{2016/09/23}{Add the optional prefix to the \meta{bigstruts} parameter.} |
| 1774 |
% \begin{macro}{\multirow@piii} |
| 1775 |
% \begin{macro}{\ifmultirow@prefixt} |
| 1776 |
% \begin{macro}{\multirow@prefixttrue} |
| 1777 |
% \begin{macro}{\multirow@prefixtfalse} |
| 1778 |
% \begin{macro}{\ifmultirow@prefixb} |
| 1779 |
% \begin{macro}{\multirow@prefixbtrue} |
| 1780 |
% \begin{macro}{\multirow@prefixbfalse} |
| 1781 |
% This macro splits off a \texttt{t}, \texttt{b}, or \texttt{tb} prefix |
| 1782 |
% of the \meta{bigstruts} argument, and sets \cs{multirow@cntb} to |
| 1783 |
% the numerical value. The prefix is remembered in two booleans: |
| 1784 |
% \cs{ifmultirow@prefixt} and \cs{ifmultirow@prefixb}. |
| 1785 |
% \begin{macrocode} |
| 1786 |
\newif\ifmultirow@prefixt |
| 1787 |
\newif\ifmultirow@prefixb |
| 1788 |
\def\multirow@piii#1#2#3\end{\multirow@prefixtfalse\multirow@prefixbfalse |
| 1789 |
\if t#1\multirow@prefixttrue |
| 1790 |
\if b#2\multirow@prefixbtrue \multirow@cntb=#3% |
| 1791 |
\else \multirow@cntb=#2#3% |
| 1792 |
\fi |
| 1793 |
\else |
| 1794 |
\if b#1\multirow@prefixbtrue \multirow@cntb=#2#3% |
| 1795 |
\else \multirow@cntb=#1#2#3% |
| 1796 |
\fi |
| 1797 |
\fi} |
| 1798 |
% \end{macrocode} |
| 1799 |
% \end{macro} |
| 1800 |
% \end{macro} |
| 1801 |
% \end{macro} |
| 1802 |
% \end{macro} |
| 1803 |
% \end{macro} |
| 1804 |
% \end{macro} |
| 1805 |
% \end{macro} |
| 1806 |
% |
| 1807 |
% This is the real workhorse. It starts with splitting the |
| 1808 |
% \meta{bigstruts} argument, and then calculating the height of the multirow box. |
| 1809 |
% \changes{v2.2}{2016/11/25}{Support fractional values for \meta{nrows}.} |
| 1810 |
% Because \meta{nrows} (\verb+#2+) can be fractional, we cannot use |
| 1811 |
% \cs{ifnum} to test for positive or negative. Therefore we use |
| 1812 |
% \cs{ifdim} by putting a unit (\texttt{pt}) after the number. |
| 1813 |
% \changes{v2.4}{2019/01/01}{Support calc compatible expressions for \meta{width} and |
| 1814 |
% \meta{vmove}.} |
| 1815 |
% \changes{v2.7}{2021/01/29}{Make \cs{@xmultirow} \cs{long} to allow |
| 1816 |
% multi-paragraph text} |
| 1817 |
% \begin{macrocode} |
| 1818 |
\long\def\@xmultirow[#1]#2[#3]#4[#5]#6{% |
| 1819 |
\expandafter\multirow@piii#3\relax\end% |
| 1820 |
\setlength\multirow@dima{#2\ht\@arstrutbox}% |
| 1821 |
\addtolength\multirow@dima{#2\dp\@arstrutbox}% |
| 1822 |
\ifdim#2pt<\z@\setlength\multirow@dima{-\multirow@dima}\fi |
| 1823 |
\addtolength\multirow@dima{\multirow@cntb\bigstrutjot}% |
| 1824 |
% \end{macrocode} |
| 1825 |
% \changes{v1.9a}{2016/09/23}{Redo the \cs{vbox} calculation and positioning.} |
| 1826 |
% The text is set in a \cs{vbox} by calling \cs{multirow@vbox}. \\ |
| 1827 |
% If the \meta{width} argument is \texttt{*} set just the text in the \cs{vbox}. |
| 1828 |
% \begin{macrocode} |
| 1829 |
\if*#4\multirow@vbox{#1}{}{\hbox{\strut#6\strut}}% |
| 1830 |
% \end{macrocode} |
| 1831 |
% Otherwise set it in a \cs{parbox} inside a \cs{vbox}. \\ |
| 1832 |
% If the \meta{width} argument is given as ``\texttt{=}'', we calculate |
| 1833 |
% \cs{multirow@colwidth} and use that as width of the \cs{parbox}. |
| 1834 |
% \begin{macrocode} |
| 1835 |
\else \if=#4\multirow@setcolwidth{#6}% |
| 1836 |
\multirow@vbox{#1}{\setlength\hsize{\multirow@colwidth}\@parboxrestore}{\strut#6\strut\par}% |
| 1837 |
% \end{macrocode} |
| 1838 |
% Otherwise the given argument is used as the width of the \cs{parbox}. |
| 1839 |
% \begin{macrocode} |
| 1840 |
\else \multirow@vbox{#1}{\setlength\hsize{#4}\@parboxrestore}{\strut#6\strut\par}% |
| 1841 |
\fi \fi |
| 1842 |
% \end{macrocode} |
| 1843 |
% Now position the \cs{vbox} properly. More details are given in the |
| 1844 |
% appendix. The overview of the calculation of the shift amount can be |
| 1845 |
% found in section~\ref{sec:overview}. |
| 1846 |
% |
| 1847 |
% If \meta{nrows}${}> 0$: \\ |
| 1848 |
% If \meta{vpos} = \texttt{[t]}, then the box is already positioned |
| 1849 |
% correctly (the baseline is on the baseline of the row). However, later |
| 1850 |
% the top of the box will be taken as the reference point (instead |
| 1851 |
% of the baseline), therefore we take |
| 1852 |
% the height of the box (h) as the shift amount. See fig.~\ref{fig:top-t}.\\ |
| 1853 |
% If \meta{vpos} = \texttt{[c]} we shift it up h1 (see fig.~\ref{fig:top-c}), where h1 = \cs{ht}\cs{@arstrutbox} |
| 1854 |
% + (\cs{bigstrutjot} \cs{ifmultirow@prefixt}).\\ |
| 1855 |
% If \meta{vpos} = \texttt{[b]} we shift it up h1 + h2 (see fig.~\ref{fig:top-b}), where h2 = \cs{dp}\cs{@arstrutbox} |
| 1856 |
% + (\cs{bigstrutjot} \cs{ifmultirow@prefixb}).\\ |
| 1857 |
% We calculate the required shift in \cs{multirow@dima}. |
| 1858 |
% \begin{macrocode} |
| 1859 |
\ifdim#2pt>\z@ |
| 1860 |
\if#1t\relax\setlength\multirow@dima{\ht0}\else |
| 1861 |
\setlength\multirow@dima{\ht\@arstrutbox}% |
| 1862 |
\ifmultirow@prefixt \addtolength\multirow@dima{\bigstrutjot}\fi |
| 1863 |
\if#1b\relax \addtolength\multirow@dima{\dp\@arstrutbox}% |
| 1864 |
\ifmultirow@prefixb \addtolength\multirow@dima{\bigstrutjot}\fi |
| 1865 |
\fi |
| 1866 |
\fi |
| 1867 |
% \end{macrocode} |
| 1868 |
% If \meta{nrows}${}< 0$: \\ |
| 1869 |
% If \meta{vpos} = \texttt{[t]}, shift the box up $\textrm{H} - |
| 1870 |
% \textrm{h1} -\textrm{h2} + \textrm{h}$. See fig.~\ref{fig:bot-t}.\\ |
| 1871 |
% If \meta{vpos} = \texttt{[c]}, shift the box up $\textrm{H} - \textrm{h2}$. See fig.~\ref{fig:bot-c}.\\ |
| 1872 |
% If \meta{vpos} = \texttt{[b]}, shift the box up H. See fig.~\ref{fig:bot-b}.\\ |
| 1873 |
% H is the current value of \cs{multirow@dima}. |
| 1874 |
% \begin{macrocode} |
| 1875 |
\else |
| 1876 |
\if#1b\relax\else |
| 1877 |
\addtolength\multirow@dima{-\dp\@arstrutbox}% |
| 1878 |
\ifmultirow@prefixb \addtolength\multirow@dima{-\bigstrutjot}\fi |
| 1879 |
\if#1t\relax\addtolength\multirow@dima{-\ht\@arstrutbox}% |
| 1880 |
\ifmultirow@prefixt \addtolength\multirow@dima{-\bigstrutjot}\fi |
| 1881 |
\addtolength\multirow@dima{\ht0}% |
| 1882 |
\fi |
| 1883 |
\fi |
| 1884 |
\fi |
| 1885 |
% \end{macrocode} |
| 1886 |
% \changes{v2.1}{2016/10/11}{Set depth of final \cs{vbox} to 0, to |
| 1887 |
% prevent a tall multirow line to push the following rows downwards.} |
| 1888 |
% Finally, we add the \meta{vmove} argument (\verb+#5+), and go into |
| 1889 |
% horizontal mode. Then we shift the box up by putting a \cs{vskip} above it, |
| 1890 |
% and add it to the output. Because of the \cs{vskip} the resulting box |
| 1891 |
% will have a height 0. We set the depth of the \cs{vbox} |
| 1892 |
% to 0, so that it will not influence the depth of the current row.\\ |
| 1893 |
% If \cs{multirowdebug} is true, we show the box. |
| 1894 |
% \begin{macrocode} |
| 1895 |
\addtolength\multirow@dima{#5}% |
| 1896 |
\leavevmode |
| 1897 |
\setbox0\vtop{\vskip-\multirow@dima\box0\vss}\dp0=\z@ |
| 1898 |
\ifmultirowdebug{\showboxdepth=5 \showboxbreadth=10 \showbox0}\fi |
| 1899 |
\box0 |
| 1900 |
} |
| 1901 |
% \end{macrocode} |
| 1902 |
% \end{macro} |
| 1903 |
% \begin{macro}{\bigstrutjot} |
| 1904 |
% Define \cs{bigstrutjot} if not already defined. |
| 1905 |
% \begin{macrocode} |
| 1906 |
\@ifundefined{bigstrutjot}{\newdimen\bigstrutjot \bigstrutjot=\jot}{} |
| 1907 |
% \end{macrocode} |
| 1908 |
% \end{macro} |
| 1909 |
% \iffalse |
| 1910 |
%</multirow> |
| 1911 |
% \fi |
| 1912 |
% |
| 1913 |
% \subsection{The \Package{bigstrut} package} |
| 1914 |
% \label{sec:pack-bigstrut} |
| 1915 |
% |
| 1916 |
% \iffalse |
| 1917 |
%<*bigstrut> |
| 1918 |
% \fi |
| 1919 |
% \changes{bigstrut v1.0}{1994/05/31}{Initial version} |
| 1920 |
% \begin{macro}{\bigstrutjot} |
| 1921 |
% This is a length. By default it is set to 2pt. You can change it |
| 1922 |
% with the \cs{setlength} command. |
| 1923 |
% \begin{macrocode} |
| 1924 |
\@ifundefined{bigstrutjot}{\newdimen\bigstrutjot}{}\bigstrutjot=2pt |
| 1925 |
% \end{macrocode} |
| 1926 |
% \end{macro} |
| 1927 |
% |
| 1928 |
% \changes{bigstrut v2.4}{2018/12/30}{Add \cs{leavevmode} |
| 1929 |
% at the beginning to force horizontal mode} |
| 1930 |
% \begin{macro}{\bigstrut} |
| 1931 |
% This macro inserts a strut. Depending on the optional parameter it extends |
| 1932 |
% above and/or below the standard \env{array}/\env{tabular} strut. |
| 1933 |
% \begin{macrocode} |
| 1934 |
\newcommand\bigstrut[1][x]{% |
| 1935 |
\leavevmode\unskip\@tempdima=\ht\@arstrutbox \@tempdimb=\dp\@arstrutbox |
| 1936 |
\ifx #1b\relax \else \advance\@tempdima by \bigstrutjot\fi |
| 1937 |
\ifx #1t\relax \else \advance\@tempdimb by \bigstrutjot\fi |
| 1938 |
\hbox{\vrule \@height\@tempdima \@depth\@tempdimb \@width\z@}\ignorespaces} |
| 1939 |
% \end{macrocode} |
| 1940 |
% \end{macro} |
| 1941 |
% |
| 1942 |
% \iffalse |
| 1943 |
%</bigstrut> |
| 1944 |
% \fi |
| 1945 |
% |
| 1946 |
% \subsection{The \Package{bigdelim} package} |
| 1947 |
% \label{sec:pack-bigdelim} |
| 1948 |
% \iffalse |
| 1949 |
%<*bigdelim> |
| 1950 |
% \fi |
| 1951 |
% \changes{bigdelim v0.0}{1994/10/02}{bigbrace.sty by \O ystein Bache} |
| 1952 |
% \changes{bigdelim v1.0}{1999/11/05}{Initial version bigdelim.sty} |
| 1953 |
% \begin{macrocode} |
| 1954 |
\RequirePackage{multirow} |
| 1955 |
% \end{macrocode} |
| 1956 |
% \begin{macro}{\ldelim} |
| 1957 |
% This macro typesets a left delimiter. It calls \cs{multirow} with the proper arguments. |
| 1958 |
% The size of the delimiter is determined by putting a \cs{vbox} with the proper height and |
| 1959 |
% zero width next to it. The height is the one that \cs{multirow} |
| 1960 |
% already has calculated in \cs{multirow@dima}. That calculation uses |
| 1961 |
% the size of \cs{@arstrutbox}, which is set by \texttt{tabular} or |
| 1962 |
% \texttt{array} environments. In case it is not set, we initialize it |
| 1963 |
% to a default value. |
| 1964 |
% \changes{bigdelim v2.3}{2018/08/03}{Replace \cs{textrm} by \cs{textnormal}} |
| 1965 |
% \changes{bigdelim v2.6}{2020/12/26}{Initialize \cs{@arstrutbox} if not defined} |
| 1966 |
% \changes{bigdelim v2.8}{2021/03/15}{Add optional argument \meta{vmove}} |
| 1967 |
% \begin{macrocode} |
| 1968 |
\newcommand\ldelim[2]{\@ifnextchar[{\@ldelim{#1}{#2}}{\@ldelim{#1}{#2}[0pt]}} |
| 1969 |
\def\@ldelim#1#2[#3]#4{\@ifnextchar[{\@@ldelim{#1}{#2}{#3}{#4}}{\@@ldelim{#1}{#2}{#3}{#4}[\null]}} |
| 1970 |
\def\@@ldelim#1#2#3#4[#5]% |
| 1971 |
{\ifvoid\@arstrutbox\setbox\@arstrutbox\hbox{\strut}\fi |
| 1972 |
\multirow{#2}{#4}[#3]{% |
| 1973 |
\ensuremath |
| 1974 |
{\left.\vcenter{\hsize=0pt\vrule height \multirow@dima width 0pt}% |
| 1975 |
\textnormal{#5}\right#1}}} |
| 1976 |
% \end{macrocode} |
| 1977 |
% \end{macro} |
| 1978 |
% |
| 1979 |
% \begin{macro}{\rdelim} |
| 1980 |
% This macro typesets a right delimiter. It calls \cs{multirow} with the |
| 1981 |
% proper arguments, similar to \cs{ldelim}. |
| 1982 |
% \changes{bigdelim v2.3}{2018/08/03}{Replace \cs{textrm} by \cs{textnormal}} |
| 1983 |
% \changes{bigdelim v2.6}{2020/12/26}{Initialize \cs{@arstrutbox} if not defined} |
| 1984 |
% \changes{bigdelim v2.8}{2021/03/15}{Add optional argument \meta{vmove}} |
| 1985 |
% \begin{macrocode} |
| 1986 |
\newcommand\rdelim[2]{\@ifnextchar[{\@rdelim{#1}{#2}}{\@rdelim{#1}{#2}[0pt]}} |
| 1987 |
\def\@rdelim#1#2[#3]#4{\@ifnextchar[{\@@rdelim{#1}{#2}{#3}{#4}}{\@@rdelim{#1}{#2}{#3}{#4}[\null]}} |
| 1988 |
\def\@@rdelim#1#2#3#4[#5]% |
| 1989 |
{\ifvoid\@arstrutbox\setbox\@arstrutbox\hbox{\strut}\fi |
| 1990 |
\multirow{#2}{#4}[#3]{% |
| 1991 |
\ensuremath |
| 1992 |
{\left#1\vcenter{\hsize=0pt\vrule height \multirow@dima width 0pt}% |
| 1993 |
\textnormal{#5}\right.}}} |
| 1994 |
% \end{macrocode} |
| 1995 |
% \end{macro} |
| 1996 |
% \iffalse |
| 1997 |
%</bigdelim> |
| 1998 |
% \fi |
| 1999 |
% |
| 2000 |
% \appendix |
| 2001 |
% |
| 2002 |
% \section{Appendix} |
| 2003 |
% \label{sec:appendix} |
| 2004 |
% |
| 2005 |
% \index{vbox=\verb!*+\vbox+|usage} |
| 2006 |
% |
| 2007 |
% In this section we explain the \cs{vbox} positioning in \cs{multirow}. |
| 2008 |
% The positioning depends on the \meta{nrows}, \meta{vpos}, |
| 2009 |
% \meta{bigstruts} and \meta{vmove} arguments. The box is constructed with \cs{vtop}. The |
| 2010 |
% algorithm of \cs{vtop} is described in \emph{The \TeX{}book}, p.~81. |
| 2011 |
% |
| 2012 |
% Each case is described by a figure. In the figure the lefthand column |
| 2013 |
% indicates the context of the tabular in which the multirow appears, |
| 2014 |
% i.e \meta{nrows} rows. The righthand column is the multirow box that |
| 2015 |
% is to be inserted. The baseline is the natural position where the material will be |
| 2016 |
% positioned in the first place. Later it will be shifted up |
| 2017 |
% to the desired location. |
| 2018 |
% |
| 2019 |
% H is the calculated height of the box: $\meta{nrows} \times |
| 2020 |
% \textrm{the natural height of a row} + \meta{bigstruts} \times |
| 2021 |
% \mathrm{\cs{bigstrutjot}} $. |
| 2022 |
% |
| 2023 |
% {topstrut} = \cs{bigstrutjot} if there is a \cs{bigstrut} on the top of |
| 2024 |
% the first row (as indicated by the \texttt{t} prefix in the |
| 2025 |
% \meta{bigstruts} argument), otherwise 0. |
| 2026 |
% |
| 2027 |
% {botstrut} = \cs{bigstrutjot} if there is a \cs{bigstrut} on bottom of |
| 2028 |
% the last row (as indicated by the \texttt{b} prefix in the |
| 2029 |
% \meta{bigstruts} argument), otherwise 0. |
| 2030 |
% |
| 2031 |
% h1 = $\textrm{height of a tabular row} + \textrm{topstrut}$ |
| 2032 |
% |
| 2033 |
% h2 = $\textrm{depth of a tabular row} + \textrm{botstrut}$ |
| 2034 |
% |
| 2035 |
% Note: the following descriptions describe the vertical shift of the |
| 2036 |
% box without taking the \meta{vmove} into account. In all cases |
| 2037 |
% \meta{vmove} has to be added if it is given. |
| 2038 |
% |
| 2039 |
% \subsection{Case \meta{nrows}${}> 0$} |
| 2040 |
% |
| 2041 |
% \subsubsection*{\meta{vpos} = [t]} |
| 2042 |
% |
| 2043 |
% In this case the \cs{vbox} contains the text followed by a \cs{vfill}. |
| 2044 |
% Such a \cs{vbox} has a height that is the height of the top line of |
| 2045 |
% the text (h). H = height + depth of the box. This means that the box is |
| 2046 |
% already positioned correctly. However, later we will put the box |
| 2047 |
% inside another \cs{vbox}, with a \cs{vskip} on to of it, and this will |
| 2048 |
% make the top of the box its reference point. Therefore we will |
| 2049 |
% have to shift it up again over a distance h |
| 2050 |
% (which probably will be different from the height of the tabular row). |
| 2051 |
% So the total shift becomes h. See fig.~\ref{fig:top-t}. |
| 2052 |
% |
| 2053 |
% Alternatively, we could have omitted the \cs{vskip} in this case, |
| 2054 |
% thereby leaving the baseline undisturbed, but this would make the code |
| 2055 |
% unsymmetrical. Moreover, this would not work when a non-zero |
| 2056 |
% \meta{vmove} is present. Therefore we choose to set the shift amount to h here. |
| 2057 |
% |
| 2058 |
% \begin{figure}[htpb] |
| 2059 |
% \centering |
| 2060 |
% \begin{tikzpicture} |
| 2061 |
% \draw (2, -0.5) rectangle (5,4.5); |
| 2062 |
% \foreach \y in {0,...,4} \draw (2, \y) -- (5, \y); |
| 2063 |
% \draw (0, 4.2) node (topstrut) {topstrut}; |
| 2064 |
% \draw[->] (topstrut) -- (2, 4.2); |
| 2065 |
% \draw (0, -0.25) node (botstrut) {botstrut}; |
| 2066 |
% \draw[->] (botstrut) -- (2, -0.25); |
| 2067 |
% \draw[<->] (5.3, -0.5) -- (5.3, 4.5); |
| 2068 |
% \draw (5.5, 2) node {H}; |
| 2069 |
% \draw (0, 3.3) node (baseline) {baseline}; |
| 2070 |
% \draw[dashed] (1.7, 3.3) -- (5.9, 3.3); |
| 2071 |
% \draw[<->] (5.5, 3.3) -- (5.5, 4.5); |
| 2072 |
% \draw (5.9, 3.9) node {h1}; |
| 2073 |
% |
| 2074 |
% \draw (6.5, 4) rectangle (9.5, -1); |
| 2075 |
% \draw[<->] (9.7, -1) -- (9.7, 4); |
| 2076 |
% \draw (10, 1.5) node {H}; |
| 2077 |
% \draw[<->] (10, 3.3) -- (10, 4); |
| 2078 |
% \draw (10.3, 3.7) node {h}; |
| 2079 |
% \draw[fill=lightgray] (6.6, 1) rectangle (9.4, 3.9); |
| 2080 |
% \draw (8, 0) node[align=center] {\cs{vfill}}; |
| 2081 |
% \draw (8, 2) node[align=center] {text}; |
| 2082 |
% \draw[draw=gray] (6.6, 3) -- (9.4, 3); |
| 2083 |
% \draw[dashed] (6.2, 3.3) -- (9.8, 3.3); |
| 2084 |
% \draw[->, line width=4pt, draw=gray] (8, 3.3) -- (8, 4); |
| 2085 |
% \end{tikzpicture} |
| 2086 |
% \caption{Case \meta{nrows}${}> 0$, \meta{vpos} = [t]} |
| 2087 |
% \label{fig:top-t} |
| 2088 |
% \end{figure} |
| 2089 |
% |
| 2090 |
% \subsubsection*{\meta{vpos} = [c]} |
| 2091 |
% |
| 2092 |
% In this case the \cs{vbox} contains a \cs{vfill}, the text, and another \cs{vfill}. |
| 2093 |
% Such a \cs{vbox} has a height 0, i.e. the top of the box is on the |
| 2094 |
% baseline. Because both boxes have the same size (H), they can be |
| 2095 |
% aligned by shifting the \cs{vbox} up over h1. See fig.~\ref{fig:top-c}. |
| 2096 |
% |
| 2097 |
% \begin{figure}[htpb] |
| 2098 |
% \centering |
| 2099 |
%\begin{tikzpicture} |
| 2100 |
% \draw (2, -0.5) rectangle (5,4.5); |
| 2101 |
% \foreach \y in {0,...,4} \draw (2, \y) -- (5, \y); |
| 2102 |
% \draw (0, 4.2) node (topstrut) {topstrut}; |
| 2103 |
% \draw[->] (topstrut) -- (2, 4.2); |
| 2104 |
% \draw (0, -0.25) node (botstrut) {botstrut}; |
| 2105 |
% \draw[->] (botstrut) -- (2, -0.25); |
| 2106 |
% \draw[<->] (5.3, -0.5) -- (5.3, 4.5); |
| 2107 |
% \draw (5.5, 2) node {H}; |
| 2108 |
% \draw (0, 3.3) node (baseline) {baseline}; |
| 2109 |
% \draw[dashed] (1.7, 3.3) -- (5.9, 3.3); |
| 2110 |
% \draw[<->] (5.5, 3.3) -- (5.5, 4.5); |
| 2111 |
% \draw (5.9, 3.9) node {h1}; |
| 2112 |
% |
| 2113 |
% \draw (6.5, 3.3) rectangle (9.5, -1.7); |
| 2114 |
% \draw[<->] (9.7, -1.7) -- (9.7, 3.3); |
| 2115 |
% \draw (10, 0.8) node {H}; |
| 2116 |
% \draw[fill=lightgray] (6.6, -0.5) rectangle (9.4, 2.1); |
| 2117 |
% \draw (8, 2.7) node[align=center] {\cs{vfill}}; |
| 2118 |
% \draw (8, 0.8) node[align=center] {text}; |
| 2119 |
% \draw (8, -1) node[align=center] {\cs{vfill}}; |
| 2120 |
% \draw[->, line width=4pt, draw=gray] (8, 3.3) -- (8, 4.5); |
| 2121 |
% \draw[draw=gray] (6.5, 4.5) -- (9.5, 4.5); |
| 2122 |
% \end{tikzpicture} |
| 2123 |
% \caption{Case \meta{nrows}${}> 0$, \meta{vpos} = [c]} |
| 2124 |
% \label{fig:top-c} |
| 2125 |
% \end{figure} |
| 2126 |
% |
| 2127 |
% \subsubsection*{\meta{vpos} = [b]} |
| 2128 |
% |
| 2129 |
% Now the \cs{vbox} contains a \cs{vfill}, followed by the text. |
| 2130 |
% Because it ends with the text, it gets an additional depth equal to |
| 2131 |
% the depth of the last line of the text. |
| 2132 |
% Such a \cs{vbox} has a height 0, i.e. the top of the box is on the |
| 2133 |
% baseline, but its depth is H + that depth. In other words the baseline |
| 2134 |
% of the last text line is H below the top. |
| 2135 |
% |
| 2136 |
% Because \meta{vpos} = \texttt{[b]} we want the baseline of the last |
| 2137 |
% textline to shift to the baseline of the last tabular row. The amount |
| 2138 |
% of the shift is h1 + h2. See fig.~\ref{fig:top-b}. |
| 2139 |
% |
| 2140 |
% \begin{figure}[htpb] |
| 2141 |
% \centering |
| 2142 |
%\begin{tikzpicture} |
| 2143 |
% \draw (2, -0.5) rectangle (5,4.5); |
| 2144 |
% \foreach \y in {0,...,4} \draw (2, \y) -- (5, \y); |
| 2145 |
% \draw (0, 4.2) node (topstrut) {topstrut}; |
| 2146 |
% \draw[->] (topstrut) -- (2, 4.2); |
| 2147 |
% \draw (0, -0.25) node (botstrut) {botstrut}; |
| 2148 |
% \draw[->] (botstrut) -- (2, -0.25); |
| 2149 |
% \draw[<->] (5.3, -0.5) -- (5.3, 4.5); |
| 2150 |
% \draw (5.5, 2) node {H}; |
| 2151 |
% \draw (0, 3.3) node (baseline) {baseline}; |
| 2152 |
% \draw[dashed] (1.7, 3.3) -- (5.9, 3.3); |
| 2153 |
% \draw[<->] (5.5, 3.3) -- (5.5, 4.5); |
| 2154 |
% \draw (5.9, 3.9) node {h1}; |
| 2155 |
% \draw[<->] (5.5, -0.5) -- (5.5, 0.3); |
| 2156 |
% \draw (5.9, -0.1) node {h2}; |
| 2157 |
% |
| 2158 |
% \draw (6.5, 3.3) rectangle (9.5, -2.1); |
| 2159 |
% \draw[<->] (9.7, -1.7) -- (9.7, 3.3); |
| 2160 |
% \draw (10, 0.8) node {H}; |
| 2161 |
% \draw[fill=lightgray] (6.6, -2) rectangle (9.4, 1); |
| 2162 |
% \draw (8, 2) node[align=center] {{\cs{vfill}}}; |
| 2163 |
% \draw (8, -0.5) node[align=center] {text}; |
| 2164 |
% \draw (0, 0.3) node (baseline) {baseline}; |
| 2165 |
% \draw[dashed] (6.3, -1.7) -- (10, -1.7); |
| 2166 |
% \draw (3.5, -1.7) node (baseline) {baseline of last text line}; |
| 2167 |
% \draw[dashed] (1.7, 0.3) -- (10, 0.3); |
| 2168 |
% \draw[->, line width=4pt, draw=gray] (8.5, -1.7) -- (8.5, 0.3); |
| 2169 |
% \end{tikzpicture} |
| 2170 |
% \caption{Case \meta{nrows}${}> 0$, \meta{vpos} = [b]} |
| 2171 |
% \label{fig:top-b} |
| 2172 |
% \end{figure} |
| 2173 |
% |
| 2174 |
% \subsection{Case \meta{nrows}${}<0$} |
| 2175 |
% |
| 2176 |
% \meta{nrows}${}<0$ when the multirow is positioned in the last row of |
| 2177 |
% the multirow block. |
| 2178 |
% |
| 2179 |
% \subsubsection*{\meta{vpos} = [t]} |
| 2180 |
% |
| 2181 |
% In this case the \cs{vbox} contains the text followed by a \cs{vfill}. |
| 2182 |
% Such a \cs{vbox} has a height that is the height of the top line of |
| 2183 |
% the text. The baseline is aligned with the baseline of the last row. |
| 2184 |
% Because \meta{vpos} = [t], we want it to be aligned with the baseline |
| 2185 |
% of the first row. Therefore it has to be shifted up $\textrm{H} - |
| 2186 |
% \textrm{h1} - \textrm{h2}$. But because later the height of the box |
| 2187 |
% will be set to 0, we must also add the current height h. Therefore the |
| 2188 |
% total shift becomes $\textrm{H} - \textrm{h1} - \textrm{h2} + |
| 2189 |
% \textrm{h}$. See fig.~\ref{fig:bot-t}. |
| 2190 |
% |
| 2191 |
% \begin{figure}[htpb] |
| 2192 |
% \centering |
| 2193 |
% \begin{tikzpicture} |
| 2194 |
% \draw (2, -0.5) rectangle (5,4.5); |
| 2195 |
% \foreach \y in {0,...,4} \draw (2, \y) -- (5, \y); |
| 2196 |
% \draw (0, 4.2) node (topstrut) {topstrut}; |
| 2197 |
% \draw[->] (topstrut) -- (2, 4.2); |
| 2198 |
% \draw (0, -0.25) node (botstrut) {botstrut}; |
| 2199 |
% \draw[->] (botstrut) -- (2, -0.25); |
| 2200 |
% \draw[<->] (5.3, -0.5) -- (5.3, 4.5); |
| 2201 |
% \draw (5.5, 2) node {H}; |
| 2202 |
% \draw (0, 3.3) node (baseline) {baseline}; |
| 2203 |
% \draw[dashed] (1.7, 3.3) -- (9, 3.3); |
| 2204 |
% \draw[<->] (5.5, 3.3) -- (5.5, 4.5); |
| 2205 |
% \draw (5.9, 3.9) node {h1}; |
| 2206 |
% \draw[<->] (5.5, -0.5) -- (5.5, 0.3); |
| 2207 |
% \draw (5.9, -0.1) node {h2}; |
| 2208 |
% \draw (0, 0.3) node (baseline) {baseline}; |
| 2209 |
% \draw[dashed] (1.7, 0.3) -- (5.9, 0.3); |
| 2210 |
% |
| 2211 |
% \draw (6.5, 1) rectangle (9.5, -4); |
| 2212 |
% \draw[<->] (9.7, -4) -- (9.7, 1); |
| 2213 |
% \draw (10, -1.5) node {H}; |
| 2214 |
% \draw[<->] (10, 0.3) -- (10, 1); |
| 2215 |
% \draw (10.3, 0.7) node {h}; |
| 2216 |
% \draw[fill=lightgray] (6.6, -2) rectangle (9.4, 0.9); |
| 2217 |
% \draw (8, -3) node[align=center] {\cs{vfill}}; |
| 2218 |
% \draw (8, -1) node[align=center] {text}; |
| 2219 |
% \draw[draw=gray] (6.6, 0) -- (9.4, 0); |
| 2220 |
% \draw[dashed] (6.2, 0.3) -- (10.3, 0.3); |
| 2221 |
% \draw[->, line width=4pt, draw=gray] (8, 0.3) -- (8, 3.3); |
| 2222 |
% \end{tikzpicture} |
| 2223 |
% \caption{Case \meta{nrows}${} < 0$, \meta{vpos} = [t]} |
| 2224 |
% \label{fig:bot-t} |
| 2225 |
% \end{figure} |
| 2226 |
% |
| 2227 |
% \subsubsection*{\meta{vpos} = [c]} |
| 2228 |
% |
| 2229 |
% In this case the \cs{vbox} contains a \cs{vfill}, the text, and another \cs{vfill}. |
| 2230 |
% Such a \cs{vbox} has a height 0, i.e. the top of the box is on the |
| 2231 |
% baseline. Because both boxes have the same size (H), they can be |
| 2232 |
% aligned by shifting the \cs{vbox} up over $\textrm{H} - \textrm{h2}$. |
| 2233 |
% See fig.~\ref{fig:bot-c}. |
| 2234 |
% |
| 2235 |
% \begin{figure}[htpb] |
| 2236 |
% \begin{tikzpicture} |
| 2237 |
% \draw (2, -0.5) rectangle (5,4.5); |
| 2238 |
% \foreach \y in {0,...,4} \draw (2, \y) -- (5, \y); |
| 2239 |
% \draw (0, 4.2) node (topstrut) {topstrut}; |
| 2240 |
% \draw[->] (topstrut) -- (2, 4.2); |
| 2241 |
% \draw (0, -0.25) node (botstrut) {botstrut}; |
| 2242 |
% \draw[->] (botstrut) -- (2, -0.25); |
| 2243 |
% \draw[<->] (5.3, -0.5) -- (5.3, 4.5); |
| 2244 |
% \draw (5.5, 2) node {H}; |
| 2245 |
% \draw (0, 3.3) node {baseline}; |
| 2246 |
% \draw[dashed] (1.7, 3.3) -- (5.8, 3.3); |
| 2247 |
% \draw[<->] (5.5, 3.3) -- (5.5, 4.5); |
| 2248 |
% \draw (5.9, 3.9) node {h1}; |
| 2249 |
% \draw[<->] (5.5, -0.5) -- (5.5, 0.3); |
| 2250 |
% \draw (5.9, -0.1) node {h2}; |
| 2251 |
% \draw (0, 0.3) node {baseline}; |
| 2252 |
% \draw[dashed] (1.7, 0.3) -- (5.9, 0.3); |
| 2253 |
% |
| 2254 |
% \draw (6.5, 0.3) rectangle (9.5, -4.7); |
| 2255 |
% \draw[<->] (9.7, -4.7) -- (9.7, 0.3); |
| 2256 |
% \draw (10, -3.2) node {H}; |
| 2257 |
% \draw[fill=lightgray] (6.6, -3.5) rectangle (9.4, -0.9); |
| 2258 |
% \draw (8, -0.3) node[align=center] {\cs{vfill}}; |
| 2259 |
% \draw (8, -2.2) node[align=center] {text}; |
| 2260 |
% \draw (8, -4) node[align=center] {\cs{vfill}}; |
| 2261 |
% \draw[->, line width=4pt, draw=gray] (8, 0.3) -- (8, 4.5); |
| 2262 |
% \draw[draw=gray] (6.5, 4.5) -- (9.5, 4.5); |
| 2263 |
% \end{tikzpicture} |
| 2264 |
% \caption{Case \meta{nrows}${} < 0$, \meta{vpos} = [c]} |
| 2265 |
% \label{fig:bot-c} |
| 2266 |
% \end{figure} |
| 2267 |
% |
| 2268 |
% \subsubsection*{\meta{vpos} = [b]} |
| 2269 |
% |
| 2270 |
% The \cs{vbox} contains a \cs{vfill}, followed by the text. |
| 2271 |
% Because it ends with the text, it gets an additional depth equal to |
| 2272 |
% the depth of the last line of the text. |
| 2273 |
% Such a \cs{vbox} has a height 0, i.e. the top of the box is on the |
| 2274 |
% baseline, but its depth is H + that depth. In other words the baseline |
| 2275 |
% of the last text line is H below the top. |
| 2276 |
% |
| 2277 |
% Because \meta{vpos} = \texttt{[b]} we want the baseline of the last |
| 2278 |
% textline to shift to the baseline of the last tabular row. The amount |
| 2279 |
% of the shift is H. See fig.~\ref{fig:bot-b}. |
| 2280 |
% |
| 2281 |
% \begin{figure}[htpb] |
| 2282 |
% \begin{tikzpicture} |
| 2283 |
% \draw (2, -0.5) rectangle (5,4.5); |
| 2284 |
% \foreach \y in {0,...,4} \draw (2, \y) -- (5, \y); |
| 2285 |
% \draw (0, 4.2) node (topstrut) {topstrut}; |
| 2286 |
% \draw[->] (topstrut) -- (2, 4.2); |
| 2287 |
% \draw (0, -0.25) node (botstrut) {botstrut}; |
| 2288 |
% \draw[->] (botstrut) -- (2, -0.25); |
| 2289 |
% \draw[<->] (5.3, -0.5) -- (5.3, 4.5); |
| 2290 |
% \draw (5.5, 2) node {H}; |
| 2291 |
% \draw (0, 3.3) node {baseline}; |
| 2292 |
% \draw[dashed] (1.7, 3.3) -- (5.8, 3.3); |
| 2293 |
% \draw[<->] (5.5, 3.3) -- (5.5, 4.5); |
| 2294 |
% \draw (5.9, 3.9) node {h1}; |
| 2295 |
% \draw[<->] (5.5, -0.5) -- (5.5, 0.3); |
| 2296 |
% \draw (5.9, -0.1) node {h2}; |
| 2297 |
% \draw (0, 0.3) node {baseline}; |
| 2298 |
% \draw[dashed] (1.7, 0.3) -- (5.9, 0.3); |
| 2299 |
% |
| 2300 |
% \draw (6.5, 0.3) rectangle (9.5, -5.1); |
| 2301 |
% \draw[<->] (9.7, -4.7) -- (9.7, 0.3); |
| 2302 |
% \draw (10, -3.2) node {H}; |
| 2303 |
% \draw[fill=lightgray] (6.6, -5) rectangle (9.4, -2); |
| 2304 |
% \draw (8, -1) node[align=center] {{vfill}}; |
| 2305 |
% \draw (8, -3.5) node[align=center] {text}; |
| 2306 |
% \draw (0, 0.3) node (baseline) {baseline}; |
| 2307 |
% \draw[dashed] (1.7, 0.3) -- (10, 0.3); |
| 2308 |
% \draw[dashed] (6.3, -4.7) -- (10, -4.7); |
| 2309 |
% \draw (3.5, -4.7) node {baseline of last text line}; |
| 2310 |
% \draw[->, line width=4pt, draw=gray] (8.5, -4.7) -- (8.5, 0.3); |
| 2311 |
% \end{tikzpicture} |
| 2312 |
% \caption{Case \meta{nrows}${} < 0$, \meta{vpos} = [b]} |
| 2313 |
% \label{fig:bot-b} |
| 2314 |
% \end{figure} |
| 2315 |
% |
| 2316 |
% \subsection{Overview} |
| 2317 |
% \label{sec:overview} |
| 2318 |
% |
| 2319 |
% \begin{tabular}{| l | l | l |} |
| 2320 |
% \hline |
| 2321 |
% \meta{vpos} & \meta{nrows} > 0 & \meta{nrows} < 0 \\ |
| 2322 |
% \hline |
| 2323 |
% \texttt{[t]} & h & $\textrm{H} - \textrm{h1} -\textrm{h2} + \textrm{h}$ \\ |
| 2324 |
% \texttt{[c]} & h1 & $\textrm{H} - \textrm{h2}$ \\ |
| 2325 |
% \texttt{[b]} & h1 + h2 & H \\ |
| 2326 |
% \hline |
| 2327 |
% & x & $\textrm{H} - \textrm{h1} -\textrm{h2} + x$ \\ |
| 2328 |
% \hline |
| 2329 |
% \end{tabular} |
| 2330 |
% |
| 2331 |
% \Finale |
| 2332 |
\endinput |