From df26ea121b9e796e96a97b34d37312c6be731e89 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Sat, 18 Sep 2021 20:16:59 +0000 Subject: readarray (18sep21) git-svn-id: svn://tug.org/texlive/trunk@60540 c570f23f-e606-0410-a88d-b1316a301751 --- .../texmf-dist/doc/latex/readarray/readarray.pdf | Bin 528752 -> 530275 bytes .../texmf-dist/doc/latex/readarray/readarray.tex | 45 +++++++++++++++++++-- 2 files changed, 42 insertions(+), 3 deletions(-) (limited to 'Master/texmf-dist/doc') diff --git a/Master/texmf-dist/doc/latex/readarray/readarray.pdf b/Master/texmf-dist/doc/latex/readarray/readarray.pdf index 5b8f2b4dbda..7bbc00acaa1 100644 Binary files a/Master/texmf-dist/doc/latex/readarray/readarray.pdf and b/Master/texmf-dist/doc/latex/readarray/readarray.pdf differ diff --git a/Master/texmf-dist/doc/latex/readarray/readarray.tex b/Master/texmf-dist/doc/latex/readarray/readarray.tex index bd9a4aa114b..bdbb3bef709 100644 --- a/Master/texmf-dist/doc/latex/readarray/readarray.tex +++ b/Master/texmf-dist/doc/latex/readarray/readarray.tex @@ -9,8 +9,22 @@ \def\rdar{\textsf{readarray}} \def\loi{\textsf{listofitems}} \def\cmd#1{\texttt{\string\ \unskip#1}} -\usepackage{readarray} +\usepackage{readarray,tokcycle} \usepackage{verbatimbox} +\newcommand\bverb[1][]{\begingroup\ifx\relax#1\relax + \def\tmpA{\allowbreak}\def\tmpB{0}\else + \def\tmpA{}\def\tmpB{#1}\fi + \catcode`\%=12 \bverbaux} +\newcommand\bverbaux[2][\allowbreak\textvisiblespace\allowbreak]{% + \ttfamily\tokencycle + {\expandafter\tctestifx\expandafter{\tmpB##1}{\allowbreak} + {\string##1\tmpA}} + {\{\processtoks{##1}\}} + {\tctestifx{\isiteleven##1}{##1} + {\expandafter\tctestifx\expandafter{\tmpB##1}{\allowbreak} + {\tcpush{\string##1\isiteleven}}}} + {#1}#2\endtokencycle\endgroup} +\def\isiteleven{\tcpeek\zzz\ifcat\noexpand\zzz A\tcpush{\space}\fi} \begin{filecontents*}[overwrite]{file1data.txt} A111 A112 A113 A114 A121 A122 A123 A124 @@ -179,7 +193,11 @@ commands are: \textup{To select the level of bounds checking on array cell recall:}\\ \rl\vb|\nocheckbounds|\hfill OR\hfill% \vb|\checkbounds|\hfill OR\hfill% -\vb|\hypercheckbounds| +\vb|\hypercheckbounds|\\ +\textup{To ignore blank (or fully commented) records during the + course of a record-array read (this can be undone with a false + setting):}\\ +\rl\vb|\ignoreblankreadarrayrecordstrue| \upshape In these commands, \cmd{}\textit{data-macro} is a control sequence into @@ -454,6 +472,27 @@ If an array name is reutilized, its prior definitions are cleared, so that ``old'' data is not inadvertantly retrieved following the reutilization. +One option (introduced in v3.1) in this regard is the if-condition% + \margcmd{ifignoreblank readarrayrecords} + \bverb[.]{\ifignore.blankreadarrayrecords}, which can take on + values of either \bverb[\-]{\ignoreblank\-readarrayrecordstrue} or + \bverb{\ignoreblankreadarrayrecordsfalse}. +When set to the true condition, ``blank'' records in the input file + (defined either when the record is actually blank or if the first + non-blank token in the record is a catcode-14 \verb|%|) will + be ignored. +This setting will only affect the record array itself---the result + of any \cmd{readdef} will be unaffected by this setting, except + as detailed in the next paragraph. + +The only warning to heed when setting + \bverb[\-]{\ignoreblankreadarrayrecords\-true} is that the first + blank line in a \bverb{\readdef}'ed file is used to set the value + of \cmd{nrows}, which can be used to set the row-depth of a 3-D + array plane within subsequent invocations of \cmd{readarray}. +Of course, the array plane's row-depth may always be set + manually, in lieu of using \bverb{\nrows}. + \subsection{Creating 2-D and 3-D Arrays from Data} @@ -948,7 +987,7 @@ I am likewise grateful to Ken Kubota, who suggested moving the \vb|\newread| outside of \vb|\readdef|, so as not to prematurely exhaust the 16 available file streams. -\clearpage +%\clearpage \section{Code Listing} \verbfilenobox[\footnotesize]{readarray.sty} -- cgit v1.2.3