From fd52ae5add99db57c832177d0d39a712a413b1c4 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Fri, 19 Nov 2010 23:48:39 +0000 Subject: tabu 1.3 (18nov10) git-svn-id: svn://tug.org/texlive/trunk@20495 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/tex/latex/tabu/tabu.sty | 140 +++++++++++++++++------------- 1 file changed, 79 insertions(+), 61 deletions(-) (limited to 'Master/texmf-dist/tex/latex/tabu') diff --git a/Master/texmf-dist/tex/latex/tabu/tabu.sty b/Master/texmf-dist/tex/latex/tabu/tabu.sty index ff5e802d2a8..4da593ac290 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 : 2010/11/15 v1.2 - tabu : Flexible LaTeX tabulars +%% tabu : 2010/11/18 v1.3 - tabu : Flexible LaTeX tabulars %% %% This work may be distributed and/or modified under the %% conditions of the LaTeX Project Public License, either @@ -25,7 +25,7 @@ %% \NeedsTeXFormat{LaTeX2e}[2005/12/01] -\ProvidesPackage{tabu}[2010/11/15 v1.2 - flexible LaTeX tabulars (FC)] +\ProvidesPackage{tabu}[2010/11/18 v1.3 - flexible LaTeX tabulars (FC)] \RequirePackage{array}[2008/09/09] \AtEndOfPackage{\tabu@AtEnd\let\tabu@AtEnd\@undefined} \let\tabu@AtEnd\@empty @@ -76,6 +76,8 @@ \newcount\tabu@cnt \newcount\tabu@nbcols \newcount\tabu@X@cols +\newcount\tabu@start +\newcount\tabu@stop \newdimen\tabu@target \newdimen\tabu@spreadtarget \newdimen\tabu@naturalX @@ -86,6 +88,8 @@ \newif\iftabu@nested \newif\iftabu@firstcline \newsavebox\tabu@box +\chardef\tabu@arstrutbox=\@arstrutbox +\let\tabu@vcenter \vcenter \def\tabu@gobblespace#1 {#1} \newcommand\tabu@NC@rewrite@X[1][]{\tabu@rewrite@X{#1}% \let\@halignto \relax @@ -122,7 +126,6 @@ \let\save@decl \tabu@save@decl % inversion of tokens in text mode \let\NC@rewrite@X \tabu@NC@rewrite@X \aftergroup \tabu@global@temp - \aftergroup \tabu@firstcline \NC@find \tabu@rewritelast }% NC@rewrite@\tabu@rewritefirst \expandafter\def\csname NC@find@\string\tabu@rewritefirst\endcsname @@ -140,7 +143,11 @@ \def\tabu@rewritelast{% \ifx \@halignto\relax % found a X column \let\tabu@temp \@empty - \aftergroup \tabu@addphantomline + %\aftergroup \tabu@addphantomline + \ifx \tabu@halignto\relax % X column measure + \aftergroup \tabu@prep@TRIAL + \else \aftergroup \tabu@setup@everycr + \fi \else \ifdim \tabu@target=\z@ \let\tabu@temp \@empty \else @@ -148,11 +155,12 @@ \if !\noexpand\tabu@temp \def\tabu@temp{@{\extracolsep\@flushglue}}\else \def\tabu@temp{!{\extracolsep\@flushglue}}\fi\fi \fi + \aftergroup\tabu@setup@everycr \fi \let\@halignto \tabu@halignto \expandafter\NC@find \tabu@temp }% \tabu@rewritelast -\newtoks\tabu@everycr@tok +%%\newtoks\tabu@everycr@tok \newif\iftabu@colortbl \def\tabu@nowrite{% cancels a \write command (tabularx method) \begingroup @@ -160,22 +168,6 @@ \afterassignment\let\count@ }% \tabu@nowrite \let\tabu@write\write -\def\tabu@phantomline{\noalign{% - \global\everycr{}% - \global\setbox\tabu@box\box\@arstrutbox - \global\let\tabu@minrowclearance \minrowclearance - \global\let\minrowclearance \z@ - \global\let\tabu@temp \vcenter - \global\let\vcenter \vbox - \toks@{}\count@\@ne - \@whilenum\count@<\tabu@nbcols\do{\advance\count@\@ne - \toks@\expandafter{\the\toks@&}}% - \toks@\expandafter{\the\toks@ - \cr\noalign{\global\setbox\@arstrutbox\box\tabu@box - \global\let\minrowclearance \tabu@minrowclearance - \global\let\vcenter \tabu@temp}}% - \expandafter}\the\toks@ -}% \tabu@phantomline \def\tabu{% \ifmmode \def\endtabu{\endarray}% \else \def\endtabu{\endtabular}\fi @@ -193,6 +185,8 @@ \def\tabu@aligndefault{t}\def\tabudefaulttarget{\linewidth}% \else \tabu@nestedfalse \def\tabu@aligndefault{c}% + \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}% @@ -204,10 +198,6 @@ \fi \let\@footnotetext \tabu@footnotetext \let\@xfootnotenext\tabu@xfootnotetext - \iftabu@nested\else - \global\tabu@footnotes{}% - \aftergroup\the\aftergroup\tabu@footnotes - \fi \let\centering \tabu@centering \let\raggedright \tabu@raggedright \let\raggedleft \tabu@raggedleft @@ -217,6 +207,7 @@ \let\fbox \tabu@fbox \let\prepnext@tok \tabu@prepnext@tok % \let\rowfont \tabu@rowfont + \everycr{}\let\tabu@everycr \everycr \tabu@spreadfalse \tabu@measuringfalse \edef\tabu@hfuzz{\ifdim\hfuzz<.1\p@ .1\p@\else\the\hfuzz\fi}% \tabu@rewritefirst @@ -281,7 +272,9 @@ \else \tabu@rewrite@Xto \fi }% \tabu@rewrite@X -\def\tabu@rewrite@Xnested#1{\def\tabucolX@spec{p{\tabucolX}}} +\def\tabu@rewrite@Xnested#1{\in@ ${#1}\ifin@ + \def\tabucolX@spec{>{$}p{\tabucolX}<{$}}\else + \def\tabucolX@spec{p{\tabucolX}}\fi} \def\tabu@rewrite@Xrestore#1{\tabu@Xarg{#1}\let\tabucolX@spec\tabu@temp}% \def\tabu@rewrite@Xto{% \iftabu@measuring % not the first X column found in preamble @@ -296,7 +289,6 @@ \tabu@X@sum \the\tabu@X@sum\relax \tabu@target \the\tabu@target\relax}% \let\tabu@halignto \relax - \aftergroup \tabu@prep@TRIAL \fi }% \tabu@rewrite@Xto \def\tabu@rewrite@Xspread{% tabu spread with X columns: we need to store each coef @@ -319,7 +311,6 @@ \tabu@spreadtarget \the\tabu@spreadtarget\relax \def\csname tabu@X\the\tabu@X@cols\endcsname{\strip@pt\tabu@X@sum}}% \let\tabu@halignto \relax - \aftergroup \tabu@prep@TRIAL \fi }% \tabu@rewrite@Xspread \def\tabu@Xarg#1{% @@ -392,22 +383,24 @@ \ifx\tabucolX@spec\@empty \def\tabucolX@spec{p}\fi \ifdim \tabu@X@sum=\z@ \tabu@X@sum \p@\fi \begingroup - \ifx \tabu@Xmath\relax - \edef\tabucolX@spec##1{\tabucolX@spec{##1}}% - \else - \edef\tabucolX@spec##1{>{$}\tabucolX@spec{##1}<{$}}% - \fi + \edef\tabucolX@spec##1{\tabucolX@spec{##1}}% \edef\tabu@temp{\dimexpr\strip@pt\tabu@X@sum \tabucolX \relax}% \toks@\expandafter{\tabucolX@align}% \edef\x{% - \def\noexpand\tabu@temp{\the\toks@ \tabucolX@spec{\the\tabu@temp}}% - \def\noexpand\tabucolX@spec{\the\toks@ \tabucolX@spec{\tabu@temp}}% + \def\noexpand\tabu@temp{% + \ifx \tabu@Xmath\relax\else >{$}\fi + \the\toks@ \tabucolX@spec{\the\tabu@temp}% + \ifx \tabu@Xmath\relax\else <{$}\fi}% + \def\noexpand\tabucolX@spec{% + \ifx \tabu@Xmath\relax\else >{$}\fi + \the\toks@ \tabucolX@spec{\tabu@temp}% + \ifx \tabu@Xmath\relax\else <{$}\fi}% }\expandafter\endgroup\x }% \tabucolX@do \def\tabu@prep@TRIAL{% \let\tabu@savedpreamble \@preamble \def\savetabu {\tabu@saveX}% - {\ifnum0=`}\fi + \begingroup\iffalse{\fi\ifnum0=`}\fi \tabu@setup@TRIAL \iftabu@spread % first trial only \advance\tabu@X@cols \@ne @@ -440,9 +433,10 @@ \let\tabu@TRIAL@hook\@empty \newcommand\tabuDisableCommands[1]{\g@addto@macro\tabu@TRIAL@hook{#1}} \def\tabu@arrayleft@measure#1\bgroup{% - \def\tabu@Xfinish{\ifnum0=`{\fi}\tabu@global@X - \let\@halignto\tabu@halignto \tabu@firstcline #1\bgroup}% - \toks@{\let\@preamble\tabu@savedpreamble}% + \def\tabu@Xfinish{\ifnum0=`{\fi\iffalse}\fi\endgroup\tabu@global@X #1\bgroup}% + \toks@{% + \tabu@setup@everycr + \let\@preamble\tabu@savedpreamble}% \tabu@collect }% \tabu@arrayleft@measure \def\tabu@collect{\catcode`\^^@=13\def\tabu@stack{b}\tabu@collectbody} @@ -457,8 +451,9 @@ \fi }% \tabu@collectbody \long\def\tabu@pushbegins#1\begin#2{\ifx\end#2\else b\expandafter\tabu@pushbegins\fi} -\def\tabu@TRIAL{\setbox\tabu@box \hbox\bgroup $\@arrayleft\vbox\bgroup \the\toks@ - \tabu@endTRIAL}% constant +\def\tabu@TRIAL{\setbox\tabu@box \hbox\bgroup $\@arrayleft + \if c\tabu@align\vcenter\else\vbox\fi\bgroup \the\toks@ + \tabu@endTRIAL}% constant \def\tabu@endTRIAL{\endarray$\egroup \iftabu@spread \tabu@spreadfalse \let\@startpbox \tabu@startpboxORI @@ -475,6 +470,7 @@ }% \tabu@endTRIAL \def\tabu@arith{% \advance\tabu@cnt \@ne +%% \showbox\tabu@box \ifdim \tabu@lasttry=\wd\tabu@box \tabu@message{\tabu@header Reached minimum width. Backing up}% \else @@ -617,18 +613,42 @@ }% \tabu@vline } \def\tabuvlines@find#1|{\NC@{#1}} -\def\tabu@firstcline{% +\def\tabu@setup@everycr{% \tabu@firstclinetrue - \let\tabu@everycr \everycr - \def\tabu@restoreeverycr {\let\everycr\tabu@everycr}% - \def\everycr{\afterassignment\tabu@restoreeverycr\@temptokena}% - \tabu@everycr{\noalign{% - \global\tabu@everycr{\noalign{% - \global\tabu@everycr{}\global\tabu@firstclinefalse}}% - \global\let\everycr\tabu@everycr}}% -}% \tabu@firstcline -\def\tabu@addphantomline{\tabu@everycr\expandafter{\the\tabu@everycr - \tabu@phantomline}} + \let\tabu@first@cline \z@ + \def\tabu@restoreeverycr {\let\everycr \tabu@everycr}% + \def\everycr{\afterassignment\tabu@restoreeverycr \@temptokena}% + \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@setup@everycr +\def\tabuphantomline{\crcr\noalign{% + \global\let\@arstrutbox \voidb@x + \iftabu@colortbl + \xdef\tabu@minrowclearance{\the\minrowclearance}% + \global\minrowclearance \z@ + \fi + \global\let\vcenter \vbox + \iftabu@nested\vspace*{\dimexpr\extrarowheight-\ht\@arstrutbox}\fi + \toks@{}\count@\@ne + \@whilenum\count@<\tabu@nbcols\do{\advance\count@\@ne + \toks@\expandafter{\the\toks@&}}% + \toks@\expandafter{\the\toks@ + \cr\noalign{% + \global\let\@arstrutbox \tabu@arstrutbox + \global\let\vcenter \tabu@vcenter + \iftabu@colortbl + \global\minrowclearance \tabu@minrowclearance\relax\fi + \global\let\tabu@first@cline \@ne}}% + \expandafter}\the\toks@ +}% \tabuphantomline \def\tabu@linedash{4pt}% \def\tabu@dashgap{4pt}% \def\tabucline{\noalign{\ifnum0=`}\fi\@ifstar @@ -639,8 +659,8 @@ \ifnum\tabu@start>\tabu@stop \the\toks@ \else\ifx\tabu@xleaders\relax\the\toks@ \else - \toks@{\ifnum0=`{\fi}\noalign{\global\setbox\tabu@box \box\@arstrutbox}}% - \iftabu@firstcline\if\tabu@align t\vskip-\ht\@arstrutbox\fi\fi + \toks@{\ifnum0=`{\fi}\noalign{\global\let\@arstrutbox \voidb@x}}% +%% \iftabu@firstcline\if\tabu@align t\vskip-\ht\@arstrutbox\fi\fi \@whilenum\@multicnt<\tabu@start\do{\advance\@multicnt\@ne \toks@\expandafter{\the\toks@ &}}% \loop @@ -664,14 +684,14 @@ \@whilenum\@multicnt<\tabu@nbcols\do{\advance\@multicnt\@ne \toks@\expandafter{\the\toks@ &}}% \toks@\expandafter{\the\toks@ \cr \noalign{% - \global\tabu@firstclinefalse \global\setbox\@arstrutbox \box\tabu@box}}% + \global\let\@arstrutbox \tabu@arstrutbox}}% +%% \message{LIGNE AJOUTEE:\the\toks@}% \the\toks@ \fi\fi }% \tabucline \def\tabu@add #1\@nil{\toks@\expandafter{\the\toks@ #1\ifmmode$\fi}} \def\tabu@startstop#1{\tabu@start@stop #1\relax 1-\tabu@nbcols\@nnil} \def\tabu@start@stop #1-#2\@nnil{% - \countdef\tabu@start100\countdef\tabu@stop101 % \@defaultunits \tabu@start \number0#1\relax\@nnil \@defaultunits \tabu@stop \number0#2\relax\@nnil \ifnum\tabu@start>\tabu@nbcols\tabu@start=\tabu@nbcols\else @@ -871,7 +891,7 @@ \MessageBreak I cannot restore an unknown preamble!}\@ehd} \def\tabu@rowfont{\noalign{\ifnum0=`}\fi\tabu@row@font} \newcommand*\tabu@row@font[2][]{% - \global\tabu@everycr@tok=\everycr + \global\let\tabu@rowfontreset \tabu@rowfont@reset \global\let\tabu@@cellleft \tabu@cellleft \global\let\tabu@@cellright \tabu@cellright \gdef\tabu@cellfont{#2}% @@ -879,20 +899,19 @@ \csname tabu@cell@#1\endcsname \fi \toks@\expandafter {\tabu@cellleft\tabu@cellfont}% inside \noalign group ok \xdef\tabu@cellleft {\the\toks@}% - \global\everycr\expandafter {\the\everycr\tabu@rowfont@reset}% \ifnum0=`{\fi}% end of noalign group }% \rowfont \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 \@empty \global\let\tabu@cellralign \@empty - \global\everycr=\tabu@everycr@tok - \global\tabu@everycr@tok{}% }% }% \tabu@rowfont@reset +\let\tabu@rowfontreset\@empty \newif\iftabu@cellright \AtBeginDocument{\let\array@prepnext@tok \prepnext@tok }% original definition \def\tabu@prepnext@tok{% @@ -1150,7 +1169,6 @@ \egroup \adl@colhtdp \box\adl@box \hfil }% \tabu@adl@act@endpbox - \endinput %% %% End of file `tabu.sty'. -- cgit v1.2.3