diff options
author | Karl Berry <karl@freefriends.org> | 2010-12-30 01:08:01 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2010-12-30 01:08:01 +0000 |
commit | 23e7dcd67bf998e35a72c812629bb8bb5c26d2b5 (patch) | |
tree | 595ded633d6557102bc51bac576ccb5978f6bc2c /Master/texmf-dist | |
parent | 7ddba07a080f5b9d0b7e69f1b0118693fa8d9e9c (diff) |
tabu (29dec10)
git-svn-id: svn://tug.org/texlive/trunk@20877 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist')
-rw-r--r-- | Master/texmf-dist/doc/latex/tabu/README | 2 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/tabu/tabu.pdf | bin | 1594602 -> 1611749 bytes | |||
-rw-r--r-- | Master/texmf-dist/source/latex/tabu/tabu.drv | 8 | ||||
-rw-r--r-- | Master/texmf-dist/source/latex/tabu/tabu.dtx | 443 | ||||
-rw-r--r-- | Master/texmf-dist/source/latex/tabu/tabu.ins | 6 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/tabu/tabu.sty | 229 |
6 files changed, 445 insertions, 243 deletions
diff --git a/Master/texmf-dist/doc/latex/tabu/README b/Master/texmf-dist/doc/latex/tabu/README index 04d554ad065..295162e2b84 100644 --- a/Master/texmf-dist/doc/latex/tabu/README +++ b/Master/texmf-dist/doc/latex/tabu/README @@ -30,7 +30,7 @@ tabu with X columns has a default target if not specified tabu provides facilities to change the font and the alignment in one row (\rowfont), save and restore the preamble and the -tabular parameters (\savetabu, \usetabu). +tabular parameters (\savetabu, \usetabu, \preamble). tabu provides other facilities to align numbers in X columns draw lines with color, dashed or even leaders. Those facilities diff --git a/Master/texmf-dist/doc/latex/tabu/tabu.pdf b/Master/texmf-dist/doc/latex/tabu/tabu.pdf Binary files differindex ac7b1da14f6..4ccbfc46301 100644 --- a/Master/texmf-dist/doc/latex/tabu/tabu.pdf +++ b/Master/texmf-dist/doc/latex/tabu/tabu.pdf diff --git a/Master/texmf-dist/source/latex/tabu/tabu.drv b/Master/texmf-dist/source/latex/tabu/tabu.drv index ffab7fadafe..fb95ecf5af6 100644 --- a/Master/texmf-dist/source/latex/tabu/tabu.drv +++ b/Master/texmf-dist/source/latex/tabu/tabu.drv @@ -8,7 +8,7 @@ %% %% This is a generated file. %% -%% tabu : 2010/12/18 v1.7 - tabu : Flexible LaTeX tabulars +%% tabu : 2010/12/28 v1.8 - tabu : Flexible LaTeX tabulars %% %% This work may be distributed and/or modified under the %% conditions of the LaTeX Project Public License, either @@ -25,8 +25,8 @@ %% \edef\thisfile{\jobname} \def\thisinfo{Flexible \LaTeX{} tabulars (\FC)} -\def\thisdate{2010/12/18} -\def\thisversion{1.7} +\def\thisdate{2010/12/28} +\def\thisversion{1.8} \def\CTANbaseurl{http://www.ctan.org/tex-archive/macros/latex} \def\CTANdisplay{CTAN:macros/latex} \makeatletter\protected\def\CTANhref{\@ifstar\CTANhrefstar\CTANhrefnost}\makeatother @@ -72,7 +72,7 @@ pdfsubject={a simple line parser for TeX}, pdfauthor={Florent CHERVET}, colorlinks,linkcolor=reflink,urlcolor=CornflowerBlue, - pdfstartview=FitH,pdfpagemode=UseOutLines, + pdfstartview=FitH,pdfpagemode=UseOutlines, pdfkeywords={tex, e-tex, latex, package, tabular, array, halign, tabularx, longtable, color, colortbl, alignment}, } \embedfile{\thisfile.dtx} diff --git a/Master/texmf-dist/source/latex/tabu/tabu.dtx b/Master/texmf-dist/source/latex/tabu/tabu.dtx index e11d3ce94b7..5f090403340 100644 --- a/Master/texmf-dist/source/latex/tabu/tabu.dtx +++ b/Master/texmf-dist/source/latex/tabu/tabu.dtx @@ -1,5 +1,5 @@ % \iffalse meta-comment -% tabu : 2010/12/18 v1.7 - tabu: flexible LaTeX tabulars] +% tabu : 2010/12/28 v1.8 - tabu: flexible LaTeX tabulars] % % This work may be distributed and/or modified under the % conditions of the LaTeX Project Public License, either @@ -36,7 +36,7 @@ \input docstrip.tex \Msg{************************************************************************} \Msg{* Installation} -\Msg{* Package: 2010/12/18 v1.7 - tabu: Flexible LaTeX tabulars} +\Msg{* Package: 2010/12/28 v1.8 - tabu: Flexible LaTeX tabulars} \Msg{************************************************************************} \keepsilent @@ -47,7 +47,7 @@ This is a generated file. -tabu : 2010/12/18 v1.7 - tabu : Flexible LaTeX tabulars +tabu : 2010/12/28 v1.8 - tabu : Flexible LaTeX tabulars This work may be distributed and/or modified under the conditions of the LaTeX Project Public License, either @@ -98,8 +98,8 @@ Copyright (C) 2010 by Florent Chervet <florent.chervet@free.fr> %<*driver> \edef\thisfile{\jobname} \def\thisinfo{Flexible \LaTeX{} tabulars (\FC)} -\def\thisdate{2010/12/18} -\def\thisversion{1.7} +\def\thisdate{2010/12/28} +\def\thisversion{1.8} \def\CTANbaseurl{http://www.ctan.org/tex-archive/macros/latex} \def\CTANdisplay{CTAN:macros/latex} \makeatletter\protected\def\CTANhref{\@ifstar\CTANhrefstar\CTANhrefnost}\makeatother @@ -145,7 +145,7 @@ Copyright (C) 2010 by Florent Chervet <florent.chervet@free.fr> pdfsubject={a simple line parser for TeX}, pdfauthor={Florent CHERVET}, colorlinks,linkcolor=reflink,urlcolor=CornflowerBlue, - pdfstartview=FitH,pdfpagemode=UseOutLines, + pdfstartview=FitH,pdfpagemode=UseOutlines, pdfkeywords={tex, e-tex, latex, package, tabular, array, halign, tabularx, longtable, color, colortbl, alignment}, } \embedfile{\thisfile.dtx} @@ -155,7 +155,7 @@ Copyright (C) 2010 by Florent Chervet <florent.chervet@free.fr> %</driver> % \fi % -% \CheckSum{4479} +% \CheckSum{4626} % % \CharacterTable % {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z @@ -273,8 +273,9 @@ Copyright (C) 2010 by Florent Chervet <florent.chervet@free.fr> % }\expandafter\thisyear\thisdate\@nil % } % \renewrobustcmd\declcs[2][]{^^A -% \par\addvspace\parskip -% \needspace{\bottomtitlespace}% +% \if@nobreak \par\nobreak +% \else \par\addvspace\parskip +% \needspace{\bottomtitlespace}\fi % \noindent\changefont{size+=2.5pt,spread=1,fam=\ttdefault}^^A % \hspace{-\leftmargini}^^A % \def\*{\unskip\,\texttt{*}}^^A @@ -365,15 +366,13 @@ Copyright (C) 2010 by Florent Chervet <florent.chervet@free.fr> % \newrobustcmd*\@@stform[2][\string]{\textttbf{#1#2}\Xspace} % \newrobustcmd\Xspace{\ifnum\catcode`\ =\active\else\expandafter\xspace\fi} % -% % \makeatother % -% % \deffootnote{1em}{0pt}{\rlap{\textsuperscript{\thefootnotemark}}\kern1em} % -% \title{\vspace*{-28pt}\mdseries {\HUGE\bfseries\sffamily t\,a\,b\,u\,}\vspace*{6pt}} +% \title{\vspace*{-28pt}\href{http://www.tex.ac.uk/tex-archive/help/Catalogue/entries/tabu.html}{\HUGE\bfseries\sffamily t\,a\,b\,u}\vspace*{6pt}} % \date{} -% \author{\small\thisdate~--~version \thisversion} +% \author{\small\thisdate~--~\hyperref[\thisversion]{version \thisversion}} % \subtitle{\begin{tabu}{X[c]} tabu\, and\, longtabu \\[1ex] \LARGE Flexible \LaTeX{} tabulars\\ \small\FC \end{tabu}\vspace*{-12pt}} % \maketitle % @@ -517,6 +516,10 @@ Copyright (C) 2010 by Florent Chervet <florent.chervet@free.fr> % The line spec can also be defined with \cs{tabulinestyle} % \\ % \csref{tabulinestyle}\M*{name=spec,...} & Defines a line style for use with \cs{tabucline} +% \\ \tabucline[dash]- +% \begin{tabu}{@{}X[-1]} \csref{tracingtabu} \\ \cs{tracingtabu}=2\end{tabu} & +% Reports informations in the \xext{log} file about the steps of the algorithm for \textt{tabu X} columns, +% and the informations saved by \cs{savetabu}. % \\ \bottomrule % \end{tabu} % @@ -600,11 +603,11 @@ Copyright (C) 2010 by Florent Chervet <florent.chervet@free.fr> % \textt{longtabu} enhances the possibilities of \textt{longtable} with the possibility to use \textt{X columns} % and line specification for \hyperref[Vertical lines]{vertical rules}. \textt{longtabu} is thus much easier than % \Xpackage{ltxtable}. +% \goodbreak % -% The following commands provided for \textt{tabu} does not work with \textt{longtabu}: -% +% The following commands provided for \textt{tabu} does not work with \textt{longtabu}:\par\nobreak % \let\theadfont\bfseries -% \begin{longtabu}{X[-1]*2{X[-1c]}X} \toprule +% \begin{tabu}{X[-1]*2{X[-1c]}X} \toprule % \rowfont[c]{\bfseries} \textt{tabu} command &\thead{Not \\available} &\thead{Not \\implemented} &Comment \\\tabucline[dash]- % \csref{tabucline} & &\AsteriskRoundedEnds &\cs{tabucline} does not care of page breaks presently: use \cs{hline} instead. \\ % \csref{usetabu} &\CheckFAIL & &but \csref{savetabu} and \csref{preamble} work. \\ @@ -612,7 +615,7 @@ Copyright (C) 2010 by Florent Chervet <florent.chervet@free.fr> % \xpackage{delarray} shortcuts &\CheckFAIL & &a delimiter cannot be spanned over pages... \\ % \csref{tabuphantomline} &\CheckFAIL & &useless inside \textt{longtabu} % \\\bottomrule -% \end{longtabu} +% \end{tabu} % % However, \textt{tabu X} columns, \csref{rowfont}, \csref{verbatim} and \csref{tabudecimal} work inside \textt{longtabu}. % @@ -635,10 +638,12 @@ Copyright (C) 2010 by Florent Chervet <florent.chervet@free.fr> % $2.5 \times \left(\text{the width of the second column}\right)$ then it will be narrowed down to this natural width. % \textbf{The following \textt{tabu}{\smaller s} have the same preamble:} \\ % \hspace*{1em}\cs{begin}\M*{tabu} to\cs{linewidth}\M*{|X\M*[$-$2.5c]|X\M*[c]|}: \\ -% \begin{tabu} to\linewidth{|X[c,-2.5]|X[c]|} \firsthline \textt{X[$-$2.5]} & \textt X \\ \hline\end{tabu} \\ -% \begin{tabu} to\linewidth{|X[c,-2.5]|X[c]|} \firsthline -% Negativ coefficients make \textt X columns close to standard\par \textt l, \textt c and \textt r columns. -% & \textt X \\ \hline +% \begin{tabu} to\linewidth{|X[c,-2.5]|X[c]|} \tabucline- +% \textt{X[$-$2.5]} & \textt X \\ \tabucline- +% \end{tabu} \\ +% \begin{tabu} to\linewidth{|X[c,-2.5]|X[c]|} \tabucline- +% Negativ coefficients make \textt X columns close to standard\par \textt l, \textt c and \textt r columns. +% & \textt X \\ \tabucline- % \end{tabu} % \item horizontal alignment specification is made easier with\, \texttbf{X[5,r]X[2,c]}\, for example. Vertical % alignment can be specified as well with\, \textt{X[5,r,m]X[2,p,c]}\, (commas are not required, @@ -1127,7 +1132,7 @@ Copyright (C) 2010 by Florent Chervet <florent.chervet@free.fr> % \end{declcs} % % \cs{tabudecimal} can be used in the preamble of a \textt{tabu} before a column specification. -% The \meta{user-macro} is a macro with one parameter that have to be defined before. +% The \meta{user-macro} is a macro with one parameter that has to be defined before. % % \medskip % @@ -1290,6 +1295,9 @@ Copyright (C) 2010 by Florent Chervet <florent.chervet@free.fr> % preamble instead of the usual columns specifications % to restore any previous settings saved with \cs{savetabu}. % The \meta{user-name} must exist otherwise, you get an error. +% \cs{usetabu} is a help to \textbf{make several tabulars of exactly the same shape, same target, +% same preamble.} The only parameter that can be changed is the optional vertical position parameter +% for the whole tabular. % % \cs{usetabu} does not work with \hyperref[sec.longtabu]{\textt{longtabu}}. % @@ -1317,6 +1325,7 @@ Copyright (C) 2010 by Florent Chervet <florent.chervet@free.fr> % \begin{tabu}to .7\linewidth{|XXX|X[c]|} ($db(\savetabu)){mytabu} \tabucline*[on1pt]- % This & is & tabu & package \\ \tabucline*[on1pt]- % \end{tabu} +% \arrayrulecolor{black} % \end{Verb*} % % \begin{center} @@ -1324,9 +1333,9 @@ Copyright (C) 2010 by Florent Chervet <florent.chervet@free.fr> % \begin{tabu}to .7\linewidth{|XXX|X[c]|} \savetabu{mytabu} \tabucline*[myline]- % This & is & tabu & package \\ \tabucline*[myline]- % \end{tabu} +% \arrayrulecolor{black} % \end{center} % -% % \begin{Verb*} % \begin{tabu}{($db(\usetabu)){mytabu}} \tabucline*[on1pt]- % \multicolumn3{|c}{This is tabu} & package \\ \tabucline*[on1pt]- @@ -1341,11 +1350,10 @@ Copyright (C) 2010 by Florent Chervet <florent.chervet@free.fr> % \end{tabu} % \end{center} % +% % If one day you use \textt{tabu}, you will have the idea to restore a \textt{tabu} while modifying its target, % or adding new columns... \cs{savetabu} and \cs{usetabu} have not been thought for this purpose, and you may -% have unexpected results. \cs{usetabu} is a help to get several tabulars of exactly the same shape, same target, -% same preamble. The only parameter that can be changed is the optional vertical position parameter -% for the whole tabular. +% have unexpected results. % % \begin{declcs}{preamble}\M{user-name} % \end{declcs} @@ -1357,7 +1365,7 @@ Copyright (C) 2010 by Florent Chervet <florent.chervet@free.fr> % unless another position is specified. % \item the \textt{tabu} / \textt{longtabu} target width, unless another target is specified. % \end{itemize} -% Any other tabular parameters are not restored. +% Any other tabular parameter is not restored. % % Put \cs{preamble}\M{user-name} alone inside the \textt{tabu} (or \textt{longtabu}) preamble in place of the usual % columns specifications. @@ -1366,7 +1374,19 @@ Copyright (C) 2010 by Florent Chervet <florent.chervet@free.fr> % % \cs{preamble} works with \hyperref[sec.longtabu]{\textt{longtabu}}. % +% Example (continued...): % +% \begin{Verb*} +% \begin{tabu} to\linewidth{($db(\preamble)){mytabu}} \tabucline[1pt off1pt]- +% This &is &tabu &package \\\tabucline[1pt off1pt]- +% \end{tabu} +% \end{Verb*} +% +% \begin{tabu} to\linewidth{\preamble{mytabu}} \tabucline[1pt off1pt]- +% This &is &\textt{tabu} &package \\\tabucline[1pt off1pt]- +% \end{tabu} +% +% \cs{arrayrulecolor}, \cs{tabcolsep} \etc. are not restored from \cs{savetabu}. % % % \section(row font and alignment){Modifying the font and the alignment in one row: \cs{rowfont}} @@ -1394,18 +1414,23 @@ Copyright (C) 2010 by Florent Chervet <florent.chervet@free.fr> % \begin{Verb*} % \begin{tabu}{|X|X[-1]|} \tabucline- % ($db(\rowfont))[c]\bfseries -% This & Is \\ \tabucline[on 2pt,blue]- -% \textt{tabu} & package for \textt{tabu} and \textt{longtabu} \\ \tabucline- +% This &Is \\\tabucline[on 2pt,blue]- +% \xpackage{tabu} &package \\\tabucline[off 2pt blue]- +% ($db(\rowfont))[r]\itshape +% for &\textt{tabu} and \textt{longtabu} \\\tabucline- % \end{tabu} % \end{Verb*} % % \begin{tabu}{|X|X[-1]|}\tabucline- -% \rowfont[c]\bfseries This & Is \\ \tabucline[on 2pt,blue]- -% \textt{tabu} & package for \textt{tabu} and \textt{longtabu} \\ \tabucline- +% \rowfont[c]\bfseries +% This &Is \\\tabucline[on 2pt,blue]- +% \xpackage{tabu} &package \\\tabucline[off 2pt blue]- +% \rowfont[r]\itshape +% for &\textt{tabu} and \textt{longtabu} \\\tabucline- % \end{tabu} % % -% \section(Differences: tabu, tabular, tabularx, longtable){Differences between \textt{tabu}, \textt{tabular}\, \textt{tabularx} and \textt{longtable}} +% \section(Differences: tabu, tabular, tabularx, longtable){Differences between \textt{tabu},\, \textt{tabular},\, \textt{tabularx} and \textt{longtable}} % % \subsection{Paragraph indentation} % @@ -1500,7 +1525,7 @@ Copyright (C) 2010 by Florent Chervet <florent.chervet@free.fr> % % \subsection(Improved rewrite process){Improved process for rewritting columns \textmd{\emph{(for keen readers)}}} % -% Any tabulars that do not split accross pages are made with the following process: +% Any tabular that does not split accross pages is made with the following process: % % \begin{tikzpicture}[ % start chain=going below, every join/.style={->,thin,black,solid},node distance=.5cm and 1cm, @@ -1523,6 +1548,7 @@ Copyright (C) 2010 by Florent Chervet <florent.chervet@free.fr> % \end{tikzpicture} % % For more details, see the \nameref{Flow chart of expansion}. +% \pagebreak % % \cs{@mkpream} works in two times inside a (semi-simple) group: % @@ -1562,7 +1588,7 @@ Copyright (C) 2010 by Florent Chervet <florent.chervet@free.fr> % \UseVerbatim{siunitx} % & % Inside \textt{tabular}: -% \begin{enumerate}[label=\arabic*),topsep=\parskip,itemsep=.5\parskip] +% \begin{enumerate}[label=\arabic*),topsep=\parskip,itemsep=.5\parskip,leftmargin=3em] % \item Rewrite \textt S: not found because inside \M*{...} % \item Rewrite \stform* % \item Rewrite \textt n column defined by package \xpackage{numprint} \\ @@ -1570,7 +1596,7 @@ Copyright (C) 2010 by Florent Chervet <florent.chervet@free.fr> % \end{enumerate} % \vskip1ex % Inside \textt{tabu}: -% \begin{enumerate}[label=\arabic*),itemsep=.5\parskip,topsep=\parskip,parsep=\parskip] +% \begin{enumerate}[label=\arabic*),itemsep=.5\parskip,topsep=\parskip,parsep=\parskip,leftmargin=3em] % \item Rewrite \stform* % \item Rewrite \textt\textbar\ (there is none here) % \interitem \textt{\scshape go back} @@ -1603,10 +1629,10 @@ Copyright (C) 2010 by Florent Chervet <florent.chervet@free.fr> % In fact, a problem may arise in nested \textt{tabu}{\small s} if such a \textt Q column % is defined before the \textt C column... % -% Well, just avoid to nest new column type definitions ! -% +% Well, just avoid to nest new column types definitions ! % % +% \clearpage % \section{The package options} % % \subsection(The debugshow option){The \textt{debugshow} package option} @@ -1727,11 +1753,15 @@ Copyright (C) 2010 by Florent Chervet <florent.chervet@free.fr> % % \section{To do for even better \textt{tabus}} % +% In decreasing order of priority: +% % \nprounddigits{0} % \begin{itemize}[leftmargin=*,label=\ding{223}] -% \item Make double \cs{tabucline} with compatibility with \xpackage{colortbl} \cs{doublerulesepcolor} +% \item Implement \cs{tabulineskiplimit} in a manner close to \xpackage{tabls} \cs{tabulinesep} +% or \xpackage{cellspace} \textt S columns-modifier. +% \item Make double \cs{tabucline} compatible with \xpackage{colortbl} \cs{doublerulesepcolor} % \item Multiple \cs{tabucline} between different columns: extended specs: \\ -% \cs{tabucline}\M*[line spec]\M*{start-stop,start-stop}\M*[line spec]\M*{start-stop} ... +% \cs{tabucline}\M[line spec]\M*{start-stop, start-stop}\M[line spec]\M*{start-stop} ... % \item Presently, \textt{longtabu} with \textt X columns works only if \cs{LTchunksize} is greater than the number of rows. % I compiled a \textt{longtabu} of 56 pages on my PC with \cs{LTchunksize} $ = $ \numprint{2000} without problem. % Presently \cs{LTchunksize} is set to \numprint{10000} during trials when \textt{longtabu} contains \textt{X columns}. @@ -1755,13 +1785,12 @@ Copyright (C) 2010 by Florent Chervet <florent.chervet@free.fr> % \begin{macrocode} %<*package> \NeedsTeXFormat{LaTeX2e}[2005/12/01] -\ProvidesPackage{tabu}[2010/12/18 v1.7 - flexible LaTeX tabulars (FC)] +\ProvidesPackage{tabu}[2010/12/28 v1.8 - flexible LaTeX tabulars (FC)] \RequirePackage{array}[2008/09/09] \RequirePackage{varwidth}[2009/03/30] -\let\DEBUG\@gobble%\message % \end{macrocode} % -% Then minimal catcode acertaining for loading \thispackage in good conditions: +% Minimal catcode acertaining for loading \thispackage in good conditions: % % \begin{macrocode} \AtEndOfPackage{\tabu@AtEnd\let\tabu@AtEnd\@undefined} @@ -1787,14 +1816,18 @@ Copyright (C) 2010 by Florent Chervet <florent.chervet@free.fr> \let\tabu@message \@gobble \let\tabu@message@save \@gobble \let\tabu@debug \@gobble +\let\tabu@timerstart \relax \def\tracingtabu{% \let\tabu@message \message \let\tabu@message@save \tabu@tracing@save + \ifdefined \pdfelapsedtime + \def\tabu@timerstart{\edef\tabu@starttime{\the\pdfelapsedtime}}% + \let\tabu@elapsedtime \tabu@message@etime\fi \@ifnextchar={\tabu@tracing}{}} \def\tabu@tracing{\begingroup\afterassignment\tabu@tr@cing\count@} \def\tabu@tr@cing{\expandafter\endgroup\ifnum\count@>\@ne \let\tabu@debug\message\else\let\tabu@debug\@gobble\fi} -\DeclareOption{debugshow}{\AtEndOfPackage\tracingtabu} +\DeclareOption{debugshow}{\AtEndOfPackage{\tracingtabu\relax}} % \end{macrocode} % \end{macro} % @@ -1841,17 +1874,15 @@ Copyright (C) 2010 by Florent Chervet <florent.chervet@free.fr> \ProcessOptions % \end{macrocode} % -% At Begin Document, we check if a \textt X column has already been defined (\xpackage{tabularx}) -% and if not, we define a new column type \textt X. +% At Begin Document,a fix for \xpackage{arydshln} and \xpackage{colortbl} comptability with \xpackage{delarray} +% shortcuts available inside \textt{tabu}: requirement for this fix is checked by \cs{tabu@fix@arrayright}. % -% Then a fix for \xpackage{arydshln} and \xpackage{colortbl} comptability with \xpackage{delarray} shortcuts -% available inside \textt{tabu}: requirement for this fix is checked by \cs{tabu@fix@arrayright}. +% Then the switch \cs{iftabu@colortbl} is set. % -% Finally the switch \cs{iftabu@colortbl} is set. +% Finally, \cs{longtabu} is defined only if the \xpackage{longtable} package is detected. % % \begin{macrocode} \AtBeginDocument{% - \@ifundefined{NC@rewrite@X}{\newcolumntype{X}{}}{}% new column X if not exists \expandafter\in@ \expandafter\@arrayright\expandafter{\endarray}% \ifin@ \let\tabu@endarray \endarray \else \tabu@fix@arrayright \fi % <fix for colortbl & arydshln (delarray)> @@ -1876,17 +1907,29 @@ Copyright (C) 2010 by Florent Chervet <florent.chervet@free.fr> % % Used only when \textt{tabu X} columns are used with ``\textt{tabu spread}''. % +% \begin{macro}{\tabu@nested} +% +% A counter that stores the deepness of nested \textt{tabu}'s. +% +% \begin{macro}{\tabu@start} +% \begin{macro}{\tabu@stop} +% +% Counters used for \csref{tabucline} to get the starting and ending columns. +% % \begin{macrocode} \newcount \tabu@cnt \newcount \tabu@nbcols \newcount \tabu@X@cols +\newcount \tabu@nested \newcount \tabu@start \newcount \tabu@stop -\newcount \tabu@nested % \end{macrocode} % \end{macro} % \end{macro} % \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} % % % \begin{macro}{\tabu@target} @@ -1896,7 +1939,8 @@ Copyright (C) 2010 by Florent Chervet <florent.chervet@free.fr> % \begin{macro}{\tabu@spreadtarget} % \begin{macro}{\tabu@naturalX} % -% Used only when \textt{tabu X} columns are used with ``\textt{tabu spread}''. +% Used only when \textt{tabu X} columns are used with ``\textt{tabu spread}'', +% or with negativ coefficients. % % \begin{macrocode} \newdimen \tabu@target @@ -1997,48 +2041,75 @@ Copyright (C) 2010 by Florent Chervet <florent.chervet@free.fr> % % \begin{macrocode} \def\tabu@save@decl{% - \toks\count@ = \expandafter{\the\toks\expandafter\count@\@nextchar}% + \toks\count@ =\expandafter{\the\toks\expandafter\count@ \@nextchar}% }% \tabu@save@decl % \end{macrocode} % \end{macro} % % -% \begin{macro}{\tabu@NC@rewrite@X} +% \begin{macro}{\tabu@newcolumntype} % -% This is the rewrite macro for \textt{tabu X} columns. -% Such a column has an optional argument: the width coefficient for the \textt{tabu X} column -% whose default value is 1, and may be some alignments parameters. -% The coefficient is used in the expression: \textt{p\M*{\cs{dimexpr}\meta{coef}\cs{tabucolX}}} +% A helper macro to create new column types for \textt{tabu}. +% +% The column types are not appended to \cs{NC@list} in order to keep them local to \textt{tabu}. +% +% \begin{macro}{\tabu@privatecolumntype} +% +% Columns types defined with \cs{tabu@privatecolumntype} are "mounted" only inside the \cs{@mkpream} group +% of \textt{tabu}. % % \begin{macrocode} -\newcommand\tabu@NC@rewrite@X[1][]{\tabu@rewrite@X{#1}% - \let\@halignto \relax - \expandafter \NC@find \tabucolX@rw} +\def\tabu@newcolumntype #1{% + \expandafter\tabu@new@columntype + \csname NC@find@\string#1\expandafter\endcsname + \csname NC@rewrite@\string#1\endcsname + {#1}% +}% \tabu@newcolumntype +\def\tabu@new@columntype #1#2#3{% + \def#1##1#3{\NC@{##1}}% + \let#2\relax \newcommand*#2% +}% \tabu@new@columntype +\def\tabu@privatecolumntype #1{% + \expandafter\tabu@private@columntype + \csname NC@find@\string#1\expandafter\endcsname + \csname NC@rewrite@\string#1\expandafter\endcsname + \csname tabu@NC@find@\string#1\expandafter\endcsname + \csname tabu@NC@rewrite@\string#1\endcsname + {#1}% +}% \tabu@privatecolumntype +\def\tabu@private@columntype#1#2#3#4{% + \g@addto@macro\tabu@privatecolumns{\let#1#3\let#2#4}% + \tabu@new@columntype#3#4% +}% \tabu@private@columntype +\let\tabu@privatecolumns \@empty % \end{macrocode} % \end{macro} +% \end{macro} % -% The next part of the definition (\cs{tabu@rewrite@X}) can be found page \pageref{tabu X column definition}. % -% \begin{macro}{\tabu@newcolumntype} +% \begin{macro}{X (private column type)} % -% A helper macro to create local new column types for \textt{tabu}. +% This is the rewrite macro for \textt{tabu X} columns. +% Such a column has an optional argument: the width coefficient for the \textt{tabu X} column +% whose default value is 1, and may be some alignments parameters. +% The coefficient is used in the expression: \textt{p\M*{\cs{dimexpr}\meta{coef}\cs{tabucolX}}} % % \begin{macrocode} -\def\tabu@newcolumntype #1{% - \expandafter\def\csname NC@find@\string#1\endcsname##1#1{\NC@{##1}}% - \expandafter\def\csname NC@rewrite@\string#1\endcsname% -}% \tabu@newcolumntype +\tabu@privatecolumntype X[1][]{\tabu@rewrite@X{#1}% + \let\@halignto \relax + \expandafter \NC@find \tabucolX@rw} % \end{macrocode} % \end{macro} % +% The next part of the definition (\cs{tabu@rewrite@X}) can be found page \pageref{tabu X column definition}. % -% \begin{macro}{\usetabu (new column type)} +% \begin{macro}{\usetabu (private column type)} % % \cs{usetabu} is defined as a \textt{tabu} new column type: loaded only inside the \cs{@mkpream} % group inside the \textt{tabu} environment. % % \begin{macrocode} -\tabu@newcolumntype \usetabu #1{% +\tabu@privatecolumntype \usetabu [1]{% \ifx\\#1\\\tabu@saveerr{}\else \@ifundefined{tabu@saved@\string#1} {\tabu@saveerr{#1}} @@ -2049,13 +2120,13 @@ Copyright (C) 2010 by Florent Chervet <florent.chervet@free.fr> % \end{macrocode} % \end{macro} % -% \begin{macro}{\preamble (new column type)} +% \begin{macro}{\preamble (private column type)} % % \cs{preamble} is defined as a \textt{tabu} new column type: loaded only inside the \cs{@mkpream} % group inside the \textt{tabu} environment. % % \begin{macrocode} -\tabu@newcolumntype \preamble #1{% +\tabu@privatecolumntype \preamble [1]{% \ifx\\#1\\\tabu@saveerr{}\else \@ifundefined{tabu@saved@\string#1} {\tabu@saveerr{#1}} @@ -2080,21 +2151,27 @@ Copyright (C) 2010 by Florent Chervet <florent.chervet@free.fr> % % \begin{macrocode} \tabu@newcolumntype \tabu@rewritefirst{% - \tabu@X@cols \z@ \let\NC@rewrite@X \tabu@NC@rewrite@X - \let\tabu@dimexpr \relax \aftergroup \tabu@global@temp - \aftergroup \tabu@restore@NC@list + \tabu@X@cols \z@ + \let\tabu@dimexpr \relax + \let\tabu@savepreamble \relax + \let\NC@rewrite@X \tabu@NC@rewrite@X + \gdef\tabu@global@temp {\tabu@savepreamble}% + \aftergroup \tabu@global@temp + \let\tabu@islast \relax + \tabu@privatecolumns \NC@list{\NC@do\usetabu \NC@do\preamble \NC@do *}% \tabu@lines % defines NC@rewrite@| for tabu only (inside @mkpream group) - %\NC@list\expandafter{\the\NC@list \NC@do X\NC@do\tabu@rewritelast}% -%% \message{NC@list est: \the\NC@list^^J}% \NC@list\expandafter{\the\expandafter\NC@list \expandafter\NC@do \expandafter X% - \tabu@NC@list \NC@do\tabu@rewritelast}% -%% \message{NC@list est: \the\NC@list^^J}% + \tabu@NC@list \NC@do X\NC@do\tabu@rewritemiddle}% \ifcat$\d@llarend\else \let\save@decl \tabu@save@decl \fi % no inversion of tokens in text mode - \NC@find \tabu@rewritelast + \NC@find \tabu@rewritemiddle }% NC@rewrite@\tabu@rewritefirst -\def\tabu@restore@NC@list{\NC@list\expandafter{\tabu@NC@list}} +\def\tabu@savepreamble{% + \gdef\tabu@global@temp{}% + \NC@list\expandafter{\tabu@NC@list}% + \let\tabu@savedpreamble \@preamble +}% \tabu@savepreamble % \end{macrocode} % \end{macro} % @@ -2116,10 +2193,25 @@ Copyright (C) 2010 by Florent Chervet <florent.chervet@free.fr> % group inside the \textt{tabu} environment. % % \begin{macrocode} -\tabu@newcolumntype \tabu@rewritelast{% - \NC@list\expandafter{\tabu@NC@list}% +\tabu@newcolumntype \tabu@rewritemiddle{% + \NC@list\expandafter{\tabu@NC@list \NC@do\tabu@endrewrite \NC@do\tabu@rewritelast}% + \tabu@checklast +}% \NC@rewrite@\tabu@rewritemiddle +\def\tabu@checklast#1\relax{% + \def\tabu@temp{#1}% + \ifx \tabu@temp\tabu@islast + \expandafter\tabu@lastrewrite + \else \let\tabu@islast \tabu@temp + \expandafter\NC@find \expandafter\tabu@rewritelast + \fi + #1\relax +}% \tabu@checklast +\tabu@newcolumntype \tabu@rewritelast{\NC@find \tabu@endrewrite} +\tabu@newcolumntype \tabu@endrewrite{\tabu@checklast} +\def\tabu@lastrewrite{% \let\tabu@next \NC@find \ifx \@halignto\relax % found a X column + \edef\tabu@global@X{\tabu@global@X \tabu@X@cols\the\tabu@X@cols\relax}% \ifx \tabu@halignto\relax % X column measure \tabu@global@Xnested \iftabu@negcoef \aftergroup\tabu@negcoeftrue \fi @@ -2129,15 +2221,15 @@ Copyright (C) 2010 by Florent Chervet <florent.chervet@free.fr> \else \aftergroup \tabu@setup@everycr \ifdim \tabu@target=\z@ \else - \let\tabu@next \tabu@rewritelast \fi % <need \extracolsep ?> + \let\tabu@next \tabu@extracolsep \fi % <need \extracolsep ?> \fi \let\@halignto \tabu@halignto \tabu@next -}% \NC@rewrite@\tabu@rewritelast -\def\tabu@rewritelast{\futurelet\tabu@temp \tabu@rewrite@last} -\def\tabu@rewrite@last{% +}% \tabu@lastrewrite +\def\tabu@extracolsep{\futurelet\tabu@temp \tabu@extracol@sep} +\def\tabu@extracol@sep{% \ifx \tabu@temp\@sptoken - \expandafter\tabu@gobblespace \expandafter\tabu@rewritelast + \expandafter\tabu@gobblespace \expandafter\tabu@extracol@sep \else {\endlinechar\m@ne\scantokens{\let\x |}% \expandafter}\ifx \x\tabu@temp @@ -2148,11 +2240,12 @@ Copyright (C) 2010 by Florent Chervet <florent.chervet@free.fr> \def\tabu@next {\NC@find !{\extracolsep\@flushglue}}\fi\fi \expandafter\tabu@next \fi -}% \tabu@rewritelast -\def\tabu@global@Xnested{\global\expandafter\let - \csname tabu@global@X\the\tabu@nested\endcsname\tabu@global@X - \aftergroup\let \aftergroup\tabu@global@X - \expandafter\aftergroup \csname tabu@global@X\the\tabu@nested\endcsname +}% \tabu@extracol@sep +\def\tabu@global@Xnested{\expandafter\tabu@global@X@nested + \csname tabu@global@X\the\tabu@nested\endcsname} +\def\tabu@global@X@nested#1{% + \global\let#1\tabu@global@X + \aftergroup\let \aftergroup\tabu@global@X \aftergroup#1% }% \tabu@global@Xnested % \end{macrocode} % \end{macro} @@ -2172,7 +2265,7 @@ Copyright (C) 2010 by Florent Chervet <florent.chervet@free.fr> % % \begin{macro}{\tabu@nowrite} % -% A trick (from the \TeX-book to forbidd \cs{write} when a trial is done on the \cs{halign}. +% A trick (from the \TeX-book) to forbidd \cs{write} when a trial is done on the \cs{halign}. % % \begin{macrocode} \def\tabu@nowrite#1#{{\afterassignment}\toks@} @@ -2221,19 +2314,15 @@ Copyright (C) 2010 by Florent Chervet <florent.chervet@free.fr> % % This macro sets the \textt{tabu X} column definition at the beginning of the \textt{tabu} environment. % -% Incidentally, \cs{tabu@X} (number of \textt{tabu X} columns) and \cs{tabu@X@sum} (sum of the width-coefs) are reset to $0$. -% -% The current value of \cs{hfuzz} is stored in \cs{tabu@hfuzz}, with a minimum of $0.1 pt$. -% % \begin{macrocode} \def\tabu@setup{% \tabu@adl@fix \let\endarray \tabu@endarray % <fix> colortbl & arydshln (delarray) - \let\tabu@global@temp \@empty \let\tabu@global@X \@empty + \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 + \else \tabu@timerstart \def\tabu@aligndefault{c}\edef\tabu@hfuzz {\the\hfuzz}% \global\tabu@footnotes{}\aftergroup\the\aftergroup\tabu@footnotes \ifdim\parindent>\z@ \ifx\linewidth\tabudefaulttarget @@ -2248,13 +2337,14 @@ Copyright (C) 2010 by Florent Chervet <florent.chervet@free.fr> \let\@footnotetext \tabu@footnotetext \let\@xfootnotetext \tabu@xfootnotetext \let\@xfootnote \tabu@xfootnote \let\centering \tabu@centering \let\raggedright \tabu@raggedright \let\raggedleft \tabu@raggedleft - \tabu@trivlist %<restore \\=\@centercr inside lists> + \tabu@trivlist %<restore \\=\@normalcr inside lists> \def\tabudecimal {\tabu@tabudecimal}\let\verbatim \tabu@sanitizetext - \let\fbox \tabu@fbox \let\rowfont \tabu@rowfont + \let\fbox \tabu@fbox \let\color@b@x \tabu@color@b@x + \let\rowfont \tabu@rowfont \let\prepnext@tok \tabu@prepnext@tok %<for \rowfont and \tabucline> \everycr{}\let\tabu@everycr \everycr \tabu@spreadfalse \tabu@measuringfalse \tabu@negcoeffalse - \edef\tabu@NC@list{\the\NC@list}\NC@list{\NC@do\tabu@rewritefirst \NC@do *}% + \edef\tabu@NC@list{\the\NC@list}\NC@list{\NC@do \tabu@rewritefirst}% }% \tabu@setup \def\tabu@setup@saveglobal{% \expandafter\xdef\csname tabu@global@\the\tabu@nested\endcsname{% @@ -2289,8 +2379,8 @@ Copyright (C) 2010 by Florent Chervet <florent.chervet@free.fr> \else \expandafter\tabu@begin \fi }% \tabu@sett@rget -\def\tabu@to to{\def\@halignto{to}\tabu@gettarget} -\def\tabu@spread spread{\tabu@spreadtrue\def\@halignto{spread}\tabu@gettarget} +\def\tabu@to to{\def\tabu@halignto{to}\tabu@gettarget} +\def\tabu@spread spread{\tabu@spreadtrue\def\tabu@halignto{spread}\tabu@gettarget} \def\tabu@gettarget {\afterassignment\tabu@linegoaltarget \tabu@target} \def\tabu@linegoaltarget {\futurelet\tabu@temp \tabu@linegoal@target} \def\tabu@linegoal@target {% @@ -2299,14 +2389,13 @@ Copyright (C) 2010 by Florent Chervet <florent.chervet@free.fr> \tabu@begin }% \tabu@linegoal@target \def\tabu@begin #1#{% - \edef\@halignto {\ifdim\tabu@target>\z@ \@halignto\the\tabu@target\fi}% - \let\tabu@halignto \@halignto + \edef\tabu@halignto{\ifdim\tabu@target>\z@ \tabu@halignto\the\tabu@target\fi}% \@testopt \tabu@@begin \tabu@aligndefault #1\@nil }% \tabu@begin \def\tabu@@begin [#1]#2\@nil#3{% \tabu@preparesave{#3}% <for \savetabu> \def\tabu@align {#1}% - \tabu@ [{\tabu@align}]#2{\tabu@rewritefirst #3}% + \tabu@ [\tabu@align]#2{\tabu@rewritefirst #3}% }% \tabu@@begin % \end{macrocode} % \end{macro} @@ -2314,13 +2403,17 @@ Copyright (C) 2010 by Florent Chervet <florent.chervet@free.fr> % % \begin{macro}{\tabu@preparesave} % -% This macro temporarily save the \textt{tabu} preamble and the settings +% This macro temporarily saves the \textt{tabu} preamble and the settings % for \cs{arrayrulewidth}, \cs{extrarowheight} \etc. % % Those values are retrieved by \cs{savetabu}, if invoked inside the \textt{tabu}. % % \begin{macrocode} \def\tabu@preparesave #1{% + \iftabu@colortbl \@temptokena{}% + \tabu@prepare@save\CT@arc@ + \tabu@prepare@save\CT@drsc@ + \fi \edef\tabu@savedparam{% \ifmmode \col@sep \the\arraycolsep \else \col@sep \the\tabcolsep \fi\relax @@ -2329,9 +2422,16 @@ Copyright (C) 2010 by Florent Chervet <florent.chervet@free.fr> \extrarowheight \the\extrarowheight\relax \extratabsurround \the\extratabsurround\relax \def\noexpand\arraystretch {\arraystretch}% - \iftabu@colortbl \minrowclearance\the\minrowclearance\relax \fi}% + \iftabu@colortbl \minrowclearance\the\minrowclearance\relax + \the\@temptokena + \fi}% \def\tabu@savedpream {\edef\tabu@halignto{to\the\tabu@target}\NC@find #1}% }% \tabu@preparesave +\def\tabu@prepare@save #1{% + \ifx\relax#1\else + \@temptokena\expandafter{\the\expandafter\@temptokena + \expandafter\def\expandafter#1\expandafter{#1}}\fi +}% \tabu@prepare@save % \end{macrocode} % \end{macro} % @@ -2619,7 +2719,6 @@ Copyright (C) 2010 by Florent Chervet <florent.chervet@free.fr> \expandafter\let\csname tabu@X\the\tabu@X@cols\endcsname \relax \iftabu@measuring % not the first X column found in preamble \edef\tabu@global@X {\tabu@global@X - \advance\tabu@X@cols \@ne \def\csname tabu@X\the\tabu@X@cols\endcsname {\strip@pt\tabu@X@sum}% \advance\tabu@X@sum \the\tabu@X@sum\relax}% \else % first X column found in preamble @@ -2634,7 +2733,6 @@ Copyright (C) 2010 by Florent Chervet <florent.chervet@free.fr> \fi\fi=\the\tabu@target \on@line, page \the\c@page}\fi \tabu@message{\tabu@titles}% \edef\tabu@global@X {\tabu@global@X - \tabu@X@cols \@ne \def\csname tabu@X1\endcsname{\strip@pt\tabu@X@sum}% \tabu@X@sum \the\tabu@X@sum\relax \tabu@target \the\tabu@target\relax @@ -2686,15 +2784,14 @@ Copyright (C) 2010 by Florent Chervet <florent.chervet@free.fr> \else \tabu@X@sum \z@ \let\tabucolX@align \@empty \let\tabucolX@rw \@empty - \let\tabu@Xmath \@empty \let\tabu@temp \@empty - \tabu@Xparse {}#1\relax\@nnil + \let\tabu@Xmath \@empty \let\tabu@temp \@empty + \tabu@Xparse {}#1,\@nnil \fi }% \tabu@Xarg \def\tabu@Xparse #1{\futurelet\@let@token \tabu@Xtest} \expandafter\def\expandafter\tabu@Xparsespace\space{\tabu@Xparse{}} \def\tabu@Xtest{% \ifcase \ifx \@nnil\@let@token \z@ \else - \ifx \relax\@let@token \m@ne\else \if ,\@let@token \m@ne\else \if p\@let@token 1\else \if m\@let@token 2\else @@ -2709,7 +2806,7 @@ Copyright (C) 2010 by Florent Chervet <florent.chervet@free.fr> \if .\@let@token 11\else \if -\@let@token 11\else \ifcat $\@let@token 12\else - 13\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\relax + 13\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\relax \tabucolX@do \expandafter \remove@to@nnil \or \tabu@Xtype {p}% \or \tabu@Xtype {m}% @@ -2756,7 +2853,7 @@ Copyright (C) 2010 by Florent Chervet <florent.chervet@free.fr> \edef\tabu@temp {\strip@pt\tabu@X@sum \tabucolX}% \edef\tabucolX@rw##1{% \ifx$\tabu@Xmath>{\noexpand\the\toks@ $}\else - \ifx \tabucolXalign\@empty \else + \ifx \tabucolX@align\@empty \else >{\noexpand\the\toks@}\fi\fi \tabucolX@rw{##1}% \ifx$\tabu@Xmath<{$}\fi}% @@ -2789,7 +2886,6 @@ Copyright (C) 2010 by Florent Chervet <florent.chervet@free.fr> % % \begin{macrocode} \def\tabu@prep@TRIAL{% - \let\tabu@savedpreamble \@preamble \begingroup \iffalse{\fi \ifnum0=`}\fi \tabu@setup@TRIAL \tabucolX \tabu@target @@ -2981,8 +3077,8 @@ Copyright (C) 2010 by Florent Chervet <florent.chervet@free.fr> \the\tabu@target\space+ \tabu@hfuzz}% \or \ifdim \tabu@X@sum=\z@ \tabu@measuringtrue \tabucolX=\@tempdima - \else \tabu@message{\tabu@message@arith}% - \advance\tabucolX-\dimexpr(\wd\tabu@box-\tabu@target-\tabu@X@sum/\p@) + \else + \advance\tabucolX-\dimexpr(\wd\tabu@box-\tabu@target-.5\tabu@X@sum/\p@) *\p@/\tabu@X@sum\relax \ifdim \tabucolX<\z@ \tabu@warn{X Columns too narrow (table too wide)}% @@ -3075,7 +3171,7 @@ Copyright (C) 2010 by Florent Chervet <florent.chervet@free.fr> \ifx\@startpbox\tabu@measure@startpbox\tabu@spaces (coefs<0)\else \ifdim\tabu@X@sum>\z@ \expandafter\tabu@msg@align \the\dimexpr(\tabu@target-\wd\tabu@box) - *\p@/\tabu@X@sum\relax {}{}{}{}{}\@@\fi\fi}% + *\p@/\tabu@X@sum\relax {}{}{}{}{}\@@\fi\fi^^J}% \def\tabu@message@spread{\tabu@spreadheader \expandafter\tabu@msg@align \the\tabu@spreadtarget {}{}{}{}{}\@@ \expandafter\tabu@msg@align \the\wd\tabu@box {}{}{}{}{}\@@ @@ -3087,8 +3183,14 @@ Copyright (C) 2010 by Florent Chervet <florent.chervet@free.fr> <\expandafter\tabu@msg@align \the\tabu@target { }{ }{ }{ }{}\@@ + \tabu@hfuzz\space= hfuzz *****^^J% (tabu)\tabu@spaces******* Reached Target: - hfuzz = \tabu@hfuzz\on@line\space *******^^J - \ifnum\tabu@nested=\z@^^J\fi}% + hfuzz = \tabu@hfuzz\on@line\space *******^^J% + \ifnum\tabu@nested=\z@ \tabu@elapsedtime ^^J\fi}% +\def\tabu@message@etime{(tabu)\tabu@spaces + Time elapsed for trials: + \the\numexpr(\pdfelapsedtime-\tabu@starttime-32767)/65536\relax sec + \the\numexpr\numexpr(\pdfelapsedtime-\tabu@starttime) + -\numexpr(\pdfelapsedtime-\tabu@starttime-32767)/65536\relax*65536\relax + *1000/65536\relax ms}% \def\tabu@message@negcoef #1{\tabu@spaces\tabu@spaces * #1. X[-\csname tabu@X#1\endcsname]: natural width = \tabu@wd{#1} @@ -3118,6 +3220,11 @@ Copyright (C) 2010 by Florent Chervet <florent.chervet@free.fr> \def\extratabsurround ####1\relax{(tabu) extratabsurround = ####1^^J}% \def\minrowclearance ####1\relax {(tabu) minrowclearance#1 = ####1^^J}% \def\arraystretch ####1{(tabu) arraystretch #1 #1 = ####1^^J}% + \iftabu@colortbl + \def\CT@arc@####1{(tabu) arrayrulecolor #1 = ####1^^J}% + \def\CT@drsc@####1{(tabu) doublerulesepcolor=####1^^J}% + \let\color \relax + \fi \def\NC@find ####1\@nil{(tabu) tabu preamble#1 #1 = \detokenize{####1}^^J}% \def\tabu@wddef####1####2{(tabu) Natural width ####1 = ####2^^J}% \let\edef \@gobbletwo \let\def \@empty @@ -3411,10 +3518,10 @@ Copyright (C) 2010 by Florent Chervet <florent.chervet@free.fr> \def\tabu@start@stop #1-#2\@nnil{% \@defaultunits \tabu@start \number0#1\relax\@nnil \@defaultunits \tabu@stop \number0#2\relax\@nnil - \ifnum\tabu@start>\tabu@nbcols\tabu@start=\tabu@nbcols\else - \ifnum\tabu@start>\z@\else \tabu@start=\@ne \fi\fi - \ifnum\tabu@stop>\tabu@nbcols \tabu@stop\tabu@nbcols \else - \ifnum\tabu@stop>\z@\else \tabu@stop=\tabu@nbcols \fi\fi + \ifnum\tabu@start>\tabu@nbcols\tabu@start \tabu@nbcols\else + \ifnum\tabu@start<\@ne \tabu@start \@ne \fi\fi + \ifnum\tabu@stop>\tabu@nbcols \tabu@stop \tabu@nbcols \else + \ifnum\tabu@stop<\@ne \tabu@stop \tabu@nbcols\fi\fi }% \tabu@start@stop % \end{macrocode} % \end{macro} @@ -3666,19 +3773,13 @@ Copyright (C) 2010 by Florent Chervet <florent.chervet@free.fr> \ifx\\#1\\\tabu@savewarn{}{The tabu will not be saved}\else \@ifundefined{tabu@saved@\string#1}{}{\tabu@savewarn{#1}{Overwritting}}% {% - \toks0\expandafter{\@preamble}% + \toks0\expandafter{\tabu@savedpreamble}% \toks1\expandafter{\tabu@savedparam}% \toks2\expandafter{\tabu@savedpream}% - \iftabu@colortbl - \toks3\expandafter{\expandafter\gdef\expandafter\CT@arc@ - \expandafter{\CT@arc@}}% - \toks3\expandafter{\the\toks\expandafter3 - \expandafter\gdef\expandafter\CT@drsc@\expandafter{\CT@drsc@}}% - \else \toks3{}% - \fi + \toks3{}% \iftabu@negcoef \edef\tabu@savewd{\tabu@savewd{\number\numexpr1}}% - \toks3\expandafter{\the\toks\expandafter3\tabu@savewd}\fi + \toks3\expandafter{\tabu@savewd}\fi \expandafter\xdef\csname tabu@saved@\string#1\endcsname##1{% \noexpand\ifcase##1\relax \noexpand\ifdim\tabu@target>\z@ @@ -3872,7 +3973,7 @@ Copyright (C) 2010 by Florent Chervet <florent.chervet@free.fr> \ifnum \count@<\z@ % <first initialisation> \@tempcnta \@M % <not initialized by array.sty> \tabu@nbcols\z@ - \gdef\tabu@global@temp{\tabu@nbcols\z@}% + \xdef\tabu@global@temp{\tabu@global@temp \tabu@nbcols\z@}% \expandafter\let\csname tabu@tok@1L\endcsname \relax \tabu@cellrightfalse \else @@ -4105,10 +4206,9 @@ Copyright (C) 2010 by Florent Chervet <florent.chervet@free.fr> % \end{macro} % % -% % \subsection{Utilities} % -% \subsubsection{tabu \cs{fbox}} +% \subsubsection{\textt{tabu} \cs{fbox}} % % \cs{tabu@fbox} works exactly like \LaTeX{} \cs{fbox} but allows the syntax: \cs{fbox}\cs{bgroup}...\cs{egroup} % suitable for use inside tabular columns. \cs{fbox} is \cs{let} to \cs{tabu@fbox} at the entry inside a \textt{tabu} @@ -4120,10 +4220,36 @@ Copyright (C) 2010 by Florent Chervet <florent.chervet@free.fr> \let\color@bgroup\bgroup \def\color@egroup{\endgraf\egroup}% \afterassignment\tabu@begin@fbox - \setbox\@tempboxa \hbox + \setbox\@tempboxa \hbox }% \tabu@fbox \def\tabu@begin@fbox{\color@bgroup\kern\fboxsep\aftergroup\tabu@end@fbox} -\def\tabu@end@fbox{\kern\fboxsep\color@egroup\@frameb@x\relax} +\def\tabu@end@fbox{\kern\fboxsep \color@egroup \@frameb@x\relax} +% \end{macrocode} +% +% \subsubsection{\textt{tabu} \cs{fcolorbox}} +% +% \cs{tabu@fcolorbox} works exactly like \xpackage{xcolor} \cs{fcolorbox} but allows the syntax: +% +% \cs{fcolorbox}\M*{frame color}\M*{background color}\cs{bgroup}...\cs{egroup} +% +% suitable for use insed tabular columns. \cs{fcolorbox} is \cs{let} to \cs{tabu@fcolorbox} at the entry inside a \textt{tabu} +% environment. +% +% \begin{macrocode} +\def\tabu@color@b@x#1#2{\leavevmode + \def\tabu@do@color@b@x{#1{#2\color@block{\wd\z@}{\ht\z@}{\dp\z@}\box\z@}}% + \afterassignment\tabu@begin@color@b@x + \setbox\z@ \hbox +}% \tabu@color@b@x +\def\tabu@begin@color@b@x{% + \bgroup \kern\fboxsep \set@color + \aftergroup\tabu@end@color@b@x +}% \tabu@begin@color@b@x +\def\tabu@end@color@b@x{\kern\fboxsep \egroup + \dimen@\ht\z@\advance\dimen@\fboxsep\ht\z@\dimen@ + \dimen@\dp\z@\advance\dimen@\fboxsep\dp\z@\dimen@ + \tabu@do@color@b@x +}% \tabu@end@color@b@x % \end{macrocode} % % @@ -4132,14 +4258,12 @@ Copyright (C) 2010 by Florent Chervet <florent.chervet@free.fr> % Inside \textt{tabu} environment, no need to add \cs{arraybackslash} after these commands. % % \begin{macrocode} -\expandafter\def\expandafter\tabu@centering\expandafter{% - \centering\arraybackslash} -\expandafter\def\expandafter\tabu@raggedleft\expandafter{% - \raggedleft\arraybackslash} -\expandafter\def\expandafter\tabu@raggedright\expandafter{% - \raggedright\arraybackslash} +\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@trivlist{\expandafter\def\expandafter\@trivlist\expandafter{% - \expandafter\let\expandafter\\\expandafter\@centercr\@trivlist}}% + \expandafter\let\expandafter\\\expandafter\@normalcr\@trivlist}}% % \end{macrocode} % % @@ -4288,12 +4412,23 @@ Copyright (C) 2010 by Florent Chervet <florent.chervet@free.fr> % % \sectionformat\subsection[hang]{font=\large\bfseries\macrocodecolor} % -% \begin{Version}{2010/12/18 v1.7} +% \begin{Version}{2010/12/28 v1.8}\HistLabel{1.8} +% \item \csref{tracingtabu} / \hyperref[debugshow]{\textt{debugshow}} package option:\\ +% reporting of the time elapsed during trials (if \cs{pdfelapsedtime} and thus \hologo{pdfTeX} is available) \\ +% Slight modifications for better reporting on the \xext{log} file. +% \item Fix a bug when \csref{savetabu} is used after \cs{multicolumn} (\cs{multicolumn} globally redefines \cs{@preamble}). +% \item Fix a bug with \csref{tabucline} and \cs{CT@arc@} (\xpackage{colortbl}). +% \item Better privacy of columns types specifically defined for \textt{tabu}. +% \item Improvement in the rewritting process (but only very few people should notice...) +% \item Documentation. +% \end{Version} +% +% \begin{Version}{2010/12/18 v1.7}\HistLabel{1.7} % \item Code optimisation % \item Modification in the columns rewritting process (bug with some new column types defined by the user). % \end{Version} % -% \begin{Version}{2010/12/07 v1.5} +% \begin{Version}{2010/12/07 v1.5}\HistLabel{1.5} % \item Implementation of negativ width coefficients for \textt X columns (cf. \refitem{tabu X columns,2}[\nameref*{tabu X columns} point \ref]). % \item Columns natural widths computation (for \textt{tabu spread} with \textt X columns and negativ coefficients) % is based on the code of the \xpackage{varwidth} package by Donald Arseneau. @@ -4309,7 +4444,7 @@ Copyright (C) 2010 by Florent Chervet <florent.chervet@free.fr> % \item Optimisation of some parts of the code. % \end{Version} % -% \begin{Version}{2010/11/22 v1.4} +% \begin{Version}{2010/11/22 v1.4}\HistLabel{1.4} % \item Compatibility improvement with \xpackage{linegoal} for the syntax: \\ % \cs{begin}\M*{tabu}\textt{ to\cs{linegoal}}\M*{...} % \item Hyper footnotes now work correctly. @@ -4319,8 +4454,7 @@ Copyright (C) 2010 by Florent Chervet <florent.chervet@free.fr> % vertical dashed lines (\xpackage{arydshln}) inside \textt{tabu spread} with \textt X columns. % \end{Version} % -% \begin{Version}{2010/11/18 v1.3} -% \item Documentation. +% \begin{Version}{2010/11/18 v1.3}\HistLabel{1.3} % \item Fix a bug that may appear in \cs{tabucline} depending on the preamble due to arbitrary \cs{countdef}. % \item Improvement in the use of \cs{everycr}: no \cs{global} stuff. Thus bug fixed when nesting \textt{tabu} % inside \hologo{AmS}-\textt{align} environment for example. Same issue with \cs{rowfont} which now works @@ -4329,16 +4463,17 @@ Copyright (C) 2010 by Florent Chervet <florent.chervet@free.fr> % (required with \cs{multicolumn} in some cases). % \item Improvement on vertical alignment. % \item To do: an example file to test a wide range of possibilities... +% \item Documentation. % \end{Version} % -% \begin{Version}{2010/11/15 v1.2} +% \begin{Version}{2010/11/15 v1.2}\HistLabel{1.2} % \item Improvement in parameters parsing for optional parameters (\textt\textbar\ and \cs{tabucline}). % \item Modification / optimization in \cs{tabu@prepnext@tok}. % \item Modification of \cs{tabucline} to get better results with \textt m columns (\textt{X[m]}) % and also when \cs{minrowclearance} $>0$ (package \xpackage{colortbl}). % \end{Version} % -% \begin{Version}{2010/10/28 v1.1} +% \begin{Version}{2010/10/28 v1.1}\HistLabel{1.1} % \item First version. % \end{Version} % diff --git a/Master/texmf-dist/source/latex/tabu/tabu.ins b/Master/texmf-dist/source/latex/tabu/tabu.ins index b83c61086ed..d4dde6e930d 100644 --- a/Master/texmf-dist/source/latex/tabu/tabu.ins +++ b/Master/texmf-dist/source/latex/tabu/tabu.ins @@ -8,7 +8,7 @@ %% %% This is a generated file. %% -%% tabu : 2010/12/18 v1.7 - tabu : Flexible LaTeX tabulars +%% tabu : 2010/12/28 v1.8 - tabu : Flexible LaTeX tabulars %% %% This work may be distributed and/or modified under the %% conditions of the LaTeX Project Public License, either @@ -26,7 +26,7 @@ \input docstrip.tex \Msg{************************************************************************} \Msg{* Installation} -\Msg{* Package: 2010/12/18 v1.7 - tabu: Flexible LaTeX tabulars} +\Msg{* Package: 2010/12/28 v1.8 - tabu: Flexible LaTeX tabulars} \Msg{************************************************************************} \keepsilent @@ -37,7 +37,7 @@ This is a generated file. -tabu : 2010/12/18 v1.7 - tabu : Flexible LaTeX tabulars +tabu : 2010/12/28 v1.8 - tabu : Flexible LaTeX tabulars This work may be distributed and/or modified under the conditions of the LaTeX Project Public License, either diff --git a/Master/texmf-dist/tex/latex/tabu/tabu.sty b/Master/texmf-dist/tex/latex/tabu/tabu.sty index 76b129c0a6d..b123d51ce9b 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/12/18 v1.7 - tabu : Flexible LaTeX tabulars +%% tabu : 2010/12/28 v1.8 - tabu : Flexible LaTeX tabulars %% %% This work may be distributed and/or modified under the %% conditions of the LaTeX Project Public License, either @@ -25,10 +25,9 @@ %% \NeedsTeXFormat{LaTeX2e}[2005/12/01] -\ProvidesPackage{tabu}[2010/12/18 v1.7 - flexible LaTeX tabulars (FC)] +\ProvidesPackage{tabu}[2010/12/28 v1.8 - flexible LaTeX tabulars (FC)] \RequirePackage{array}[2008/09/09] \RequirePackage{varwidth}[2009/03/30] -\let\DEBUG\@gobble%\message \AtEndOfPackage{\tabu@AtEnd\let\tabu@AtEnd\@undefined} \let\tabu@AtEnd\@empty \def\TMP@EnsureCode#1#2{% @@ -45,14 +44,18 @@ \let\tabu@message \@gobble \let\tabu@message@save \@gobble \let\tabu@debug \@gobble +\let\tabu@timerstart \relax \def\tracingtabu{% \let\tabu@message \message \let\tabu@message@save \tabu@tracing@save + \ifdefined \pdfelapsedtime + \def\tabu@timerstart{\edef\tabu@starttime{\the\pdfelapsedtime}}% + \let\tabu@elapsedtime \tabu@message@etime\fi \@ifnextchar={\tabu@tracing}{}} \def\tabu@tracing{\begingroup\afterassignment\tabu@tr@cing\count@} \def\tabu@tr@cing{\expandafter\endgroup\ifnum\count@>\@ne \let\tabu@debug\message\else\let\tabu@debug\@gobble\fi} -\DeclareOption{debugshow}{\AtEndOfPackage\tracingtabu} +\DeclareOption{debugshow}{\AtEndOfPackage{\tracingtabu\relax}} \let\tabudefaulttarget \linewidth \DeclareOption{linegoal}{% \AtEndOfPackage{% @@ -76,7 +79,6 @@ {\string\tabucline\space is not available with option `light'}\@ehd} \ProcessOptions \AtBeginDocument{% - \@ifundefined{NC@rewrite@X}{\newcolumntype{X}{}}{}% new column X if not exists \expandafter\in@ \expandafter\@arrayright\expandafter{\endarray}% \ifin@ \let\tabu@endarray \endarray \else \tabu@fix@arrayright \fi % <fix for colortbl & arydshln (delarray)> @@ -88,9 +90,9 @@ \newcount \tabu@cnt \newcount \tabu@nbcols \newcount \tabu@X@cols +\newcount \tabu@nested \newcount \tabu@start \newcount \tabu@stop -\newcount \tabu@nested \newdimen \tabu@target \newdimen \tabu@spreadtarget \newdimen \tabu@naturalX @@ -108,16 +110,35 @@ \def\tabu@gobbleopt#1{\@ifnextchar [{\tabu@gobble@pt{#1}}{#1}}%] \def\tabu@gobble@pt#1[#2]{#1} \def\tabu@save@decl{% - \toks\count@ = \expandafter{\the\toks\expandafter\count@\@nextchar}% + \toks\count@ =\expandafter{\the\toks\expandafter\count@ \@nextchar}% }% \tabu@save@decl -\newcommand\tabu@NC@rewrite@X[1][]{\tabu@rewrite@X{#1}% - \let\@halignto \relax - \expandafter \NC@find \tabucolX@rw} \def\tabu@newcolumntype #1{% - \expandafter\def\csname NC@find@\string#1\endcsname##1#1{\NC@{##1}}% - \expandafter\def\csname NC@rewrite@\string#1\endcsname% + \expandafter\tabu@new@columntype + \csname NC@find@\string#1\expandafter\endcsname + \csname NC@rewrite@\string#1\endcsname + {#1}% }% \tabu@newcolumntype -\tabu@newcolumntype \usetabu #1{% +\def\tabu@new@columntype #1#2#3{% + \def#1##1#3{\NC@{##1}}% + \let#2\relax \newcommand*#2% +}% \tabu@new@columntype +\def\tabu@privatecolumntype #1{% + \expandafter\tabu@private@columntype + \csname NC@find@\string#1\expandafter\endcsname + \csname NC@rewrite@\string#1\expandafter\endcsname + \csname tabu@NC@find@\string#1\expandafter\endcsname + \csname tabu@NC@rewrite@\string#1\endcsname + {#1}% +}% \tabu@privatecolumntype +\def\tabu@private@columntype#1#2#3#4{% + \g@addto@macro\tabu@privatecolumns{\let#1#3\let#2#4}% + \tabu@new@columntype#3#4% +}% \tabu@private@columntype +\let\tabu@privatecolumns \@empty +\tabu@privatecolumntype X[1][]{\tabu@rewrite@X{#1}% + \let\@halignto \relax + \expandafter \NC@find \tabucolX@rw} +\tabu@privatecolumntype \usetabu [1]{% \ifx\\#1\\\tabu@saveerr{}\else \@ifundefined{tabu@saved@\string#1} {\tabu@saveerr{#1}} @@ -125,7 +146,7 @@ \csname tabu@saved@\string#1\expandafter\endcsname\expandafter\z@}% \fi }% \NC@rewrite@\usetabu -\tabu@newcolumntype \preamble #1{% +\tabu@privatecolumntype \preamble [1]{% \ifx\\#1\\\tabu@saveerr{}\else \@ifundefined{tabu@saved@\string#1} {\tabu@saveerr{#1}} @@ -133,25 +154,46 @@ \fi }% \NC@rewrite@\preamble \tabu@newcolumntype \tabu@rewritefirst{% - \tabu@X@cols \z@ \let\NC@rewrite@X \tabu@NC@rewrite@X - \let\tabu@dimexpr \relax \aftergroup \tabu@global@temp - \aftergroup \tabu@restore@NC@list + \tabu@X@cols \z@ + \let\tabu@dimexpr \relax + \let\tabu@savepreamble \relax + \let\NC@rewrite@X \tabu@NC@rewrite@X + \gdef\tabu@global@temp {\tabu@savepreamble}% + \aftergroup \tabu@global@temp + \let\tabu@islast \relax + \tabu@privatecolumns \NC@list{\NC@do\usetabu \NC@do\preamble \NC@do *}% \tabu@lines % defines NC@rewrite@| for tabu only (inside @mkpream group) - %\NC@list\expandafter{\the\NC@list \NC@do X\NC@do\tabu@rewritelast}% -%% \message{NC@list est: \the\NC@list^^J}% \NC@list\expandafter{\the\expandafter\NC@list \expandafter\NC@do \expandafter X% - \tabu@NC@list \NC@do\tabu@rewritelast}% -%% \message{NC@list est: \the\NC@list^^J}% + \tabu@NC@list \NC@do X\NC@do\tabu@rewritemiddle}% \ifcat$\d@llarend\else \let\save@decl \tabu@save@decl \fi % no inversion of tokens in text mode - \NC@find \tabu@rewritelast + \NC@find \tabu@rewritemiddle }% NC@rewrite@\tabu@rewritefirst -\def\tabu@restore@NC@list{\NC@list\expandafter{\tabu@NC@list}} -\tabu@newcolumntype \tabu@rewritelast{% +\def\tabu@savepreamble{% + \gdef\tabu@global@temp{}% \NC@list\expandafter{\tabu@NC@list}% + \let\tabu@savedpreamble \@preamble +}% \tabu@savepreamble +\tabu@newcolumntype \tabu@rewritemiddle{% + \NC@list\expandafter{\tabu@NC@list \NC@do\tabu@endrewrite \NC@do\tabu@rewritelast}% + \tabu@checklast +}% \NC@rewrite@\tabu@rewritemiddle +\def\tabu@checklast#1\relax{% + \def\tabu@temp{#1}% + \ifx \tabu@temp\tabu@islast + \expandafter\tabu@lastrewrite + \else \let\tabu@islast \tabu@temp + \expandafter\NC@find \expandafter\tabu@rewritelast + \fi + #1\relax +}% \tabu@checklast +\tabu@newcolumntype \tabu@rewritelast{\NC@find \tabu@endrewrite} +\tabu@newcolumntype \tabu@endrewrite{\tabu@checklast} +\def\tabu@lastrewrite{% \let\tabu@next \NC@find \ifx \@halignto\relax % found a X column + \edef\tabu@global@X{\tabu@global@X \tabu@X@cols\the\tabu@X@cols\relax}% \ifx \tabu@halignto\relax % X column measure \tabu@global@Xnested \iftabu@negcoef \aftergroup\tabu@negcoeftrue \fi @@ -161,15 +203,15 @@ \else \aftergroup \tabu@setup@everycr \ifdim \tabu@target=\z@ \else - \let\tabu@next \tabu@rewritelast \fi % <need \extracolsep ?> + \let\tabu@next \tabu@extracolsep \fi % <need \extracolsep ?> \fi \let\@halignto \tabu@halignto \tabu@next -}% \NC@rewrite@\tabu@rewritelast -\def\tabu@rewritelast{\futurelet\tabu@temp \tabu@rewrite@last} -\def\tabu@rewrite@last{% +}% \tabu@lastrewrite +\def\tabu@extracolsep{\futurelet\tabu@temp \tabu@extracol@sep} +\def\tabu@extracol@sep{% \ifx \tabu@temp\@sptoken - \expandafter\tabu@gobblespace \expandafter\tabu@rewritelast + \expandafter\tabu@gobblespace \expandafter\tabu@extracol@sep \else {\endlinechar\m@ne\scantokens{\let\x |}% \expandafter}\ifx \x\tabu@temp @@ -180,11 +222,12 @@ \def\tabu@next {\NC@find !{\extracolsep\@flushglue}}\fi\fi \expandafter\tabu@next \fi -}% \tabu@rewritelast -\def\tabu@global@Xnested{\global\expandafter\let - \csname tabu@global@X\the\tabu@nested\endcsname\tabu@global@X - \aftergroup\let \aftergroup\tabu@global@X - \expandafter\aftergroup \csname tabu@global@X\the\tabu@nested\endcsname +}% \tabu@extracol@sep +\def\tabu@global@Xnested{\expandafter\tabu@global@X@nested + \csname tabu@global@X\the\tabu@nested\endcsname} +\def\tabu@global@X@nested#1{% + \global\let#1\tabu@global@X + \aftergroup\let \aftergroup\tabu@global@X \aftergroup#1% }% \tabu@global@Xnested \newif\iftabu@colortbl \def\tabu@nowrite#1#{{\afterassignment}\toks@} @@ -213,12 +256,12 @@ {longtabu requires the longtable package}\@ehd} \def\tabu@setup{% \tabu@adl@fix \let\endarray \tabu@endarray % <fix> colortbl & arydshln (delarray) - \let\tabu@global@temp \@empty \let\tabu@global@X \@empty + \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 + \else \tabu@timerstart \def\tabu@aligndefault{c}\edef\tabu@hfuzz {\the\hfuzz}% \global\tabu@footnotes{}\aftergroup\the\aftergroup\tabu@footnotes \ifdim\parindent>\z@ \ifx\linewidth\tabudefaulttarget @@ -233,13 +276,14 @@ \let\@footnotetext \tabu@footnotetext \let\@xfootnotetext \tabu@xfootnotetext \let\@xfootnote \tabu@xfootnote \let\centering \tabu@centering \let\raggedright \tabu@raggedright \let\raggedleft \tabu@raggedleft - \tabu@trivlist %<restore \\=\@centercr inside lists> + \tabu@trivlist %<restore \\=\@normalcr inside lists> \def\tabudecimal {\tabu@tabudecimal}\let\verbatim \tabu@sanitizetext - \let\fbox \tabu@fbox \let\rowfont \tabu@rowfont + \let\fbox \tabu@fbox \let\color@b@x \tabu@color@b@x + \let\rowfont \tabu@rowfont \let\prepnext@tok \tabu@prepnext@tok %<for \rowfont and \tabucline> \everycr{}\let\tabu@everycr \everycr \tabu@spreadfalse \tabu@measuringfalse \tabu@negcoeffalse - \edef\tabu@NC@list{\the\NC@list}\NC@list{\NC@do\tabu@rewritefirst \NC@do *}% + \edef\tabu@NC@list{\the\NC@list}\NC@list{\NC@do \tabu@rewritefirst}% }% \tabu@setup \def\tabu@setup@saveglobal{% \expandafter\xdef\csname tabu@global@\the\tabu@nested\endcsname{% @@ -264,8 +308,8 @@ \else \expandafter\tabu@begin \fi }% \tabu@sett@rget -\def\tabu@to to{\def\@halignto{to}\tabu@gettarget} -\def\tabu@spread spread{\tabu@spreadtrue\def\@halignto{spread}\tabu@gettarget} +\def\tabu@to to{\def\tabu@halignto{to}\tabu@gettarget} +\def\tabu@spread spread{\tabu@spreadtrue\def\tabu@halignto{spread}\tabu@gettarget} \def\tabu@gettarget {\afterassignment\tabu@linegoaltarget \tabu@target} \def\tabu@linegoaltarget {\futurelet\tabu@temp \tabu@linegoal@target} \def\tabu@linegoal@target {% @@ -274,16 +318,19 @@ \tabu@begin }% \tabu@linegoal@target \def\tabu@begin #1#{% - \edef\@halignto {\ifdim\tabu@target>\z@ \@halignto\the\tabu@target\fi}% - \let\tabu@halignto \@halignto + \edef\tabu@halignto{\ifdim\tabu@target>\z@ \tabu@halignto\the\tabu@target\fi}% \@testopt \tabu@@begin \tabu@aligndefault #1\@nil }% \tabu@begin \def\tabu@@begin [#1]#2\@nil#3{% \tabu@preparesave{#3}% <for \savetabu> \def\tabu@align {#1}% - \tabu@ [{\tabu@align}]#2{\tabu@rewritefirst #3}% + \tabu@ [\tabu@align]#2{\tabu@rewritefirst #3}% }% \tabu@@begin \def\tabu@preparesave #1{% + \iftabu@colortbl \@temptokena{}% + \tabu@prepare@save\CT@arc@ + \tabu@prepare@save\CT@drsc@ + \fi \edef\tabu@savedparam{% \ifmmode \col@sep \the\arraycolsep \else \col@sep \the\tabcolsep \fi\relax @@ -292,9 +339,16 @@ \extrarowheight \the\extrarowheight\relax \extratabsurround \the\extratabsurround\relax \def\noexpand\arraystretch {\arraystretch}% - \iftabu@colortbl \minrowclearance\the\minrowclearance\relax \fi}% + \iftabu@colortbl \minrowclearance\the\minrowclearance\relax + \the\@temptokena + \fi}% \def\tabu@savedpream {\edef\tabu@halignto{to\the\tabu@target}\NC@find #1}% }% \tabu@preparesave +\def\tabu@prepare@save #1{% + \ifx\relax#1\else + \@temptokena\expandafter{\the\expandafter\@temptokena + \expandafter\def\expandafter#1\expandafter{#1}}\fi +}% \tabu@prepare@save \newtoks\tabu@footnotes \long\def\tabu@footnotetext #1{% \edef\@tempa{\the\tabu@footnotes @@ -354,7 +408,6 @@ \expandafter\let\csname tabu@X\the\tabu@X@cols\endcsname \relax \iftabu@measuring % not the first X column found in preamble \edef\tabu@global@X {\tabu@global@X - \advance\tabu@X@cols \@ne \def\csname tabu@X\the\tabu@X@cols\endcsname {\strip@pt\tabu@X@sum}% \advance\tabu@X@sum \the\tabu@X@sum\relax}% \else % first X column found in preamble @@ -369,7 +422,6 @@ \fi\fi=\the\tabu@target \on@line, page \the\c@page}\fi \tabu@message{\tabu@titles}% \edef\tabu@global@X {\tabu@global@X - \tabu@X@cols \@ne \def\csname tabu@X1\endcsname{\strip@pt\tabu@X@sum}% \tabu@X@sum \the\tabu@X@sum\relax \tabu@target \the\tabu@target\relax @@ -392,15 +444,14 @@ \else \tabu@X@sum \z@ \let\tabucolX@align \@empty \let\tabucolX@rw \@empty - \let\tabu@Xmath \@empty \let\tabu@temp \@empty - \tabu@Xparse {}#1\relax\@nnil + \let\tabu@Xmath \@empty \let\tabu@temp \@empty + \tabu@Xparse {}#1,\@nnil \fi }% \tabu@Xarg \def\tabu@Xparse #1{\futurelet\@let@token \tabu@Xtest} \expandafter\def\expandafter\tabu@Xparsespace\space{\tabu@Xparse{}} \def\tabu@Xtest{% \ifcase \ifx \@nnil\@let@token \z@ \else - \ifx \relax\@let@token \m@ne\else \if ,\@let@token \m@ne\else \if p\@let@token 1\else \if m\@let@token 2\else @@ -415,7 +466,7 @@ \if .\@let@token 11\else \if -\@let@token 11\else \ifcat $\@let@token 12\else - 13\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\relax + 13\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\relax \tabucolX@do \expandafter \remove@to@nnil \or \tabu@Xtype {p}% \or \tabu@Xtype {m}% @@ -462,7 +513,7 @@ \edef\tabu@temp {\strip@pt\tabu@X@sum \tabucolX}% \edef\tabucolX@rw##1{% \ifx$\tabu@Xmath>{\noexpand\the\toks@ $}\else - \ifx \tabucolXalign\@empty \else + \ifx \tabucolX@align\@empty \else >{\noexpand\the\toks@}\fi\fi \tabucolX@rw{##1}% \ifx$\tabu@Xmath<{$}\fi}% @@ -477,7 +528,6 @@ \ifdim \tabu@wd{#1}<#2 \tabu@wd{#1}\else#2\fi\else #2\fi }% \tabu@dimexpr \def\tabu@prep@TRIAL{% - \let\tabu@savedpreamble \@preamble \begingroup \iffalse{\fi \ifnum0=`}\fi \tabu@setup@TRIAL \tabucolX \tabu@target @@ -596,8 +646,8 @@ \the\tabu@target\space+ \tabu@hfuzz}% \or \ifdim \tabu@X@sum=\z@ \tabu@measuringtrue \tabucolX=\@tempdima - \else \tabu@message{\tabu@message@arith}% - \advance\tabucolX-\dimexpr(\wd\tabu@box-\tabu@target-\tabu@X@sum/\p@) + \else + \advance\tabucolX-\dimexpr(\wd\tabu@box-\tabu@target-.5\tabu@X@sum/\p@) *\p@/\tabu@X@sum\relax \ifdim \tabucolX<\z@ \tabu@warn{X Columns too narrow (table too wide)}% @@ -671,7 +721,7 @@ \ifx\@startpbox\tabu@measure@startpbox\tabu@spaces (coefs<0)\else \ifdim\tabu@X@sum>\z@ \expandafter\tabu@msg@align \the\dimexpr(\tabu@target-\wd\tabu@box) - *\p@/\tabu@X@sum\relax {}{}{}{}{}\@@\fi\fi}% + *\p@/\tabu@X@sum\relax {}{}{}{}{}\@@\fi\fi^^J}% \def\tabu@message@spread{\tabu@spreadheader \expandafter\tabu@msg@align \the\tabu@spreadtarget {}{}{}{}{}\@@ \expandafter\tabu@msg@align \the\wd\tabu@box {}{}{}{}{}\@@ @@ -683,8 +733,14 @@ <\expandafter\tabu@msg@align \the\tabu@target { }{ }{ }{ }{}\@@ + \tabu@hfuzz\space= hfuzz *****^^J% (tabu)\tabu@spaces******* Reached Target: - hfuzz = \tabu@hfuzz\on@line\space *******^^J - \ifnum\tabu@nested=\z@^^J\fi}% + hfuzz = \tabu@hfuzz\on@line\space *******^^J% + \ifnum\tabu@nested=\z@ \tabu@elapsedtime ^^J\fi}% +\def\tabu@message@etime{(tabu)\tabu@spaces + Time elapsed for trials: + \the\numexpr(\pdfelapsedtime-\tabu@starttime-32767)/65536\relax sec + \the\numexpr\numexpr(\pdfelapsedtime-\tabu@starttime) + -\numexpr(\pdfelapsedtime-\tabu@starttime-32767)/65536\relax*65536\relax + *1000/65536\relax ms}% \def\tabu@message@negcoef #1{\tabu@spaces\tabu@spaces * #1. X[-\csname tabu@X#1\endcsname]: natural width = \tabu@wd{#1} @@ -714,6 +770,11 @@ \def\extratabsurround ####1\relax{(tabu) extratabsurround = ####1^^J}% \def\minrowclearance ####1\relax {(tabu) minrowclearance#1 = ####1^^J}% \def\arraystretch ####1{(tabu) arraystretch #1 #1 = ####1^^J}% + \iftabu@colortbl + \def\CT@arc@####1{(tabu) arrayrulecolor #1 = ####1^^J}% + \def\CT@drsc@####1{(tabu) doublerulesepcolor=####1^^J}% + \let\color \relax + \fi \def\NC@find ####1\@nil{(tabu) tabu preamble#1 #1 = \detokenize{####1}^^J}% \def\tabu@wddef####1####2{(tabu) Natural width ####1 = ####2^^J}% \let\edef \@gobbletwo \let\def \@empty @@ -905,10 +966,10 @@ \def\tabu@start@stop #1-#2\@nnil{% \@defaultunits \tabu@start \number0#1\relax\@nnil \@defaultunits \tabu@stop \number0#2\relax\@nnil - \ifnum\tabu@start>\tabu@nbcols\tabu@start=\tabu@nbcols\else - \ifnum\tabu@start>\z@\else \tabu@start=\@ne \fi\fi - \ifnum\tabu@stop>\tabu@nbcols \tabu@stop\tabu@nbcols \else - \ifnum\tabu@stop>\z@\else \tabu@stop=\tabu@nbcols \fi\fi + \ifnum\tabu@start>\tabu@nbcols\tabu@start \tabu@nbcols\else + \ifnum\tabu@start<\@ne \tabu@start \@ne \fi\fi + \ifnum\tabu@stop>\tabu@nbcols \tabu@stop \tabu@nbcols \else + \ifnum\tabu@stop<\@ne \tabu@stop \tabu@nbcols\fi\fi }% \tabu@start@stop \def\tabu@getlinespec#1{\let\tabu@xleaders \relax \@defaultunits \let\@tempa=#1 \relax\@nnil @@ -1088,19 +1149,13 @@ \ifx\\#1\\\tabu@savewarn{}{The tabu will not be saved}\else \@ifundefined{tabu@saved@\string#1}{}{\tabu@savewarn{#1}{Overwritting}}% {% - \toks0\expandafter{\@preamble}% + \toks0\expandafter{\tabu@savedpreamble}% \toks1\expandafter{\tabu@savedparam}% \toks2\expandafter{\tabu@savedpream}% - \iftabu@colortbl - \toks3\expandafter{\expandafter\gdef\expandafter\CT@arc@ - \expandafter{\CT@arc@}}% - \toks3\expandafter{\the\toks\expandafter3 - \expandafter\gdef\expandafter\CT@drsc@\expandafter{\CT@drsc@}}% - \else \toks3{}% - \fi + \toks3{}% \iftabu@negcoef \edef\tabu@savewd{\tabu@savewd{\number\numexpr1}}% - \toks3\expandafter{\the\toks\expandafter3\tabu@savewd}\fi + \toks3\expandafter{\tabu@savewd}\fi \expandafter\xdef\csname tabu@saved@\string#1\endcsname##1{% \noexpand\ifcase##1\relax \noexpand\ifdim\tabu@target>\z@ @@ -1190,7 +1245,7 @@ \ifnum \count@<\z@ % <first initialisation> \@tempcnta \@M % <not initialized by array.sty> \tabu@nbcols\z@ - \gdef\tabu@global@temp{\tabu@nbcols\z@}% + \xdef\tabu@global@temp{\tabu@global@temp \tabu@nbcols\z@}% \expandafter\let\csname tabu@tok@1L\endcsname \relax \tabu@cellrightfalse \else @@ -1374,18 +1429,30 @@ \let\color@bgroup\bgroup \def\color@egroup{\endgraf\egroup}% \afterassignment\tabu@begin@fbox - \setbox\@tempboxa \hbox + \setbox\@tempboxa \hbox }% \tabu@fbox \def\tabu@begin@fbox{\color@bgroup\kern\fboxsep\aftergroup\tabu@end@fbox} -\def\tabu@end@fbox{\kern\fboxsep\color@egroup\@frameb@x\relax} -\expandafter\def\expandafter\tabu@centering\expandafter{% - \centering\arraybackslash} -\expandafter\def\expandafter\tabu@raggedleft\expandafter{% - \raggedleft\arraybackslash} -\expandafter\def\expandafter\tabu@raggedright\expandafter{% - \raggedright\arraybackslash} +\def\tabu@end@fbox{\kern\fboxsep \color@egroup \@frameb@x\relax} +\def\tabu@color@b@x#1#2{\leavevmode + \def\tabu@do@color@b@x{#1{#2\color@block{\wd\z@}{\ht\z@}{\dp\z@}\box\z@}}% + \afterassignment\tabu@begin@color@b@x + \setbox\z@ \hbox +}% \tabu@color@b@x +\def\tabu@begin@color@b@x{% + \bgroup \kern\fboxsep \set@color + \aftergroup\tabu@end@color@b@x +}% \tabu@begin@color@b@x +\def\tabu@end@color@b@x{\kern\fboxsep \egroup + \dimen@\ht\z@\advance\dimen@\fboxsep\ht\z@\dimen@ + \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@trivlist{\expandafter\def\expandafter\@trivlist\expandafter{% - \expandafter\let\expandafter\\\expandafter\@centercr\@trivlist}}% + \expandafter\let\expandafter\\\expandafter\@normalcr\@trivlist}}% \def\tabu@fix@arrayright{% \@ifpackageloaded{arydshln} {% |