From c14fe77571416f823736ed0c6deae5f4fc808b16 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Tue, 27 Sep 2016 21:06:23 +0000 Subject: multirow (27sep16) git-svn-id: svn://tug.org/texlive/trunk@42160 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/tex/latex/multirow/bigdelim.sty | 89 +++---- Master/texmf-dist/tex/latex/multirow/bigstrut.sty | 67 +++-- Master/texmf-dist/tex/latex/multirow/multirow.sty | 303 +++++++++++----------- 3 files changed, 213 insertions(+), 246 deletions(-) (limited to 'Master/texmf-dist/tex/latex/multirow') diff --git a/Master/texmf-dist/tex/latex/multirow/bigdelim.sty b/Master/texmf-dist/tex/latex/multirow/bigdelim.sty index 72eda5ae2df..52ad8f2fb09 100644 --- a/Master/texmf-dist/tex/latex/multirow/bigdelim.sty +++ b/Master/texmf-dist/tex/latex/multirow/bigdelim.sty @@ -1,68 +1,43 @@ -% bigdelim.sty -% version 1.0 -% Nov 5, 1999 -% Piet van Oostrum -% From bigbrace.sty : Oct 2, 1994 \Oystein Bache -% from: \dobrace by piet@cs.ruu.nl (Piet van Oostrum): %% -%% This file may be distributed under the terms of the LaTeX Project Public -%% License, as described in lppl.txt in the base LaTeX distribution. -%% Either version 1 or, at your option, any later version. +%% This is file `bigdelim.sty', +%% generated with the docstrip utility. %% -% -% Usage in a tabular or array: -% \usepackage{multirow} -% \usepackage{bigdelim} -% \ldelim({n}{w}[text] -% \rdelim){n}{w}[text] -% Use these commands in a column of a tabular or array. They generate a big -% parenthesis/brace extending over the next n rows (including this one). -% The corresponding entries in the next rows must explicitely be given as -% empty cells. The first parameter must be the delimiter to be used, e.g. -% \{ \} [ ] ( ), in fact any parameter that can be used with \left and -% \right. The text is optional and is set centered to the left of -% \ldelim and to the right of \rdelim. w must be the width reserved for -% the brace and text. If you have a recent version of multirow.sty {w} may -% be given as {*}, but this may cause the braces to be too small. Also with -% a recent version of multirow.sty the commands may be used in the last row -% of the extension with a negative n parameter. This is useful in -% combination with the colortbl package (see multirow.sty) -% If there are unusually large rows you may have to enlarge n (you can use -% non-integral values). -% If you have horizontal lines that interact with the braces you are -% advised to use the hhline package to make the lines. - -\def\ldelim#1#2#3{\@ifnextchar[{\@ldelim{#1}{#2}{#3}}{\@ldelim{#1}{#2}{#3}[\null]}} +%% The original source files were: +%% +%% multirow.dtx (with options: `bigdelim') +%% +%% This is a generated file. +%% +%% This file may be distributed and/or modified under the conditions of +%% the LaTeX Project Public License, either version 1.3 of this license +%% or (at your option) any later version. The latest version of this +%% license is in: +%% +%% http://www.latex-project.org/lppl.txt +%% +%% and version 1.3 or later is part of all distributions of LaTeX version +%% 2005/12/01 or later. +%% +%% Copyright (C) 1994 by \O ystein Bache +%% Copyright (C) 2016 by Piet van Oostrum +%% +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{bigdelim} + [2016/09/27 v2.0 + Create big delimiters in tabular or array] +\RequirePackage{multirow} +\newcommand\ldelim[3]{\@ifnextchar[{\@ldelim{#1}{#2}{#3}}{\@ldelim{#1}{#2}{#3}[\null]}} \def\@ldelim#1#2#3[#4]% {\multirow{#2}{#3}{% \ensuremath - {\left.\vcenter{\hsize=0pt\vrule height - \ifnum #2<0 -\fi#2\baselineskip width 0pt}% + {\left.\vcenter{\hsize=0pt\vrule height \multirow@dima width 0pt}% \textrm{#4}\right#1}}} -% -\def\rdelim#1#2#3{\@ifnextchar[{\@rdelim{#1}{#2}{#3}}{\@rdelim{#1}{#2}{#3}[\null]}} +\newcommand\rdelim[3]{\@ifnextchar[{\@rdelim{#1}{#2}{#3}}{\@rdelim{#1}{#2}{#3}[\null]}} \def\@rdelim#1#2#3[#4]% {\multirow{#2}{#3}{% \ensuremath - {\left#1\vcenter{\hsize=0pt\vrule height - \ifnum #2<0 -\fi#2\baselineskip width 0pt}% + {\left#1\vcenter{\hsize=0pt\vrule height \multirow@dima width 0pt}% \textrm{#4}\right.}}} -% \endinput -% -% Example: -\documentclass{article} -\usepackage{multirow} -\usepackage{bigdelim} -\begin{document} - -\begin{equation} - \begin{array}{ccccccc} - \ldelim({4}{4mm}& x & x & x & x &\rdelim){4}{4mm} \\ - & x & x & x & x & & i\\ - & x & x & x & x & & j\\ - & x & x & x & x & \\ - & & u & v & & - \end{array} -\end{equation} -\end{document} +%% +%% End of file `bigdelim.sty'. diff --git a/Master/texmf-dist/tex/latex/multirow/bigstrut.sty b/Master/texmf-dist/tex/latex/multirow/bigstrut.sty index 900e30895ad..379c581190a 100644 --- a/Master/texmf-dist/tex/latex/multirow/bigstrut.sty +++ b/Master/texmf-dist/tex/latex/multirow/bigstrut.sty @@ -1,41 +1,36 @@ %% -%% bigstrut.sty V1.0 (31-May-94) +%% This is file `bigstrut.sty', +%% generated with the docstrip utility. %% -%% Author: Jerry Leichter +%% The original source files were: %% -%% V1.0 Split out as a separate style file. +%% multirow.dtx (with options: `bigstrut') +%% +%% This is a generated file. +%% +%% This file may be distributed and/or modified under the conditions of +%% the LaTeX Project Public License, either version 1.3 of this license +%% or (at your option) any later version. The latest version of this +%% license is in: +%% +%% http://www.latex-project.org/lppl.txt +%% +%% and version 1.3 or later is part of all distributions of LaTeX version +%% 2005/12/01 or later. +%% +%% Copyright (C) 1994 by Jerry Leichter +%% Copyright (C) 2016 by Piet van Oostrum %% -%% This file may be distributed under the terms of the LaTeX Project Public -%% License, as described in lppl.txt in the base LaTeX distribution. -%% Either version 1 or, at your option, any later version. -%% -% \bigstrut[x] produces a strut which is \bigstrutjot (2pt by default) higher, -% lower, or both than the standard array/table strut. Use it in table entries -% that are adjacent to \hline's to leave an extra bit of space - according to -% the TeXbook (page 246), "This is a little touch that improves the appearance -% of boxed tables; look for it as a mark of quality." -% -% Although you could use \bigstrut in an array, there isn't normally much -% point since arrays are "opened up" by \jot anyway. -% -% \bigstrut[t] adds height; \bigstrut[b] adds depth. Just \bigstrut adds -% both. So: Use \bigstrut[t] in the row just *after* an \hline; \bigstrut[b] -% in the row just *before*; and \bigstrut if there are \hline's both before -% and after. -% -% Spaces after the \bigstrut are ignored, even if it has an optional argument. -% Spaces before the \bigstrut are generally ignored (by a single \unskip). -% -% Note: The multirow style file makes use of \bigstrutjot. If both styles -% are used, they can be used in either order, as each checks to see if the -% other has already defined \bigstrutjot. However, the default values they -% set are different: If only multirow is used, \bigstrutjot will be set to -% 3pt. If bigstrut is used, with or without multirow, \bigstrutjot will be -% 2pt. - -\@ifundefined{bigstrutjot}{\newdimen\bigstrutjot}{}\bigstrutjot2pt -\def\bigstrut{\relax\@ifnextchar [{\@bigstrut}{\@bigstrut[x]}} -\def\@bigstrut[#1]{\unskip\@tempdima\ht\@arstrutbox \@tempdimb\dp\@arstrutbox - \ifx #1b\else \advance\@tempdima by \bigstrutjot\fi - \ifx #1t\else \advance\@tempdimb by \bigstrutjot\fi +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{bigstrut} + [2016/09/27 v2.0 + Provide larger struts in tabulars] +\@ifundefined{bigstrutjot}{\newdimen\bigstrutjot}{}\bigstrutjot=2pt +\newcommand\bigstrut[1][x]{% + \unskip\@tempdima=\ht\@arstrutbox \@tempdimb=\dp\@arstrutbox + \ifx #1b\relax \else \advance\@tempdima by \bigstrutjot\fi + \ifx #1t\relax \else \advance\@tempdimb by \bigstrutjot\fi \hbox{\vrule \@height\@tempdima \@depth\@tempdimb \@width\z@}\ignorespaces} +\endinput +%% +%% End of file `bigstrut.sty'. diff --git a/Master/texmf-dist/tex/latex/multirow/multirow.sty b/Master/texmf-dist/tex/latex/multirow/multirow.sty index f52132fd150..91e4575b14d 100644 --- a/Master/texmf-dist/tex/latex/multirow/multirow.sty +++ b/Master/texmf-dist/tex/latex/multirow/multirow.sty @@ -1,159 +1,156 @@ %% -%% multirow.sty V1.6 version (5-May-2004) +%% This is file `multirow.sty', +%% generated with the docstrip utility. %% -%% Author: Jerry Leichter -%% Piet van Oostrum +%% The original source files were: %% -%% This file may be distributed under the terms of the LaTeX Project Public -%% License, as described in lppl.txt in the base LaTeX distribution. -%% Either version 1 or, at your option, any later version. +%% multirow.dtx (with options: `multirow') +%% +%% This is a generated file. +%% +%% This file may be distributed and/or modified under the conditions of +%% the LaTeX Project Public License, either version 1.3 of this license +%% or (at your option) any later version. The latest version of this +%% license is in: +%% +%% http://www.latex-project.org/lppl.txt +%% +%% and version 1.3 or later is part of all distributions of LaTeX version +%% 2005/12/01 or later. +%% +%% Copyright (C) 1994 by Jerry Leichter +%% Copyright (C) 2016 by Piet van Oostrum %% -%% V1.0 was distributed anonymously, based on a Usenet posting that was -%% not intended for stand-alone use. -%% V1.1 was modified by Piet van Oostrum to allow it to -%% work without bigstrut.sty. -%% V1.2 was modified by Jerry Leichter for the same goal, but using a -%% different approach which will work properly in conjunction with -%% bigstrut.sty. -%% V1.2a was modified by Piet van Oostrum to use \vskip -%% instead of \raise in positioning, avoiding making rows too high -%% when the adjustment is large. -%% V1.3 was modified by Piet van Oostrum to work properly in a p{} column -%% (\leavevmode added) -%% V1.4 was modified by Piet van Oostrum to check for the special case that -%% the width is given as an *. In this case the natural -%% width of the text argument will be used and the argument -%% is processed in LR-mode. -%% V1.5 was modified by Piet van Oostrum: Added a % after \hbox{#5}\vfill}. -%% Added \struts around #5 for better vertical positioning. -%% Additional coding for negative value of nrows. -%% V1.6 was modified by Piet van Oostrum: Replace a space by \relax after -%% \advance\@tempdima#4. -%% -% Make an entry that will span multiple rows of a table. -% -% \multirow{nrows}[bigstruts]{width}[fixup]{text} -% -% nrows is the number of rows to span. It's up to you to leave the other -% rows empty, or the stuff created by \multirow will over-write it. -% With a positive value of nrows the spanned colomns are this row and -% (nrows-1) rows below it. With a negative value of nrows they are -% this row and (1-nrows) above it. -% -% bigstruts is mainly used if you've used bigstrut.sty. In that case it -% is the total number of uses of \bigstrut within the rows being -% spanned. Count 2 uses for each \bigstrut, 1 for each \bigstrut[x] -% where x is either t or b. The default is 0. -% width is the width to which the text is to be set, or * to indicate that -% the text argument's natural width is to be used. -% -% text is the actual text. If the width was set explicitly, the text will -% be set in a parbox of that width; you can use \\ to force linebreaks -% where you like. -% -% If the width was given as * the text will be set in LR mode. If you -% want a multiline entry in this case you should use a tabular or array -% in the text parameter. -% -% The text is centered vertically within the range spanned by nrows. -% -% 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 -% it would otherwise have gone. -% -% For example (using both multirow and bigstrut) -% -% \newcommand{\minitab}[2][l]{\begin{tabular}{#1}#2\end{tabular}} -% \begin{tabular}{|c|c|} -% \hline -% \multirow{4}{1in}{Common g text} & Column g2a\\ -% & Column g2b \\ -% & Column g2c \\ -% & Column g2d \\ -% \hline -% \multirow{3}[6]*{Common g text} & Column g2a\bigstrut\\\cline{2-2} -% & Column g2b \bigstrut\\\cline{2-2} -% & Column g2c \bigstrut\\ -% \hline -% \multirow{4}[8]{1in}{Common g text} & Column g2a\bigstrut\\\cline{2-2} -% & Column g2b \bigstrut\\\cline{2-2} -% & Column g2c \bigstrut\\\cline{2-2} -% & Column g2d \bigstrut\\ -% \hline -% \multirow{4}*{\minitab[c]{Common \\ g text}} & Column g2a\\ -% & Column g2b \\ -% & Column g2c \\ -% & Column g2d \\ -% \hline -% \end{tabular} -% -% 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. -% -% 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} -% -\def\multirowsetup{\raggedright} -\def\multirow#1{\relax\@ifnextchar - [{\@multirow{#1}}{\@multirow{#1}[0]}} -\def\@multirow#1[#2]#3{\@ifnextchar [{\@xmultirow{#1}[#2]{#3}}% - {\@xmultirow{#1}[#2]{#3}[0pt]}} -\def\@xmultirow#1[#2]#3[#4]#5{\@tempcnta=#1% - \@tempdima\@tempcnta\ht\@arstrutbox - \advance\@tempdima\@tempcnta\dp\@arstrutbox - \ifnum\@tempcnta<0\@tempdima=-\@tempdima\fi - \advance\@tempdima#2\bigstrutjot - \if*#3\setbox0\vtop to \@tempdima{\vfill\multirowsetup - \hbox{\strut#5\strut}\vfill}% +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{multirow}% + [2016/09/27 v2.0 + Span multiple rows of a table]% +\newif\ifmultirowdebug +\DeclareOption{debug}{\multirowdebugtrue} +\DeclareOption{longtable}{% +\AtBeginDocument{% +\def\@cline#1-#2\@nil{% + \omit + \@multicnt#1% + \advance\@multispan\m@ne + \ifnum\@multicnt=\@ne\@firstofone{&\omit}\fi + \@multicnt#2% + \advance\@multicnt-#1% + \advance\@multispan\@ne + \leaders\hrule\@height\arrayrulewidth\hfill + \cr + \noalign{\nobreak\vskip-\arrayrulewidth}} +}} +\DeclareOption{supertabular}{% +\AtBeginDocument{% +\def\ST@tabularcr{% + {\ifnum0=`}\fi + \@ifstar{\MRST@xtabularcr}{\ST@xtabularcr}} +\def\MRST@xtabularcr{% + \@ifnextchar[%] + {\MRST@argtabularcr}% + {\ifnum0=`{\fi}\cr\MRST@cr}} +\def\MRST@argtabularcr[#1]{% + \ifnum0=`{\fi}% + \ifdim #1>\z@ + \unskip\MRST@xargarraycr{#1} \else - \setbox0\vtop to \@tempdima{\hsize#3\@parboxrestore - \vfill \multirowsetup \strut#5\strut\par\vfill}% - \fi - \ht0\z@\dp0\z@ - \ifnum\@tempcnta<0\advance\@tempdima-\dp\@arstrutbox - \else\@tempdima=\ht\@arstrutbox - \ifnum#2>0 \advance\@tempdima\bigstrutjot \fi + \MRST@yargarraycr{#1}% + \fi} +\def\MRST@xargarraycr#1{% + \@tempdima #1\advance\@tempdima \dp \@arstrutbox + \vrule \@height\z@ \@depth\@tempdima \@width\z@ \cr + \noalign{\global\ST@toadd=#1}\MRST@cr} +\def\MRST@yargarraycr#1{% + \cr\noalign{\vskip #1\global\MRST@toadd=#1}\MRST@cr} +\def\MRST@cr{% + \noalign{% + \ifnum\ST@pboxht<\ST@lineht + \global\advance\ST@pageleft -\ST@lineht + \global\ST@prevht\ST@lineht + \else + \global\advance\ST@pageleft -\ST@pboxht + \global\advance\ST@pageleft -0.1\ST@pboxht + \global\advance\ST@pageleft -\ST@stretchht + \global\ST@prevht\ST@pboxht + \global\ST@pboxht\z@ + \fi + \global\advance\ST@pageleft -\ST@toadd + \global\ST@toadd=\z@}} +} +\def\STneed#1{\ifdim\ST@pageleft<#1\ST@newpage\ST@next\fi} +} +\ProcessOptions +\newlength{\multirow@colwidth} +\newcount\multirow@cnta +\newcount\multirow@cntb +\newlength\multirow@dima +\def\multirow@setcolwidth#1{% + \ifx\TY@final\@undefined \multirow@colwidth=\hsize + \else + \ifx\TY@box\TY@box@v\multirow@colwidth=\hsize + \else \setbox0\hbox + {\let\\\space\let\newline\space #1}\multirow@colwidth=\wd0 + \fi + \fi} +\newcommand\multirowsetup{\raggedright} +\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} +\newcommand\multirow[2][c]{\@multirow[#1]{#2}} +\def\@multirow[#1]#2{\@ifnextchar[{\@@multirow[#1]#2}{\@@multirow[#1]#2[0]}} +\def\@@multirow[#1]#2[#3]#4{\@ifnextchar[{\@xmultirow[#1]{#2}[#3]{#4}}% + {\@xmultirow[#1]{#2}[#3]{#4}[0pt]}} +\newif\ifmultirow@prefixt +\newif\ifmultirow@prefixb +\def\multirow@piii#1#2#3\end{\multirow@prefixtfalse\multirow@prefixbfalse + \if t#1\multirow@prefixttrue + \if b#2\multirow@prefixbtrue \multirow@cntb=#3% + \else \multirow@cntb=#2#3% + \fi + \else + \if b#1\multirow@prefixbtrue \multirow@cntb=#2#3% + \else \multirow@cntb=#1#2#3% + \fi + \fi} +\def\@xmultirow[#1]#2[#3]#4[#5]#6{\multirow@cnta=#2% + \expandafter\multirow@piii#3\relax\end% + \multirow@dima=\multirow@cnta\ht\@arstrutbox + \advance\multirow@dima\multirow@cnta\dp\@arstrutbox + \ifnum\multirow@cnta<0\multirow@dima=-\multirow@dima\fi + \advance\multirow@dima \multirow@cntb\bigstrutjot + \if*#4\multirow@vbox{#1}{}{\hbox{\strut#6\strut}}% + \else \if=#4\multirow@setcolwidth{#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 + \ifmultirow@prefixt \advance\multirow@dima\bigstrutjot\fi + \if#1b\relax \advance\multirow@dima\dp\@arstrutbox + \ifmultirow@prefixb \advance\multirow@dima\bigstrutjot\fi + \fi + \fi + \else + \if#1b\relax\else + \advance\multirow@dima-\dp\@arstrutbox + \ifmultirow@prefixb \advance\multirow@dima-\bigstrutjot\fi + \if#1t\relax\advance\multirow@dima-\ht\@arstrutbox + \ifmultirow@prefixt \advance\multirow@dima-\bigstrutjot\fi + \advance\multirow@dima\ht0 + \fi + \fi \fi - \advance\@tempdima#4\relax\leavevmode\vtop{\vskip-\@tempdima\box0\vss}} -\@ifundefined{bigstrutjot}{\newdimen\bigstrutjot \bigstrutjot\jot}{} + \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 +} +\@ifundefined{bigstrutjot}{\newdimen\bigstrutjot \bigstrutjot=\jot}{} +\endinput +%% +%% End of file `multirow.sty'. -- cgit v1.2.3