summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2010-11-15 23:47:43 +0000
committerKarl Berry <karl@freefriends.org>2010-11-15 23:47:43 +0000
commita5a271360add796657bcd43f539e59decd26a060 (patch)
treeb150746b8e643b20b943089fa177a513111a3edc /Master/texmf-dist/tex
parent147b42500c5ad159da818792bf6b18e3f4b4e11c (diff)
tabu (15nov10)
git-svn-id: svn://tug.org/texlive/trunk@20451 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex')
-rw-r--r--Master/texmf-dist/tex/latex/tabu/tabu.sty175
1 files changed, 92 insertions, 83 deletions
diff --git a/Master/texmf-dist/tex/latex/tabu/tabu.sty b/Master/texmf-dist/tex/latex/tabu/tabu.sty
index 750a4286675..ff5e802d2a8 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/10/27 v1.1 - tabu : Flexible LaTeX tabulars
+%% tabu : 2010/11/15 v1.2 - 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/10/28 v1.1 - flexible LaTeX tabulars (FC)]
+\ProvidesPackage{tabu}[2010/11/15 v1.2 - flexible LaTeX tabulars (FC)]
\RequirePackage{array}[2008/09/09]
\AtEndOfPackage{\tabu@AtEnd\let\tabu@AtEnd\@undefined}
\let\tabu@AtEnd\@empty
@@ -88,6 +88,7 @@
\newsavebox\tabu@box
\def\tabu@gobblespace#1 {#1}
\newcommand\tabu@NC@rewrite@X[1][]{\tabu@rewrite@X{#1}%
+ \let\@halignto \relax
\expandafter \NC@find \tabucolX@spec}
\expandafter\def\csname NC@rewrite@\string\usetabu\endcsname#1{%
\ifx\\#1\\\tabu@saveerr{}\else
@@ -137,9 +138,10 @@
\expandafter\def\csname NC@find@\string\tabu@rewritelast\endcsname
#1\tabu@rewritelast{\NC@{#1}}
\def\tabu@rewritelast{%
- \ifx \@halignto\relax \let\tabu@temp \@empty
+ \ifx \@halignto\relax % found a X column
+ \let\tabu@temp \@empty
+ \aftergroup \tabu@addphantomline
\else
- \let\@halignto \tabu@halignto
\ifdim \tabu@target=\z@ \let\tabu@temp \@empty
\else
\if |\noexpand\tabu@temp \def\tabu@temp{@{\extracolsep\@flushglue}}\else
@@ -147,6 +149,7 @@
\def\tabu@temp{!{\extracolsep\@flushglue}}\fi\fi
\fi
\fi
+ \let\@halignto \tabu@halignto
\expandafter\NC@find \tabu@temp
}% \tabu@rewritelast
\newtoks\tabu@everycr@tok
@@ -160,11 +163,17 @@
\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}}%
+ \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{%
@@ -176,6 +185,7 @@
\let\adl@xarraydashrule \tabu@adl@xarraydashrule % <fix> arydshln
\let\adl@act@endpbox \tabu@adl@act@endpbox % <fix> arydshln
\let\adl@act@@endpbox \tabu@adl@act@endpbox % <fix> arydshln
+ \let\@preamerror \@preamerr % <fix> arydshln
\let\endarray \tabu@endarray % <fix> colortbl & arydshln (delarray)
\let\tabu@global@temp \@empty \let\tabu@global@X \@empty
\ifx\verbatim \tabu@sanitizetext
@@ -272,11 +282,7 @@
\fi
}% \tabu@rewrite@X
\def\tabu@rewrite@Xnested#1{\def\tabucolX@spec{p{\tabucolX}}}
-\def\tabu@rewrite@Xrestore#1{\tabu@Xarg{#1}\let\tabucolX@spec\tabu@temp
- \iftabu@measuring \else \tabu@measuringtrue \aftergroup\tabu@usetabuX \fi}%
-\def\tabu@usetabuX{%
- \tabu@everycr\expandafter{\the\tabu@everycr\tabu@phantomline}%
-}% \tabu@usetabuX
+\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
\xdef\tabu@global@X {\tabu@global@X
@@ -289,7 +295,7 @@
\xdef\tabu@global@X{%
\tabu@X@sum \the\tabu@X@sum\relax
\tabu@target \the\tabu@target\relax}%
- \let \@halignto \relax
+ \let\tabu@halignto \relax
\aftergroup \tabu@prep@TRIAL
\fi
}% \tabu@rewrite@Xto
@@ -312,7 +318,7 @@
\tabu@target \the\tabu@target\relax
\tabu@spreadtarget \the\tabu@spreadtarget\relax
\def\csname tabu@X\the\tabu@X@cols\endcsname{\strip@pt\tabu@X@sum}}%
- \let\@halignto \relax
+ \let\tabu@halignto \relax
\aftergroup \tabu@prep@TRIAL
\fi
}% \tabu@rewrite@Xspread
@@ -435,7 +441,7 @@
\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@firstclinetrue #1\bgroup}%
+ \let\@halignto\tabu@halignto \tabu@firstcline #1\bgroup}%
\toks@{\let\@preamble\tabu@savedpreamble}% <required for multicolumn>
\tabu@collect
}% \tabu@arrayleft@measure
@@ -577,63 +583,6 @@
\box\tabu@box
\egroup % end of \vtop (measure)
}% \tabu@spread@endhbox
-\def\tabu@tabudecimal#1{%
- \def\tabu@decimal{#1}\@temptokena{}%
- \let\tabu@getdecimal@ \tabu@getdecimal@ignorespaces
- \tabu@scandecimal
-}% \tabudecimal
-\def\tabu@scandecimal{\futurelet \tabu@temp \tabu@getdecimal@}
-\def\tabu@skipdecimal#1{#1\tabu@scandecimal}
-\def\tabu@getdecimal@ignorespaces{%
- \ifcase 0\ifx\tabu@temp\ignorespaces\else
- \ifx\tabu@temp\@sptoken1\else
- 2\fi\fi\relax
- \let\tabu@getdecimal@ \tabu@getdecimal
- \expandafter\tabu@skipdecimal
- \or \expandafter\tabu@gobblespace\expandafter\tabu@scandecimal
- \else \expandafter\tabu@skipdecimal
- \fi
-}% \tabu@getdecimal@ignorespaces
-\def\tabu@get@decimal#1{\@temptokena\expandafter{\the\@temptokena #1}%
- \tabu@scandecimal}
-\def\do#1{%
- \def\tabu@get@decimalspace#1{%
- \@temptokena\expandafter{\the\@temptokena #1}\tabu@scandecimal}%
-}\do{ }
-\def\tabu@getdecimal{%
- \ifcase 0\ifx 0\tabu@temp\else
- \ifx 1\tabu@temp\else
- \ifx 2\tabu@temp\else
- \ifx 3\tabu@temp\else
- \ifx 4\tabu@temp\else
- \ifx 5\tabu@temp\else
- \ifx 6\tabu@temp\else
- \ifx 7\tabu@temp\else
- \ifx 8\tabu@temp\else
- \ifx 9\tabu@temp\else
- \ifx .\tabu@temp\else
- \ifx ,\tabu@temp\else
- \ifx -\tabu@temp\else
- \ifx +\tabu@temp\else
- \ifx e\tabu@temp\else
- \ifx E\tabu@temp\else
- \ifx\tabu@cellleft\tabu@temp1\else
- \ifx\ignorespaces\tabu@temp1\else
- \ifx\@sptoken\tabu@temp2\else
- 3\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\relax
- \expandafter\tabu@get@decimal
- \or \expandafter\tabu@skipdecimal
- \or \expandafter\tabu@get@decimalspace
- \else\expandafter\tabu@printdecimal
- \fi
-}% \tabu@getdecimal
-\def\tabu@printdecimal{%
- \edef\tabu@temp{\the\@temptokena}%
- \ifx\tabu@temp\@empty\else
- \ifx\tabu@temp\space\else
- \expandafter\tabu@decimal\expandafter{\the\@temptokena}%
- \fi\fi
-}% \tabu@printdecimal
\newcommand*\tabuvline@rewrite[1][]{\tabuvline@arg{#1}%
\expandafter \NC@find \tabu@temp}
\def\tabu@vline#1{\vrule width#1}
@@ -670,14 +619,16 @@
\def\tabuvlines@find#1|{\NC@{#1}}
\def\tabu@firstcline{%
\tabu@firstclinetrue
- \let\tabu@everycr\everycr
- \def\tabu@restoreeverycr{\let\everycr\tabu@everycr}%
+ \let\tabu@everycr \everycr
+ \def\tabu@restoreeverycr {\let\everycr\tabu@everycr}%
\def\everycr{\afterassignment\tabu@restoreeverycr\@temptokena}% <for ialign>
\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}}
\def\tabu@linedash{4pt}% <default value>
\def\tabu@dashgap{4pt}% <default value>
\def\tabucline{\noalign{\ifnum0=`}\fi\@ifstar
@@ -694,7 +645,7 @@
\toks@\expandafter{\the\toks@ &}}%
\loop
\toks@\expandafter{\the\toks@ \omit }%
- \ifcase 0\if@tempswa\else\ifnum \@multicnt>\tabu@start 1\fi\fi\relax
+ \ifnum \@multicnt=\@ne
\expandafter \tabu@add \csname tabu@tok@\the\@multicnt L\endcsname \@nil
\fi
\ifcase 0\if@tempswa\else\ifnum \@multicnt<\tabu@stop 1\fi\fi\relax
@@ -734,8 +685,8 @@
\ifx\@tempa\hbox \tabu@defleaders{#1}\else
\ifx\@tempa\box \tabu@defleaders{#1}\else
\ifx\@tempa\copy \tabu@defleaders{#1}\else
- \ifcsname tabu@line@style@\string#1\endcsname
- \csname tabu@line@style@\string#1\endcsname
+ \ifcsname tabu@line@style@\detokenize{#1}\endcsname
+ \csname tabu@line@style@\detokenize{#1}\endcsname
\else \tabu@getline{#1\p@ on0pt off0pt}\fi\fi\fi\fi\fi
}% \tabu@getlinespec
\def\tabu@defleaders#1{%
@@ -778,11 +729,11 @@
\ifdim\@tempdimc>\z@
\hbox\bgroup \kern\the\dimexpr\@tempdimc/2\relax\fi
\noexpand\iftabu@firstcline
- \vrule depth\the\@tempdima
+ \vrule depth\dimexpr\the\@tempdima
\ifdim\@tempdimb>\z@ width\the\@tempdimb\fi
\noexpand\else
\vrule height\dimexpr-\extrarowheight+\the\@tempdima
- depth\extrarowheight
+ depth\dimexpr\extrarowheight
\ifdim\@tempdimb>\z@ width\the\@tempdimb\fi
\noexpand\fi
\ifdim\@tempdimc>\z@
@@ -812,7 +763,7 @@
\def\tabulinestyle#1{\@for\@tempa:=#1\do{\expandafter\tabu@linestyle\@tempa==\@nil}}
\def\tabu@linestyle#1=#2=#3\@nil{%
\begingroup \tabu@getlinespec {#2}\expandafter\gdef
- \csname tabu@line@style@\string#1\expandafter\endcsname
+ \csname tabu@line@style@\detokenize{#1}\expandafter\endcsname
\expandafter{\expandafter\def\expandafter\tabu@xleaders
\expandafter{\tabu@xleaders}}%
\endgroup
@@ -836,6 +787,63 @@
\tabu@verb #1\tabu@s@nitizetext}
\long\def\tabu@s@nitizetext#1{\@makeother\{\@makeother\}%
\everyeof{\noexpand}\scantokens{#1}\endgroup}
+\def\tabu@tabudecimal#1{%
+ \def\tabu@decimal{#1}\@temptokena{}%
+ \let\tabu@getdecimal@ \tabu@getdecimal@ignorespaces
+ \tabu@scandecimal
+}% \tabudecimal
+\def\tabu@scandecimal{\futurelet \tabu@temp \tabu@getdecimal@}
+\def\tabu@skipdecimal#1{#1\tabu@scandecimal}
+\def\tabu@getdecimal@ignorespaces{%
+ \ifcase 0\ifx\tabu@temp\ignorespaces\else
+ \ifx\tabu@temp\@sptoken1\else
+ 2\fi\fi\relax
+ \let\tabu@getdecimal@ \tabu@getdecimal
+ \expandafter\tabu@skipdecimal
+ \or \expandafter\tabu@gobblespace\expandafter\tabu@scandecimal
+ \else \expandafter\tabu@skipdecimal
+ \fi
+}% \tabu@getdecimal@ignorespaces
+\def\tabu@get@decimal#1{\@temptokena\expandafter{\the\@temptokena #1}%
+ \tabu@scandecimal}
+\def\do#1{%
+ \def\tabu@get@decimalspace#1{%
+ \@temptokena\expandafter{\the\@temptokena #1}\tabu@scandecimal}%
+}\do{ }
+\def\tabu@getdecimal{%
+ \ifcase 0\ifx 0\tabu@temp\else
+ \ifx 1\tabu@temp\else
+ \ifx 2\tabu@temp\else
+ \ifx 3\tabu@temp\else
+ \ifx 4\tabu@temp\else
+ \ifx 5\tabu@temp\else
+ \ifx 6\tabu@temp\else
+ \ifx 7\tabu@temp\else
+ \ifx 8\tabu@temp\else
+ \ifx 9\tabu@temp\else
+ \ifx .\tabu@temp\else
+ \ifx ,\tabu@temp\else
+ \ifx -\tabu@temp\else
+ \ifx +\tabu@temp\else
+ \ifx e\tabu@temp\else
+ \ifx E\tabu@temp\else
+ \ifx\tabu@cellleft\tabu@temp1\else
+ \ifx\ignorespaces\tabu@temp1\else
+ \ifx\@sptoken\tabu@temp2\else
+ 3\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\relax
+ \expandafter\tabu@get@decimal
+ \or \expandafter\tabu@skipdecimal
+ \or \expandafter\tabu@get@decimalspace
+ \else\expandafter\tabu@printdecimal
+ \fi
+}% \tabu@getdecimal
+\def\tabu@printdecimal{%
+ \edef\tabu@temp{\the\@temptokena}%
+ \ifx\tabu@temp\@empty\else
+ \ifx\tabu@temp\space\else
+ \expandafter\tabu@decimal\expandafter{\the\@temptokena}%
+ \fi\fi
+}% \tabu@printdecimal
\newcommand*\savetabu[1]{\noalign{%
\ifx\\#1\\\tabu@savewarn{}{The tabu will not be saved}\else
\@ifundefined{tabu@save@\string#1}{}{\tabu@savewarn{#1}{Overwritting}}%
@@ -897,9 +905,6 @@
\else
\ifcase \numexpr \count@-\@tempcnta \relax % (case 0): prev. token is left
\advance \tabu@nbcols\@ne
- \ifnum \tabu@nbcols>\@ne
- \expandafter\let\csname tabu@tok@\the\tabu@nbcols L\endcsname \relax
- \fi
\expandafter\let\csname tabu@tok@\the\tabu@nbcols R\endcsname \relax
\expandafter\gdef\expandafter\tabu@global@temp\expandafter{%
\tabu@global@temp \advance\tabu@nbcols\@ne}%
@@ -907,17 +912,21 @@
\tabu@cellrightfalse % <only once>
\tabu@savetok R\tabu@preptokenright
\fi
- \tabu@savetok L\tabu@preptokenleft
+ \ifnum \tabu@nbcols=\@ne
+ \tabu@savetok L% LEFT token is always empty unless >{...}
+ \fi
+ \tabu@preptokenleft
\or % (case 1) previous token is right
\tabu@savetok R\tabu@cellrighttrue
\else % special column: do not change the token
\ifnum \tabu@nbcols>\z@ %special column: always on the right of normal one
+ \tabu@savetok R%
\else % unless this is the very first column (\tabu@nbcols=0)
\advance\tabu@nbcols\@ne \tabu@savetok L\advance\tabu@nbcols\m@ne
\fi
\iftabu@cellright % before-previous token is right
\tabu@cellrightfalse
- \tabu@savetok R\tabu@preptokenright
+ \tabu@preptokenright
\fi
\fi % \ifcase
\fi