diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex/interfaces/interfaces-makecell.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/interfaces/interfaces-makecell.sty | 370 |
1 files changed, 370 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/interfaces/interfaces-makecell.sty b/Master/texmf-dist/tex/latex/interfaces/interfaces-makecell.sty new file mode 100644 index 00000000000..fa20c8f0ac0 --- /dev/null +++ b/Master/texmf-dist/tex/latex/interfaces/interfaces-makecell.sty @@ -0,0 +1,370 @@ +%% +%% This is file `interfaces-makecell.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% interfaces.dtx (with options: `makecell') +%% +%% This is a generated file. +%% +%% interfaces : 2010/10/20 v1.0 - interfaces : interfaces with keys for other packages (FC) +%% +%% This work 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 +%% +%% This work consists of the main source file interfaces.dtx +%% and the derived files +%% interfaces.sty, interfaces.pdf, interfaces.ins, +%% interfaces-base.sty, +%% interfaces-LaTeX.sty, +%% interfaces-tikz.sty, +%% interfaces-titlesec.sty, +%% interfaces-hyperref.sty, +%% interfaces-bookmark.sty, +%% interfaces-hypbmsec.sty,interfaces-hypbmsec.code.tex, +%% interfaces-fancyhdr.sty, +%% interfaces-marks.sty, +%% interfaces-tocloft.sty, +%% interfaces-makecell.sty, +%% interfaces-enumitem.sty, +%% interfaces-truncate.sty, +%% interfaces-appendix.sty, +%% interfaces-embedfile.sty, +%% interfaces-environ.sty, +%% interfaces-umrand.sty, +%% interfaces-scrlfile.sty, +%% interfaces-pgfkeys.sty, +%% interfaces-etoolbox.sty, +%% interfaces-fancyvrb.sty +%% +%% interfaces: interfaces with keys for other packages (FC) +%% Copyright (C) 2010 by Florent Chervet <florent.chervet@free.fr> +%% +\ProvidesPackage{interfaces-makecell} + [2010/10/12 v1.0 more control on tabular cells (FC)] +\RequirePackage{interfaces-base} +\itf@Check@Package{makecell} +\edef\itf@AtEnd{\catcode126 \the\catcode126}% 126 = ~ +\AtEndOfPackage{\itf@AtEnd} +\catcode126 \active % 126 = ~ +\itf@pgfkeys +\def\countvalues#1{\number\numexpr + \expandafter\itf@countvalues\expandafter0#1,\countvalues\@nnil +}% \countvalues +\def\itf@countvalues#1#2,#3\@nnil{% + \ifx\countvalues#3% + +#1\expandafter\remove@to@nnil + \else + +1\expandafter\itf@countvalues + \fi1#3\@nnil +}% \itf@countvalues +\def\itf@getvalue#1#2{% + \romannumeral-`\q\expandafter\itf@getv@lue\expandafter0#1,\itf@getvalue\@nil{#2-1}\@nnil +}% \itf@getvalue +\def\itf@getv@lue#1#2,#3\@nil#4\@nnil{% + \ifnum\numexpr#1=\numexpr#4\relax + #2\expandafter\remove@to@nnil + \else\ifx\itf@getvalue#3% + \expandafter\expandafter\expandafter\remove@to@nnil + \else + \expandafter\expandafter\expandafter\itf@getv@lue + \fi\fi{#1+1}#3\@nil#4\@nnil +}% \itf@getv@lue +\newif\ifitf@celltranspose +\def\itf@ampactive{% + \def\tab{&}% + \lccode`\~=38\lowercase{\def~{&}}% +}% \itf@ampactive +\newrobustcmd*\repeatcell{\begingroup + \let\tab\relax + \catcode38\active + \itf@repeatcell +}% \repeatcell +\newrobustcmd*\itf@repeatcell[3][]{% + \ifblank{#1}% alignment option ? + {\let\itf@makecell\@firstofone} + {\def\itf@makecell##1{\noexpand\makecell[{#1}]{##1}}}% + \countdef\itf@col=100% local + \countdef\itf@row=101% local + \countdef\itf@cnt=102% local + \toksdef\itf@cell=1% local + \itf@pgfkeys + \pgfqkeys{/itf/makecell/repeatcell}{@reset={#2},#3}% + \toks@{}% local + \ifnum\itf@row>\z@ % number + \edef\itf@rowloop{\noexpand\@whilenum\itf@row<\the\itf@row}% + \def\itf@cell@init{\def\r{\row}\let\R\@empty}% + \else % list + \def\itf@rowloop{\@for\r:=\itf@rows}% + \expandafter\def\expandafter\itf@cell@init\expandafter{% + \expandafter\def\expandafter\R\expandafter{% + \expandafter\itf@getvalue\expandafter{\expandafter\@empty\itf@rows}}}% + \fi + \ifnum\itf@col>\z@ % number + \edef\itf@colloop{\noexpand\@whilenum\itf@col<\the\itf@col}% + \expandafter\def\expandafter\itf@cell@init\expandafter{% + \itf@cell@init\def\c{\column}\let\C\@empty}% + \else % list + \def\itf@colloop{\@for\c:=\itf@cols}% + \expandafter\expandafter\expandafter\def + \expandafter\expandafter\expandafter\itf@cell@init + \expandafter\expandafter\expandafter{% + \expandafter\itf@cell@init + \expandafter\def\expandafter\C\expandafter{% + \expandafter\itf@getvalue\expandafter{\expandafter\@empty\itf@cols}}}% + \fi + \itf@cell@init % in case they are used in formulas + \ifitf@celltranspose + \itf@col\z@ + \itf@colloop\do{% + \ifnum\itf@col>\z@ + \pgfkeysifdefined{/itf/makecell/repeatcell/cr/row\the\itf@col}% + {\pgfkeysgetvalue{/itf/makecell/repeatcell/cr/row\the\itf@col}\itf@thecr} + {\pgfkeysgetvalue{/itf/makecell/repeatcell/cr}\itf@thecr}% + \toks@\expandafter\expandafter\expandafter{% + \expandafter\the\expandafter\toks@\itf@thecr}% + \fi + \advance\itf@col\@ne + \itf@row\z@ + \itf@rowloop\do{% + \advance\itf@row\@ne + \ifnum\itf@row>\@ne + \toks@\expandafter{\the\toks@&}% + \fi + \toks@\expandafter\expandafter\expandafter{% + \expandafter\the\expandafter\toks@ + \itf@cell@init\itf@ampactive}% + \itf@cell@insert}% + }% + \else + \itf@row\z@ + \itf@rowloop\do{% + \ifnum\itf@row>\z@ + \pgfkeysifdefined{/itf/makecell/repeatcell/cr/row\the\itf@row}% + {\pgfkeysgetvalue{/itf/makecell/repeatcell/cr/row\the\itf@row}\itf@thecr} + {\pgfkeysgetvalue{/itf/makecell/repeatcell/cr}\itf@thecr}% + \toks@\expandafter\expandafter\expandafter{% + \expandafter\the\expandafter\toks@\itf@thecr}% + \fi + \advance\itf@row\@ne + \itf@col\z@ + \itf@colloop\do{% + \advance\itf@col\@ne + \ifnum\itf@col>\@ne + \toks@\expandafter{\the\toks@&}% + \fi + \toks@\expandafter\expandafter\expandafter{% + \expandafter\the\expandafter\toks@ + \itf@cell@init\itf@ampactive}% + \itf@cell@insert}% + }% + \fi + \itf@message{Code introduced by repeatcell in the \@currenvir:\the\toks@}% (to see the code...) + \expandafter\endgroup\the\toks@ + \ignorespaces +}% \itf@repeatcell +\let\itf@message\@gobble +\def\itf@cell@rowcolkey{% + \removefromstart\pgfkeyscurrentname{row}% + \ifin@\else + \removefromstart\pgfkeyscurrentname{col}% + \fi + \ifin@ + \itf@number\itf@cnt\pgfkeyscurrentname\relax\@nnil + {\pgfkeyslet\pgfkeyscurrentkey\pgfkeyscurrentvalue} + \in@false + \fi + \ifin@\else + \pgfkeysvalueof{/errors/unknown key/.@cmd}\pgfkeyscurrentkey + \pgfkeyscurrentvalue + \pgfeov + \fi +}% \itf@cell@rowcolkey +\pgfqkeys{/itf/makecell/repeatcell}{% + font/.store in=\itf@cellfont,% + font/.unknown/.code=\itf@cell@rowcolkey,% + text/.store in=\itf@celltext,% + text/.default=\ifdefined\C\C\column\fi,% + text/.unknown/.code=\itf@cell@rowcolkey,% + cr/.initial=\\,% + cr/.default=\crcr,cr/.blank=\\,end/.alias=cr,% + cr/.unknown/.code=\itf@cell@rowcolkey,% + rows/.code=\itf@number\itf@row#1\relax\@nnil + {\ifnum\itf@row<\z@\itf@row\@ne\fi} + {\itf@row\z@ + \def\itf@rows{#1}\itf@expandonceifcs\itf@rows},% + rows/.default=1,rows/.blank=1,% + @cols/.is private=interfaces-makecell,% + column/.is private=interfaces-makecell,% + row/.is private=interfaces-makecell,% + transpose/.is if=itf@celltranspose,% + .unknown/.code=% + \ifx\pgfkeyscurrentvalue\pgfkeysnovalue@text \itf@cell@formulaerror{}\z@ \fi + \ifx\pgfkeyscurrentvalue\@empty \itf@cell@formulaerror{}\@ne \fi + \pgfkeysifdefined{\pgfkeyscurrentkey/@calc}% + {\itf@cell@formulaerror{}\tw@} + {\pgfkeyslet{\pgfkeyscurrentkey/@calc}\relax}% + \itf@cell@getformula{#1}% + \pgfkeysEaddvalue{/itf/makecell/repeatcell/@calc}{} + {\the\toks@\expandafter\noexpand\csname\pgfkeyscurrentname\endcsname}% + \expandafter\let\csname\pgfkeyscurrentname\endcsname\@undefined,% (order of evaluation => "undefined cs") + @reset/.code=% #1 are the columns + \itf@celltransposefalse + \let\itf@celltext\@empty + \let\itf@cellfont\@empty + \pgfkeyssetvalue{/itf/makecell/repeatcell/cr}{\\}% + \itf@row\@ne + \pgfkeyssetvalue{/itf/makecell/repeatcell/@calc}{% + \itf@cell@numcalc\itf@col\column + \itf@cell@numcalc\itf@row\row}% + \itf@number\itf@col#1\relax\@nnil + {\ifnum\itf@col<\z@\itf@col\@ne\fi} + {\itf@col\z@ + \def\itf@cols{#1}\itf@expandonceifcs\itf@cols},% +}% keys for \repeatcell +\def\itf@cell@getformula#1{% + \itf@cell@getf@rmula #1$$$\itf@cell@getformula$\relax\@nnil + \expandafter\ifx\expandafter\toks@\the\toks@ + \itf@cell@formulaerror{#1}\thr@@ + \fi +}% \itf@cell@getformula +\def\itf@cell@getf@rmula #1$#2$#3$#4#5$#6{% + \toks@{\toks@}% + \ifx\itf@cell@getformula #4% + \toks@{\itf@cell@numcalc{#1}}% + \else\ifx $#4% + \ifx\itf@cell@getformula #6% + \ifdefined\pgfmathparse\else\itf@cell@formulaerror{#2}4\fi + \toks@{\itf@cell@pgfcalc{#2}}% + \else\ifx $#6% + \ifdefined\FPeval\else\itf@cell@formulaerror{#3}5\fi + \toks@{\itf@cell@FPcalc{#3}}% + \fi\fi + \fi\fi\remove@to@nnil +}% \itf@cell@getf@rmula +\def\itf@cell@formulaerror#1#2{% + \def\itf@tp{#1}\@onelevel@sanitize\itf@tp + \ifcase#2% 0 + \PackageError{interfaces-makecell} + {Missing formula for key \pgfkeyscurrentname!}\@ehd + \or %1 + \PackageError{interfaces-makecell} + {Computed key \pgfkeyscurrentname\space wes left blank!}\@ehd + \or %2 + \PackageError{interfaces-makecell} + {Duplicate definition for computed key \pgfkeyscurrentname + \MessageBreak\string\repeatcell\space will redefine the key}\@eha + \or %3 + \PackageError{interfaces-makecell} + {Incorrect formula in \string\repeatcell + \MessageBreak Check: \itf@tp + \MessageBreak Take care of commas and equal signs...}\@ehd + \or %4 + \PackageError{interfaces-makecell} + {Formula: \itf@tp + \MessageBreak requires \string\pgfmathparse:\space\string\usetikz{pgfmath}}\@ehd + \or %5 + \PackageError{interfaces-makecell} + {Formula: \itf@tp + \MessageBreak requires \string\FPeval:\space\string\usepackage{fp}}\@ehd + \else + \PackageError{interfaces-makecell} + {Impossible value!}\@ehd + \fi +}% \itf@cell@formulaerror +\protected\def\itf@cell@calc#1#2{% + \edef#1{\def\noexpand#1{#2}}% + \toks@\expandafter\expandafter\expandafter{% + \expandafter\the\expandafter\toks@#1}% + #1% +}% \itf@cell@calc +\protected\def\itf@cell@numcalc#1#2{% + \itf@cell@calc#2{\number\numexpr#1}% +}% \itf@cell@numcalc +\protected\def\itf@cell@pgfcalc#1#2{% + \pgfmathparse{#1}% + \itf@cell@calc#2\pgfmathresult +}% \itf@cell@pgfcalc +\protected\def\itf@cell@FPcalc#1#2{% + \begingroup + \setbox\z@\vbox{%\FPeval introduces some weird code, hence the calculation in a \vbox + \FPeval\FPresult{#1}% + \global\let\FPresult\FPresult}% + \endgroup + \itf@cell@calc#2\FPresult +}% \itf@cell@FPcalc +\def\itf@cell@getifdefined#1#2{% + \pgfkeysifdefined{/itf/makecell/repeatcell/#1} + {\pgfkeysgetvalue{/itf/makecell/repeatcell/#1}#2} + {\let#2\@empty}% +}% +\def\itf@cell@insert{% + \pgfkeysvalueof{/itf/makecell/repeatcell/@calc}% + \ifx\R\@empty\else + \toks@\expandafter\expandafter\expandafter{% + \expandafter\the\expandafter\toks@ + \expandafter\def\expandafter\r\expandafter{\r}}% + \fi + \ifx\C\@empty\else + \toks@\expandafter\expandafter\expandafter{% + \expandafter\the\expandafter\toks@ + \expandafter\def\expandafter\c\expandafter{\c}}% + \fi + \itf@cell@getifdefined{font/row\the\itf@row}\itf@cellfontrow + \itf@cell@getifdefined{font/col\the\itf@col}\itf@cellfontcol + \itf@cell@getifdefined{text/row\the\itf@row}\itf@cellrow + \itf@cell@getifdefined{text/col\the\itf@col}\itf@cellcol + \toks@\expandafter\expandafter\expandafter{% + \expandafter\the\expandafter\toks@\itf@cellfont}% + \ifx\itf@cellrow\@empty + \ifx\itf@cellcol\@empty + \itf@cell\expandafter\expandafter\expandafter{% + \expandafter\itf@cellfontcol\itf@cellfontrow}% + \let\itf@tp\itf@celltext + \else + \itf@cell\expandafter{\itf@cellfontcol}% + \let\itf@tp\itf@cellcol + \fi + \else + \ifx\itf@cellcol\@empty + \itf@cell\expandafter{\itf@cellfontrow}% + \let\itf@tp\itf@cellrow + \else + \itf@cell{}% + \ifitf@celltranspose + \edef\itf@tp{\noexpand\itf@diaghead(-2,1) + {\expandonce\itf@cellfontrow\expandonce\itf@cellrow} + {\expandonce\itf@cellfontcol\expandonce\itf@cellcol}}% + \else + \edef\itf@tp{\noexpand\itf@diaghead(-2,1) + {\expandonce\itf@cellfontcol\expandonce\itf@cellcol} + {\expandonce\itf@cellfontrow\expandonce\itf@cellrow}}% + \fi + \fi + \fi + \itf@cell\expandafter\expandafter\expandafter{% + \expandafter\the\expandafter\itf@cell\itf@tp}% + \edef\itf@tp{\itf@makecell{\the\itf@cell}}% + \toks@\expandafter\expandafter\expandafter{% + \expandafter\the\expandafter\toks@\itf@tp}% +}% \itf@cell@insert +\def\itf@diaghead(#1)#2#3{% + \begingroup + \edef\itf@tp{% + \noexpand\diaghead({#1}){\unexpanded{#2 #3}}% + {\unexpanded{#2}} + {\unexpanded{#3}}}% + \expandafter\endgroup\itf@tp +}% \itf@diaghead +\AfterPackage*{colortbl}{% +\def\CT@cellc#1[#2]#3{% #1 is either \@firstofone or \@gobble, [#2]#3 = color spec + \xdef\CT@cell@color{\noexpand\CT@color#1{[{#2}]}{#3}% + \global\let\noexpand\CT@cell@color\relax}% +}} +\endinput +%% +%% End of file `interfaces-makecell.sty'. |