From fe071a3248b7f619d72c83bed1ac96acb78abbfe Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Wed, 30 Nov 2016 22:25:14 +0000 Subject: tabstackengine (30nov16) git-svn-id: svn://tug.org/texlive/trunk@42610 c570f23f-e606-0410-a88d-b1316a301751 --- .../doc/latex/tabstackengine/tabstackengine.pdf | Bin 562549 -> 569190 bytes .../doc/latex/tabstackengine/tabstackengine.tex | 89 ++++++++++++++++----- 2 files changed, 67 insertions(+), 22 deletions(-) (limited to 'Master/texmf-dist/doc/latex/tabstackengine') diff --git a/Master/texmf-dist/doc/latex/tabstackengine/tabstackengine.pdf b/Master/texmf-dist/doc/latex/tabstackengine/tabstackengine.pdf index 68b8d116cdb..c288ddfd20f 100644 Binary files a/Master/texmf-dist/doc/latex/tabstackengine/tabstackengine.pdf and b/Master/texmf-dist/doc/latex/tabstackengine/tabstackengine.pdf differ diff --git a/Master/texmf-dist/doc/latex/tabstackengine/tabstackengine.tex b/Master/texmf-dist/doc/latex/tabstackengine/tabstackengine.tex index f4a448f4029..fa4be38a47b 100644 --- a/Master/texmf-dist/doc/latex/tabstackengine/tabstackengine.tex +++ b/Master/texmf-dist/doc/latex/tabstackengine/tabstackengine.tex @@ -459,7 +459,7 @@ This macro may be independently called by the user to read TABstack data 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 @@ If the routine is not called independently by the user, data from the most 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 @@ Here, use the macro \vb|\TABcellRaw[2,1]|\margcmd{TABcellRaw}, which will \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 @@ However, even for long stacks, the height of the top row and the depth of 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 @@ Alternately, the macro \vb|\getTABcelltoks[]|\margcmd{getTABcelltoks} will 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 @@ In summary then, \tst{} cell content can be accessed in a number of ways:\\ 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 @@ $\textrm{Columns} = \vb|\TABcells{1}| = \TABcells{1}$ 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} +\section{Absent Features/Tricky Syntax} -\textbf{Nothing Equivalent to} \vb|\hline| or \vb`|` +\textbf{1. 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} -- cgit v1.2.3