texlive[42610] Master/texmf-dist: tabstackengine (30nov16)

commits+karl at tug.org commits+karl at tug.org
Wed Nov 30 23:25:14 CET 2016


Revision: 42610
          http://tug.org/svn/texlive?view=revision&revision=42610
Author:   karl
Date:     2016-11-30 23:25:14 +0100 (Wed, 30 Nov 2016)
Log Message:
-----------
tabstackengine (30nov16)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/latex/tabstackengine/tabstackengine.pdf
    trunk/Master/texmf-dist/doc/latex/tabstackengine/tabstackengine.tex
    trunk/Master/texmf-dist/tex/latex/tabstackengine/tabstackengine.sty

Modified: trunk/Master/texmf-dist/doc/latex/tabstackengine/tabstackengine.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/tabstackengine/tabstackengine.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/tabstackengine/tabstackengine.tex	2016-11-30 22:25:02 UTC (rev 42609)
+++ trunk/Master/texmf-dist/doc/latex/tabstackengine/tabstackengine.tex	2016-11-30 22:25:14 UTC (rev 42610)
@@ -459,7 +459,7 @@
   EOL-separated data that would otherwise be used to construct a stack.%
   \footnote{Alternately, TABstacking data can be read without generating a
   TABstack by using the \texttt{\cmd renewcommand\cmd quietstack\{T\}} 
-  setting of \ste{} to suppress the stack output, without supressing its 
+  setting of \ste{} to suppress the stack output, without suppressing its 
   construction.}
 If the routine is not called independently by the user, data from the most 
   recent TABstacking operation is still available for interrogation.
@@ -467,7 +467,7 @@
 Take the example
 
 \vb|\TABstackMath\TABstackMathstyle{\displaystyle}\setstackgap{S}{5pt}%|\\
-\vb|\alignShortstack{\frac{A}{Q}x=&B\\ C= &\frac{Dx}{2}\\E=&F}}|
+\vb|\alignShortstack{\frac{A}{Q}x=&B\\ C= &\frac{Dx}{2}\\E=&F}|
 
 which presents as
 
@@ -497,7 +497,16 @@
 \fbox{\TABcellRaw[2,1]}
 
 If one would like to see the cell data presented in the prevailing
-  (\textsf{tab})\ste{} mode and style, the macro 
+  (\textsf{tab})\ste{} mode and style%
+\footnote{Note that both \cmd{TABcell} and, as described later,
+  \cmd{TABcellBox} present in the \textit{prevailing} TABstack mode and
+  style.
+  While a recent use of \cmd{ensureTABstackMath} will be remembered,
+  intervening declarations of \cmd{TABstackMath}, \cmd{TABstackText} and
+  their associated styles will change the \textit{prevailing} mode
+  and style in which subsequent \cmd{TABcell} and \cmd{TABcellBox}
+  are processed.}%
+  , the macro 
   \vb|\TABcell{2}{1}|\margcmd{TABcell} may be used (again shown in
   an \vb|\fbox|):
  
@@ -546,16 +555,14 @@
 If one wishes to recover the \textit{actual tokens} that were employed in a 
   given TABstack cell (rather that just something that will \textit{expand}
   to those tokens), that can be accomplished in one of two ways.
-The macro \vb|\TABcellRaw[]| can be expanded twice in the manner of
+The macro \vb|\TABcellRaw[,]| can be expanded twice in the manner of
 \end{sloppypar}
 
-\vb|\expandafter\detokenize%|\\
-\vb|\expandafter\expandafter\expandafter{\TABcellRaw[2,2]}|
+\vb|\detokenize\expandafter\expandafter\expandafter{\TABcellRaw[2,2]}|
 
-\expandafter\detokenize%
-\expandafter\expandafter\expandafter{\TABcellRaw[2,2]}
+\detokenize\expandafter\expandafter\expandafter{\TABcellRaw[2,2]}
 
-Alternately, the macro \vb|\getTABcelltoks[]|\margcmd{getTABcelltoks} will
+Alternately, the macro \vb|\getTABcelltoks[,]|\margcmd{getTABcelltoks} will
   produce a token list named  \vb|\TABcelltoks|\margcmd{the\cmd TABcelltoks} that 
   contains the cell's tokens:
 
@@ -566,16 +573,16 @@
 
 In summary then, \tst{} cell content can be accessed in a number of ways:\\
 \renewcommand\arraystretch{1.2}
-\begin{tabular}{@{}l@{~--~}p{3.5in}@{}}
-\vb|\TABcellRaw| & expands into the tokens of the cell\\
-\vb|\TABcell| & presents the cell content in the prevailing mode (text
+\begin{tabular}{@{}l@{~--~}p{3.3in}@{}}
+\vb|\TABcellRaw[,]| & expands into the tokens of the cell\\
+\vb|\TABcell{}{}| & presents the cell content in the prevailing mode (text
   or math) and style set by \ste{} and \tst{}\\
-\vb|\TABcellBox| & presents the cell content, in the prevailing mode
+\vb|\TABcellBox{}{}| & presents the cell content, in the prevailing mode
   and style, strutted to the proper row height/depth, set in a box of the
   proper cell width, flanked by the appropriate \vb|{}| groups defined by
   \tst's unary and/or binary declarations,
   and (when knowable) set in the proper \texttt{lcr} alignment\\
-\vb|\getTABcelltoks| & creates a token list register \vb|\TABcelltoks| 
+\vb|\getTABcelltoks[,]| & creates a token list register \vb|\TABcelltoks| 
   that contains the actual tokens employed in the cell, accessible by
    way of \vb|\the\TABcelltoks|
 \end{tabular}
@@ -584,6 +591,11 @@
 
 Consider the example
 
+\vb|\setstacktabbedgap{.5em}|\\
+\vb|\tabbedLongstack{a & b & c & d\\ e & f & g & h\\ i & j & k & l}|
+
+which produces
+
 \setstacktabbedgap{.5em}
 \tabbedLongstack{a & b & c & d\\ e & f & g & h & H\\ i & j & k & l}
 
@@ -605,22 +617,55 @@
 Note that \tst{} uses the number of columns provided in row 1 to determine the
   dimensions of the subsequent TABstack.
 If the 2nd or 3rd rows of the above stack were [accidentally] defined with 5 
-  columns of data, the last column would be ignored, since the 1st row only
-  has 4 columns.  
-However, in that case, \vb|\TABcells{2}| would, in fact, yield \TABcells{2}.
- 
+  columns of data, the 5th column of data would be ignored during the TABstack
+  construction, since the 1st row only has 4 columns.  
+However, in that case, \vb|\TABcells{2}| would still, in fact, yield 
+  \TABcells{2}.
 
+\section{Absent Features/Tricky Syntax}
 
-\section{Absent Features}
+\textbf{1. Nothing Equivalent to} \vb|\hline| or \vb`|`
 
-\textbf{Nothing Equivalent to} \vb|\hline| or \vb`|`
-
-This is not a bug, so much as a notation of a missing feature.  Currently
+This is not a bug, but rather a notation of a missing feature.  Currently
 there is nothing equivalent to \vb|\hline| available for use in 
 \tst{} arguments. 
 Furthermore, vertical lines may \textbf{not} be added to a tabular stack 
   with the use of \vb`|` elements in the column specifier.
 
+\textbf{2. Empty Items Are Not Ignored (by Default)}
+
+The \loi{} package used to parse TABstack input, does not, by default,
+  ignore empty items.
+This can cause parsing errors, if not understood properly. 
+Take, for example, the well formed TABstack invocation,
+
+\vb|\tabularLongstack{rc}{11&12\\21&22\\31&32}|.
+
+Adding a trailing \vb|\\| to the input, as in:
+
+\vb|\tabularLongstack{rc}{11&12\\21&22\\31&32\\}|,
+
+however, breaks the parsing because 2 columns of data are expected
+  following the final \vb|\\| (even though such syntax is accepted
+  in, for example, the \texttt{tabular} environment).
+This syntax can be immediately made acceptable by
+  invoking the \loi{} declaration \cmd{ignoreemptyitems}, in which case
+  the final [empty] row is discarded.
+However, that approach can introduce a new set of problems, because 
+  it will then ignore actual blank input that was intended, as in the
+  case of this example, in which table cell (2,2) is intentionally
+  left blank:
+
+\vb|\tabularLongstack{rc}{11&12\\21&\\31&32\\}|.
+
+To make this latter case work, when empty items are ignored, an
+   empty group would need be explicitly inserted:
+
+\vb|\tabularLongstack{rc}{11&12\\21&{}\\31&32\\}|.
+
+These problems can be wholly avoided if care is used in the
+  construction of TABstack input.
+
 \endvbdelim
 \section*{Acknowledgements}
 

Modified: trunk/Master/texmf-dist/tex/latex/tabstackengine/tabstackengine.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/tabstackengine/tabstackengine.sty	2016-11-30 22:25:02 UTC (rev 42609)
+++ trunk/Master/texmf-dist/tex/latex/tabstackengine/tabstackengine.sty	2016-11-30 22:25:14 UTC (rev 42610)
@@ -1,4 +1,4 @@
-\def\tabstackengineversionnumber{V2.00}
+\def\tabstackengineversionnumber{V2.01}
 %
 % THIS MATERIAL IS SUBJECT TO THE LaTeX Project Public License
 %
@@ -28,10 +28,16 @@
 %       -Employed a \toks based approach to parsing the argument, rather than the
 %        previous \protected at edef approach.  The prior approach suffered problems
 %        when \\ was redefined, as in, for example, \centering or \raggedright.
+% V2.01 -Take advantage of listofitems revision to allow global \readlist, via 
+%        \greadlist.  This allows \setsepchar to be placed inside of group, thus
+%        preventing a global change in the listofitems \setsepchar.
+%       -\TABcell and \TABcellBox modified to remember recent use of
+%        \ensureTABstackMath, which otherwise changes temporarily the
+%        prevailing mode and style of the TABstack.
 \ProvidesPackage{tabstackengine}
-[2016/10/04 (\tabstackengineversionnumber) tabbed stacking]
+[2016/11/30 (\tabstackengineversionnumber) tabbed stacking]
 \RequirePackage{stackengine}[2016-10-04]
-\RequirePackage{listofitems}
+\RequirePackage{listofitems}[2016/11/18]
 \RequirePackage{etoolbox}
 
 \newcounter{TABrowindex@}
@@ -65,7 +71,7 @@
 \newcommand\readTABstack[1]{%
   \expandafter\expandafter\expandafter\setsepchar\expandafter\expandafter%
     \expandafter{\expandafter\SEP at char\expandafter/\TAB at char}%
-  \readlist*\TABcellRaw{#1}%
+  \greadlist*\TABcellRaw{#1}%
   \edef\TABstack at rows{\TABcellRawlen}%
   \edef\TABstack at cols{\listlen\TABcellRaw[1]}%
   \def\maxTABwd{0pt}%
@@ -90,6 +96,7 @@
     \setbox0=\hbox{\stack at delim\TAB at delim{\@accumulatedTAB}\stack at delim}%
     \csxdef{row\theTABrowindex@ TAB at ht}{\the\ht0}%
     \csxdef{row\theTABrowindex@ TAB at dp}{\the\dp0}%
+    \global\let\recent at TAB@delim\TAB at delim%
   }%
 }
 
@@ -99,14 +106,14 @@
 \newcommand\TABstrut[1]{\ifnum#1<1\relax{}\else%
   \protect\rule[-\TABdp{#1}]{0pt}{\dimexpr\TABdp{#1}+\TABht{#1}\relax}\fi}
 
-\newcommand\TABcell[2]{\stack at delim\TAB at delim{\TABcellRaw[#1,#2]}\stack at delim}
+\newcommand\TABcell[2]{\stack at delim\recent at TAB@delim{\TABcellRaw[#1,#2]}\stack at delim}
 
 \newcommand\TABcellBox[3][\relax]{\ifx\relax#1\relax%
-  \TABcellBoxaux{\csuse{col#3TAB at stackalignment}}{#2}{#3}\else
-  \TABcellBoxaux{#1}{#2}{#3}\fi}
+  \TABcellBox at aux{\csuse{col#3TAB at stackalignment}}{#2}{#3}\else
+  \TABcellBox at aux{#1}{#2}{#3}\fi}
 
-\newcommand\TABcellBoxaux[3]{\makebox[\TABwd{#3}][#1]{\stack at delim%
-  \TAB at delim{\TAB at strutL{#2}\TABcellRaw[#2,#3]\TAB at strutR{#2}}\stack at delim}}
+\newcommand\TABcellBox at aux[3]{\makebox[\TABwd{#3}][#1]{\stack at delim%
+  \recent at TAB@delim{\TAB at strutL{#2}\TABcellRaw[#2,#3]\TAB at strutR{#2}}\stack at delim}}
 
 \newcommand\TABcells[1]{\listlen\TABcellRaw[#1]}
 
@@ -119,8 +126,10 @@
 \let\TABbinaryRight\TABunaryLeft
 \let\TABbinaryLeft\TABunaryRight
 
-\newcommand\TABstackMath{\renewcommand\TAB at delim[1]{\ensuremath{\TAB at mathstyle##1}}}
-\newcommand\TABstackText{\renewcommand\TAB at delim[1]{\TAB at textstyle##1}}
+\newcommand\TABstackMath{\renewcommand\TAB at delim[1]{\ensuremath{\TAB at mathstyle##1}}%
+  \let\recent at TAB@delim\TAB at delim}
+\newcommand\TABstackText{\renewcommand\TAB at delim[1]{\TAB at textstyle##1}%
+  \let\recent at TAB@delim\TAB at delim}
 \newcommand\TABstackMathstyle[1]{\renewcommand\TAB at mathstyle{#1}}
 \newcommand\TABstackTextstyle[1]{\renewcommand\TAB at textstyle{#1}}
 \newcommand\clearTABstyle{\renewcommand\TAB at textstyle{}\renewcommand\TAB at mathstyle{}}
@@ -193,9 +202,8 @@
 \newcommand\vertMatrixstack[2][\stackalignment]{%
   \ensureTABstackMath{\left|\@TAB at stack{#1}{#2}{D}{\Vectorstack}\right|}}
 
-\newcommand\@TAB at stack[4]{%
+\newcommand\@TAB at stack[4]{\bgroup%
   \readTABstack{#2}%
-  \bgroup%
   \edef\stackalignment{#1}%
   \setcounter{TABcolindex@}{0}%
   \whileboolexpr{test {\ifnumless{\theTABcolindex@}{\TABstack at cols}}}{% COL LOOP
@@ -248,11 +256,10 @@
 \newcommand\tabularstackanchor[4][\stackgap]{%
   \@TABstackonunder{#1}{#3}{#4}{#2}{\stackanchor}}
 
-\newcommand\@TABstackonunder[5]{%
+\newcommand\@TABstackonunder[5]{\bgroup%
   \def\TAB at tmp{#2}%
   \expandafter\g at addto@macro\expandafter\TAB at tmp\expandafter{\SEP at char#3}%
   \readTABstack{\TAB at tmp}%
-  \bgroup%
   \setcounter{TABcolindex@}{0}%
   \whileboolexpr{test {\ifnumless{\theTABcolindex@}{\TABstack at cols}}}{% COL LOOP
     \stepcounter{TABcolindex@}%



More information about the tex-live-commits mailing list