diff options
author | Karl Berry <karl@freefriends.org> | 2016-10-15 22:58:47 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2016-10-15 22:58:47 +0000 |
commit | aa6bd000fec765bbef2ae479183d3949fa2d2a5b (patch) | |
tree | ffbde4b35b7794585d144a56fac594cb2060e014 /Master | |
parent | 20d033ee630eb6f628a29fa51eeb753b1474922f (diff) |
multirow (11oct16)
git-svn-id: svn://tug.org/texlive/trunk@42279 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master')
-rw-r--r-- | Master/texmf-dist/doc/latex/multirow/README | 61 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/multirow/multirow.pdf | bin | 604111 -> 609825 bytes | |||
-rw-r--r-- | Master/texmf-dist/source/latex/multirow/multirow.dtx | 101 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/multirow/bigdelim.sty | 2 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/multirow/bigstrut.sty | 2 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/multirow/multirow.sty | 11 |
6 files changed, 95 insertions, 82 deletions
diff --git a/Master/texmf-dist/doc/latex/multirow/README b/Master/texmf-dist/doc/latex/multirow/README index 75accccee51..2feb9c738cb 100644 --- a/Master/texmf-dist/doc/latex/multirow/README +++ b/Master/texmf-dist/doc/latex/multirow/README @@ -1,6 +1,6 @@ -multirow.sty V2.0 version (2016/09/27) -bigstruts.sty V2.0 version (2016/09/27) -bigdelim.sty V2.0 version (2016/09/27) +multirow.sty V2.1 version (2016/10/11) +bigstruts.sty V2.1 version (2016/10/11) +bigdelim.sty V2.1 version (2016/10/11) Original Author: Jerry Leichter Current Author: Piet van Oostrum <piet@vanoostrum.org> @@ -9,11 +9,20 @@ Current Author: Piet van Oostrum <piet@vanoostrum.org> License, as described in lppl.txt in the base LaTeX distribution. Either version 1 or, at your option, any later version. +Installation: + +To generate the .sty files, run the command + tex multirow.ins +and move the resulting .sty files to a place where LaTeX can find them, preferably +..../tex/latex/multirow + +Usage: + multirow.sty: Make an entry that will span multiple rows of a table. -\multirow[vpos]{nrows}[bigstruts]{width}[fixup]{text} +\multirow[vpos]{nrows}[bigstruts]{width}[vmove]{text} vpos is the vertical positioning: t. c. or b. @@ -46,8 +55,8 @@ text is the actual text. If the width was set explicitly, the text will The text is centered vertically within the range spanned by nrows, unless a vpos argument is given. -fixup is a length used for fine tuning: The text will be raised (or - lowered, if fixup is negative) by that length above (below) wherever +vmove is a length used for fine tuning: The text will be raised (or + lowered, if vmove is negative) by that length above (below) wherever it would otherwise have gone. For example (using both multirow and bigstrut) @@ -79,49 +88,11 @@ For example (using both multirow and bigstrut) If any of the spanned rows are unusually large, or if you're using bigstrut.sty and \bigstrut's are used assymetrically about the centerline of the spanned rows, the vertical centering may not come out right. Use the -fixup argument in this case. +vmove argument in this case. Just before "text" is expanded, the \multirowsetup macro is expanded to set up any special environment. Initially, \multirowsetup contains just \raggedright. It can be redefined with \renewcommand. - -Bugs: It's just about impossible to deal correctly with descenders. The -text will be set up centered, but it may then have a baseline that doesn't -match the baseline of the stuff beside it, in particular if the stuff -beside it has descenders and "text" does not. This may result in a small -missalignment. About all that can be done is to do a final touchup on -"text", using the fixup optional argument. (Hint: If you use a measure -like .1ex, there's a reasonable chance that the fixup will still be correct -if you change the point size.) - -\multirow is mainly designed for use with table, as opposed to array, -environments. It will not work well in an array environment since the lines -have an extra \jot of space between them which it won't account for. Fixing -this is difficult in general, and doesn't seem worth it. The bigstruts -argument can be used to provide a semi-automatic fix: First set -\bigstrutjot to .5\jot. Then simply repeat nrows as the bigstruts argument. -This will be close, but probably not exact; you can use the fixup argument -to refine the result. (If you do this repeatedly, you'll probably want to -wrap these steps up in a simple macro. Note that the modified \bigstrutjot -value will not give reasonable results if you have bigstruts and use this -argument for its intended purpose elsewhere. In that case, you might want -to set it locally.) - -If you use \multirow with the colortbl package you have to take -precautions if you want to color the column that has the \multirow in it. -colortbl works by coloring each cell separately. So if you use \multirow -with a positive nrows value, colortbl will first color the top cell, then -\multirow will typeset nrows cells starting with this cell, and later -colortbl will color the other cells, effectively hiding the text in that -area. This can be solved by putting the \multirow is the last row with a -negative nrows value. -Example: - - \begin{tabular}{l>{\columncolor{yellow}}l} - aaaa & \\ - cccc & \\ - dddd & \multirow{-3}*{bbbb}\\ - \end{tabular} bigstrut.sty: diff --git a/Master/texmf-dist/doc/latex/multirow/multirow.pdf b/Master/texmf-dist/doc/latex/multirow/multirow.pdf Binary files differindex d1a20378433..a0753f26c19 100644 --- a/Master/texmf-dist/doc/latex/multirow/multirow.pdf +++ b/Master/texmf-dist/doc/latex/multirow/multirow.pdf diff --git a/Master/texmf-dist/source/latex/multirow/multirow.dtx b/Master/texmf-dist/source/latex/multirow/multirow.dtx index aa814cbb627..073967b6958 100644 --- a/Master/texmf-dist/source/latex/multirow/multirow.dtx +++ b/Master/texmf-dist/source/latex/multirow/multirow.dtx @@ -32,7 +32,7 @@ %<multirow>\ProvidesPackage{multirow}% %<bigstrut>\ProvidesPackage{bigstrut} %<bigdelim>\ProvidesPackage{bigdelim} -%<multirow|bigstrut|bigdelim> [2016/09/27 v2.0 +%<multirow|bigstrut|bigdelim> [2016/10/11 v2.1 %<multirow> Span multiple rows of a table]% %<bigstrut> Provide larger struts in tabulars] %<bigdelim> Create big delimiters in tabular or array] @@ -45,6 +45,7 @@ \usepackage{tabulary} \usepackage{longtable} \usepackage{booktabs} +\usepackage{calc} \usepackage{url} \usepackage{tikz} \newcommand{\minitab}[2][l]{\begin{tabular}{#1}#2\end{tabular}} @@ -61,7 +62,7 @@ %</driver> % \fi % -% \CheckSum{440} +% \CheckSum{434} % % \CharacterTable % {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z @@ -144,10 +145,11 @@ % rows and columns that the text spans the multirow block. Usually this % covers one column, but by combining it with \cs{multicolumn} more % columns can be covered. +% \changes{v2.1}{2016/10/06}{Rename \meta{fixup} to \meta{vmove} as in The LaTeX Companion.} % % The basic syntax is: % \begin{quote} -% \cmd{\multirow}\oarg{vpos}\marg{nrows}\oarg{bigstruts}\marg{width}\oarg{fixup}\marg{text} +% \cmd{\multirow}\oarg{vpos}\marg{nrows}\oarg{bigstruts}\marg{width}\oarg{vmove}\marg{text} % \end{quote} % where % \begin{description} @@ -177,8 +179,8 @@ % be used, and \texttt{=} to indicate that the specified width of the column in % which the \cs{multirow} entry is set should be used. % -% \item[\meta{fixup}] is a length used for fine tuning: the text will be -% raised (or lowered, if \meta{fixup} is negative) by that length +% \item[\meta{vmove}] is a length used for fine tuning: the text will be +% raised (or lowered, if \meta{vmove} is negative) by that length % above (below) wherever it would otherwise have gone. % % \item[\meta{text}] is the actual text of the construct. If the width @@ -375,7 +377,7 @@ % can make about the height is the number of rows${}\times{}$the normal % height of a row. It tries to center the text in that space, but that space % is too low in this example. Therefore the text is at the top of the -% box. If you want it to be centered, you have to supply a \meta{fixup} +% box. If you want it to be centered, you have to supply a \meta{vmove} % parameter to shift it down. % \item We have used an \cs{extrarowheight}\footnote{This is only % available with the \Package{array} package, which \Package{tabulary} @@ -434,7 +436,7 @@ % % In this case the text would be centered somewhere in the % bottom row, which would make it stick out of the bottom. Therefore we -% applied a \meta{fixup} of 12mm. The \meta{fixup} usually requires some experimentation. +% applied a \meta{vmove} of 12mm. The \meta{vmove} usually requires some experimentation. % % \subsection{Fine Tuning} % \label{sec:fine-tuning} @@ -442,22 +444,61 @@ % If any of the spanned rows are unusually large, or if you're using the % \Package{bigstrut} package and \cs{bigstrut}s are used asymetrically about the % centerline of the spanned rows, the vertical centering may not come -% out right. Use the \meta{fixup} parameter in this case. +% out right. Use the \meta{vmove} parameter in this case. % % It's just about impossible to deal correctly with descenders. The % text will be set up centred, but it may then have a baseline that % doesn't match the baseline of the stuff beside it, in particular if % the stuff beside it has descenders and \meta{text} does not. This may % result in a small misalignment. About all that can be done is to do a -% final touchup on \meta{text}, using the fixup optional parameter. +% final touchup on \meta{text}, using the \meta{vmove} optional parameter. % (Hint: If you use a measure like \texttt{.1ex}, there's a reasonable -% chance that the fixup will still be correct if you change the point +% chance that the \meta{vmove} will still be correct if you change the point % size.) % % \cs{multirow} is mainly designed for use with \environment{tabular}, as % opposed to \environment{array}, environments. It might not work well in an % array environment if there are big formulas in some rows; in that case you can use the -% \meta{fixup} parameter to refine the result. +% \meta{vmove} parameter to refine the result. +% +% In some cases you might want to align the multirow entry with the top +% of the other row cells, for example if you have a large capital in it. +% when you use \meta{vpos} = \texttt{[t]}, the baselines will be +% aligned, which is the wrong thing in this case. You can then do the +% positioning with the \meta{vmove} parameter and let \LaTeX{} calculate +% the amount. For example: +% +% \begin{quote} +% \begin{verbatim} +% \usepackage{calc} +% \newlength{\shiftdown} +% \setlength{\shiftdown}{\heightof{\Huge\bfseries B}-\heightof{f}} +% . . . +% \begin{tabular}{cll} +% \toprule +% \multirow[t]{5}{*}[-\shiftdown]{\Huge\bfseries B} +% & foo & Lorem ipsum dolor sit \\ +% & bar & Maecenas sed purus \\ +% & baz & Nullam luctus id tellus \\ +% & qux & Aenean consequat commodo \\ +% \bottomrule +% \end{tabular} +% \end{verbatim} +% \end{quote} +% +% \begin{quote} +% \newlength{\shiftdown} +% \setlength{\shiftdown}{\heightof{\Huge\bfseries B}-\heightof{f}} +% \begin{tabular}{cll} +% \toprule +% \multirow[t]{5}{*}[-\shiftdown]{\Huge\bfseries B} +% & foo & Lorem ipsum dolor sit \\ +% & bar & Maecenas sed purus \\ +% & baz & Nullam luctus id tellus \\ +% & qux & Aenean consequat commodo \\ +% \bottomrule +% \end{tabular} +% \end{quote} % % If you use \cs{multirow} with the \Package{colortbl} package you have % \index{colortbl=\Package{colortbl}|usage} @@ -769,7 +810,7 @@ % specifies that it should cover 3 rows. However, the second row is not % the vertical center in this case because the third row is much taller. % -% To remedy this, the \meta{fixup} parameter could be used. However, in +% To remedy this, the \meta{vmove} parameter could be used. However, in % this case it would be easier to pretend that \cs{multirow} spans 6 % rows (the total number of lines in the last column). So use % \verb+\multirow{6}+\ldots{} and we get: @@ -1391,7 +1432,7 @@ % First collect all the parameters and replace missing optional parameters by their default values. % \changes{v1.8}{2016/09/14}{Add the optional first parameter \meta{vpos}.} % \begin{macrocode} -%% \multirow [vpos] {nrows} [bigstruts] {width} [fixup] {text} +%% \multirow [vpos] {nrows} [bigstruts] {width} [vmove] {text} \newcommand\multirow[2][c]{\@multirow[#1]{#2}} \def\@multirow[#1]#2{\@ifnextchar[{\@@multirow[#1]#2}{\@@multirow[#1]#2[0]}} \def\@@multirow[#1]#2[#3]#4{\@ifnextchar[{\@xmultirow[#1]{#2}[#3]{#4}}% @@ -1461,12 +1502,9 @@ \fi \fi % \end{macrocode} % Now position the \cs{vbox} properly. More details are given in the -% appendix. We set the depth of the \cs{vbox} -% to 0, so that it will not influence the depth of the current row. The -% overview of the shift amount can be found in section~\ref{sec:overview}. -% \begin{macrocode} - \dp0=\z@ -% \end{macrocode} +% appendix. The overview of the calculation of the shift amount can be +% found in section~\ref{sec:overview}. +% % If \meta{nrows}${}> 0$: \\ % If \meta{vpos} = \texttt{[t]}, then the box is already positioned % correctly (the baseline is on the baseline of the row). However, later @@ -1489,7 +1527,8 @@ \fi % \end{macrocode} % If \meta{nrows}${}< 0$: \\ -% If \meta{vpos} = \texttt{[t]}, shift the box up $\textrm{H} - \textrm{h1} -\textrm{h2} + \textrm{h}$. See fig.~\ref{fig:bot-t}.\\ +% If \meta{vpos} = \texttt{[t]}, shift the box up $\textrm{H} - +% \textrm{h1} -\textrm{h2} + \textrm{h}$. See fig.~\ref{fig:bot-t}.\\ % If \meta{vpos} = \texttt{[c]}, shift the box up $\textrm{H} - \textrm{h2}$. See fig.~\ref{fig:bot-c}.\\ % If \meta{vpos} = \texttt{[b]}, shift the box up H. See fig.~\ref{fig:bot-b}.\\ % H is the current value of \cs{multirow@dima}. @@ -1505,17 +1544,20 @@ \fi \fi % \end{macrocode} -% Finally, we add the \meta{fixup} parameter (\verb+#5+), and go into +% \changes{v2.1}{2016/10/11}{Set depth of final \cs{vbox} to 0, to +% prevent a tall multirow line to push the following rows downwards.} +% Finally, we add the \meta{vmove} parameter (\verb+#5+), and go into % horizontal mode. Then we shift the box up by putting a \cs{vskip} above it, % and add it to the output. Because of the \cs{vskip} the resulting box -% will have a height 0. \\ +% will have a height 0. We set the depth of the \cs{vbox} +% to 0, so that it will not influence the depth of the current row.\\ % If \cs{multirowdebug} is true, we show the box. % \begin{macrocode} \advance\multirow@dima#5\relax \leavevmode - \ifmultirowdebug\setbox0\vtop{\vskip-\multirow@dima\box0\vss}% - {\showboxdepth=5 \showboxbreadth=10 \showbox0}\box0 - \else\vtop{\vskip-\multirow@dima\box0\vss}\fi + \setbox0\vtop{\vskip-\multirow@dima\box0\vss}\dp0=\z@ + \ifmultirowdebug{\showboxdepth=5 \showboxbreadth=10 \showbox0}\fi + \box0 } % \end{macrocode} % \end{macro} @@ -1610,7 +1652,7 @@ % % In this section we explain the \cs{vbox} positioning in \cs{multirow}. % The positioning depends on the \meta{nrows}, \meta{vpos}, -% \meta{bigstruts} and \meta{fixup} parameters. The box is constructed with \cs{vtop}. The +% \meta{bigstruts} and \meta{vmove} parameters. The box is constructed with \cs{vtop}. The % algorithm of \cs{vtop} is described in \emph{The \TeX{}book}, p.~81. % % Each case is described by a figure. In the figure the lefthand column @@ -1637,8 +1679,8 @@ % h2 = $\textrm{depth of a tabular row} + \textrm{botstrut}$ % % Note: the following descriptions describe the vertical shift of the -% box without taking the \meta{fixup} into account. In all cases -% \meta{fixup} has to be added if it is given. +% box without taking the \meta{vmove} into account. In all cases +% \meta{vmove} has to be added if it is given. % % \subsection{Case \meta{nrows}${}> 0$} % @@ -1656,7 +1698,8 @@ % % Alternatively, we could have omitted the \cs{vskip} in this case, % thereby leaving the baseline undisturbed, but this would make the code -% unsymmetrical. Therefore we choose to set the shift amount to h here. +% unsymmetrical. Moreover, this would not work when a non-zero +% \meta{vmove} is present. Therefore we choose to set the shift amount to h here. % % \begin{figure}[htpb] % \centering diff --git a/Master/texmf-dist/tex/latex/multirow/bigdelim.sty b/Master/texmf-dist/tex/latex/multirow/bigdelim.sty index 52ad8f2fb09..bb47c93d48b 100644 --- a/Master/texmf-dist/tex/latex/multirow/bigdelim.sty +++ b/Master/texmf-dist/tex/latex/multirow/bigdelim.sty @@ -23,7 +23,7 @@ %% \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{bigdelim} - [2016/09/27 v2.0 + [2016/10/11 v2.1 Create big delimiters in tabular or array] \RequirePackage{multirow} \newcommand\ldelim[3]{\@ifnextchar[{\@ldelim{#1}{#2}{#3}}{\@ldelim{#1}{#2}{#3}[\null]}} diff --git a/Master/texmf-dist/tex/latex/multirow/bigstrut.sty b/Master/texmf-dist/tex/latex/multirow/bigstrut.sty index 379c581190a..f18debf971a 100644 --- a/Master/texmf-dist/tex/latex/multirow/bigstrut.sty +++ b/Master/texmf-dist/tex/latex/multirow/bigstrut.sty @@ -23,7 +23,7 @@ %% \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{bigstrut} - [2016/09/27 v2.0 + [2016/10/11 v2.1 Provide larger struts in tabulars] \@ifundefined{bigstrutjot}{\newdimen\bigstrutjot}{}\bigstrutjot=2pt \newcommand\bigstrut[1][x]{% diff --git a/Master/texmf-dist/tex/latex/multirow/multirow.sty b/Master/texmf-dist/tex/latex/multirow/multirow.sty index 91e4575b14d..33853c8e365 100644 --- a/Master/texmf-dist/tex/latex/multirow/multirow.sty +++ b/Master/texmf-dist/tex/latex/multirow/multirow.sty @@ -23,7 +23,7 @@ %% \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{multirow}% - [2016/09/27 v2.0 + [2016/10/11 v2.1 Span multiple rows of a table]% \newif\ifmultirowdebug \DeclareOption{debug}{\multirowdebugtrue} @@ -97,7 +97,7 @@ \long\def\multirow@vbox#1#2#3{\setbox0\vtop to \multirow@dima{#2% \if #1t\relax\else\vfill\fi \multirowsetup #3\if #1b\relax\else\vfill\fi}} -%% \multirow [vpos] {nrows} [bigstruts] {width} [fixup] {text} +%% \multirow [vpos] {nrows} [bigstruts] {width} [vmove] {text} \newcommand\multirow[2][c]{\@multirow[#1]{#2}} \def\@multirow[#1]#2{\@ifnextchar[{\@@multirow[#1]#2}{\@@multirow[#1]#2[0]}} \def\@@multirow[#1]#2[#3]#4{\@ifnextchar[{\@xmultirow[#1]{#2}[#3]{#4}}% @@ -125,7 +125,6 @@ \multirow@vbox{#1}{\hsize\multirow@colwidth\@parboxrestore}{\strut#6\strut\par}% \else \multirow@vbox{#1}{\hsize#4\@parboxrestore}{\strut#6\strut\par}% \fi \fi - \dp0=\z@ \ifnum\multirow@cnta>0 \if#1t\relax\multirow@dima=\ht0\else \multirow@dima=\ht\@arstrutbox @@ -146,9 +145,9 @@ \fi \advance\multirow@dima#5\relax \leavevmode - \ifmultirowdebug\setbox0\vtop{\vskip-\multirow@dima\box0\vss}% - {\showboxdepth=5 \showboxbreadth=10 \showbox0}\box0 - \else\vtop{\vskip-\multirow@dima\box0\vss}\fi + \setbox0\vtop{\vskip-\multirow@dima\box0\vss}\dp0=\z@ + \ifmultirowdebug{\showboxdepth=5 \showboxbreadth=10 \showbox0}\fi + \box0 } \@ifundefined{bigstrutjot}{\newdimen\bigstrutjot \bigstrutjot=\jot}{} \endinput |