diff options
author | Karl Berry <karl@freefriends.org> | 2007-06-01 16:59:17 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2007-06-01 16:59:17 +0000 |
commit | 9be1534fe41a6da18ab8eda4f92a7ca40f0be8d0 (patch) | |
tree | 3ff3ac4f15cfc1b432d93a66ad7bf0349b4b13c5 /Master/texmf-dist/tex/latex/makecell | |
parent | 4d027ddb699c57025992eccbdd3cef0ec2836ee1 (diff) |
makecell update (25may07)
git-svn-id: svn://tug.org/texlive/trunk@4400 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/makecell')
-rw-r--r-- | Master/texmf-dist/tex/latex/makecell/makecell.sty | 139 |
1 files changed, 117 insertions, 22 deletions
diff --git a/Master/texmf-dist/tex/latex/makecell/makecell.sty b/Master/texmf-dist/tex/latex/makecell/makecell.sty index eef95d7b4e6..cf7b88295d0 100644 --- a/Master/texmf-dist/tex/latex/makecell/makecell.sty +++ b/Master/texmf-dist/tex/latex/makecell/makecell.sty @@ -22,7 +22,7 @@ %% in the same archive or directory.) \NeedsTeXFormat{LaTeX2e}[1999/12/01] \ProvidesPackage{makecell} - [2006/06/28 v0.1c Multilined Cells and Tabular Heads] + [2007/05/24 V0.1d Managing of Tab Column Heads and Cells] \RequirePackage{array} \newcommand\makecell{\@ifstar{\let\tabg@pe\gape\makecell@}% {\let\tabg@pe\cellgape\makecell@}} @@ -86,9 +86,9 @@ \@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} + \global\let\mcell@left\relax} \newcommand\mcell@r{\def\mcell@ii{r}\let\mcell@c\mcell@ic - \global\let\mcell@right\empty} + \global\let\mcell@right\relax} \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@{} @@ -119,10 +119,10 @@ \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}% + \let\mcell@left\relax\let\mcell@right\relax}% \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}% + \let\mcell@left\relax\let\mcell@right\relax}% \ifx\@tempa\@tempc\mcell@c\fi } \def\mcell@@@tabular#1#2\@nil#3{%\mcell@mstyle @@ -151,11 +151,13 @@ \@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} + \@namedef{mcell@#1jot}{#3}% + \@namedef{mcell@#1negjot}{-#3}\@namedef{mcell@#1negtb}{#2}} +\newcommand\negjot[1]{{\jot\mcell@MBnegjot\gape[mcell@MBnegtb]{#1}}} +\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} @@ -208,6 +210,7 @@ \loop \@temptokena\expandafter{\the\@temptokena&}% \advance\count@\m@ne \ifnum\count@>\z@\repeat \the\@temptokena\ignorespaces} +\newcounter{nlinenum} \newcommand\rnline{\gdef \TeXr@rus{\let\@Alph\@Asbuk\let\@alph\@asbuk}\@nline} \newcommand\nline{\gdef\TeXr@rus{}\@nline} @@ -217,22 +220,24 @@ \def\@@nline[#1]{\@ifnextchar[%] {\@@@nline[#1]}{\@@@nline[#1][1]}} \@ifdefinable\@@@nline{} -\def\@@@nline[#1][#2]#3{\count@ #3% +\def\@@@nline[#1][#2]#3{\count@ #3 + \def\TeXr@label{\TeXr@label@{nlinenum}}% \expandafter\TeXr@loop\@gobble{}#1\@@@ \xdef\Num{\the\TeXr@lab}% - \@tempcnta#2\relax% + \c@nlinenum#2\relax% \expandafter\@temptokena\expandafter{\Num - \global\advance\@tempcnta\@ne}% + \global\advance\c@nlinenum\@ne}% \advance\count@\m@ne \loop\@temptokena\expandafter{\the\@temptokena& - \Num \global\advance\@tempcnta\@ne}% + \Num \global\advance\c@nlinenum\@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}% +\def\TeXr@label@#1#2#3{% + \edef\TeXr@the{\noexpand#2{#1}}% + \TeXr@lab\expandafter + {\the\TeXr@lab\TeXr@rus\csname the#1\endcsname}% \advance\@tempcnta1 \TeXr@loop} \def\TeXr@rus{} @@ -242,11 +247,11 @@ \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 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 @@ -255,6 +260,96 @@ \fi\fi\fi\fi\fi\fi\fi\fi \@tempa} \providecommand\TeXr@hook{} +\newcommand\diaghead{\@ifnextchar({\mcell@diaghead}{\mcell@diagheads}} +\@ifdefinable\mcell@diaghead{} +\def\mcell@diaghead(#1){\def\celldiagratio{(#1)}\mcell@diagheads} +\newcommand\celldiagratio{(5,-2)} +\newcommand\mcell@diagheads[3]{\hbox\bgroup\expandafter + \mcell@getcelldiagratios\celldiagratio\relax + \@tempswafalse + \ifnum\mcell@Hratio<\z@\count@-\mcell@Hratio\relax + \edef\mcell@Hratio{\the\count@}\relax + \ifnum\mcell@Vratio<\z@\count@-\mcell@Vratio\relax + \edef\mcell@Vratio{\the\count@}\else\@tempswatrue + \fi + \else + \ifnum\mcell@Vratio<\z@\count@-\mcell@Vratio\relax + \edef\mcell@Vratio{\the\count@}\@tempswatrue\else + \fi + \fi + \settowidth\@tempdima{#1}\advance\@tempdima2\tabcolsep + \edef\mcell@diagH{\the\@tempdima}\divide\@tempdima\mcell@Hratio + \@tempdima\mcell@Vratio\@tempdima\edef\mcell@diagV{\the\@tempdima}% + \let\mcell@oriunitlength\unitlength\let\unitlength\relax + \kern-\tabcolsep\kern-\@wholewidth + \setbox\z@\hbox{\theadfont{\strut}}\@tempdima\dp\z@ + \advance\@tempdima.8\p@%2\@wholewidth + {\ifx\@classz\mcell@classz + \setbox\z@\hbox{#1}\ht\z@\z@\dp\z@\z@ + \mcell@MB@\z@\mcell@MBjot + \global\dimen@\@tempdima\global\@tempdimb\@tempdimb + \else\global\dimen@\z@\global\@tempdimb\z@\fi + }% + \advance\@tempdima\dimen@ + \edef\mcell@diagVoffset{\the\@tempdima}% + \@tempdima\mcell@diagV\advance\@tempdima-\mcell@diagVoffset + \advance\@tempdima-\@tempdimb + \edef\mcell@diagVcorr{\the\@tempdima}% + \noindent\nomakegapedcells\hbox{\begin{tabular}{@{}c@{}}% + \ifdim\jot<2\p@\jot2\p@\fi + \if@tempswa + \begin{picture}(\mcell@diagH,\mcell@diagVcorr)(\z@,\mcell@diagVoffset)% + \put(\z@,\mcell@diagV){\makebox(\z@,\z@)[tl]% + {\edef\tempa{(\mcell@Hratio,-\mcell@Vratio)}\expandafter + \line\tempa{\mcell@diagH}}} + \put(\tabcolsep,\jot)% + {\makebox(\z@,\z@)[bl]{\theadfont + \let\cellset\theadset\makecell[bl]{\strut#2}}} + \@tempdima\mcell@diagH\advance\@tempdima-\tabcolsep + \@tempdimb\mcell@diagV\advance\@tempdimb-\jot + \put(\@tempdima,\@tempdimb)% + {\makebox(\z@,\z@)[tr]{\theadfont + \let\cellset\theadset\makecell[tr]{#3\strut}}} + \end{picture}% + \else + \begin{picture}(\mcell@diagH,\mcell@diagVcorr)(\z@,\mcell@diagVoffset)% + \put(\z@,\mcell@diagV){\makebox(\z@,\z@)[tl]% + {\edef\tempa{(\mcell@Hratio,\mcell@Vratio)}\expandafter + \line\tempa{\mcell@diagH}}} + \@tempdima\mcell@diagV\advance\@tempdima-\jot + \put(\tabcolsep,\@tempdima)% + {\makebox(\z@,\z@)[tl]{\theadfont + \let\cellset\theadset\makecell[tl]{\strut#3}}} + \@tempdima\mcell@diagH\advance\@tempdima-\tabcolsep + \put(\@tempdima,\jot)% + {\makebox(\z@,\z@)[br]% + {\theadfont + \let\cellset\theadset{\makecell[br]{#2\strut}}}} + \end{picture}% + \fi + \end{tabular}% + \kern-\tabcolsep\kern-\@wholewidth + }\let\unitlength\mcell@oriunitlength\egroup\par + \ifvmode\strut + \vspace*{-\normalbaselineskip}\vspace*{-\normallineskip} + \fi +} +\@ifdefinable\mcell@getcelldiagratios{} +\def\mcell@getcelldiagratios(#1,#2){\def\mcell@Hratio{#1}\def\mcell@Vratio{#2}} +\newcommand\Xhline[1]{\noalign{\ifnum0=`}\fi\arrayrulewidth#1% + \hrule\@height\arrayrulewidth\futurelet\reserved@a\@xhline} +\def\Xcline#1#2{\@Xcline#1;#2\@nil} +\def\@Xcline#1-#2;#3\@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#3\hfill + \cr + \noalign{\vskip-#3}} \endinput %% %% End of file `makecell.sty'. |