Files
usenix-2026-nested/makecell.sty
2025-10-25 03:54:21 -04:00

261 lines
10 KiB
TeX

%%
%% This is file `makecell.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% makecell.dtx (with options: `package')
%%
%% IMPORTANT NOTICE:
%%
%% For the copyright see the source file.
%%
%% Any modified versions of this file must be renamed
%% with new filenames distinct from makecell.sty.
%%
%% For distribution of the original source see the terms
%% for copying and modification in the file makecell.dtx.
%%
%% This generated file may be distributed as long as the
%% original source files, as listed above, are part of the
%% same distribution. (The sources need not necessarily be
%% in the same archive or directory.)
\NeedsTeXFormat{LaTeX2e}[1999/12/01]
\ProvidesPackage{makecell}
[2006/06/28 v0.1c Multilined Cells and Tabular Heads]
\RequirePackage{array}
\newcommand\makecell{\@ifstar{\let\tabg@pe\gape\makecell@}%
{\let\tabg@pe\cellgape\makecell@}}
\newcommand\makecell@{\def\t@bset{\cellset}%
\let\mcell@align\cellalign
\@ifnextchar[\mcell@tabular
{\expandafter\mcell@@tabular\cellalign\@nil}}
\newcommand\thead{\@ifstar{\let\tabg@pe\gape\thead@}%
{\let\tabg@pe\theadgape\thead@}}
\newcommand\thead@{\def\t@bset{\cellset\theadfont\theadset}%
\let\mcell@align\theadalign
\@ifnextchar[\mcell@tabular
{\expandafter\mcell@@tabular\theadalign\@nil}}
\@ifdefinable\rotheadsize{\newdimen\rotheadsize}
\newcommand\rotcell{\@ifundefined{turn}%
{\PackageWarning{makecell}%
{\string\rotcell\space needs rotating package}%
\let\tabg@pe\empty\let\t@bset\cellset\makecell@}
{\@ifnextchar[{\@rotcell}{\@@rotcell}}}
\@ifdefinable\@rotcell{}
\def\@rotcell[#1]#2{\makecell{\\[-.65\normalbaselineskip]
\turn{\cellrotangle}\makecell[#1]{#2}\endturn}}
\newcommand\@@rotcell[1]{\makecell{\\[-.65\normalbaselineskip]
\turn{\cellrotangle}\makecell[c{>{\rightskip0explus
\rotheadsize\hyphenpenalty0\pretolerance-1%
\noindent\hskip\z@}p{\rotheadsize}
}]{#1}\endturn}}
\newcommand\rothead{\@ifundefined{turn}%
{\PackageWarning{makecell}{\string\rothead\space
needs rotating package}%
\let\tabg@pe\theadgape
\def\t@bset{\cellset\theadfont\theadset}\thead@}%
{\let\theadgape\rotheadgape
\@ifnextchar[{\@rothead}{\@@rothead}}}
\@ifdefinable\@rothead{}
\def\@rothead[#1]#2{\thead{\\[-.65\normalbaselineskip]
\turn{\cellrotangle}\thead[#1]{#2@{}}\endturn}}
\newcommand\@@rothead[1]{\thead{\\[-.65\normalbaselineskip]
\turn{\cellrotangle}\thead[c{>{\rightskip0explus
\rotheadsize\hyphenpenalty0\pretolerance-1%
\noindent\hskip\z@}p{\rotheadsize}
@{}}]{#1}\endturn}}
\newcommand\multirowcell{\@ifundefined{multirow}%
{\PackageWarning{makecell}{\string\multirowcell\space
needs multirow package}}%
{\let\mcell@multirow\multirow}\mcell@mrowcell@}
\newcommand\mcell@mrowcell@[1]{\@ifnextchar
[{\mcell@mrowcell@@{#1}}{\mcell@mrowcell@@{#1}[0pt]}}
\@ifdefinable\mcell@mrowcell@@{}
\def\mcell@mrowcell@@#1[#2]{\edef\mcell@nrows{#1}\edef\mcell@fixup{#2}%
\let\tabg@pe\cellgape\makecell@}
\newcommand\multirowthead{\@ifundefined{multirow}%
{\PackageWarning{makecell}{\string\multirowthead\space
needs multirow package}}%
{\let\mcell@multirow\multirow}\mcell@mrowhead@}
\newcommand\mcell@mrowhead@[1]{\@ifnextchar
[{\mcell@mrowhead@@{#1}}{\mcell@mrowhead@@{#1}[0pt]}}
\@ifdefinable\mcell@mrowhead@@{}
\def\mcell@mrowhead@@#1[#2]{\edef\mcell@nrows{#1}\edef\mcell@fixup{#2}%
\let\tabg@pe\theadgape\thead@}
\@ifdefinable\mcell@multirow{}
\def\mcell@multirow#1#2[#3]{}%
\newcommand\mcell@l{\def\mcell@ii{l}\let\mcell@c\mcell@ic
\global\let\mcell@left\empty}
\newcommand\mcell@r{\def\mcell@ii{r}\let\mcell@c\mcell@ic
\global\let\mcell@right\empty}
\newcommand\mcell@t{\def\mcell@i{t}\let\mcell@c\mcell@iic}
\newcommand\mcell@b{\def\mcell@i{b}\let\mcell@c\mcell@iic}
\newcommand\mcell@{}
\newcommand\mcell@c{\def\mcell@ii{c}}
\newcommand\mcell@ic{\def\mcell@i{c}}
\newcommand\mcell@iic{\def\mcell@ii{c}}
\newcommand\mcell@i{c}
\newcommand\mcell@ii{c}
\@ifdefinable\mcell@left{\let\mcell@left\hfill}
\@ifdefinable\mcell@right{\let\mcell@right\hfill}
\@ifdefinable\mcell@tabular{}\@ifdefinable\mcell@@tabular{}
\@ifdefinable\mcell@@@tabular{}
\def\mcell@tabular[#1]#2{\mcell@@tabular#1\@nil{#2}}
\newcommand\mcell@ifinlist[2]{%
\let\next\@secondoftwo
\edef\mcell@tmp{#1}%
\@for\mcell@Tmp:={#2}\do{%
\ifx\mcell@tmp\mcell@Tmp
\let\next\@firstoftwo
\fi}\next}
\def\mcell@@tabular#1#2\@nil#3{%
\expandafter\mcell@setalign\mcell@align\@nil
\mcell@setalign{#1}{#2}\@nil
\expandafter\mcell@@@tabular\expandafter\mcell@i\mcell@ii\@nil{#3}}
\@ifdefinable\mcell@setalign{}
\def\mcell@setalign#1#2\@nil{\def\@tempa{#1}\def\@tempc{c}%
\global\let\mcell@left\hfill\global\let\mcell@right\hfill
\def\mcell@c{\def\mcell@ii{c}}%
\mcell@ifinlist{#1}{l,r,t,b,c,}{\@nameuse{mcell@#1}}%
{\def\mcell@ii{#1}\let\mcell@c\mcell@ic
\let\mcell@left\empty\let\mcell@right\empty}%
\mcell@ifinlist{#2}{l,r,t,b,c,}{\@nameuse{mcell@#2}}%
{\def\mcell@ii{#2}\let\mcell@c\mcell@ic
\let\mcell@left\empty\let\mcell@right\empty}%
\ifx\@tempa\@tempc\mcell@c\fi
}
\def\mcell@@@tabular#1#2\@nil#3{%\mcell@mstyle
\ifdim\parindent<\z@\leavevmode\else\noindent\fi
\null\mcell@left
\ifmmode
\mcell@multirow\mcell@nrows*[\mcell@fixup]{\tabg@pe
{\hbox{\t@bset$\array[#1]{@{}#2@{}}#3\endarray$}}}%
\else
\mcell@multirow\mcell@nrows*[\mcell@fixup]{\tabg@pe
{\hbox{\t@bset\tabular[#1]{@{}#2@{}}#3\endtabular}}}%
\fi\mcell@right\null}
\newcommand\cellset{\def\arraystretch{1}\extrarowheight\z@
\nomakegapedcells}
\newcommand\cellgape{}
\newcommand\cellalign{cc}
\newcommand\cellrotangle{90}
\newcommand\theadfont{\footnotesize}
\newcommand\theadset{}
\newcommand\theadgape{\gape}
\newcommand\rotheadgape{}
\newcommand\theadalign{cc}
\newcommand\gape{\@ifnextchar[\@gape{\@gape[tb]}}
\newcommand\setcellgapes{\@ifnextchar[%]
{\mcell@setgapes{MB}}{\mcell@setgapes{MB}[tb]}}
\@ifdefinable\@setcellgapes{}
\def\mcell@setgapes#1[#2]#3{\expandafter\let\csname
mcell@#1@\expandafter\endcsname\csname mcell@mb@#2\endcsname
\@namedef{mcell@#1jot}{#3}}
\newcommand\mcell@mb@t[2]{\@tempdima\ht#1\advance\@tempdima#2%
\ht#1\@tempdima}
\newcommand\mcell@mb@b[2]{\@tempdimb\dp#1\advance\@tempdimb#2%
\dp#1\@tempdimb}
\newcommand\mcell@mb@tb[2]{\mcell@mb@t{#1}{#2}\mcell@mb@b{#1}{#2}}
\@ifdefinable\@gape{}\@ifdefinable\@@gape{}
\def\@gape[#1]{\mcell@setgapes{mb}[#1]{\jot}\@@gape}
\def\@@gape{%
\ifmmode \expandafter\mathpalette\expandafter\mathg@pe
\else \expandafter\makeg@pe
\fi}
\newcommand\makeg@pe[1]{\setbox\z@
\hbox{\color@begingroup#1\color@endgroup}\mcell@mb@\z@\mcell@mbjot\box\z@}
\newcommand\mathg@pe[2]{\setbox\z@
\hbox{$\m@th#1{#2}$}\mcell@mb@\z@\mcell@mbjot\box\z@}
\newcommand\Gape{\@ifnextchar[\@Gape{\@Gape[\jot]}}
\@ifdefinable\@Gape{}\@ifdefinable\@@Gape{}
\def\@Gape[#1]{\@ifnextchar[{\@@Gape[#1]}{\@@Gape[#1][#1]}}
\def\@@Gape[#1][#2]{\def\depth{\dp\z@}\def\height{\ht\z@}%
\edef\mcell@mb@##1##2{%
\@tempdima\ht\z@\advance\@tempdima#1\ht\z@\@tempdima
\@tempdimb\dp\z@\advance\@tempdimb#2\dp\z@\@tempdimb}%
\@@gape}
\newcommand\bottopstrut{\gape{\strut}}
\newcommand\topstrut{\gape[t]{\strut}}
\newcommand\botstrut{\gape[b]{\strut}}
\@ifdefinable\mcell@oriclassz{\let\mcell@oriclassz\@classz}
\newcommand\makegapedcells{\let\@classz\mcell@classz}
\newcommand\nomakegapedcells{\let\@classz\mcell@oriclassz}
\newcommand\mcell@agape[1]{\setbox\z@\hbox{#1}\mcell@MB@\z@\mcell@MBjot
\null\mcell@left\box\z@\mcell@right\null}
\newcommand\mcell@classz{\@classx
\@tempcnta \count@
\prepnext@tok
\@addtopreamble{%\mcell@mstyle
\ifcase\@chnum
\hfil
\mcell@agape{\d@llarbegin\insert@column\d@llarend}\hfil \or
\hskip1sp
\mcell@agape{\d@llarbegin\insert@column\d@llarend}\hfil \or
\hfil\hskip1sp
\mcell@agape{\d@llarbegin \insert@column\d@llarend}\or
$\mcell@agape{\vcenter
\@startpbox{\@nextchar}\insert@column\@endpbox}$\or
\mcell@agape{\vtop
\@startpbox{\@nextchar}\insert@column\@endpbox}\or
\mcell@agape{\vbox
\@startpbox{\@nextchar}\insert@column\@endpbox}%
\fi
\global\let\mcell@left\relax\global\let\mcell@right\relax
}\prepnext@tok}
\newcommand\eline[1]{\count@ #1%
\advance\count@\m@ne
\loop \@temptokena\expandafter{\the\@temptokena&}%
\advance\count@\m@ne \ifnum\count@>\z@\repeat
\the\@temptokena\ignorespaces}
\newcommand\rnline{\gdef
\TeXr@rus{\let\@Alph\@Asbuk\let\@alph\@asbuk}\@nline}
\newcommand\nline{\gdef\TeXr@rus{}\@nline}
\newcommand\@nline{\@ifnextchar[%]
{\@@nline}{\@@nline[1]}}
\@ifdefinable\@@nline{}
\def\@@nline[#1]{\@ifnextchar[%]
{\@@@nline[#1]}{\@@@nline[#1][1]}}
\@ifdefinable\@@@nline{}
\def\@@@nline[#1][#2]#3{\count@ #3%
\expandafter\TeXr@loop\@gobble{}#1\@@@
\xdef\Num{\the\TeXr@lab}%
\@tempcnta#2\relax%
\expandafter\@temptokena\expandafter{\Num
\global\advance\@tempcnta\@ne}%
\advance\count@\m@ne
\loop\@temptokena\expandafter{\the\@temptokena&
\Num \global\advance\@tempcnta\@ne}%
\advance\count@\m@ne \ifnum\count@>\z@ \repeat
\the\@temptokena\ignorespaces}
\newtoks\TeXr@lab
\def\TeXr@qmark{?}
\def\TeXr@label#1#2{%
\xdef\TeXr@the{\noexpand#1\@tempcnta}%
\TeXr@lab\expandafter{\the\TeXr@lab\TeXr@rus\TeXr@the}%
\advance\@tempcnta1
\TeXr@loop}
\def\TeXr@rus{}
\def\TeXr@space{\afterassignment\TeXr@sp@ce\let\@tempa= }
\def\TeXr@sp@ce{\TeXr@lab\expandafter{\the\TeXr@lab\space}\TeXr@loop}
\def\TeXr@group#1{\TeXr@lab\expandafter{\the\TeXr@lab{#1}}\TeXr@loop}
\def\TeXr@other#1{\TeXr@lab\expandafter{\the\TeXr@lab#1}\TeXr@loop}
\def\TeXr@loop{\futurelet\TeXr@temp\TeXr@loop@}
\def\TeXr@loop@{%
\ifx A\TeXr@temp \def\@tempa{\TeXr@label\@Alph }\else
\ifx a\TeXr@temp \def\@tempa{\TeXr@label\@alph }\else
\ifx i\TeXr@temp \def\@tempa{\TeXr@label\@roman }\else
\ifx I\TeXr@temp \def\@tempa{\TeXr@label\@Roman }\else
\ifx 1\TeXr@temp \def\@tempa{\TeXr@label\@arabic}\else
\ifx \@sptoken\TeXr@temp \let\@tempa\TeXr@space \else
\ifx \bgroup\TeXr@temp \let\@tempa\TeXr@group \else
\ifx \@@@\TeXr@temp \let\@tempa\@gobble \else
\let\@tempa\TeXr@other
\TeXr@hook
\fi\fi\fi\fi\fi\fi\fi\fi
\@tempa}
\providecommand\TeXr@hook{}
\endinput
%%
%% End of file `makecell.sty'.