From c79fbe30044b8ebdfbca7d2b53744a8e38839900 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Wed, 19 Jan 2011 00:46:27 +0000 Subject: tabu 2.0 (17jan11) git-svn-id: svn://tug.org/texlive/trunk@21114 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/doc/latex/tabu/tabu.pdf | Bin 1617198 -> 1764458 bytes Master/texmf-dist/source/latex/tabu/tabu.drv | 37 +- Master/texmf-dist/source/latex/tabu/tabu.dtx | 1033 ++++++++++++++++++++------ Master/texmf-dist/source/latex/tabu/tabu.ins | 45 +- Master/texmf-dist/tex/latex/tabu/tabu.sty | 390 +++++++--- 5 files changed, 1141 insertions(+), 364 deletions(-) diff --git a/Master/texmf-dist/doc/latex/tabu/tabu.pdf b/Master/texmf-dist/doc/latex/tabu/tabu.pdf index 4de9aac0942..8072f3f2474 100644 Binary files a/Master/texmf-dist/doc/latex/tabu/tabu.pdf and b/Master/texmf-dist/doc/latex/tabu/tabu.pdf differ diff --git a/Master/texmf-dist/source/latex/tabu/tabu.drv b/Master/texmf-dist/source/latex/tabu/tabu.drv index d99c80f5b1c..e81c0550a20 100644 --- a/Master/texmf-dist/source/latex/tabu/tabu.drv +++ b/Master/texmf-dist/source/latex/tabu/tabu.drv @@ -8,7 +8,22 @@ %% %% This is a generated file. %% -%% tabu : 2011/01/15 v1.9 - tabu : Flexible LaTeX tabulars +%% tabu : 2011/01/25 v2.0 - tabu : Flexible LaTeX tabulars +%% +%% ******************************************************* +%% \begin{tabu} to { preamble } +%% \begin{tabu} spread { preamble } +%% +%% Default target: \linewidth or \linegoal: +%% +%% \tabulinesep=2pt +%% +%% \begin{tabu} { |[3pt red] X[4c] X[1c] X[-2ml] |[3pt blue] } +%% \tabucline[3pt on 2pt, cyan]- +%% one & two & three +%% \\ \tabucline[3pt yellow]- +%% \end{tabu} +%% ******************************************************* %% %% This work may be distributed and/or modified under the %% conditions of the LaTeX Project Public License, either @@ -21,12 +36,12 @@ %% tabu.sty, tabu.pdf, tabu.ins %% %% tabu : Flexible LaTeX tabulars -%% Copyright (C) 2010 by Florent Chervet +%% lppl copyright 2010-2011 by FC %% \edef\thisfile{\jobname} \def\thisinfo{Flexible \LaTeX{} tabulars (\FC)} -\def\thisdate{2011/01/15} -\def\thisversion{1.9} +\def\thisdate{2011/01/25} +\def\thisversion{2.0} \def\CTANbaseurl{http://www.ctan.org/tex-archive/macros/latex} \def\CTANdisplay{CTAN:macros/latex} \makeatletter\protected\def\CTANhref{\@ifstar\CTANhrefstar\CTANhrefnost}\makeatother @@ -37,7 +52,13 @@ \PassOptionsToPackage{svgnames}{xcolor} \PassOptionsToPackage{hyperfootnotes}{hyperref} \documentclass[a4paper,oneside]{ltxdoc} -\AtBeginDocument{\DeleteShortVerb{\|}} +\AtBeginDocument{ + \DeleteShortVerb{\|} + \csname @ifpackagelater\endcsname{interfaces}{2011/01/17}{} + {\PackageError{tabu-pdf-documentation} + {interfaces must be later\MessageBreak + than 2011/01/17 to compile this\MessageBreak + documentation. Please update your packages}\@ehd}} \usepackage[latin1]{inputenc} \usepackage[T1]{fontenc} \usepackage{etoolbox,geometry,graphicx,xcolor,lastpage,lmodern,bbding,hologo,relsize,moresize,manfnt,pifont,xspace,numprint,amsmath} @@ -50,14 +71,15 @@ \usepackage{tabularx}\tracingtabularx \usepackage{enumitem-zref} \usepackage[verbose]{linegoal}[2010/12/07] -\usepackage{interfaces}[2010/12/07] +\usepackage{interfaces}[2011/01/17] \usetikz{basic,chains,positioning} \usepackage{embedfile} \RequirePackage{amsopn,amsmath}% \DeclareMathOperator \RequirePackage[a]{esvect}% for vectors \DeclareMathOperator*\Div{div} \DeclareMathOperator*\Rot{\vv{\text{rot}}} -\newrobustcmd*\dpartial[2]{\displaystyle\genfrac{}{}{}{}{\partial#1}{\partial#2}} +\newrobustcmd*\dpartial[2]{\displaystyle\genfrac{}{}{}{}{\partial\mkern.2\thinmuskip#1}{\partial\mkern.2\thinmuskip#2}} +\newrobustcmd*\dtotal[2]{\displaystyle\genfrac{}{}{}{}{\text d\mkern.2\thinmuskip#1}{\text d\mkern.2\thinmuskip#2}} \usepackage{expl3,l3keys2e,siunitx} \usepackage{xfrac} \csname endofdump\endcsname @@ -79,7 +101,6 @@ \begin{document} \DocInput{\thisfile.dtx} \end{document} - \endinput %% %% End of file `tabu.drv'. diff --git a/Master/texmf-dist/source/latex/tabu/tabu.dtx b/Master/texmf-dist/source/latex/tabu/tabu.dtx index 6b44a81856b..1c5641bc56b 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 : 2011/01/15 v1.9 - tabu: flexible LaTeX tabulars] +% tabu : 2011/01/25 v2.0 - tabu: flexible LaTeX tabulars] % % This work may be distributed and/or modified under the % conditions of the LaTeX Project Public License, either @@ -22,7 +22,7 @@ % % Documentation: % (pdf)latex tabu.dtx -% Copyright (C) 2010 by Florent Chervet +% lppl copyright 2010-2011 by FC %<*ignore> \begingroup \def\x{LaTeX2e}% @@ -36,18 +36,34 @@ \input docstrip.tex \Msg{************************************************************************} \Msg{* Installation} -\Msg{* Package: 2011/01/15 v1.9 - tabu: Flexible LaTeX tabulars} +\Msg{* Package: 2011/01/25 v2.0 - tabu: Flexible LaTeX tabulars} \Msg{************************************************************************} \keepsilent \askforoverwritefalse -\let\MetaPrefix\relax +\let\MetaPrefix \relax \preamble This is a generated file. -tabu : 2011/01/15 v1.9 - tabu : Flexible LaTeX tabulars +tabu : 2011/01/25 v2.0 - tabu : Flexible LaTeX tabulars + +******************************************************* +\string\begin{tabu} to { preamble } +\string\begin{tabu} spread { preamble } + + +Default target: \string\linewidth or \string\linegoal: + +\string\tabulinesep=2pt + +\string\begin{tabu} { |[3pt red] X[4c] X[1c] X[-2ml] |[3pt blue] } + \string\tabucline[3pt on 2pt, cyan]- + one & two & three + \string\\ \string\tabucline[3pt yellow]- +\string\end{tabu} +******************************************************* This work may be distributed and/or modified under the conditions of the LaTeX Project Public License, either @@ -60,10 +76,10 @@ and the derived files tabu.sty, tabu.pdf, tabu.ins tabu : Flexible LaTeX tabulars -Copyright (C) 2010 by Florent Chervet +lppl copyright 2010-2011 by FC \endpreamble -\let\MetaPrefix\DoubleperCent +\let\MetaPrefix \DoubleperCent \generate{% \file{tabu.ins}{\from{tabu.dtx}{install}}% @@ -98,8 +114,8 @@ Copyright (C) 2010 by Florent Chervet %<*driver> \edef\thisfile{\jobname} \def\thisinfo{Flexible \LaTeX{} tabulars (\FC)} -\def\thisdate{2011/01/15} -\def\thisversion{1.9} +\def\thisdate{2011/01/25} +\def\thisversion{2.0} \def\CTANbaseurl{http://www.ctan.org/tex-archive/macros/latex} \def\CTANdisplay{CTAN:macros/latex} \makeatletter\protected\def\CTANhref{\@ifstar\CTANhrefstar\CTANhrefnost}\makeatother @@ -110,7 +126,13 @@ Copyright (C) 2010 by Florent Chervet \PassOptionsToPackage{svgnames}{xcolor} \PassOptionsToPackage{hyperfootnotes}{hyperref} \documentclass[a4paper,oneside]{ltxdoc} -\AtBeginDocument{\DeleteShortVerb{\|}} +\AtBeginDocument{ + \DeleteShortVerb{\|} + \csname @ifpackagelater\endcsname{interfaces}{2011/01/17}{} + {\PackageError{tabu-pdf-documentation} + {interfaces must be later\MessageBreak + than 2011/01/17 to compile this\MessageBreak + documentation. Please update your packages}\@ehd}} \usepackage[latin1]{inputenc} \usepackage[T1]{fontenc} \usepackage{etoolbox,geometry,graphicx,xcolor,lastpage,lmodern,bbding,hologo,relsize,moresize,manfnt,pifont,xspace,numprint,amsmath} @@ -123,14 +145,15 @@ Copyright (C) 2010 by Florent Chervet \usepackage{tabularx}\tracingtabularx \usepackage{enumitem-zref} \usepackage[verbose]{linegoal}[2010/12/07] -\usepackage{interfaces}[2010/12/07] +\usepackage{interfaces}[2011/01/17] \usetikz{basic,chains,positioning} \usepackage{embedfile} \RequirePackage{amsopn,amsmath}% \DeclareMathOperator \RequirePackage[a]{esvect}% for vectors \DeclareMathOperator*\Div{div} \DeclareMathOperator*\Rot{\vv{\text{rot}}} -\newrobustcmd*\dpartial[2]{\displaystyle\genfrac{}{}{}{}{\partial#1}{\partial#2}} +\newrobustcmd*\dpartial[2]{\displaystyle\genfrac{}{}{}{}{\partial\mkern.2\thinmuskip#1}{\partial\mkern.2\thinmuskip#2}} +\newrobustcmd*\dtotal[2]{\displaystyle\genfrac{}{}{}{}{\text d\mkern.2\thinmuskip#1}{\text d\mkern.2\thinmuskip#2}} \usepackage{expl3,l3keys2e,siunitx} \usepackage{xfrac} \csname endofdump\endcsname @@ -155,7 +178,7 @@ Copyright (C) 2010 by Florent Chervet % % \fi % -% \CheckSum{4626} +% \CheckSum{5117} % % \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 @@ -217,6 +240,7 @@ Copyright (C) 2010 by Florent Chervet % \def\macro@font{\changefont{fam=lmtt,size-=1pt,color=macrocode,spread=1}\let\AltMacroFont\macro@font} % \def\MacroFont{\changefont{fam=lmtt,color=macrocode}} % \def\texorpdf#1#2{\texorpdfstring{#1{#2}}{#2}} +% \let\ltxthinspace\, \def\,{\texorpdfstring\ltxthinspace{}} % \def\textitbf#1{\textbf{\itshape#1}}\let\textbfit\textitbf % \DefineVerbatimEnvironment{VerbLines}{Verbatim}{frame=lines,framesep=6pt,fontfamily=\ttdefault,fontseries=m} % \DefineVerbatimEnvironment{VerbLines*}{Verbatim}{frame=lines,framesep=6pt,fontfamily=\ttdefault,fontseries=m,commandchars=$()} @@ -229,10 +253,14 @@ Copyright (C) 2010 by Florent Chervet % \ifmmode \check@mathfonts \fi % \fi % } +% \newcommand*\ifcurrentenvir[1]{\expandafter\ifx\csname\@currenvir\expandafter\endcsname\csname#1\endcsname +% \expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi} +% \newcommand*\currentenvirname{\@currenvir} % \newrobustcmd*\OR{{\,\upshape\texttbf\textbar\,}} % \newrobustcmd*\CheckOK{{\scriptsize\textcolor{ForestGreen}\CheckmarkBold}} % \newrobustcmd*\CheckFAIL{{\scriptsize\textcolor{Crimson}\XSolidBrush}} % \newcommand\tikzlabel[2][]{\tikz[{remember picture,#1}]\coordinate ({#2});\ignorespaces} +% \tabuDisableCommands{\let\tikzlabel \@gobble} % \newlist{itempunct}{itemize}{1} % \setlist[itempunct]{nolistsep,font=\smaller,leftmargin=1.7em,label=\textbullet} % \def\smex{\leavevmode\hb@xt@2em{\hfil$\longrightarrow$\hfil}} @@ -243,7 +271,7 @@ Copyright (C) 2010 by Florent Chervet % \newrobustcmd\textttbf[1]{\textbf{\texttt{#1}}} % \newrobustcmd*\blue{\color{blue}}\newcommand*\red{\color{dr}}\newcommand*\green{\color{green}}\newcommand\rred{\color{red}} % \newrobustcmd*\FC[1][\color{copper}]{{#1\usefont{T1}{fts}xn FC}} -% \colorlet{pkgcolor}{teal} \def\pkgcolor{\color{pkgcolor}} +% \colorlet{pkgcolor}{teal} \def\pkgcolor{\texorpdfstring{\color{pkgcolor}}{}} % \definecolor{copper}{rgb}{0.67,0.33,0.00} \newcommand\copper{\color{copper}} % \definecolor{dg}{rgb}{0.02,0.29,0.00} \newcommand\dg{\color{dg}} % \definecolor{db}{rgb}{0,0,0.502} \newcommand\db{\color{db}} @@ -275,14 +303,15 @@ Copyright (C) 2010 by Florent Chervet % \renewrobustcmd\declcs[2][]{^^A % \if@nobreak \par\nobreak % \else \par\addvspace\parskip -% \needspace{\bottomtitlespace}\fi +% \needspace{.08\textheight}\fi % \noindent\changefont{size+=2.5pt,spread=1,fam=\ttdefault}^^A +% \newcommand*\csanchor[2][]{\raisedhyperdef[14pt]{declcs}{##2}{\cs[{##1}]{##2}}}^^A % \hspace{-\leftmargini}^^A % \def\*{\unskip\,\texttt{*}}^^A % \begin{tabu}{|l|}^^A % \hline % \expandafter\SpecialUsageIndex\csname #2\endcsname -% \raisedhyperdef[14pt]{declcs}{#2}{\cs[{#1}]{#2}}^^A +% \csanchor[{#1}]{#2}^^A % }^^A % \renewcommand\enddeclcs{% % \crcr \hline @@ -296,6 +325,7 @@ Copyright (C) 2010 by Florent Chervet % \def\declmarginwidth{\dimexpr-\leftmargini+\arrayrulewidth+\tabcolsep} % \pretocmd\textasteriskcentered{\usefont{OMS}{cmsy}mn}{}{} % \newrobustcmd*\abs[1]{\left\lvert#1\right\rvert} +% % \bookmarksetup{open=true,openlevel=2} % \pagesetup{% % head/rule/width=.0pt, @@ -371,6 +401,26 @@ Copyright (C) 2010 by Florent Chervet % \deffootnote{1em}{0pt}{\rlap{\textsuperscript{\thefootnotemark}}\kern1em} % % \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}} +% \AtBeginShipoutNext{\AtBeginShipoutUpperLeft{% +% \tikz[remember picture,overlay]{ +% \coordinate (upper west) at (current page.north west); +% \coordinate (upper east) at (current page.north east); +% \node at ($(upper west)+(3cm,-4.5cm)$) [semitransparent,anchor=north west,rotate=30] { +% \begin{tabu}to 5cm{*4{|>{\smaller\noindent\pkgcolor}X[c$]}|} \tabucline- +% 1 & 2 & 3 & 4 \\ \tabucline- +% 5 & 6 & 7 \\ \tabucline{-3} +% 8 & 9 \\ \tabucline{-2} +% 10 \\ \tabucline{-1} +% \end{tabu}}; +% \node at ($(upper east)+(-.5cm,-4cm)$) [semitransparent,anchor=north east,rotate=-35] { +% \begin{tabu}to 5cm{*4{|>{\smaller\noindent\pkgcolor}X[$c]}|} \tabucline{4-} +% \multicolumn3{c|}{} & \alpha \\ \tabucline{3-} +% \multicolumn2{c|}{} & \beta & \gamma \\ \tabucline{2-} +% \multicolumn1{c|}{} & \delta & \epsilon & \zeta \\ \tabucline{-} +% \eta & \theta & \iota & \kappa \\ \tabucline- +% \end{tabu}}; +% }}} +% % \date{} % \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}} @@ -390,7 +440,7 @@ Copyright (C) 2010 by Florent Chervet % \deffootnote{1em}{0pt}{\rlap{\thefootnotemark.}\kern1em} % % {\let\quotation\relax\let\endquotation\relax\vspace*{-1cm}% -% \begin{abstract}\parskip\smallskipamount\parindent0pt\lastlinefit0\leftskip.7cm\rightskip\leftskip +% \begin{abstract}\parskip\smallskipamount\parindent0pt\lastlinefit0\leftskip.2cm\rightskip\leftskip % % This package defines a single environment \textt{tabu} to make all kinds of tabulars in text or in math mode % provided that they do not split across pages. @@ -446,16 +496,16 @@ Copyright (C) 2010 by Florent Chervet % % \changefont{spread*=1.1} % \phantomsection \label{Summary} -% \addcontentsline{toc}{section}{Summary of the features provided by \textt{tabu}} -% \def\arraystretch{1.1}\enlargethispage\baselineskip\vspace*{-6mm} +% \addcontentsline{toc}{section}{Summary of the features provided by \textt{\pkgcolor t\,a\,b\,u}} +% \def\arraystretch{1}\enlargethispage{2\baselineskip}\vspace*{-9mm} % \begin{tabu}{>{\ttfamily\bfseries}X[-1]X} \toprule % \rowfont{\larger\bfseries\lsstyle} -% \multicolumn2c{Summary of the features provided by \xpackage{tabu}} \\ \tabucline[dash]- -% \hyperref[sec.tabu]{tabu} & -% is like \textt{tabular} in text mode and like \textt{array} in math mode when there is no +% \multicolumn2c{Summary of the features provided by \,{\sffamily\pkgcolor t\,a\,b\,u}} \\ \tabucline[dash]- +% \hyperref[tabu.sec]{tabu} & +% is like \textt{tabular} in text mode and like \textt{array} \hyperref[math mode.sec]{in math mode} when there is no % \textt X column in its preamble % \\ -% \hyperref[sec.longtabu]{longtabu} & +% \hyperref[longtabu.sec]{longtabu} & % is like \textt{longtable} with the possibility to use \textt{tabu X} columns and vertical lines % with the extended syntax. % \\ @@ -477,10 +527,11 @@ Copyright (C) 2010 by Florent Chervet % \begin{itempunct}[label=\ding{223}] % \item directly specified with \textt{\M*{tabu} to\meta{dimen}} % \item computed from the natural width: \textt{\M*{tabu} spread\meta{dimen}} -% \item by default \cs{linewidth} (or \cs{linegoal} with the \textt{linegoal} package option). +% \item by default \cs{linewidth} (or \cs{linegoal} with the \hyperref[subsec:linegoal package option]{\textt{linegoal} package option}). % \end{itempunct} % \textt{coef} scales the widths of the \textt X columns, if there are more than one \textt X column. \par -% \textt{align} is either \textt r, \textt c, \textt l\, or\, \textt j\, and \textt{type}\, can be \textt p (default), \textt m\, or\, \textt b. \par +% \textt{align} is either \textt r, \textt c, \textt l\, or\, \textt j\, (or \hyperref{}{declcs}{rowfont}{\textt{R C L J}}) +% and \textt{type}\, can be \textt p (default), \textt m\, or\, \textt b.\par % \textt{X[\$]}\, makes a math \textt X column (\ie \textt{>\M*{\$}X<\M*{\$}}) % \\ % \refitem{tabu X columns,2}[{X[$-$coef,align,type]}] & @@ -497,6 +548,13 @@ Copyright (C) 2010 by Florent Chervet % \csref{rowfont}\M*[align]\M*{font spec} & % Modify the font and optionally the alignment of each cell in one row. % \\ \tabucline[dash]- +% \csref{tabulinesep}$=$\meta{dimen} & +% More control on vertical spacing of lines in a way very close to \Xpackage{cellspace}. +% \\ +% \csref{extrarowsep}$=$\meta{dimen} & +% In addition to \cs{extrarowheight}, \thispackage provides \cs{extrarowdepth}. +% But \csref{tabulinesep} generally gives better results. +% \\ \tabucline[dash]- % \csref{savetabu}\M*{user-name} & % Saves the \textt{tabu} preamble and its parameters. \par % The command must appear at the end of a line: after \string\\\ or \cs{hline}. @@ -518,7 +576,7 @@ Copyright (C) 2010 by Florent Chervet % information for making a dash or dotted line (f.ex. \M*[on 3pt off 6pt]) and a color name.\par % The line spec can also be defined with \cs{tabulinestyle} % \\ -% \csref{tabulinestyle}\M*{name=spec,...} & Defines a line style for use with \cs{tabucline} +% \csref{tabulinestyle}\M*{name=spec,...} & Defines a line style for use with \cs{tabucline}\M*[name] or with \texttbf\textbar\M*[name] % \\ \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, @@ -535,7 +593,7 @@ Copyright (C) 2010 by Florent Chervet % % \setitemize{leftmargin=3em} % \section{The \textt{tabu} environment} -% \label{sec.tabu} +% \label{tabu.sec} % % % \subsection(tabu, tabu to, tabu spread){\textt{tabu}, \textt{tabu to} and \textt{tabu spread}} @@ -591,7 +649,7 @@ Copyright (C) 2010 by Florent Chervet % \textt{@\M*{\cs{extracolsep}\M*{0pt plus 1fil}}} is inserted by default if \meta{dimen}$>0$. % % \subsection{\textt{longtabu}, \textt{longtabu to} and \textt{longtabu spread}} -% \label{sec.longtabu} +% \label{longtabu.sec} % % \begin{declcs}{begin}\M*{longtabu}\,\M*[l\OR c\OR r]\,\M*{tabular preamble} \\ % \cs{begin}\M*{longtabu} to \meta{dimen}\,\M*[l\OR c\OR r]\,\M*{tabular preamble} \\ @@ -614,7 +672,7 @@ Copyright (C) 2010 by Florent Chervet % \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. \\ -% \hyperref[sec.math mode]{mathematical mode} &\CheckFAIL & &\textt{longtable} is not designed to work in math mode. \\ +% \hyperref[math mode.sec]{mathematical mode} &\CheckFAIL & &\textt{longtable} is not designed to work in math mode. \\ % \xpackage{delarray} shortcuts &\CheckFAIL & &a delimiter cannot be spanned over pages... \\ % \csref{tabuphantomline} &\CheckFAIL & &useless inside \textt{longtabu} % \\\bottomrule @@ -779,7 +837,8 @@ Copyright (C) 2010 by Florent Chervet % \end{tabu} % \end{Verb} % -% \begin{tabu}{|[3pt ForestGreen]X[-1m]|X[c m]|[3pt ForestGreen]} \tabucline[3pt ForestGreen]- +% { +% \begin{tabu}{|[3pt ForestGreen]X[-1m]|X[c m]|[3pt ForestGreen]} \tabucline[3pt ForestGreen]- \savetabu{FirstNegativTest} % $\begin{tabu}({X[-1$]X[-1$c]}) % \alpha & \beta \\ % \gamma & \delta + \epsilon + \zeta + \eta + \theta @@ -788,7 +847,18 @@ Copyright (C) 2010 by Florent Chervet % This is a tabu with negativ width coefficients for \textt X columns % \\ \tabucline[3pt ForestGreen]- % \end{tabu} -% +% +% \tabulinesep=2pt +% \begin{tabu}{\usetabu{FirstNegativTest}}\tabucline[3pt ForestGreen]- +% $\begin{tabu}({X[-1$]X[-1$c]}) +% \alpha & \beta \\ +% \gamma & \delta + \epsilon + \zeta + \eta + \theta +% \end{tabu}$ +% & +% And this is the same with \csref{tabulinesep} set to $2pt$. +% \\ \tabucline[3pt ForestGreen]- +% \end{tabu} +% } % % \subsubsection{Multicolumn in \textt{tabu}} % @@ -945,9 +1015,20 @@ Copyright (C) 2010 by Florent Chervet % Example: % % {\makeatletter +% \AtBeginShipoutNext{\AtBeginShipoutUpperLeft{\tikz[remember picture,overlay]{ +% \node at (tabucline*) [xshift=-2cm,yshift=0cm,font=\ttfamily\smaller,text width=3cm] +% { \dbend \\[1.5ex] +% Starting from +% \hyperref[2.0]{version 2.0} use +% preferably the vertical +% spacing adjustment +% parameters provided by +% \csref{tabulinesep} and +% \csref{extrarowsep}. };}}} +% % \begin{tabu}{*3{X[mc]}} % \extrarowheight=8pt -% \begin{tabu}[c]{|[1pt]X|X|[1pt]} \tabucline- +% \begin{tabu}[c]{|[1pt]X|X|[1pt]} \tabucline- \tikzlabel{tabucline*} % Hello & world \\ \tabucline[1pt on 2pt off 2pt,blue]- % Hello & world \\ \tabucline- % \end{tabu} @@ -1006,8 +1087,8 @@ Copyright (C) 2010 by Florent Chervet % \multicolumn{3}{|c|}{Interesting ?} \\ \tabucline- % \end{tabu} % \end{tabu} +% \nobreak\par\nobreak\vspace*{\bigskipamount}\nobreak % -% ^^A\enlargethispage{2\baselineskip} % \small % \hfil\Shapepar{\nutshape}{Now we stop it because things are becoming too ugly and go to have a look at \textt{tabu} in mathematical mode...}\hfil\null % @@ -1015,16 +1096,17 @@ Copyright (C) 2010 by Florent Chervet % % % \subsection{\textt{tabu} in math mode} -% \label{sec.math mode} +% \label{math mode.sec} % % { -% \extrarowheight=3pt -% \begin{tabu} to\linewidth{X[1.5]X[r$]} \toprule +% \tabulinesep=3pt +% \begin{tabu} to\linewidth{X[1.5]X[l$]} \toprule % On the left, you can see the famous Maxwell-Lorentz equations for electromagnetic field in vacuum, % publicated in \oldstylenums{1873}. % & -% \hfil\begin{tabu}({>{\Gape[8pt]\displaystyle}r>{\displaystyle}l}. -% \Div\vv E &= \frac{\rho}{\epsilon_0} \\ +% \hfil\arraycolsep=3pt +% \begin{tabu}({rl}. +% \Div\vv E &= \dfrac \rho {\epsilon_0} \\ % \Div\vv B &= 0 \\ % \Rot\vv E &= - \dpartial{\vv B} t \\ % \Rot\vv B &= \mu_0 \vv j + \mu_0 \epsilon_0\, \dpartial{\vv E} t @@ -1032,19 +1114,18 @@ Copyright (C) 2010 by Florent Chervet % \\ \bottomrule % \end{tabu}} % -% In this example, the big \textt{tabu} is: \cs{begin}\M*{tabu} to\cs{linewidth}\M*{X[1.5]X[r\$]}. +% In this example, the big \textt{tabu} is: \cs{begin}\M*{tabu} to\cs{linewidth}\M*{X[1.5]X[l\$]}. % % The nested \textt{tabu} (in math mode) uses \xpackage{delarray} shortcut: its preamble is: % \begin{Verb} -% \begin{tabu}({>{\Gape[8pt]\displaystyle}r>{\displaystyle}l}. +% \begin{tabu}({rl}. % \end{Verb} % -% You immediately see the interest for \textt{tabu} to have a default target. -% -% \cs{Gape} is a \xpackage{makecell} macro to adjust the height and depth of the rows. +% \csref{tabulinesep} has been set to \texttbf{3pt}. % % Horizontal rules are \xpackage{booktabs} \cs{toprule}, \cs{midrule} and \cs{bottomrule}. % +% % \begin{tabu}{@{}*3{X[c]@{}}} \toprule \savetabu{math} % \rowfont{\bfseries} \textt{array} & \textt{tabu} & \textt{tabu spread 1em} \\ \midrule % $\begin{array}[t]|{cc}| @@ -1201,7 +1282,8 @@ Copyright (C) 2010 by Florent Chervet % round-integer-to-decimal=true, % per-mode=symbol]{#1}{\officialeuro\per\kilo\gram}} % \begin{tabu}{*2{X}} -% \begin{tabu}spread 0pt{|[GreenYellow]*2{>{\tabudecimal\usermacro}X[r]|[GreenYellow]}c} \tabucline[1pt GreenYellow]- +% \tabulinesep=3pt +% \begin{tabu}spread 8pt{|[GreenYellow]*2{>{\tabudecimal\usermacro}X[r]|[GreenYellow]}c} \tabucline[1pt GreenYellow]- % \rowfont[c]\bf January &February &... \\\tabucline[1pt on2pt GreenYellow]- % 12.324 &745.32 &... \\ % 21.13 &0 &... \\ @@ -1209,7 +1291,8 @@ Copyright (C) 2010 by Florent Chervet % 2143.12 &324.325 &... \\\tabucline[1pt GreenYellow]- % \end{tabu} % & -% As you can see, the columns widths are exactly the same, whatever their content. +% As you can see, the columns widths are exactly the same, whatever their content. \par \bigskip +% Here \csref{tabulinesep} has been set to $3pt$. % \end{tabu} % % \subsubsection{You should know how it works...} @@ -1224,52 +1307,280 @@ Copyright (C) 2010 by Florent Chervet % scans blank spaces and because \cs{numprint} does not allow blank spaces in its mandatory argument, % quite strangely... % - +% +% \subsection{Paragraph indentation} +% \label{Paragraph indentation.subsec} +% +% \textt{tabu} takes care of paragraph indentation when it is used with \textt X columns and its default target, +% no matter if it has been loaded or not with the \textt{linegoal} option. +% Example with \LaTeX{} default: \cs{parindent} $=20$pt. % +% {\parindent=20pt \let\tabudefaulttarget \linewidth +% +% \begin{tabu}{|[GreenYellow]X|[GreenYellow]} \tabucline[GreenYellow]- +% This is \textt{\pkgcolor tabu} with its default target in an indented paragraph. \\ \tabucline[GreenYellow]- +% \end{tabu} +% +% \noindent\begin{tabu}{|[GreenYellow]X|[GreenYellow]}\tabucline[GreenYellow]- +% This is \textt{\pkgcolor tabu} with its default target, preceded by \cs{noindent} \\ \tabucline[GreenYellow]- +% \end{tabu} +% +% +% \begin{tabularx}\linewidth{|X|} \hline +% This is \textt{tabularx} with target: \cs{linewidth} in an indented paragraph. \\ \hline +% \end{tabularx} % +% \noindent\begin{tabularx}\linewidth{|X|} \hline +% This is \textt{tabularx} with target: \cs{linewidth}, preceded by \cs{noindent} \\ \hline +% \end{tabularx}} % +% % \subsection{\texorpdf\xpackage{delarray} shortcuts} +% \label{delarray shortcuts tabularx.subsec} % % When you enclose your tabular with math delimiters using \xpackage{delarray} shortcuts, % \xpackage{tabu} tries to reach its target for the whole: the tabular and the delimiter(s). % You can see the difference: % % {\centering -% \extrarowheight=8pt +% \extrarowsep=8pt +% % \AtBeginShipoutNext{\AtBeginShipoutUpperLeft{\tikz[remember picture,overlay] -% \node at (tabularx overfull) [xshift=-3cm,yshift=-1cm,rotate=45,font=\ttfamily\smaller] +% \node at (tabularx overfull) [xshift=-3cm,yshift=-1.5cm,rotate=40,font=\ttfamily\smaller] % {\begin{tabu}{c} % with overfull hboxes\\ -% (15.8pt and 16.1pt two wide)\\ +% (17.5pt and 17.8pt two wide)\\ % for \xpackage{tabularx} % \end{tabu}};}} -% \begin{tabu}to .6\linewidth{X[m]} \tabucline- -% \extrarowheight=0pt -% \begin{tabu}({X}) -% This is \textt{tabu} with \xpackage{delarray} shortcut for parenthesis around -% \end{tabu} -% \\ \tabucline[1pt on2pt blue]- +% \renewcommand\text[1]{This is +% {\ttfamily \ifcurrentenvir{tabu}{\pkgcolor\lsstyle}{}\currentenvirname} +% with \xpackage{delarray} shortcuts for #1 around.} +% +% \tabcolsep=10pt +% \begin{tabu}to 12cm{|[pkgcolor]*2{>{\extrarowsep=0pt}X|[pkgcolor]}} \tabucline[pkgcolor]- +% \begin{tabu}({X}) \tikzlabel{tabularx overfull} +% \text{parenthesis} \end{tabu} +% & +% \begin{tabu}\{{X}\} +% \text{curly brackets} \end{tabu} +% \\ \tabucline[1pt on2pt pkgcolor]- % -% \extrarowheight=0pt % \begin{tabularx}{\linewidth}[t]({X}) -% \tikzlabel{tabularx overfull} This is \textt{tabularx} with \xpackage{delarray} shortcut for parenthesis around -% \end{tabularx} -% \\ \tabucline[1pt on2pt blue]- +% \text{parenthesis} \end{tabularx} +% & +% \begin{tabularx}{\linewidth}[t]\{{X}\} +% \text{curly brackets} \end{tabularx} +% \\ \tabucline[pkgcolor]- +% \end{tabu} % -% \extrarowheight=0pt -% \begin{tabu}\{{X}\} -% This is \textt{tabu} with \xpackage{delarray} shortcut for curly brackets around +% } +% +% +% +% \section(row font and alignment){Modifying the font and the alignment in one row: \cs{rowfont}} +% +% \begin{declcs}{rowfont}\M[alignment]\M*{font specification} +% \end{declcs} +% +% Inside a \textt{tabu} environment, you can modify the font for each cell in a row. +% \cs{rowfont} has priority over column font specification, exactly like \cs{rowcolor} (package \xpackage{colortbl}) +% has priority over \cs{columncolor}. +% +% The alignment of each cell in one row can also be changed to: \topsep=0pt +% \begin{center} +% \begin{tabu}{>{\ttfamily}r@{\,$=$\,}lc>{\ttfamily}r} +% l &left &{\qquad\smaller or\, for \xpackage{ragged2e} settings: } &L \\ +% c ¢er & &C \\ +% r &right & &R \\ +% j &justify & &J \\ % \end{tabu} -% \\ \tabucline[1pt on2pt blue]- +% \end{center} % -% \extrarowheight=0pt -% \begin{tabularx}{\linewidth}[t]\{{X}\} -% This is \textt{tabularx} with \xpackage{delarray} shortcut for curly brackets around -% \end{tabularx} -% \\ \tabucline- +% Any other value for the optional \meta{alignment} parameter is silently ignored. If \xpackage{ragged2e} is not loaded, +% \textt L\, \textt R\, \textt C\, and\, \textt J\, are synonymous with the lowercase equivalent. % -% \end{tabu}\par} +% \begin{Verb*} +% \begin{tabu}{|X|X[-1]|} \tabucline- +% ($db(\rowfont))[c]\bfseries +% 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]- +% \xpackage{tabu} &package \\\tabucline[off 2pt blue]- +% \rowfont[r]\itshape +% for &\textt{tabu} and \textt{longtabu} \\\tabucline- +% \end{tabu} +% +% \ClearPage* +% \section(Vertical spacing of lines){Controlling vertical spacing of lines: \cs{extrarowsep} \,and\, \cs{tabulinesep}} +% \label{vertical spacing.sec} +% +% +% \subsection{\cs{extrarowheight}\, \cs{extrarowdepth}\, and\, \cs{extrarowsep}} +% \label{extrarowsep.subsec} +% +% \begin{declcs}{extrarowheight}$=$\meta{dimen} \\ +% \csanchor{extrarowdepth}$=$\meta{dimen} +% \end{declcs} +% +% \cs{extrarowheight} is a dimension defined in \xfile{array.sty} whose purpose is to add -- inconditionally -- +% some more height to each line in a tabular. +% Similarly, \cs{extrarowdepth} (defined in \xfile{tabu.sty}) is added -- inconditionally as well -- to the depth of each line. +% +% Both \cs{extrarowheight} and \cs{extrarowdepth} are scaled by \cs{arraystretch}\footnote{\cs{arraystretch} is not a dimension +% but a macro that stores a scaling factor.} if \cs{arraystretch}$>1$. +% +% \begin{declcs}{extrarowsep}$=$\meta{dimen} +% \end{declcs} +% +% \cs{extrarowsep} makes the assignment for both \csref{extrarowheight} and \csref{extrarowdepth}. +% The macro can be prefixed by \cs{global}\footnote{However \cs{extrarowsep} is not a dimension ! +% You can't test, for example, \cs{ifdim}\cs{extrarowsep}$>0pt$ ! Test \cs{extrarowheight} and \cs{extrarowdepth} instead, if needed.}. +% +% Examples (with \csref{tabustrutrule}$=2pt$ to see the struts):\enlargethispage\baselineskip +% +% \tabulinestyle{test=1pt blue,testdash=.7pt on1.2pt off 2pt blue} +% +% { +% \def\arraystretch{1}\tabustrutrule=0pt +% \def\smalltest#1#2{\begin{tabu}{#1} \hline #2 \\ \hline \end{tabu}} +% +% \def\test#1{{\tabustrutrule=0pt\tabulinesep=2pt\extrarowsep=0pt +% \begin{tabu}to 15cm{@{}|[test]*3{>{\tabustrutrule=2pt\tabulinesep=0pt\extrarowsep=#1}X[mc]|[test]}>{\tabustrutrule=2pt\tabulinesep=0pt\extrarowsep=#1}X[1.3mc]|[test]} +% \tabucline[test]- +% \rowfont\bfseries +% Standard \textt c column & \textt{X[-1,c]} columns & Math mode & Mixed: \textt{X[-1c]X[-1c\$]} +% \\ \tabucline[test]- +% \smalltest{*2c}{One & Two \\ \hline Three & Four } +% & +% \smalltest{*2{X[-1,c]}}{One & Two \\ \hline Three & Four } +% & +% $\smalltest{*2c}{\alpha & \beta \\ \hline \dfrac \Phi \theta & \Gamma_x^t}$ +% & +% \smalltest{X[-1c]X[-1c$]}{First & \dpartial \Phi \theta \\ \hline Second & \dtotal \theta t} +% \\ \tabucline[testdash]- +% \multicolumn4{|[test]c|[test]}{\cs{extrarowsep}=$#1$} +% \\ \tabucline[test]- +% \end{tabu} +% }} +% +% \tikz{ +% \papergraduate (0,0) - (158mm,46mm); +% \node at (5mm,5mm) [anchor=south west,inner sep=0pt] {\test{3mm}}; +% } +% ^^A\pagebreak +% +% \tikz{ +% \papergraduate (0,0) - (158mm,40mm); +% \node at (5mm,5mm) [anchor=south west,inner sep=0pt] {\test{0mm}}; +% } +% } +% +% +% \subsection{\cs{abovetabulinesep}\, \cs{belowtabulinesep}\, and\, \cs{tabulinesep}} +% \label{tabulinesep.subsec} +% +% \begin{declcs}{abovetabulinesep}$=$\meta{dimen} \\ +% \csanchor{belowtabulinesep}$=$\meta{dimen} +% \end{declcs} +% +% \cs{abovetabulinesep} is the \emph{minimal} vertical space allowed between the cell content +% and the cell top border. Setting this dimension to a positive value will insert -- conditionally, +% depending on the cell content -- a vertical space above the cell content. +% +% \cs{belowtabulinesep} is conversely the minimal vertical space allowed to the bottom border of the cell. +% When \cs{belowtabulinesep}$>0pt$ a vertical space is inserted -- conditionnally, depending on the cell +% content -- below the cell content. +% +% \begin{declcs}{tabulinesep}$=$\meta{dimen} +% \end{declcs} +% +% \cs{tabulinesep} makes the assignment for both \csref{abovetabulinesep} and \csref{belowtabulinesep}. +% The macro can be prefixed by \cs{global}\footnote{However \cs{tabulinesep} is not a dimension ! +% You can't test, for example, \cs{ifdim}\cs{tabulinesep}$>0pt$ ! +% Test \cs{abovetabulinesep} and \cs{belowtabulinesep} instead, if needed.}. +% +% This parameter can be used in text and math modes to give more vertical space between lines, +% especially when using math formulae. +% +% Examples (with \csref{tabustrutrule}$=2pt$ to see the struts): +% +% +%\begin{tikzpicture} +% +% \papergraduate (0,0) - (158mm,32mm); +% +% \node at (5mm,5mm) [anchor=south west,inner sep=0pt] +% {{\tabulinesep=4pt\tabustrutrule=0pt\extrarowsep0pt +% \def\test#1{\tabulinesep=#1 \ifdim\abovetabulinesep>0pt \tabustrutrule=2pt\fi +% \begin{tabu}{|*2{X[-1c$]|}} \hline +% \dpartial \Phi \theta & \dtotal \theta t \\ \hline +% \end{tabu}}% +% \begin{tabu} to 15cm{@{}|[test]*3{X[cm]|[test]}} \tabucline[test]- +% \test{0mm} +% & +% \test{1mm} +% & +% \test{3mm} +% \\ \tabucline[testdash]- +% \cs{tabulinesep}$=0mm$ & \cs{tabulinesep}$=1mm$ & \cs{tabulinesep}$=3mm$ +% \\ \tabucline[test]- +% \end{tabu} +% } +% }; +% \end{tikzpicture} +% +% \centerline{Now you can compare with \csref{extrarowsep}:} +% +% \begin{tikzpicture} +% +% \papergraduate (0,0) - (158mm,29mm); +% +% \node at (5mm,5mm) [anchor=south west,inner sep=0pt] +% {{\tabulinesep=4pt\tabustrutrule=0pt\extrarowsep0pt +% \def\test#1{\tabulinesep=0pt\extrarowsep=#1 \ifdim\extrarowdepth>0pt \tabustrutrule=2pt\fi +% \begin{tabu}{|*2{X[-1c$]|}} \hline +% \dpartial \Phi \theta & \dtotal \theta t \\ \hline +% \end{tabu}}% +% \begin{tabu} to 15cm{@{}|[test]*3{X[cm]|[test]}} \tabucline[test]- +% \test{0mm} +% & +% \test{1mm} +% & +% \test{3mm} +% \\ \tabucline[testdash]- +% \cs{extrarowsep}$=0mm$ & \cs{extrarowsep}$=1mm$ & \cs{extrarowsep}$=3mm$ +% \\ \tabucline[test]- +% \end{tabu} +% } +% }; +% \end{tikzpicture} +% +% +% +% +% +% Presently (version 2.0), non zero value for \cs{tabulinesep} does not work properly with \cs{firsthline} and \cs{lasthline}, +% but you may use \cs{hline}, \csref{tabucline} and \Xpackage{booktabs} \cs{toprule}, \cs{midrule} and \cs{bottomrule}. +% +% +% +% +% \begin{declcs}{tabustrutrule}$=$\meta{dimen} +% \end{declcs} +% +% For debugging purpose only (or to learn how this works): \cs{tabustrutrule} behaves like \TeX{} \cs{overfullrule} +% and allows to see the struts introduced inside the cells to control the vertical spacing between lines. +% Struts are only inserted inside paragraph columns (\textt p,\, \textt m,\, \textt b\, columns and also +% \textt X columns which are paragraph columns as well). +% +% Normally, those struts are rules of width \textt{0pt}. % % % \section(Saving and restoring tabu){Saving and restoring a \textt{tabu}: \cs{savetabu}, \cs{usetabu} and \cs{preamble}} @@ -1302,7 +1613,7 @@ Copyright (C) 2010 by Florent Chervet % 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}}. +% \cs{usetabu} does not work with \hyperref[longtabu.sec]{\textt{longtabu}}. % % \needspace{2\baselineskip} % @@ -1317,10 +1628,16 @@ Copyright (C) 2010 by Florent Chervet % \textt p, \textt m or \textt b columns of the same widths as the ones that where calculated % at the time of \cs{savetabu} % \item \cs{tabcolsep} (or \cs{arraycolsep} in math mode) and \cs{arraystretch} -% \item \cs{arrayrulewidth}, \cs{doublerulesep}, \cs{extrarowheight} and \cs{extratabsurround} -% \item \cs{minrowclearance}, \cs{arrayrulecolor} and \cs{doublerulesepcolor} (package \xpackage{colortbl}) +% \item \cs{arrayrulewidth},\hfil \cs{doublerulesep},\hfil \cs{extrarowheight},\hfil \csref{extrarowdepth},\hfil \linebreak +% and \, \cs{extratabsurround}. +% \item \cs{minrowclearance},\, \cs{arrayrulecolor} \, and \, \cs{doublerulesepcolor} \, (package \Xpackage{colortbl}) % \end{itemize} % +% \csref{abovetabulinesep}\,and\, \csref{belowtabulinesep} are not restored, because they are related to the +% content of the tabular rather than to its shape, and\, \csref{tabustrutrule}\, is not restored because of +% its ``debugging'' nature. +% \medskip +% % Example: % % \begin{Verb*} @@ -1375,7 +1692,7 @@ Copyright (C) 2010 by Florent Chervet % % \cs{preamble} works exactly as if you defined a \hyperref[Custom environments]{custom environment} for \textt{tabu}. % -% \cs{preamble} works with \hyperref[sec.longtabu]{\textt{longtabu}}. +% \cs{preamble} works with \hyperref[longtabu.sec]{\textt{longtabu}}. % % Example (continued...): % @@ -1392,75 +1709,12 @@ Copyright (C) 2010 by Florent Chervet % \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}} -% -% \begin{declcs}{rowfont}\M[alignment]\M*{font specification} -% \end{declcs} -% -% Inside a \textt{tabu} environment, you can modify the font for each cell in a row. -% \cs{rowfont} has priority over column font specification, exactly like \cs{rowcolor} (package \xpackage{colortbl}) -% has priority over \cs{columncolor}. -% -% The alignment of each cell in one row can also be changed to: \topsep=0pt -% \begin{center} -% \begin{tabu}{>{\ttfamily}r@{\,$=$\,}lc>{\ttfamily}r} -% l &left &{\qquad\smaller or\, for \xpackage{ragged2e} settings: } &L \\ -% c ¢er & &C \\ -% r &right & &R \\ -% j &justify & &J \\ -% \end{tabu} -% \end{center} -% -% Any other value for the optional \meta{alignment} parameter is silently ignored. If \xpackage{ragged2e} is not loaded, -% \textt L\, \textt R\, \textt C\, and\, \textt J\, are synonymous with the lowercase equivalent. -% -% \begin{Verb*} -% \begin{tabu}{|X|X[-1]|} \tabucline- -% ($db(\rowfont))[c]\bfseries -% 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]- -% \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}} % % \subsection{Paragraph indentation} % -% \textt{tabu} takes care of paragraph indentation when it is used with \textt X columns and its default target, -% no matter if it has been loaded or not with the \textt{linegoal} option. -% Example with \LaTeX{} default: \cs{parindent} $=20$pt. -% -% {\parindent=20pt \let\tabudefaulttarget \linewidth -% -% \begin{tabu}{|[GreenYellow]X|[GreenYellow]} \tabucline[GreenYellow]- -% This is \textt{tabu} with its default target in an indented paragraph. \\ \tabucline[GreenYellow]- -% \end{tabu} -% -% \noindent\begin{tabu}{|[GreenYellow]X|[GreenYellow]}\tabucline[GreenYellow]- -% This is \textt{tabu} with its default target, preceded by \cs{noindent} \\ \tabucline[GreenYellow]- -% \end{tabu} -% -% -% \begin{tabularx}\linewidth{|X|} \hline -% This is \textt{tabularx} with target: \cs{linewidth} in an indented paragraph. \\ \hline -% \end{tabularx} -% -% \noindent\begin{tabularx}\linewidth{|X|} \hline -% This is \textt{tabularx} with target: \cs{linewidth}, preceded by \cs{noindent} \\ \hline -% \end{tabularx}} -% -% +% See \nameref{Paragraph indentation.subsec} +% % \subsection{Custom environments} % \label{Custom environments} % @@ -1788,7 +2042,7 @@ Copyright (C) 2010 by Florent Chervet % \begin{macrocode} %<*package> \NeedsTeXFormat{LaTeX2e}[2005/12/01] -\ProvidesPackage{tabu}[2011/01/15 v1.9 - flexible LaTeX tabulars (FC)] +\ProvidesPackage{tabu}[2011/01/25 v2.0 - flexible LaTeX tabulars (FC)] \RequirePackage{array}[2008/09/09] \RequirePackage{varwidth}[2009/03/30] % \end{macrocode} @@ -1816,21 +2070,29 @@ Copyright (C) 2010 by Florent Chervet % \cs{tracingtabu} is the same as option \textt{debugshow}. % % \begin{macrocode} -\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\relax}} +\def\tracingtabu{\begingroup\@ifnextchar=% + {\afterassignment\tabu@tracing\count@} + {\afterassignment\tabu@tracing\count@1\relax}} +\def\tabu@tracing{\expandafter\endgroup + \expandafter\tabu@tr@cing\number\count@\@nil +}% \tabu@tracing +\def\tabu@tr@cing #1\@nil{% + \ifnum#1>\z@ + \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 + \ifnum#1>\@ne \let\tabu@debug \message + \else \let\tabu@debug \@gobble \fi + \else + \let\tabu@message \@gobble + \let\tabu@message@save \@gobble + \let\tabu@debug \@gobble + \let\tabu@timerstart \relax + \fi +}% \tabu@tr@cing +\tracingtabu=\z@ +\DeclareOption{debugshow}{\AtEndOfPackage{\tracingtabu=2\relax}} % \end{macrocode} % \end{macro} % @@ -1863,7 +2125,7 @@ Copyright (C) 2010 by Florent Chervet \let\tabu@prepnext@tok \prepnext@tok \let\tabu@save@decl \save@decl \let\tabu@rowfont \tabu@norowfont \let\tabucline \tabu@nocline \let\tabu@firstcline \relax \let\tabu@lines \relax - \let\tabu@setup@everycr\relax + \let\tabu@setup@everycr\relax \let\tabu@multicolumn \multicolumn } } \def\tabu@norowfont{\PackageError{tabu} @@ -1893,7 +2155,15 @@ Copyright (C) 2010 by Florent Chervet \@ifpackageloaded{arydshln}{} {\let\tabu@adl@fix \relax \let\tabu@adl@endTRIAL \@empty}% \@ifpackageloaded{longtable}{}{\let\longtabu \tabu@nolongtabu}% + \@ifpackageloaded{cellspace} \tabu@warn@cellspace \relax } +\def\tabu@warn@cellspace{% + \PackageWarning{tabu}{% + Package cellspace has some limitations \MessageBreak + And redefines some macros of array.sty.\MessageBreak + Please use \string\tabulinesep\space to control\MessageBreak + vertical spacing of lines inside tabu environnement}% +}% \tabu@warn@cellspace % \end{macrocode} % % \subsection{Some constants} @@ -1976,6 +2246,32 @@ Copyright (C) 2010 by Florent Chervet % \end{macro} % \end{macro} % +% \begin{macro}{\abovetabulinesep} +% \begin{macro}{\belowtabulinesep} +% \begin{macro}{\extrarowdepth} +% \begin{macro}{\tabustrutrule} +% +% The two dimensions \cs{abovetabulinesep} and \cs{belowtabulinesep} allow to control +% vertical spacing of lines inside a \textt{tabu} in a way similar to the philosophy of +% \Xpackage{cellspace}. However, limitations of \xpackage{cellspace} are lifted +% (nested \textt{tabu} environments, use of colors... see the +% \refitem{cellspace limitations}[\xpackage{cellspace} limitations] in the revision history). +% +% The dimen \cs{tabustrutrule} is here only for debugging purpose: its value must be \textt{0pt}. +% It behaves like \TeX{} \cs{overfullrule} to see the struts introduced to control the +% vertical spacing of lines. +% +% \begin{macrocode} +\newdimen \abovetabulinesep +\newdimen \belowtabulinesep +\newdimen \extrarowdepth +\newdimen \tabustrutrule \tabustrutrule \z@ +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% % % \begin{macro}{\iftabu@measuring} % @@ -2171,9 +2467,20 @@ Copyright (C) 2010 by Florent Chervet \NC@find \tabu@rewritemiddle }% NC@rewrite@\tabu@rewritefirst \def\tabu@savepreamble{% - \gdef\tabu@global@temp{}% \NC@list\expandafter{\tabu@NC@list}% \let\tabu@savedpreamble \@preamble + \ifdim \tabustrutrule>\z@ + \setbox\@arstrutbox\hbox{\vrule + \@height \ht\@arstrutbox + \@width \tabustrutrule + \@depth \dp\@arstrutbox}% + \fi + \ifdim \extrarowdepth>\z@ + \setbox\@arstrutbox\hbox{\vrule + \@height \ht\@arstrutbox + \@width \tabustrutrule + \@depth \dimexpr\dp\@arstrutbox+\arraystretch\extrarowdepth}% + \fi }% \tabu@savepreamble % \end{macrocode} % \end{macro} @@ -2253,6 +2560,31 @@ Copyright (C) 2010 by Florent Chervet % \end{macrocode} % \end{macro} % +% \begin{macro}{\tabu@rewrite@multicolumn} +% +% A special rewrite to allow \texttbf\textbar\M*[...] in \cs{multicolumn} preamble inside \textt{tabu} environment. +% +% \begin{macrocode} +\tabu@newcolumntype \tabu@rewrite@multicolumn{% + \aftergroup\endgroup % after \@mkpream group (restores \multispan) + \tabu@lines + \ifcat$\d@llarend\else + \let\save@decl \tabu@save@decl \fi % no inversion of tokens in text mode + \NC@find +}% \tabu@rewrite@multicolumn +\def\tabu@multicolumn{% + \expandafter\ifx\csname\@currenvir\endcsname\tabu + \expandafter\tabu@multic@lumn + \else \expandafter\tabu@multicolumnORI + \fi +}% \tabu@multicolumn +\def\tabu@multic@lumn#1#2{\multispan{#1}\begingroup + \NC@list{\NC@do \tabu@rewrite@multicolumn}\let\multispan \@gobble + \tabu@multicolumnORI{#1}{\tabu@rewrite@multicolumn #2}% +}% \tabu@multic@lumn +% \end{macrocode} +% \end{macro} +% % % \begin{macro}{\iftabu@colortbl} % @@ -2326,6 +2658,8 @@ Copyright (C) 2010 by Florent Chervet \advance\tabu@nested \@ne \def\tabu@aligndefault{t}\let\tabudefaulttarget \linewidth \else \tabu@timerstart + \let\tabu@multicolumnORI \multicolumn + \let\multicolumn \tabu@multicolumn \def\tabu@aligndefault{c}\edef\tabu@hfuzz {\the\hfuzz}% \global\tabu@footnotes{}\aftergroup\the\aftergroup\tabu@footnotes \ifdim\parindent>\z@ \ifx\linewidth\tabudefaulttarget @@ -2337,6 +2671,11 @@ Copyright (C) 2010 by Florent Chervet }% \fi\fi \fi + \ifcase 0\ifdim\abovetabulinesep>\z@ 1\else\ifdim\belowtabulinesep>\z@ 1\fi\fi + \let\tabu@celllalign \@empty \let\tabu@cellralign \@empty + \else \def\tabu@celllalign{\tabu@verticalmeasure}% + \def\tabu@cellralign{\tabu@verticalspacing}% + \fi \let\@footnotetext \tabu@footnotetext \let\@xfootnotetext \tabu@xfootnotetext \let\@xfootnote \tabu@xfootnote \let\centering \tabu@centering \let\raggedright \tabu@raggedright \let\raggedleft \tabu@raggedleft @@ -2414,8 +2753,8 @@ Copyright (C) 2010 by Florent Chervet % \begin{macrocode} \def\tabu@preparesave #1{% \iftabu@colortbl \@temptokena{}% - \tabu@prepare@save\CT@arc@ - \tabu@prepare@save\CT@drsc@ + \tabu@prepare@save \CT@arc@ + \tabu@prepare@save \CT@drsc@ \fi \edef\tabu@savedparam{% \ifmmode \col@sep \the\arraycolsep @@ -2423,6 +2762,7 @@ Copyright (C) 2010 by Florent Chervet \arrayrulewidth \the\arrayrulewidth\relax \doublerulesep \the\doublerulesep\relax \extrarowheight \the\extrarowheight\relax + \extrarowdepth \the\extrarowdepth\relax \extratabsurround \the\extratabsurround\relax \def\noexpand\arraystretch {\arraystretch}% \iftabu@colortbl \minrowclearance\the\minrowclearance\relax @@ -2802,24 +3142,28 @@ Copyright (C) 2010 by Florent Chervet \if l\@let@token 4\else \if c\@let@token 5\else \if r\@let@token 6\else - \if L\@let@token 7\else - \if C\@let@token 8\else - \if R\@let@token 9\else - \ifx \@sptoken\@let@token 10\else - \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\relax + \if j\@let@token 7\else + \if L\@let@token 8\else + \if C\@let@token 9\else + \if R\@let@token 10\else + \if J\@let@token 11\else + \ifx \@sptoken\@let@token 12\else + \if .\@let@token 13\else + \if -\@let@token 13\else + \ifcat $\@let@token 14\else + 15\fi\fi\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}% \or \tabu@Xtype {b}% - \or \tabu@Xalign \raggedright - \or \tabu@Xalign \centering - \or \tabu@Xalign \raggedleft - \or \tabu@Xalign \RaggedRight - \or \tabu@Xalign \Centering - \or \tabu@Xalign \RaggedLeft + \or \tabu@Xalign \raggedright\relax + \or \tabu@Xalign \centering\relax + \or \tabu@Xalign \raggedleft\relax + \or \tabu@Xalign \tabu@justify\relax + \or \tabu@Xalign \RaggedRight\raggedright + \or \tabu@Xalign \Centering\centering + \or \tabu@Xalign \RaggedLeft\raggedleft + \or \tabu@Xalign \justifying\tabu@justify \or \expandafter \tabu@Xparsespace \or \expandafter \tabu@Xcoef \or \let\tabu@Xmath=$\expandafter \tabu@Xparse @@ -2827,10 +3171,12 @@ Copyright (C) 2010 by Florent Chervet \else\expandafter \tabu@Xparse \fi }% \tabu@Xtest -\def\tabu@Xalign#1{% +\def\tabu@Xalign#1#2{% \ifx \tabucolX@align\@empty \else \PackageWarning{tabu} {Duplicate horizontal alignment specification}\fi - \def\tabucolX@align{#1}\expandafter\tabu@Xparse + \ifdefined#1\def\tabucolX@align{#1}\else + \def\tabucolX@align{#2}\fi + \expandafter\tabu@Xparse }% \tabu@Xalign \def\tabu@Xtype#1{% \ifx \tabucolX@rw\@empty \else \PackageWarning{tabu} @@ -2919,6 +3265,8 @@ Copyright (C) 2010 by Florent Chervet \let\write \tabu@nowrite \let\GenericError \tabu@GenericError \long\def\@xfootnote[##1]##2{}\let\@footnotetext \@gobble \ifx\@arrayright\relax \let\@arrayright \@empty\fi + \let\tabu@verticalmeasure \@empty + \let\tabu@verticalspacing \@empty \tabu@TRIAL@hook }% \tabu@setup@TRIAL \def\tabu@savecounters{% @@ -2954,6 +3302,9 @@ Copyright (C) 2010 by Florent Chervet \def\tabu@arrayleftmeasure#1\bgroup{% \def\tabu@Xfinish{% \tabu@global@Xnested \ifnum0=`{}\fi\endgroup + \ifdim \abovetabulinesep>\z@ \setbox\@arstrutbox\box\voidb@x + \else\ifdim\belowtabulinesep>\z@ \setbox\@arstrutbox\box\voidb@x + \fi\fi \tabu@global@X #1\bgroup}% \def\tabu@TRIAL {\setbox\tabu@box \hbox\bgroup $#1\bgroup \the\toks@ \tabu@endTRIAL}% @@ -2968,7 +3319,7 @@ Copyright (C) 2010 by Florent Chervet % \begin{macro}{\tabu@long@arrayleft@measure} % % This is the long version for \textt{longtabu} -% +% % \begin{macrocode} \long\def\tabu@long@arrayleft@measure #1\LT@bchunk #2\LT@bchunk{% \def\tabu@Xfinish{% @@ -3221,6 +3572,7 @@ Copyright (C) 2010 by Florent Chervet \def\arrayrulewidth ####1\relax{(tabu) arrayrulewidth #1 = ####1^^J}% \def\doublerulesep ####1\relax {(tabu) doublerulesep #1 #1= ####1^^J}% \def\extrarowheight ####1\relax{(tabu) extrarowheight #1 = ####1^^J}% + \def\extrarowdepth ####1\relax {(tabu) extrarowdepth #1 #1= ####1^^J}% \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}% @@ -3286,13 +3638,16 @@ Copyright (C) 2010 by Florent Chervet }\x \setbox\tabu@box=\hbox\bgroup \let\tabu@rewrite@X \tabu@@rewrite@X + \tabu@nocellspace \begin{varwidth}{\tabu@temp}\narrowragged\arraybackslash \tabu@noadjustspacing \parfillskip\@flushglue \bgroup \aftergroup\tabu@measure@endpbox + \ifdefined \cellspacetoplimit \bgroup\color@begingroup\fi \else \expandafter\@gobble\@startpbox{#1}% \@gobble \bgroup \fi }% \tabu@measure@startpbox +\def\tabu@nocellspace{\def\bcolumn##1\@nil{}\let\ecolumn\@empty} \ifdefined\pdfadjustspacing \def\tabu@noadjustspacing{\pdfadjustspacing\z@}% \else @@ -3431,7 +3786,14 @@ Copyright (C) 2010 by Florent Chervet \iftabu@colortbl\begingroup\noexpand\CT@arc@\fi \noexpand\tabu@vline\arrayrulewidth \iftabu@colortbl\endgroup\fi}}% - \else \futurelet \tabu@temp \tabuvline@argi #1\p@\p@\@nnil \tabuvline@argiii + \else + \ifcsname tabu@line@style@\detokenize {#1}\endcsname + \def\tabu@temp##1\relax##2\relax{##1}% + \expandafter\tabu@temp\romannumeral-`\q + \csname tabu@line@style@\detokenize {#1}\endcsname + \tabuvline@argiii + \else \futurelet \tabu@temp \tabuvline@argi #1\p@\p@\@nnil \tabuvline@argiii + \fi \fi }% \tabuvline@arg \def\tabuvline@argi{% @@ -3537,7 +3899,7 @@ Copyright (C) 2010 by Florent Chervet % (then \cs{tabu@getline} is expanded) or a \cs{leaders} specification (then \cs{tabu@leaders} is expanded). % % \begin{macrocode} -\def\tabu@getlinespec#1{\let\tabu@xleaders \relax +\def\tabu@getlinespec#1{\let\tabu@xleaders \relax \let\tabu@color \@empty \@defaultunits \let\@tempa=#1 \relax\@nnil \ifx\@tempa\relax \let\tabu@xleaders \tabu@defaultleaders\else \ifx\@tempa\hbox \tabu@defleaders{#1}\else @@ -3563,12 +3925,15 @@ Copyright (C) 2010 by Florent Chervet % This macro parses the optional argument of \cs{tabucline} (or the one of \cs{tabulinestyle}) % and extract the thickness, the dash an gap specified. Default values assignments are done either. % +% \begin{macro}{\tabu@maybecolor} +% +% +% % \begin{macrocode} \def\tabu@getline#1{\tabu@lineon #1 \@nil on\tabu@linedash \p@ \@nil\@nnil{#1}} \def\tabu@maybecolor{\ifx\tabu@color\@empty \afterassignment\tabu@colortest \else \@defaultunits\fi} \def\tabu@lineon #1on#2\@nil#3\@nnil#4{% - \let\tabu@color \@empty \@defaultunits \let\@tempa=#1 \relax\@nnil \ifcase 0\ifx o\@tempa 1\else\ifcat A\noexpand\@tempa 2\fi\fi\relax \tabu@maybecolor \@tempdima #1\arrayrulewidth \p@\@nnil @@ -3614,6 +3979,7 @@ Copyright (C) 2010 by Florent Chervet }% \tabu@lineoff % \end{macrocode} % \end{macro} +% \end{macro} % % \begin{macro}{\tabu@colortest} % @@ -3644,16 +4010,19 @@ Copyright (C) 2010 by Florent Chervet % % \begin{macro}{\tabulinestyle} % -% \cs{tabulinestyle}\M*{style=spec.} +% \cs{tabulinestyle}\M*{style=spec.} % % \begin{macrocode} \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@\detokenize{#1}\expandafter\endcsname - \expandafter{\expandafter\def\expandafter\tabu@xleaders - \expandafter{\tabu@xleaders}}% + \begingroup \tabu@getlinespec {#2}% + \toks@\expandafter{\tabu@xleaders}% + \@temptokena\expandafter{\tabu@color}% + \expandafter\xdef\csname tabu@line@style@\detokenize{#1}\endcsname + {\@tempdima\the\@tempdima + \def\noexpand\tabu@color{\the\@temptokena}\relax + \def\noexpand\tabu@xleaders{\the\toks@}\relax}% \endgroup }% \tabu@linestyle \expandafter\def \csname tabu@line@style@\endcsname {% @@ -3675,6 +4044,9 @@ Copyright (C) 2010 by Florent Chervet % \subsection(Verbatim with X columns){Verbatim inside \textt{tabu} with \textt X columns} % % \begin{macro}{\tabu@sanitizetext} +% +% +% % \begin{macrocode} {\catcode32=13\relax\catcode`\^^@=13\relax \gdef\tabu@verb{\@sanitize\catcode`\^=7\edef\^{\string^}\tabu@makeatletter @@ -3726,6 +4098,9 @@ Copyright (C) 2010 by Florent Chervet % \end{macro} % % \begin{macro}{\tabu@getdecimal} +% +% +% % \begin{macrocode} \def\tabu@getdecimal{% \ifcase 0\ifx 0\tabu@temp\else @@ -3763,8 +4138,147 @@ Copyright (C) 2010 by Florent Chervet }% \tabu@printdecimal % \end{macrocode} % \end{macro} +% +% \sectionformat\subsection{bookmark={color*=DarkRed}} +% \subsection{\cs{extrarowsep} and \cs{tabulinesep}} +% +% \begin{macro}{\extrarowsep} +% +% \cs{extrarowsep} makes the assignment for both \cs{extrarowheight} and \cs{extrarowdepth}. +% +% The macro may be prefixed by \cs{global}. +% +% \begin{macrocode} +\def\extrarowsep{\edef\tabu@C@rowsep{\the\numexpr\tabu@C@rowsep+1}% + \aftergroup\tabu@Growsep + \afterassignment\tabu@setrowsep \extrarowheight +}% \extrarowsep +\def\tabu@setrowsep{% + \extrarowdepth\extrarowheight + \tabu@Gsave \tabu@G@rowsep \tabu@C@rowsep \extrarowheight \extrarowdepth +}% \tabu@setrowsep +\def\tabu@Growsep{\ifx \tabu@G@rowsep\@empty \else \tabu@Rrowsep\fi} +\def\tabu@Rrowsep{\tabu@Grestore \tabu@G@rowsep \tabu@C@rowsep} +\let\tabu@C@rowsep \z@ +\let\tabu@G@rowsep \@empty +% \end{macrocode} +% \end{macro} % +% \begin{macro}{\tabulinesep} % +% \cs{tabulinesep} makes the assignment for both \cs{abovetabulinesep} and \cs{belowtabulinesep}, +% similar to \xpackage{cellspace} \cs{cellspacetoplimit} and \cs{cellspacebottomlimit}. +% +% The macro may be prefixed by \cs{global}. +% +% \begin{macrocode} +\def\tabulinesep{\edef\tabu@C@linesep{\the\numexpr\tabu@C@linesep+1}% + \aftergroup\tabu@Glinesep + \afterassignment\tabu@setlinesep \abovetabulinesep +}% \tabulinesep +\def\tabu@setlinesep{% + \belowtabulinesep\abovetabulinesep + \tabu@Gsave \tabu@G@linesep \tabu@C@linesep \abovetabulinesep \belowtabulinesep +}% \tabu@setlinesep +\def\tabu@Glinesep{\ifx \tabu@G@linesep\@empty \else \tabu@Rlinesep\fi} +\def\tabu@Rlinesep{\tabu@Grestore \tabu@G@linesep \tabu@C@linesep} +\let\tabu@C@linesep \z@ +\let\tabu@G@linesep \@empty +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\tabu@Gsave} +% \begin{macro}{\tabu@Grestore} +% +% Utility macro to implement the possibility to prefix a macro by \cs{global}. +% +% \begin{macrocode} +\def\tabu@Gsave #1#2#3#4{\xdef#1{#1% + \toks#2{\toks\the\currentgrouplevel{\global#3\the#3\global#4\the#4}}}% +}% \tabu@Gsave +\def\tabu@Grestore#1#2{\begingroup + \toks#2{}#1\toks\currentgrouplevel\expandafter{\expandafter}\the\toks#2\relax + \ifcat$\the\toks\currentgrouplevel$\else + \global\let#1\@empty \global\let#2\z@ + \fi + \expandafter\endgroup + \the\toks\currentgrouplevel +}% \tabu@Grestore +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% +% \begin{macro}{\tabu@verticalmeasure} +% +% +% +% \begin{macrocode} +\def\tabu@verticalmeasure{% + \ifnum \currentgrouptype>12 + \begingroup\lrbox\tabu@box \d@llarbegin + \let\tabu@verticalspacing \tabu@verticalsp@lcr + \else + \setbox\tabu@box + \ifnum \currentgrouptype=5\vtop\else\vbox\fi \bgroup + \everypar{}\let\@finalstrut \@gobble + \let\tabu@verticalspacing \tabu@verticalsp@pmb + \fi +}% \tabu@verticalmeasure +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\tabu@verticalsp@lcr} +% +% Vertical spacing adjustment for standard \textt l,\, \textt c,\, \textt r\, columns. +% +% \begin{macrocode} +\def\tabu@verticalsp@lcr{% adjust \ht \tabu@box and \dp \tabu@box + \d@llarend\endlrbox\endgroup + \@tempdima \dimexpr \ht\@arstrutbox -\ht\tabu@box \relax + \@tempdimb \dimexpr \dp\@arstrutbox -\dp\tabu@box \relax + \ifdim \@tempdima<\abovetabulinesep + \ht\tabu@box=\dimexpr \ht\tabu@box+\abovetabulinesep\relax \fi + \ifdim \@tempdimb<\belowtabulinesep + \dp\tabu@box=\dimexpr \dp\tabu@box+\belowtabulinesep \relax \fi + \leavevmode \box\tabu@box +}% \tabu@verticalsp@lcr +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\tabu@verticalsp@pmb} +% +% Vertical spacing adjustment with struts for \textt p,\, \textt m,\, or \textt b\, columns. +% +% \begin{macrocode} +\def\tabu@verticalsp@pmb{% inserts struts as needed + \par \expandafter\egroup + \expandafter\@tempdimc \the\prevdepth + \@tempdima \dimexpr \ht\@arstrutbox -\ht\tabu@box \relax + \@tempdimb \dimexpr \dp\@arstrutbox -\@tempdimc \relax + \ifdim \@tempdima<\abovetabulinesep + \llap {\vrule + \@height \dimexpr\ht\tabu@box+\abovetabulinesep\relax + \@depth -\ht\tabu@box + \@width \tabustrutrule + }\nointerlineskip \vskip-\ht\tabu@box + \fi + \unvbox\tabu@box + \ifdim \@tempdimb<\belowtabulinesep + \llap{\vrule + \@depth \dimexpr \belowtabulinesep \relax + \@height \z@ + \@width \tabustrutrule + }\nointerlineskip%\vskip-\@tempdimc + \let\@finalstrut \@gobble + \fi +}% \tabu@verticalsp@pmb +% \end{macrocode} +% \end{macro} +% +% +% +% \sectionformat\subsection{bookmark={color*=DarkRed}} % \subsection{\cs{savetabu}} % % \begin{macro}{\savetabu} @@ -3830,11 +4344,13 @@ Copyright (C) 2010 by Florent Chervet }% \tabu@savewd \def\tabu@make@arstrutbox{% \@tempdima \ht \strutbox + \@tempdimb \dp \strutbox \advance \@tempdima by\extrarowheight + \advance \@tempdimb by\extrarowdepth \setbox \@arstrutbox \hbox{\vrule \@height \arraystretch \@tempdima - \@depth \arraystretch \dp \strutbox - \@width \z@}% + \@depth \arraystretch \@tempdimb + \@width \z@}% }% \tabu@make@arstrutbox % \end{macrocode} % \end{macro} @@ -3857,7 +4373,7 @@ Copyright (C) 2010 by Florent Chervet % \end{macro} % \end{macro} % -% +% \sectionformat\subsection{bookmark={color*=DarkRed}} % \subsection(\cs{rowfont}){\csbf{rowfont}} % % \subsubsection(Font and alignment){Setting font and alignment specification} @@ -3883,9 +4399,11 @@ Copyright (C) 2010 by Florent Chervet \global\let\tabu@rowfontreset \tabu@rowfont@reset \global\let\tabu@@cellleft \tabu@cellleft \global\let\tabu@@cellright \tabu@cellright + \global\let\tabu@@celllalign \tabu@celllalign + \global\let\tabu@@cellralign \tabu@cellralign \gdef\tabu@cellfont{\let\color \tabu@colorleavevmode#2\let\color \tabu@colorORI}% - \ifcsname tabu@cell@#1\endcsname % row alignment - \csname tabu@cell@#1\endcsname \fi + \ifcsname tabu@cell@#1\endcsname % row alignment + \csname tabu@cell@#1\endcsname \fi \toks@\expandafter {\tabu@cellleft\tabu@cellfont}% inside \noalign group ok \xdef\tabu@cellleft {\the\toks@}% \ifnum0=`{\fi}% end of noalign group @@ -3910,11 +4428,11 @@ Copyright (C) 2010 by Florent Chervet \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\let\tabu@celllalign \tabu@@celllalign + \global\let\tabu@cellralign \tabu@@cellralign }% }% \tabu@rowfont@reset -\let\tabu@rowfontreset\@empty +\let\tabu@rowfontreset \@empty % \end{macrocode} % \end{macro} % @@ -3977,7 +4495,9 @@ Copyright (C) 2010 by Florent Chervet \ifnum \count@<\z@ % \@tempcnta \@M % \tabu@nbcols\z@ - \xdef\tabu@global@temp{\tabu@global@temp \tabu@nbcols\z@}% + \let\tabu@fornoopORI \@fornoop + \expandafter\gdef\expandafter\tabu@global@temp\expandafter{% + \tabu@global@temp\gdef\tabu@global@temp{}\tabu@nbcols\z@}% \expandafter\let\csname tabu@tok@1L\endcsname \relax \tabu@cellrightfalse \else @@ -3994,6 +4514,7 @@ Copyright (C) 2010 by Florent Chervet \tabu@preptokenleft \or % (case 1) previous token is right \tabu@savetok R\tabu@cellrighttrue + \let\@fornoop \tabu@lastnoop \else % special column: do not change the token \ifnum \tabu@nbcols>\z@ %special column: always on the right of normal one \tabu@savetok R% @@ -4008,13 +4529,15 @@ Copyright (C) 2010 by Florent Chervet \fi \tabu@prepnext@tokORI }% \tabu@prepnext@tok +\long\def\tabu@lastnoop#1\@@#2#3{\in@\@nextchar{#2}% + \ifin@ \let\@fornoop \tabu@fornoopORI \expandafter\prepnext@tok \fi} \def\tabu@preptokenright{% \advance \count@ \m@ne \toks\count@\expandafter {\the\toks\count@ \tabu@cellright \tabu@cellralign}% \advance \count@ \@ne }% \tabu@preptokenright -\def\tabu@preptokenleft{\toks\count@\expandafter {\expandafter\tabu@celllalign - \the\toks\count@ \tabu@cellleft}% +\def\tabu@preptokenleft{\toks\count@\expandafter{\expandafter\tabu@celllalign + \the\toks\count@ \tabu@cellleft}% }% \tabu@preptokenleft \def\tabu@savetok#1{\begingroup \expandafter\tabu@savet@k\csname tabu@tok@\the\tabu@nbcols #1\endcsname @@ -4044,11 +4567,11 @@ Copyright (C) 2010 by Florent Chervet % \begin{macro}{\tabu@cellfont} % First initialisation to \cs{@empty}. % \begin{macrocode} -\let\tabu@cellleft\@empty -\let\tabu@cellright\@empty -\def\tabu@celllalign{\tabu@cellleft}% row font spec. applies to pre-column material -\let\tabu@cellralign\@empty -\let\tabu@cellfont\@empty +\let\tabu@cellleft \@empty +\let\tabu@cellright \@empty +\def\tabu@celllalign {\tabu@cellleft}% row font spec. applies to pre-column material +\let\tabu@cellralign \@empty +\let\tabu@cellfont \@empty % \end{macrocode} % \end{macro} % \end{macro} @@ -4056,6 +4579,19 @@ Copyright (C) 2010 by Florent Chervet % \end{macro} % \end{macro} % +% \begin{macro}{\tabu@cell@align} +% \begin{macrocode} +\def\tabu@cell@align #1#2#3{% + \toks@\expandafter{\tabu@celllalign #1}% + \xdef\tabu@celllalign{\the\toks@}% + \toks@\expandafter{\tabu@cellralign #2}% + \xdef\tabu@cellralign{\the\toks@}% + \toks@\expandafter{\tabu@cellleft #3}% + \xdef\tabu@cellleft{\the\toks@}% +}% \tabu@cell@align +% \end{macrocode} +% \end{macro} +% % \begin{macro}{\tabu@cell@l} % \begin{macro}{\tabu@cell@c} % \begin{macro}{\tabu@cell@r} @@ -4067,34 +4603,28 @@ Copyright (C) 2010 by Florent Chervet % % \begin{macrocode} \def\tabu@cell@l{% force alignment to left - \gdef\tabu@celllalign{\tabu@removehfil - \raggedright\arraybackslash - \tabu@cellleft}% - \gdef\tabu@cellralign{\tabu@flush1\tabu@ignorehfil}% - \toks@\expandafter{\tabu@cellleft\raggedright\arraybackslash}% local - \xdef\tabu@cellleft{\the\toks@}% + \tabu@cell@align + {\tabu@removehfil \raggedright \tabu@cellleft}% left + {\tabu@flush1\tabu@ignorehfil}% right + \raggedright }% \tabu@cell@l \def\tabu@cell@c{% force alignment to center - \gdef\tabu@celllalign{\tabu@removehfil - \centering\arraybackslash - \tabu@flush{.5}\tabu@cellleft}% - \gdef\tabu@cellralign{\tabu@flush{.5}\tabu@ignorehfil}% - \toks@\expandafter{\tabu@cellleft\centering\arraybackslash}% local - \xdef\tabu@cellleft{\the\toks@}% + \tabu@cell@align + {\tabu@removehfil \centering \tabu@flush{.5}\tabu@cellleft} + {\tabu@flush{.5}\tabu@ignorehfil} + \centering }% \tabu@cell@c \def\tabu@cell@r{% force alignment to right - \gdef\tabu@celllalign{\tabu@removehfil - \raggedleft\arraybackslash - \tabu@flush1\tabu@cellleft}% - \gdef\tabu@cellralign{\tabu@ignorehfil}% - \toks@\expandafter{\tabu@cellleft\raggedleft\arraybackslash}% local - \xdef\tabu@cellleft{\the\toks@}% + \tabu@cell@align + {\tabu@removehfil \raggedleft \tabu@flush1\tabu@cellleft} + \tabu@ignorehfil + \raggedleft }% \tabu@cell@r \def\tabu@cell@j{% force justification (for p, m, b columns) - \gdef\tabu@celllalign{\tabu@justify\tabu@cellleft}% - \global\let\tabu@cellralign\@empty - \toks@\expandafter{\tabu@cellleft\tabu@justify}% local (noalign grp) - \xdef\tabu@cellleft{\the\toks@}% + \tabu@cell@align + {\tabu@justify\tabu@cellleft} + {} + \tabu@justify }% \tabu@cell@j \def\tabu@justify{% \leftskip\z@skip \@rightskip\leftskip \rightskip\@rightskip @@ -4102,34 +4632,31 @@ Copyright (C) 2010 by Florent Chervet }% \tabu@justify %% ragged2e settings \def\tabu@cell@L{% force alignment to left (ragged2e) - \gdef\tabu@celllalign{\tabu@removehfil - \RaggedRight\arraybackslash - \tabu@cellleft}% - \gdef\tabu@cellralign{\tabu@flush1\tabu@ignorehfil}% - \toks@\expandafter{\tabu@cellleft\RaggedRight\arraybackslash}% - \xdef\tabu@cellleft{\the\toks@}% + \tabu@cell@align + {\tabu@removehfil \RaggedRight \arraybackslash + \tabu@cellleft} + {\tabu@flush1\tabu@ignorehfil} + {\RaggedRight \arraybackslash}% }% \tabu@cell@L \def\tabu@cell@C{% force alignment to center (ragged2e) - \gdef\tabu@celllalign{\tabu@removehfil - \Centering\arraybackslash - \tabu@flush{.5}\tabu@cellleft}% - \gdef\tabu@cellralign{\tabu@flush{.5}\tabu@ignorehfil}% - \toks@\expandafter{\tabu@cellleft\Centering\arraybackslash}% - \xdef\tabu@cellleft{\the\toks@}% + \tabu@cell@align + {\tabu@removehfil \Centering \arraybackslash + \tabu@flush{.5}\tabu@cellleft} + {\tabu@flush{.5}\tabu@ignorehfil} + {\Centering \arraybackslash}% }% \tabu@cell@C \def\tabu@cell@R{% force alignment to right (ragged2e) - \gdef\tabu@celllalign{\tabu@removehfil - \RaggedLeft\arraybackslash - \tabu@flush1\tabu@cellleft}% - \gdef\tabu@cellralign{\tabu@ignorehfil}% - \toks@\expandafter{\tabu@cellleft\RaggedLeft\arraybackslash}% - \xdef\tabu@cellleft{\the\toks@}% + \tabu@cell@align + {\tabu@removehfil \RaggedLeft \arraybackslash + \tabu@flush1\tabu@cellleft} + {\tabu@ignorehfil} + {\RaggedLeft \arraybackslash}% }% \tabu@cell@R \def\tabu@cell@J{% force justification (ragged2e) - \gdef\tabu@celllallign{\justifying\arraybackslash\tabu@cellleft}% - \global\let\tabu@cellralign\@empty - \toks@\expandafter{\tabu@cellleft\justifying\arraybackslash}% - \xdef\tabu@cellleft{\the\toks@}% + \tabu@cell@align + {\justifying \arraybackslash \tabu@cellleft} + {} + {\justifying \arraybackslash}% }% \tabu@cell@J \def\tabu@flush#1{% \iftabu@colortbl % colortbl uses \hfill rather than \hfil @@ -4416,6 +4943,26 @@ Copyright (C) 2010 by Florent Chervet % % \sectionformat\subsection[hang]{font=\large\bfseries\macrocodecolor} % +% \begin{Version}{2011/01/25 v2.0}\HistLabel{2.0} +% \item \hyperref[vertical spacing.sec]{Vertical spacing} of lines implemented ! See \csref{tabulinesep} and \csref{extrarowsep}. +% \item \csref{tabulinestyle}: user defined line style can now be used inside the optional argument of the \texttbf\textbar\M*[...] +% preamble token. +% \item \texttbf\textbar\M*[...] is now allowed in \cs{multicolumn} preamble inside \textt{tabu} environment. +% (Disabled with the \hyperref[sec:light package option]{\textt{light} package option}.) +% \item Bug fixed inside \cs{tabu@prepnexttok} (again !!! - a difficult case !) +% \item Incompatibility of package \Xpackage{cellspace} with \textt{tabu spread} and \textt{tabu} with \label{cellspace limitations} +% \refitem{item:Negativ width coefficients}[negativ coefficients] for \textt{X} columns with has been lifted. \\ +% However, as said in the documentation of package \xpackage{cellspace}, \textt{S} column modifier does not work +% in the case of nested tabulars. \\ +% The \textt S column modifier becomes \textt C when the package \Xpackage{siunitx} is loaded +% (see \xpackage{siunitx} documentation). \\ +% Moreover, \xpackage{cellspace} does not work with \xpackage{color} or \xpackage{xcolor} and paragraph column types !! \\ +% Finally, \xpackage{cellspace} redefines \cs{@startpbox} and \cs{@endpbox} and is therefore not fully compatible +% with \xfile{array.sty} and therefore with \thispackage. \\ +% For all those reasons, \thispackage displays a warning to discourage the use of \xpackage{cellspace} with the +% \textt{tabu} environment. +% \end{Version} +% % \begin{Version}{2011/01/15 v1.9}\HistLabel{1.9} % \item Bug in \csref{savetabu} when used inside \textt{longtabu}... % \item Bug when \textt{tabu} with \textt X column is nested inside \textt{lontabu}. diff --git a/Master/texmf-dist/source/latex/tabu/tabu.ins b/Master/texmf-dist/source/latex/tabu/tabu.ins index 19d353d648c..e789445f372 100644 --- a/Master/texmf-dist/source/latex/tabu/tabu.ins +++ b/Master/texmf-dist/source/latex/tabu/tabu.ins @@ -8,7 +8,22 @@ %% %% This is a generated file. %% -%% tabu : 2011/01/15 v1.9 - tabu : Flexible LaTeX tabulars +%% tabu : 2011/01/25 v2.0 - tabu : Flexible LaTeX tabulars +%% +%% ******************************************************* +%% \begin{tabu} to { preamble } +%% \begin{tabu} spread { preamble } +%% +%% Default target: \linewidth or \linegoal: +%% +%% \tabulinesep=2pt +%% +%% \begin{tabu} { |[3pt red] X[4c] X[1c] X[-2ml] |[3pt blue] } +%% \tabucline[3pt on 2pt, cyan]- +%% one & two & three +%% \\ \tabucline[3pt yellow]- +%% \end{tabu} +%% ******************************************************* %% %% This work may be distributed and/or modified under the %% conditions of the LaTeX Project Public License, either @@ -21,23 +36,38 @@ %% tabu.sty, tabu.pdf, tabu.ins %% %% tabu : Flexible LaTeX tabulars -%% Copyright (C) 2010 by Florent Chervet +%% lppl copyright 2010-2011 by FC %% \input docstrip.tex \Msg{************************************************************************} \Msg{* Installation} -\Msg{* Package: 2011/01/15 v1.9 - tabu: Flexible LaTeX tabulars} +\Msg{* Package: 2011/01/25 v2.0 - tabu: Flexible LaTeX tabulars} \Msg{************************************************************************} \keepsilent \askforoverwritefalse -\let\MetaPrefix\relax +\let\MetaPrefix \relax \preamble This is a generated file. -tabu : 2011/01/15 v1.9 - tabu : Flexible LaTeX tabulars +tabu : 2011/01/25 v2.0 - tabu : Flexible LaTeX tabulars + +******************************************************* +\string\begin{tabu} to { preamble } +\string\begin{tabu} spread { preamble } + +Default target: \string\linewidth or \string\linegoal: + +\string\tabulinesep=2pt + +\string\begin{tabu} { |[3pt red] X[4c] X[1c] X[-2ml] |[3pt blue] } + \string\tabucline[3pt on 2pt, cyan]- + one & two & three + \string\\ \string\tabucline[3pt yellow]- +\string\end{tabu} +******************************************************* This work may be distributed and/or modified under the conditions of the LaTeX Project Public License, either @@ -50,10 +80,10 @@ and the derived files tabu.sty, tabu.pdf, tabu.ins tabu : Flexible LaTeX tabulars -Copyright (C) 2010 by Florent Chervet +lppl copyright 2010-2011 by FC \endpreamble -\let\MetaPrefix\DoubleperCent +\let\MetaPrefix \DoubleperCent \generate{% \file{tabu.ins}{\from{tabu.dtx}{install}}% @@ -81,7 +111,6 @@ Copyright (C) 2010 by Florent Chervet \Msg{************************************************************************} \endbatchfile - \endinput %% %% End of file `tabu.ins'. diff --git a/Master/texmf-dist/tex/latex/tabu/tabu.sty b/Master/texmf-dist/tex/latex/tabu/tabu.sty index fe2b5876561..dbeb1e7a15c 100644 --- a/Master/texmf-dist/tex/latex/tabu/tabu.sty +++ b/Master/texmf-dist/tex/latex/tabu/tabu.sty @@ -8,7 +8,22 @@ %% %% This is a generated file. %% -%% tabu : 2011/01/15 v1.9 - tabu : Flexible LaTeX tabulars +%% tabu : 2011/01/25 v2.0 - tabu : Flexible LaTeX tabulars +%% +%% ******************************************************* +%% \begin{tabu} to { preamble } +%% \begin{tabu} spread { preamble } +%% +%% Default target: \linewidth or \linegoal: +%% +%% \tabulinesep=2pt +%% +%% \begin{tabu} { |[3pt red] X[4c] X[1c] X[-2ml] |[3pt blue] } +%% \tabucline[3pt on 2pt, cyan]- +%% one & two & three +%% \\ \tabucline[3pt yellow]- +%% \end{tabu} +%% ******************************************************* %% %% This work may be distributed and/or modified under the %% conditions of the LaTeX Project Public License, either @@ -21,11 +36,10 @@ %% tabu.sty, tabu.pdf, tabu.ins %% %% tabu : Flexible LaTeX tabulars -%% Copyright (C) 2010 by Florent Chervet +%% lppl copyright 2010-2011 by FC %% - \NeedsTeXFormat{LaTeX2e}[2005/12/01] -\ProvidesPackage{tabu}[2011/01/15 v1.9 - flexible LaTeX tabulars (FC)] +\ProvidesPackage{tabu}[2011/01/25 v2.0 - flexible LaTeX tabulars (FC)] \RequirePackage{array}[2008/09/09] \RequirePackage{varwidth}[2009/03/30] \AtEndOfPackage{\tabu@AtEnd\let\tabu@AtEnd\@undefined} @@ -41,21 +55,29 @@ \TMP@EnsureCode{124}{12}% | \TMP@EnsureCode{0}{12}% ^^@ \TMP@EnsureCode{36}{3}% $ = math shift -\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\relax}} +\def\tracingtabu{\begingroup\@ifnextchar=% + {\afterassignment\tabu@tracing\count@} + {\afterassignment\tabu@tracing\count@1\relax}} +\def\tabu@tracing{\expandafter\endgroup + \expandafter\tabu@tr@cing\number\count@\@nil +}% \tabu@tracing +\def\tabu@tr@cing #1\@nil{% + \ifnum#1>\z@ + \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 + \ifnum#1>\@ne \let\tabu@debug \message + \else \let\tabu@debug \@gobble \fi + \else + \let\tabu@message \@gobble + \let\tabu@message@save \@gobble + \let\tabu@debug \@gobble + \let\tabu@timerstart \relax + \fi +}% \tabu@tr@cing +\tracingtabu=\z@ +\DeclareOption{debugshow}{\AtEndOfPackage{\tracingtabu=2\relax}} \let\tabudefaulttarget \linewidth \DeclareOption{linegoal}{% \AtEndOfPackage{% @@ -70,7 +92,7 @@ \let\tabu@prepnext@tok \prepnext@tok \let\tabu@save@decl \save@decl \let\tabu@rowfont \tabu@norowfont \let\tabucline \tabu@nocline \let\tabu@firstcline \relax \let\tabu@lines \relax - \let\tabu@setup@everycr\relax + \let\tabu@setup@everycr\relax \let\tabu@multicolumn \multicolumn } } \def\tabu@norowfont{\PackageError{tabu} @@ -86,7 +108,15 @@ \@ifpackageloaded{arydshln}{} {\let\tabu@adl@fix \relax \let\tabu@adl@endTRIAL \@empty}% \@ifpackageloaded{longtable}{}{\let\longtabu \tabu@nolongtabu}% + \@ifpackageloaded{cellspace} \tabu@warn@cellspace \relax } +\def\tabu@warn@cellspace{% + \PackageWarning{tabu}{% + Package cellspace has some limitations \MessageBreak + And redefines some macros of array.sty.\MessageBreak + Please use \string\tabulinesep\space to control\MessageBreak + vertical spacing of lines inside tabu environnement}% +}% \tabu@warn@cellspace \newcount \tabu@cnt \newcount \tabu@nbcols \newcount \tabu@X@cols @@ -99,6 +129,10 @@ \newdimen \tabucolX \newdimen \tabu@X@sum \newdimen \tabucolX@error \tabucolX@error=1em +\newdimen \abovetabulinesep +\newdimen \belowtabulinesep +\newdimen \extrarowdepth +\newdimen \tabustrutrule \tabustrutrule \z@ \newif \iftabu@measuring \newif \iftabu@spread \newif \iftabu@firstcline @@ -171,9 +205,20 @@ \NC@find \tabu@rewritemiddle }% NC@rewrite@\tabu@rewritefirst \def\tabu@savepreamble{% - \gdef\tabu@global@temp{}% \NC@list\expandafter{\tabu@NC@list}% \let\tabu@savedpreamble \@preamble + \ifdim \tabustrutrule>\z@ + \setbox\@arstrutbox\hbox{\vrule + \@height \ht\@arstrutbox + \@width \tabustrutrule + \@depth \dp\@arstrutbox}% + \fi + \ifdim \extrarowdepth>\z@ + \setbox\@arstrutbox\hbox{\vrule + \@height \ht\@arstrutbox + \@width \tabustrutrule + \@depth \dimexpr\dp\@arstrutbox+\arraystretch\extrarowdepth}% + \fi }% \tabu@savepreamble \tabu@newcolumntype \tabu@rewritemiddle{% \NC@list\expandafter{\tabu@NC@list \NC@do\tabu@endrewrite \NC@do\tabu@rewritelast}% @@ -229,6 +274,23 @@ \global\let#1\tabu@global@X \aftergroup\let \aftergroup\tabu@global@X \aftergroup#1% }% \tabu@global@Xnested +\tabu@newcolumntype \tabu@rewrite@multicolumn{% + \aftergroup\endgroup % after \@mkpream group (restores \multispan) + \tabu@lines + \ifcat$\d@llarend\else + \let\save@decl \tabu@save@decl \fi % no inversion of tokens in text mode + \NC@find +}% \tabu@rewrite@multicolumn +\def\tabu@multicolumn{% + \expandafter\ifx\csname\@currenvir\endcsname\tabu + \expandafter\tabu@multic@lumn + \else \expandafter\tabu@multicolumnORI + \fi +}% \tabu@multicolumn +\def\tabu@multic@lumn#1#2{\multispan{#1}\begingroup + \NC@list{\NC@do \tabu@rewrite@multicolumn}\let\multispan \@gobble + \tabu@multicolumnORI{#1}{\tabu@rewrite@multicolumn #2}% +}% \tabu@multic@lumn \newif\iftabu@colortbl \def\tabu@nowrite#1#{{\afterassignment}\toks@} \let\tabu@write\write @@ -262,6 +324,8 @@ \advance\tabu@nested \@ne \def\tabu@aligndefault{t}\let\tabudefaulttarget \linewidth \else \tabu@timerstart + \let\tabu@multicolumnORI \multicolumn + \let\multicolumn \tabu@multicolumn \def\tabu@aligndefault{c}\edef\tabu@hfuzz {\the\hfuzz}% \global\tabu@footnotes{}\aftergroup\the\aftergroup\tabu@footnotes \ifdim\parindent>\z@ \ifx\linewidth\tabudefaulttarget @@ -273,6 +337,11 @@ }% \fi\fi \fi + \ifcase 0\ifdim\abovetabulinesep>\z@ 1\else\ifdim\belowtabulinesep>\z@ 1\fi\fi + \let\tabu@celllalign \@empty \let\tabu@cellralign \@empty + \else \def\tabu@celllalign{\tabu@verticalmeasure}% + \def\tabu@cellralign{\tabu@verticalspacing}% + \fi \let\@footnotetext \tabu@footnotetext \let\@xfootnotetext \tabu@xfootnotetext \let\@xfootnote \tabu@xfootnote \let\centering \tabu@centering \let\raggedright \tabu@raggedright \let\raggedleft \tabu@raggedleft @@ -328,8 +397,8 @@ }% \tabu@@begin \def\tabu@preparesave #1{% \iftabu@colortbl \@temptokena{}% - \tabu@prepare@save\CT@arc@ - \tabu@prepare@save\CT@drsc@ + \tabu@prepare@save \CT@arc@ + \tabu@prepare@save \CT@drsc@ \fi \edef\tabu@savedparam{% \ifmmode \col@sep \the\arraycolsep @@ -337,6 +406,7 @@ \arrayrulewidth \the\arrayrulewidth\relax \doublerulesep \the\doublerulesep\relax \extrarowheight \the\extrarowheight\relax + \extrarowdepth \the\extrarowdepth\relax \extratabsurround \the\extratabsurround\relax \def\noexpand\arraystretch {\arraystretch}% \iftabu@colortbl \minrowclearance\the\minrowclearance\relax @@ -459,24 +529,28 @@ \if l\@let@token 4\else \if c\@let@token 5\else \if r\@let@token 6\else - \if L\@let@token 7\else - \if C\@let@token 8\else - \if R\@let@token 9\else - \ifx \@sptoken\@let@token 10\else - \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\relax + \if j\@let@token 7\else + \if L\@let@token 8\else + \if C\@let@token 9\else + \if R\@let@token 10\else + \if J\@let@token 11\else + \ifx \@sptoken\@let@token 12\else + \if .\@let@token 13\else + \if -\@let@token 13\else + \ifcat $\@let@token 14\else + 15\fi\fi\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}% \or \tabu@Xtype {b}% - \or \tabu@Xalign \raggedright - \or \tabu@Xalign \centering - \or \tabu@Xalign \raggedleft - \or \tabu@Xalign \RaggedRight - \or \tabu@Xalign \Centering - \or \tabu@Xalign \RaggedLeft + \or \tabu@Xalign \raggedright\relax + \or \tabu@Xalign \centering\relax + \or \tabu@Xalign \raggedleft\relax + \or \tabu@Xalign \tabu@justify\relax + \or \tabu@Xalign \RaggedRight\raggedright + \or \tabu@Xalign \Centering\centering + \or \tabu@Xalign \RaggedLeft\raggedleft + \or \tabu@Xalign \justifying\tabu@justify \or \expandafter \tabu@Xparsespace \or \expandafter \tabu@Xcoef \or \let\tabu@Xmath=$\expandafter \tabu@Xparse @@ -484,10 +558,12 @@ \else\expandafter \tabu@Xparse \fi }% \tabu@Xtest -\def\tabu@Xalign#1{% +\def\tabu@Xalign#1#2{% \ifx \tabucolX@align\@empty \else \PackageWarning{tabu} {Duplicate horizontal alignment specification}\fi - \def\tabucolX@align{#1}\expandafter\tabu@Xparse + \ifdefined#1\def\tabucolX@align{#1}\else + \def\tabucolX@align{#2}\fi + \expandafter\tabu@Xparse }% \tabu@Xalign \def\tabu@Xtype#1{% \ifx \tabucolX@rw\@empty \else \PackageWarning{tabu} @@ -553,6 +629,8 @@ \let\write \tabu@nowrite \let\GenericError \tabu@GenericError \long\def\@xfootnote[##1]##2{}\let\@footnotetext \@gobble \ifx\@arrayright\relax \let\@arrayright \@empty\fi + \let\tabu@verticalmeasure \@empty + \let\tabu@verticalspacing \@empty \tabu@TRIAL@hook }% \tabu@setup@TRIAL \def\tabu@savecounters{% @@ -564,6 +642,9 @@ \def\tabu@arrayleftmeasure#1\bgroup{% \def\tabu@Xfinish{% \tabu@global@Xnested \ifnum0=`{}\fi\endgroup + \ifdim \abovetabulinesep>\z@ \setbox\@arstrutbox\box\voidb@x + \else\ifdim\belowtabulinesep>\z@ \setbox\@arstrutbox\box\voidb@x + \fi\fi \tabu@global@X #1\bgroup}% \def\tabu@TRIAL {\setbox\tabu@box \hbox\bgroup $#1\bgroup \the\toks@ \tabu@endTRIAL}% @@ -767,6 +848,7 @@ \def\arrayrulewidth ####1\relax{(tabu) arrayrulewidth #1 = ####1^^J}% \def\doublerulesep ####1\relax {(tabu) doublerulesep #1 #1= ####1^^J}% \def\extrarowheight ####1\relax{(tabu) extrarowheight #1 = ####1^^J}% + \def\extrarowdepth ####1\relax {(tabu) extrarowdepth #1 #1= ####1^^J}% \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}% @@ -807,13 +889,16 @@ }\x \setbox\tabu@box=\hbox\bgroup \let\tabu@rewrite@X \tabu@@rewrite@X + \tabu@nocellspace \begin{varwidth}{\tabu@temp}\narrowragged\arraybackslash \tabu@noadjustspacing \parfillskip\@flushglue \bgroup \aftergroup\tabu@measure@endpbox + \ifdefined \cellspacetoplimit \bgroup\color@begingroup\fi \else \expandafter\@gobble\@startpbox{#1}% \@gobble \bgroup \fi }% \tabu@measure@startpbox +\def\tabu@nocellspace{\def\bcolumn##1\@nil{}\let\ecolumn\@empty} \ifdefined\pdfadjustspacing \def\tabu@noadjustspacing{\pdfadjustspacing\z@}% \else @@ -899,7 +984,14 @@ \iftabu@colortbl\begingroup\noexpand\CT@arc@\fi \noexpand\tabu@vline\arrayrulewidth \iftabu@colortbl\endgroup\fi}}% - \else \futurelet \tabu@temp \tabuvline@argi #1\p@\p@\@nnil \tabuvline@argiii + \else + \ifcsname tabu@line@style@\detokenize {#1}\endcsname + \def\tabu@temp##1\relax##2\relax{##1}% + \expandafter\tabu@temp\romannumeral-`\q + \csname tabu@line@style@\detokenize {#1}\endcsname + \tabuvline@argiii + \else \futurelet \tabu@temp \tabuvline@argi #1\p@\p@\@nnil \tabuvline@argiii + \fi \fi }% \tabuvline@arg \def\tabuvline@argi{% @@ -971,7 +1063,7 @@ \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 +\def\tabu@getlinespec#1{\let\tabu@xleaders \relax \let\tabu@color \@empty \@defaultunits \let\@tempa=#1 \relax\@nnil \ifx\@tempa\relax \let\tabu@xleaders \tabu@defaultleaders\else \ifx\@tempa\hbox \tabu@defleaders{#1}\else @@ -993,7 +1085,6 @@ \def\tabu@maybecolor{\ifx\tabu@color\@empty \afterassignment\tabu@colortest \else \@defaultunits\fi} \def\tabu@lineon #1on#2\@nil#3\@nnil#4{% - \let\tabu@color \@empty \@defaultunits \let\@tempa=#1 \relax\@nnil \ifcase 0\ifx o\@tempa 1\else\ifcat A\noexpand\@tempa 2\fi\fi\relax \tabu@maybecolor \@tempdima #1\arrayrulewidth \p@\@nnil @@ -1059,10 +1150,13 @@ \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@\detokenize{#1}\expandafter\endcsname - \expandafter{\expandafter\def\expandafter\tabu@xleaders - \expandafter{\tabu@xleaders}}% + \begingroup \tabu@getlinespec {#2}% + \toks@\expandafter{\tabu@xleaders}% + \@temptokena\expandafter{\tabu@color}% + \expandafter\xdef\csname tabu@line@style@\detokenize{#1}\endcsname + {\@tempdima\the\@tempdima + \def\noexpand\tabu@color{\the\@temptokena}\relax + \def\noexpand\tabu@xleaders{\the\toks@}\relax}% \endgroup }% \tabu@linestyle \expandafter\def \csname tabu@line@style@\endcsname {% @@ -1145,6 +1239,84 @@ \expandafter\tabu@decimal\expandafter{\the\@temptokena}% \fi\fi }% \tabu@printdecimal +\def\extrarowsep{\edef\tabu@C@rowsep{\the\numexpr\tabu@C@rowsep+1}% + \aftergroup\tabu@Growsep + \afterassignment\tabu@setrowsep \extrarowheight +}% \extrarowsep +\def\tabu@setrowsep{% + \extrarowdepth\extrarowheight + \tabu@Gsave \tabu@G@rowsep \tabu@C@rowsep \extrarowheight \extrarowdepth +}% \tabu@setrowsep +\def\tabu@Growsep{\ifx \tabu@G@rowsep\@empty \else \tabu@Rrowsep\fi} +\def\tabu@Rrowsep{\tabu@Grestore \tabu@G@rowsep \tabu@C@rowsep} +\let\tabu@C@rowsep \z@ +\let\tabu@G@rowsep \@empty +\def\tabulinesep{\edef\tabu@C@linesep{\the\numexpr\tabu@C@linesep+1}% + \aftergroup\tabu@Glinesep + \afterassignment\tabu@setlinesep \abovetabulinesep +}% \tabulinesep +\def\tabu@setlinesep{% + \belowtabulinesep\abovetabulinesep + \tabu@Gsave \tabu@G@linesep \tabu@C@linesep \abovetabulinesep \belowtabulinesep +}% \tabu@setlinesep +\def\tabu@Glinesep{\ifx \tabu@G@linesep\@empty \else \tabu@Rlinesep\fi} +\def\tabu@Rlinesep{\tabu@Grestore \tabu@G@linesep \tabu@C@linesep} +\let\tabu@C@linesep \z@ +\let\tabu@G@linesep \@empty +\def\tabu@Gsave #1#2#3#4{\xdef#1{#1% + \toks#2{\toks\the\currentgrouplevel{\global#3\the#3\global#4\the#4}}}% +}% \tabu@Gsave +\def\tabu@Grestore#1#2{\begingroup + \toks#2{}#1\toks\currentgrouplevel\expandafter{\expandafter}\the\toks#2\relax + \ifcat$\the\toks\currentgrouplevel$\else + \global\let#1\@empty \global\let#2\z@ + \fi + \expandafter\endgroup + \the\toks\currentgrouplevel +}% \tabu@Grestore +\def\tabu@verticalmeasure{% + \ifnum \currentgrouptype>12 + \begingroup\lrbox\tabu@box \d@llarbegin + \let\tabu@verticalspacing \tabu@verticalsp@lcr + \else + \setbox\tabu@box + \ifnum \currentgrouptype=5\vtop\else\vbox\fi \bgroup + \everypar{}\let\@finalstrut \@gobble + \let\tabu@verticalspacing \tabu@verticalsp@pmb + \fi +}% \tabu@verticalmeasure +\def\tabu@verticalsp@lcr{% adjust \ht \tabu@box and \dp \tabu@box + \d@llarend\endlrbox\endgroup + \@tempdima \dimexpr \ht\@arstrutbox -\ht\tabu@box \relax + \@tempdimb \dimexpr \dp\@arstrutbox -\dp\tabu@box \relax + \ifdim \@tempdima<\abovetabulinesep + \ht\tabu@box=\dimexpr \ht\tabu@box+\abovetabulinesep\relax \fi + \ifdim \@tempdimb<\belowtabulinesep + \dp\tabu@box=\dimexpr \dp\tabu@box+\belowtabulinesep \relax \fi + \leavevmode \box\tabu@box +}% \tabu@verticalsp@lcr +\def\tabu@verticalsp@pmb{% inserts struts as needed + \par \expandafter\egroup + \expandafter\@tempdimc \the\prevdepth + \@tempdima \dimexpr \ht\@arstrutbox -\ht\tabu@box \relax + \@tempdimb \dimexpr \dp\@arstrutbox -\@tempdimc \relax + \ifdim \@tempdima<\abovetabulinesep + \llap {\vrule + \@height \dimexpr\ht\tabu@box+\abovetabulinesep\relax + \@depth -\ht\tabu@box + \@width \tabustrutrule + }\nointerlineskip \vskip-\ht\tabu@box + \fi + \unvbox\tabu@box + \ifdim \@tempdimb<\belowtabulinesep + \llap{\vrule + \@depth \dimexpr \belowtabulinesep \relax + \@height \z@ + \@width \tabustrutrule + }\nointerlineskip%\vskip-\@tempdimc + \let\@finalstrut \@gobble + \fi +}% \tabu@verticalsp@pmb \newcommand*\savetabu[1]{\noalign{% \ifx\\#1\\\tabu@savewarn{}{The tabu will not be saved}\else \@ifundefined{tabu@saved@\string#1}{}{\tabu@savewarn{#1}{Overwritting}}% @@ -1202,11 +1374,13 @@ }% \tabu@savewd \def\tabu@make@arstrutbox{% \@tempdima \ht \strutbox + \@tempdimb \dp \strutbox \advance \@tempdima by\extrarowheight + \advance \@tempdimb by\extrarowdepth \setbox \@arstrutbox \hbox{\vrule \@height \arraystretch \@tempdima - \@depth \arraystretch \dp \strutbox - \@width \z@}% + \@depth \arraystretch \@tempdimb + \@width \z@}% }% \tabu@make@arstrutbox \def\tabu@savewarn#1#2{\PackageInfo{tabu} {User-name `#1' already used for \string\savetabu @@ -1219,9 +1393,11 @@ \global\let\tabu@rowfontreset \tabu@rowfont@reset \global\let\tabu@@cellleft \tabu@cellleft \global\let\tabu@@cellright \tabu@cellright + \global\let\tabu@@celllalign \tabu@celllalign + \global\let\tabu@@cellralign \tabu@cellralign \gdef\tabu@cellfont{\let\color \tabu@colorleavevmode#2\let\color \tabu@colorORI}% - \ifcsname tabu@cell@#1\endcsname % row alignment - \csname tabu@cell@#1\endcsname \fi + \ifcsname tabu@cell@#1\endcsname % row alignment + \csname tabu@cell@#1\endcsname \fi \toks@\expandafter {\tabu@cellleft\tabu@cellfont}% inside \noalign group ok \xdef\tabu@cellleft {\the\toks@}% \ifnum0=`{\fi}% end of noalign group @@ -1234,18 +1410,20 @@ \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\let\tabu@celllalign \tabu@@celllalign + \global\let\tabu@cellralign \tabu@@cellralign }% }% \tabu@rowfont@reset -\let\tabu@rowfontreset\@empty +\let\tabu@rowfontreset \@empty \newif\iftabu@cellright \AtBeginDocument{\let\tabu@prepnext@tokORI \prepnext@tok }% original definition \def\tabu@prepnext@tok{% \ifnum \count@<\z@ % \@tempcnta \@M % \tabu@nbcols\z@ - \xdef\tabu@global@temp{\tabu@global@temp \tabu@nbcols\z@}% + \let\tabu@fornoopORI \@fornoop + \expandafter\gdef\expandafter\tabu@global@temp\expandafter{% + \tabu@global@temp\gdef\tabu@global@temp{}\tabu@nbcols\z@}% \expandafter\let\csname tabu@tok@1L\endcsname \relax \tabu@cellrightfalse \else @@ -1262,6 +1440,7 @@ \tabu@preptokenleft \or % (case 1) previous token is right \tabu@savetok R\tabu@cellrighttrue + \let\@fornoop \tabu@lastnoop \else % special column: do not change the token \ifnum \tabu@nbcols>\z@ %special column: always on the right of normal one \tabu@savetok R% @@ -1276,13 +1455,15 @@ \fi \tabu@prepnext@tokORI }% \tabu@prepnext@tok +\long\def\tabu@lastnoop#1\@@#2#3{\in@\@nextchar{#2}% + \ifin@ \let\@fornoop \tabu@fornoopORI \expandafter\prepnext@tok \fi} \def\tabu@preptokenright{% \advance \count@ \m@ne \toks\count@\expandafter {\the\toks\count@ \tabu@cellright \tabu@cellralign}% \advance \count@ \@ne }% \tabu@preptokenright -\def\tabu@preptokenleft{\toks\count@\expandafter {\expandafter\tabu@celllalign - \the\toks\count@ \tabu@cellleft}% +\def\tabu@preptokenleft{\toks\count@\expandafter{\expandafter\tabu@celllalign + \the\toks\count@ \tabu@cellleft}% }% \tabu@preptokenleft \def\tabu@savetok#1{\begingroup \expandafter\tabu@savet@k\csname tabu@tok@\the\tabu@nbcols #1\endcsname @@ -1300,40 +1481,42 @@ \xdef\tabu@global@temp {\the\@temptokena \the\toks@}% \expandafter\endgroup \the\toks@ }% \tabu@savetok -\let\tabu@cellleft\@empty -\let\tabu@cellright\@empty -\def\tabu@celllalign{\tabu@cellleft}% row font spec. applies to pre-column material -\let\tabu@cellralign\@empty -\let\tabu@cellfont\@empty -\def\tabu@cell@l{% force alignment to left - \gdef\tabu@celllalign{\tabu@removehfil - \raggedright\arraybackslash - \tabu@cellleft}% - \gdef\tabu@cellralign{\tabu@flush1\tabu@ignorehfil}% - \toks@\expandafter{\tabu@cellleft\raggedright\arraybackslash}% local +\let\tabu@cellleft \@empty +\let\tabu@cellright \@empty +\def\tabu@celllalign {\tabu@cellleft}% row font spec. applies to pre-column material +\let\tabu@cellralign \@empty +\let\tabu@cellfont \@empty +\def\tabu@cell@align #1#2#3{% + \toks@\expandafter{\tabu@celllalign #1}% + \xdef\tabu@celllalign{\the\toks@}% + \toks@\expandafter{\tabu@cellralign #2}% + \xdef\tabu@cellralign{\the\toks@}% + \toks@\expandafter{\tabu@cellleft #3}% \xdef\tabu@cellleft{\the\toks@}% +}% \tabu@cell@align +\def\tabu@cell@l{% force alignment to left + \tabu@cell@align + {\tabu@removehfil \raggedright \tabu@cellleft}% left + {\tabu@flush1\tabu@ignorehfil}% right + \raggedright }% \tabu@cell@l \def\tabu@cell@c{% force alignment to center - \gdef\tabu@celllalign{\tabu@removehfil - \centering\arraybackslash - \tabu@flush{.5}\tabu@cellleft}% - \gdef\tabu@cellralign{\tabu@flush{.5}\tabu@ignorehfil}% - \toks@\expandafter{\tabu@cellleft\centering\arraybackslash}% local - \xdef\tabu@cellleft{\the\toks@}% + \tabu@cell@align + {\tabu@removehfil \centering \tabu@flush{.5}\tabu@cellleft} + {\tabu@flush{.5}\tabu@ignorehfil} + \centering }% \tabu@cell@c \def\tabu@cell@r{% force alignment to right - \gdef\tabu@celllalign{\tabu@removehfil - \raggedleft\arraybackslash - \tabu@flush1\tabu@cellleft}% - \gdef\tabu@cellralign{\tabu@ignorehfil}% - \toks@\expandafter{\tabu@cellleft\raggedleft\arraybackslash}% local - \xdef\tabu@cellleft{\the\toks@}% + \tabu@cell@align + {\tabu@removehfil \raggedleft \tabu@flush1\tabu@cellleft} + \tabu@ignorehfil + \raggedleft }% \tabu@cell@r \def\tabu@cell@j{% force justification (for p, m, b columns) - \gdef\tabu@celllalign{\tabu@justify\tabu@cellleft}% - \global\let\tabu@cellralign\@empty - \toks@\expandafter{\tabu@cellleft\tabu@justify}% local (noalign grp) - \xdef\tabu@cellleft{\the\toks@}% + \tabu@cell@align + {\tabu@justify\tabu@cellleft} + {} + \tabu@justify }% \tabu@cell@j \def\tabu@justify{% \leftskip\z@skip \@rightskip\leftskip \rightskip\@rightskip @@ -1341,34 +1524,31 @@ }% \tabu@justify %% ragged2e settings \def\tabu@cell@L{% force alignment to left (ragged2e) - \gdef\tabu@celllalign{\tabu@removehfil - \RaggedRight\arraybackslash - \tabu@cellleft}% - \gdef\tabu@cellralign{\tabu@flush1\tabu@ignorehfil}% - \toks@\expandafter{\tabu@cellleft\RaggedRight\arraybackslash}% - \xdef\tabu@cellleft{\the\toks@}% + \tabu@cell@align + {\tabu@removehfil \RaggedRight \arraybackslash + \tabu@cellleft} + {\tabu@flush1\tabu@ignorehfil} + {\RaggedRight \arraybackslash}% }% \tabu@cell@L \def\tabu@cell@C{% force alignment to center (ragged2e) - \gdef\tabu@celllalign{\tabu@removehfil - \Centering\arraybackslash - \tabu@flush{.5}\tabu@cellleft}% - \gdef\tabu@cellralign{\tabu@flush{.5}\tabu@ignorehfil}% - \toks@\expandafter{\tabu@cellleft\Centering\arraybackslash}% - \xdef\tabu@cellleft{\the\toks@}% + \tabu@cell@align + {\tabu@removehfil \Centering \arraybackslash + \tabu@flush{.5}\tabu@cellleft} + {\tabu@flush{.5}\tabu@ignorehfil} + {\Centering \arraybackslash}% }% \tabu@cell@C \def\tabu@cell@R{% force alignment to right (ragged2e) - \gdef\tabu@celllalign{\tabu@removehfil - \RaggedLeft\arraybackslash - \tabu@flush1\tabu@cellleft}% - \gdef\tabu@cellralign{\tabu@ignorehfil}% - \toks@\expandafter{\tabu@cellleft\RaggedLeft\arraybackslash}% - \xdef\tabu@cellleft{\the\toks@}% + \tabu@cell@align + {\tabu@removehfil \RaggedLeft \arraybackslash + \tabu@flush1\tabu@cellleft} + {\tabu@ignorehfil} + {\RaggedLeft \arraybackslash}% }% \tabu@cell@R \def\tabu@cell@J{% force justification (ragged2e) - \gdef\tabu@celllallign{\justifying\arraybackslash\tabu@cellleft}% - \global\let\tabu@cellralign\@empty - \toks@\expandafter{\tabu@cellleft\justifying\arraybackslash}% - \xdef\tabu@cellleft{\the\toks@}% + \tabu@cell@align + {\justifying \arraybackslash \tabu@cellleft} + {} + {\justifying \arraybackslash}% }% \tabu@cell@J \def\tabu@flush#1{% \iftabu@colortbl % colortbl uses \hfill rather than \hfil -- cgit v1.2.3