summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/multirow/multirow.sty
blob: 02f8db7bcc3d6d3749b5e5f942003713042922aa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
%%
%% This is file `multirow.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% 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 , 2018, 2019 by Piet van Oostrum <piet@vanoostrum.org>
%%
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{multirow}%
           [2019/05/31 v2.5
                  Span multiple rows of a table]%
\newif\ifmultirowdebug
\DeclareOption{debug}{\multirowdebugtrue}
\DeclareOption{longtable}{%
\AtBeginDocument{%
\@ifundefined{CT@arc}
{\def\@cline#1-#2\@nil{%
  \omit
  \@multicnt#1%
  \advance\@multispan\m@ne
  \ifnum\@multicnt=\@ne\@firstofone{&\omit}\fi
  \@multicnt#2%
  \advance\@multicnt-#1%
  \advance\@multispan\@ne
  \leaders\hrule\@height\arrayrulewidth\hfill
  \cr
  \noalign{\nobreak\vskip-\arrayrulewidth}}}
{\def\@cline#1-#2\@nil{%
  \omit
  \@multicnt#1%
  \advance\@multispan\m@ne
  \ifnum\@multicnt=\@ne\@firstofone{&\omit}\fi
  \@multicnt#2%
  \advance\@multicnt-#1%
  \advance\@multispan\@ne
  {\CT@arc@\leaders\hrule\@height\arrayrulewidth\hfill}%
  \cr
  \noalign{\nobreak\vskip-\arrayrulewidth}}}
}}
\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
    \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@cntb
\newlength\multirow@dima
\def\multirow@setcolwidth#1{%
    \ifx\TY@final\multirow@undefined \multirow@colwidth=\hsize
    \else
      \ifx\TY@box\TY@box@v\multirow@colwidth=\hsize
      \else \setbox0\hbox
        {\let\\\space\let\newline\space #1}\multirow@colwidth=\wd0
      \fi
    \fi}
\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} [vmove] {text}
\newcommand\multirow[2][c]{\@multirow[#1]{#2}}
\def\@multirow[#1]#2{\@ifnextchar[{\@@multirow[#1]#2}{\@@multirow[#1]#2[0]}}
\def\@@multirow[#1]#2[#3]#4{\@ifnextchar[{\@xmultirow[#1]{#2}[#3]{#4}}%
                                {\@xmultirow[#1]{#2}[#3]{#4}[0pt]}}
\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{%
  \expandafter\multirow@piii#3\relax\end%
  \setlength\multirow@dima{#2\ht\@arstrutbox}%
  \addtolength\multirow@dima{#2\dp\@arstrutbox}%
  \ifdim#2pt<\z@\setlength\multirow@dima{-\multirow@dima}\fi
  \addtolength\multirow@dima{\multirow@cntb\bigstrutjot}%
  \if*#4\multirow@vbox{#1}{}{\hbox{\strut#6\strut}}%
  \else \if=#4\multirow@setcolwidth{#6}%
    \multirow@vbox{#1}{\setlength\hsize{\multirow@colwidth}\@parboxrestore}{\strut#6\strut\par}%
  \else \multirow@vbox{#1}{\setlength\hsize{#4}\@parboxrestore}{\strut#6\strut\par}%
  \fi \fi
  \ifdim#2pt>\z@
    \if#1t\relax\setlength\multirow@dima{\ht0}\else
      \setlength\multirow@dima{\ht\@arstrutbox}%
      \ifmultirow@prefixt \addtolength\multirow@dima{\bigstrutjot}\fi
      \if#1b\relax \addtolength\multirow@dima{\dp\@arstrutbox}%
        \ifmultirow@prefixb \addtolength\multirow@dima{\bigstrutjot}\fi
      \fi
    \fi
  \else
    \if#1b\relax\else
      \addtolength\multirow@dima{-\dp\@arstrutbox}%
      \ifmultirow@prefixb \addtolength\multirow@dima{-\bigstrutjot}\fi
      \if#1t\relax\addtolength\multirow@dima{-\ht\@arstrutbox}%
        \ifmultirow@prefixt \addtolength\multirow@dima{-\bigstrutjot}\fi
        \addtolength\multirow@dima{\ht0}%
      \fi
    \fi
  \fi
  \addtolength\multirow@dima{#5}%
  \leavevmode
  \setbox0\vtop{\vskip-\multirow@dima\box0\vss}\dp0=\z@
  \ifmultirowdebug{\showboxdepth=5 \showboxbreadth=10 \showbox0}\fi
  \box0
}
\@ifundefined{bigstrutjot}{\newdimen\bigstrutjot \bigstrutjot=\jot}{}
\endinput
%%
%% End of file `multirow.sty'.