diff options
author | Karl Berry <karl@freefriends.org> | 2011-01-23 01:07:22 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2011-01-23 01:07:22 +0000 |
commit | af624ba34d468559f5a8706a36716a56fc8a512d (patch) | |
tree | 13af1388693fbf1c28fd77acd0431d17056d7ce0 /Master/texmf-dist/tex/latex/tabu | |
parent | 15703ccdfc4e8e60c48c88a46bd19990f7f97264 (diff) |
tabu 2.1 (20jan11)
git-svn-id: svn://tug.org/texlive/trunk@21146 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/tabu')
-rw-r--r-- | Master/texmf-dist/tex/latex/tabu/tabu.sty | 149 |
1 files changed, 96 insertions, 53 deletions
diff --git a/Master/texmf-dist/tex/latex/tabu/tabu.sty b/Master/texmf-dist/tex/latex/tabu/tabu.sty index dbeb1e7a15c..1c278d8312f 100644 --- a/Master/texmf-dist/tex/latex/tabu/tabu.sty +++ b/Master/texmf-dist/tex/latex/tabu/tabu.sty @@ -8,7 +8,7 @@ %% %% This is a generated file. %% -%% tabu : 2011/01/25 v2.0 - tabu : Flexible LaTeX tabulars +%% tabu : 2011/01/19 v2.1 - tabu : Flexible LaTeX tabulars %% %% ******************************************************* %% \begin{tabu} to <dimen>{ preamble } @@ -39,7 +39,7 @@ %% lppl copyright 2010-2011 by FC <florent.chervet@free.fr> %% \NeedsTeXFormat{LaTeX2e}[2005/12/01] -\ProvidesPackage{tabu}[2011/01/25 v2.0 - flexible LaTeX tabulars (FC)] +\ProvidesPackage{tabu}[2011/01/19 v2.1 - flexible LaTeX tabulars (FC)] \RequirePackage{array}[2008/09/09] \RequirePackage{varwidth}[2009/03/30] \AtEndOfPackage{\tabu@AtEnd\let\tabu@AtEnd\@undefined} @@ -135,14 +135,22 @@ \newdimen \tabustrutrule \tabustrutrule \z@ \newif \iftabu@measuring \newif \iftabu@spread -\newif \iftabu@firstcline \newif \iftabu@negcoef +\newif \iftabu@firstcline +\newif \iftabu@everyrow +\def\tabu@everyrowtrue{\global\let\iftabu@everyrow \iftrue} +\def\tabu@everyrowfalse{\global\let\iftabu@everyrow \iffalse} \newsavebox \tabu@box \chardef \tabu@arstrutbox=\@arstrutbox \let\tabu@vcenter \vcenter \def\tabu@gobblespace#1 {#1} \def\tabu@gobbleopt#1{\@ifnextchar [{\tabu@gobble@pt{#1}}{#1}}%] \def\tabu@gobble@pt#1[#2]{#1} +\def\tabu@ifenvir {% + \csname @\expandafter\ifx\csname\@currenvir\endcsname\tabu + first\else\expandafter\ifx\csname\@currenvir\endcsname\longtabu + first\else second\fi\fi oftwo\endcsname +}% \tabu@ifenvir \def\tabu@save@decl{% \toks\count@ =\expandafter{\the\toks\expandafter\count@ \@nextchar}% }% \tabu@save@decl @@ -276,19 +284,15 @@ }% \tabu@global@Xnested \tabu@newcolumntype \tabu@rewrite@multicolumn{% \aftergroup\endgroup % after \@mkpream group (restores \multispan) - \tabu@lines + \tabu@lines \NC@list\expandafter{\the\expandafter\NC@list \tabu@NC@list}% \ifcat$\d@llarend\else \let\save@decl \tabu@save@decl \fi % no inversion of tokens in text mode \NC@find }% \tabu@rewrite@multicolumn -\def\tabu@multicolumn{% - \expandafter\ifx\csname\@currenvir\endcsname\tabu - \expandafter\tabu@multic@lumn - \else \expandafter\tabu@multicolumnORI - \fi -}% \tabu@multicolumn +\def\tabu@multicolumn{\tabu@ifenvir \tabu@multic@lumn \tabu@multicolumnORI} \def\tabu@multic@lumn#1#2{\multispan{#1}\begingroup - \NC@list{\NC@do \tabu@rewrite@multicolumn}\let\multispan \@gobble + \NC@list{\NC@do \tabu@rewrite@multicolumn}% + \expandafter\@gobbletwo % gobbles \multispan{#1} \tabu@multicolumnORI{#1}{\tabu@rewrite@multicolumn #2}% }% \tabu@multic@lumn \newif\iftabu@colortbl @@ -312,6 +316,7 @@ \ifmmode\PackageError{tabu}{longtabu not allowed in math mode}\fi \def\tabu@{\longtable}\def\endlongtabu{\endlongtable}% \let\tabu@arrayleft@measure \tabu@long@arrayleft@measure + \let\LT@startpbox \tabu@LT@startpbox % \everypar{ array strut } instead of { array strut } \tabu@setup \tabu@settarget }% \longtabu \def\tabu@nolongtabu{\PackageError{tabu} @@ -320,21 +325,19 @@ \tabu@adl@fix \let\endarray \tabu@endarray % <fix> colortbl & arydshln (delarray) \let\tabu@global@X \@empty \ifx \verbatim\tabu@sanitizetext % <nested tabu> - \tabu@setup@saveglobal \advance\tabu@nested \@ne \def\tabu@aligndefault{t}\let\tabudefaulttarget \linewidth - \else \tabu@timerstart - \let\tabu@multicolumnORI \multicolumn - \let\multicolumn \tabu@multicolumn + \else + \tabu@timerstart \global\tabu@footnotes{}\tabu@nested \z@ + \let\tabu@multicolumnORI \multicolumn \let\multicolumn \tabu@multicolumn \def\tabu@aligndefault{c}\edef\tabu@hfuzz {\the\hfuzz}% - \global\tabu@footnotes{}\aftergroup\the\aftergroup\tabu@footnotes \ifdim\parindent>\z@ \ifx\linewidth\tabudefaulttarget \everypar\expandafter{% % correction for indentation \the\everypar\everypar\expandafter{\the\everypar}% \setbox\z@=\lastbox \ifdim\wd\z@>\z@ \advance\linewidth -\wd\z@\fi \box\z@ - }% + }% \fi\fi \fi \ifcase 0\ifdim\abovetabulinesep>\z@ 1\else\ifdim\belowtabulinesep>\z@ 1\fi\fi @@ -342,6 +345,7 @@ \else \def\tabu@celllalign{\tabu@verticalmeasure}% \def\tabu@cellralign{\tabu@verticalspacing}% \fi + \tabu@setup@saveglobal \let\@footnotetext \tabu@footnotetext \let\@xfootnotetext \tabu@xfootnotetext \let\@xfootnote \tabu@xfootnote \let\centering \tabu@centering \let\raggedright \tabu@raggedright \let\raggedleft \tabu@raggedleft @@ -354,12 +358,19 @@ \tabu@spreadfalse \tabu@measuringfalse \tabu@negcoeffalse \edef\tabu@NC@list{\the\NC@list}\NC@list{\NC@do \tabu@rewritefirst}% }% \tabu@setup -\def\tabu@setup@saveglobal{% +\def\tabu@setup@saveglobal{{% + \toks@\expandafter{\tabu@everyrow@hook}% \expandafter\xdef\csname tabu@global@\the\tabu@nested\endcsname{% - \global\tabu@X@cols \the\tabu@X@cols\relax - \global\tabu@naturalX \the\tabu@naturalX\relax - \gdef\noexpand\tabu@naturalX@min {\tabu@naturalX@min}% - \gdef\noexpand\tabu@naturalX@max {\tabu@naturalX@max}}% + \gdef\noexpand\tabu@everyrow@hook {\the\toks@}% + \noexpand\tabu@everyrowtrue + \ifcase \tabu@nested + \noexpand\the \tabu@footnotes + \else + \global\tabu@X@cols \the\tabu@X@cols\relax + \global\tabu@naturalX \the\tabu@naturalX\relax + \gdef\noexpand\tabu@naturalX@min {\tabu@naturalX@min}% + \gdef\noexpand\tabu@naturalX@max {\tabu@naturalX@max}% + \fi}}% \expandafter\aftergroup\csname tabu@global@\the\tabu@nested\endcsname }% \tabu@setup@saveglobal \def\tabu@settarget{\futurelet\@let@token \tabu@sett@rget} @@ -625,7 +636,8 @@ \hbadness \@M \let\hbadness \@tempcnta \hfuzz \maxdimen \let\hfuzz \@tempdima \let\tabu@rewrite@X \tabu@rewrite@Xnested - \let\savetabu \@gobble \let\tabudefaulttarget \linewidth + \let\savetabu \@gobble \let\everyrow \@gobble + \let\tabudefaulttarget \linewidth \let\write \tabu@nowrite \let\GenericError \tabu@GenericError \long\def\@xfootnote[##1]##2{}\let\@footnotetext \@gobble \ifx\@arrayright\relax \let\@arrayright \@empty\fi @@ -683,7 +695,7 @@ \def\tabu@collect{\catcode`\^^@=13\def\tabu@stack{b}\tabu@collectbody} \long\def\tabu@collectbody#1\end#2{% \edef\tabu@stack{\tabu@pushbegins #1\begin\end\expandafter\@gobble\tabu@stack}% - \ifx\tabu@stack\@empty + \ifx \tabu@stack\@empty \toks@\expandafter{\the\toks@#1}\def\tabu@endenvir{\end{#2}}% \expandafter \tabu@TRIAL \else @@ -932,21 +944,26 @@ \def\tabu@naturalX@min{\z@} \def\tabu@naturalX@max{\z@} \def\tabu@setup@everycr{% - \tabu@firstclinetrue + \tabu@firstclinetrue \tabu@everyrowtrue \let\tabu@first@cline \z@ \def\tabu@restoreeverycr {\let\everycr \tabu@everycr}% \def\everycr{\afterassignment\tabu@restoreeverycr \@temptokena}% <for ialign> - \tabu@everycr\expandafter{\the\tabu@everycr - \noalign{% - \ifcase\tabu@first@cline - \global\let\tabu@first@cline \tw@ - \or\global\let\tabu@first@cline \tw@ - \or\global\tabu@firstclinefalse - \global\let\tabu@first@cline \m@ne - \fi}% - \tabu@rowfontreset - }% + \tabu@everycr\expandafter{\the\tabu@everycr \tabu@everyrow}% }% \tabu@setup@everycr +\def\tabu@everyrow{% + \noalign{% + \ifcase\tabu@first@cline + \global\let\tabu@first@cline \tw@ + \or\global\let\tabu@first@cline \tw@ + \or\global\tabu@firstclinefalse + \global\let\tabu@first@cline \m@ne + \fi}% + \tabu@rowfontreset + \iftabu@everyrow + \noalign{\tabu@everyrowfalse}\expandafter\tabu@everyrow@hook + \fi +}% \tabu@everyrow +\let\tabu@everyrow@hook \@empty \def\tabuphantomline{\crcr\noalign{% \global\let\@arstrutbox \voidb@x \iftabu@colortbl @@ -1014,9 +1031,9 @@ }% \tabuvline@argiii \def\tabu@linedash{4pt}% <default value> \def\tabu@dashgap{4pt}% <default value> -\def\tabucline{\noalign{\ifnum0=`}\fi \@ifstar - {\@tempswatrue\tabu@cline} - {\@tempswafalse\tabu@cline}}% +\def\tabucline{\crcr\noalign{\ifnum0=`}\fi \@ifstar + {\@tempswatrue \tabu@cline} + {\@tempswafalse \tabu@cline}}% \newcommand*\tabu@cline[2][]{\toks@{}% \tabu@startstop{#2}\tabu@getlinespec{#1}\@multicnt\@ne \ifnum\tabu@start>\tabu@stop @@ -1395,26 +1412,37 @@ \global\let\tabu@@cellright \tabu@cellright \global\let\tabu@@celllalign \tabu@celllalign \global\let\tabu@@cellralign \tabu@cellralign - \gdef\tabu@cellfont{\let\color \tabu@colorleavevmode#2\let\color \tabu@colorORI}% + \gdef\tabu@cellfont{#2}% \ifcsname tabu@cell@#1\endcsname % row alignment \csname tabu@cell@#1\endcsname \fi \toks@\expandafter {\tabu@cellleft\tabu@cellfont}% inside \noalign group ok \xdef\tabu@cellleft {\the\toks@}% \ifnum0=`{\fi}% end of noalign group }% \rowfont -\def\tabu@colorleavevmode{\leavevmode\tabu@colorORI} -\AtBeginDocument{\let\tabu@colorORI \color} +\def\tabu@ifcolorleavevmode#1{\let\color \tabu@leavevmodecolor #1\let\color\tabu@color}% +\AtBeginDocument{% + \ifdefined\color + \let\tabu@color \color + {\toks@\expandafter\expandafter\expandafter{\csname color \endcsname} + \xdef\tabu@leavevmodecolor{\leavevmode\the\toks@}} + \else \let\tabu@ifcolorleavevmode \@firstofone + \fi +}% \def\tabu@rowfont@reset{% \noalign{% \global\let\tabu@rowfontreset \@empty - \global\let\tabu@cellleft \tabu@@cellleft - \global\let\tabu@cellright \tabu@@cellright - \global\let\tabu@cellfont \@empty - \global\let\tabu@celllalign \tabu@@celllalign - \global\let\tabu@cellralign \tabu@@cellralign + \global\let\tabu@cellleft \tabu@@cellleft + \global\let\tabu@cellright \tabu@@cellright + \global\let\tabu@cellfont \@empty + \global\let\tabu@celllalign \tabu@@celllalign + \global\let\tabu@cellralign \tabu@@cellralign }% }% \tabu@rowfont@reset \let\tabu@rowfontreset \@empty +\def\everyrow #1{% + \ifdim\baselineskip=\z@\noalign\fi + {\gdef\tabu@everyrow@hook{#1}}% +}% \everyrow \newif\iftabu@cellright \AtBeginDocument{\let\tabu@prepnext@tokORI \prepnext@tok }% original definition \def\tabu@prepnext@tok{% @@ -1456,14 +1484,19 @@ \tabu@prepnext@tokORI }% \tabu@prepnext@tok \long\def\tabu@lastnoop#1\@@#2#3{\in@\@nextchar{#2}% - \ifin@ \let\@fornoop \tabu@fornoopORI \expandafter\prepnext@tok \fi} + \ifin@ + \let\@fornoop \tabu@fornoopORI + \toks0\expandafter{\expandafter\tabu@everyrowtrue \the\toks0}% + \expandafter\prepnext@tok + \fi +}% \tabu@lastnoop \def\tabu@preptokenright{% \advance \count@ \m@ne \toks\count@\expandafter {\the\toks\count@ \tabu@cellright \tabu@cellralign}% \advance \count@ \@ne }% \tabu@preptokenright \def\tabu@preptokenleft{\toks\count@\expandafter{\expandafter\tabu@celllalign - \the\toks\count@ \tabu@cellleft}% + \the\toks\count@ \tabu@cellleft}% after because of $ }% \tabu@preptokenleft \def\tabu@savetok#1{\begingroup \expandafter\tabu@savet@k\csname tabu@tok@\the\tabu@nbcols #1\endcsname @@ -1627,12 +1660,13 @@ \dimen@\dp\z@\advance\dimen@\fboxsep\dp\z@\dimen@ \tabu@do@color@b@x }% \tabu@end@color@b@x -\def\tabu@temp#1#2{{\toks@\expandafter{#2\arraybackslash}\xdef#1{\the\toks@}}} -\tabu@temp \tabu@centering \centering -\tabu@temp \tabu@raggedleft \raggedleft -\tabu@temp \tabu@raggedright \raggedright +\def\tabu@temp#1#2#3{{\toks@\expandafter{#2#3}\xdef#1{\the\toks@}}} +\tabu@temp \tabu@centering \centering \arraybackslash +\tabu@temp \tabu@raggedleft \raggedleft \arraybackslash +\tabu@temp \tabu@raggedright \raggedright \arraybackslash +\def\tabu@normalcrbackslash{\let\\\@normalcr} \def\tabu@trivlist{\expandafter\def\expandafter\@trivlist\expandafter{% - \expandafter\let\expandafter\\\expandafter\@normalcr\@trivlist}}% + \expandafter\tabu@normalcrbackslash \@trivlist}}% \def\tabu@fix@arrayright{% \@ifpackageloaded{arydshln} {% @@ -1691,6 +1725,15 @@ \let\adl@act@@endpbox \tabu@adl@act@endpbox % <fix> arydshln \let\@preamerror \@preamerr % <fix> arydshln }% \tabu@adl@fix +\def\tabu@LT@startpbox #1{% + \bgroup + \let\@footnotetext\LT@p@ftntext + \setlength\hsize{#1}% + \@arrayparboxrestore + \everypar{% + \vrule \@height \ht\@arstrutbox \@width \z@ + \everypar{}}% +}% \tabu@LT@startpbox \endinput %% %% End of file `tabu.sty'. |