summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2013-05-15 21:52:42 +0000
committerKarl Berry <karl@freefriends.org>2013-05-15 21:52:42 +0000
commitf6e1d9fa85c54742b7ac40117c1631cd744227d1 (patch)
treef1de13a19b54b3c5381c617b37855fe7edab6eb1
parent2f2f8135aece956533150760a0b8fabbb491239e (diff)
readarray (15may13)
git-svn-id: svn://tug.org/texlive/trunk@30489 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r--Master/texmf-dist/doc/latex/readarray/readarray.pdfbin218668 -> 230149 bytes
-rw-r--r--Master/texmf-dist/doc/latex/readarray/readarray.tex52
-rw-r--r--Master/texmf-dist/tex/latex/readarray/readarray.sty32
3 files changed, 44 insertions, 40 deletions
diff --git a/Master/texmf-dist/doc/latex/readarray/readarray.pdf b/Master/texmf-dist/doc/latex/readarray/readarray.pdf
index 764bfbdc971..3de54fcfaa8 100644
--- a/Master/texmf-dist/doc/latex/readarray/readarray.pdf
+++ b/Master/texmf-dist/doc/latex/readarray/readarray.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/readarray/readarray.tex b/Master/texmf-dist/doc/latex/readarray/readarray.tex
index e4036d7faff..85081ab4359 100644
--- a/Master/texmf-dist/doc/latex/readarray/readarray.tex
+++ b/Master/texmf-dist/doc/latex/readarray/readarray.tex
@@ -1,5 +1,5 @@
\documentclass{article}
-\def\version{1.1}
+\def\version{1.2}
%% Copyright 2013 Steven B. Segletes
%
% This work may be distributed and/or modified under the
@@ -16,6 +16,10 @@
% Revisions:
% v1.01 Documentation revision
% v1.1 Added \csname record\roman{@row}\endcsname to \readdef
+% v1.2 -Corrected the [truncated] LPPL license info
+% -Added \arrayij and \arrayijk, which can be put into \edef
+% -Used \romannumeral in preference to \roman{}, when possible,
+% to avoid unnecessary use of counters.
\parskip 1em
\parindent 0em
@@ -59,6 +63,9 @@ commands are:\\\itshape
\rl\vb|\readArrayijk{|token\vb|}{|identifier\vb|}{|rows\vb|}{|columns\vb|}|\\
\rl\vb|\Arrayij[|error\vb|]{|identifier\vb|}{|row\vb|}{|column\vb|}|\\
\rl\vb|\Arrayijk[|error\vb|]{|identifier\vb|}{|plane\vb|}{|row\vb|}{|%
+ column\vb|}|\\
+\rl\vb|\arrayij{|identifier\vb|}{|row\vb|}{|column\vb|}|\\
+\rl\vb|\arrayijk{|identifier\vb|}{|plane\vb|}{|row\vb|}{|%
column\vb|}|\upshape
Several strings of fixed name are defined through the use of this
@@ -89,6 +96,12 @@ the following:\\\itshape
\rl\vb|\showargs[|number\vb|]|\\\upshape
\rl\vb|\def\converttilde{|T or F\vb|}|\upshape
+\begin{center}
+\vfill
+[\textsc{This Space Intentionally Left Blank}]
+\vfill
+\end{center}
+\clearpage
\section{Data Structure}
The first requirement is to lay out a format for the data interface to
@@ -233,7 +246,6 @@ array of data. Its use accomplishes two things: 1) it allows records
the most recently read file data into its own data structure, so that it
is not overwritten by a subsequent invocation of \verb|\readdef|.
-\clearpage
\subsection{Creating 3-D Arrays}
For the 3-D case, \vb|\readArrayijk|\margcmd{readArrayijk} takes an
@@ -395,8 +407,7 @@ an array element is asked for which falls outside the array bounds.
Like \verb|\showrecord|, the \verb|\Arrayij| and \verb|\Arrayijk|
commands also employ bounds checking. These commands check for
four error conditions that, by default, produce the following error
-messages:
-
+messages:\\
\rl\Arrayijk{tobeConjugation}{-3}{2}{4}\\
\rl\Arrayijk{tobeConjugation}{9}{2}{4}\\
\rl\Arrayijk{tobeConjugation}{3}{9}{4}\\
@@ -416,31 +427,14 @@ The\verb|\Arrayij| and \verb|\Arrayijk| commands may, of course, be
placed as arguments of \verb|\def| commands. They, cannot, however, be
placed into an \verb|\edef|. If the user has need to place the
array-element content into an \verb|\edef| (and assuming that the
-actual array-element content is suitable for an \verb|\edef|), the
-following approach may be employed. The contents of an array which
-would otherwise be accessed by the command
-{\itshape\vb|\Arrayij{|identifier\vb|}{|row\vb|}{|column\vb|}|\upshape}
-can be accessed directly with the command
-``\itshape\vb|\|identifier\vb|X|roman-row\vb|X|roman-column\upshape'',
-where \textit{roman-row} and \textit{roman-column} indicate that the row
-and column numbers are expressed in lower-case roman numerals. Thus,
-even if \textit{row} and/or \textit{column} are obtained by way of a
-mathematical calculation, they can be placed into an \verb|\edef| token
-using the following syntax:\\
- \rl\itshape\vb|\edef\tokenname{\csname %|\\
- \rl\rl\rl identifier\vb|X\roman{|row\vb|}X\roman{|column%
- \vb|}\endcsname}|\upshape\\
-For 3-D arrays, the corresponding command is
-``\itshape\vb|\|identifier\vb|X|roman-plane\vb|X|roman-row\vb|X|%
- roman-column\upshape''.
-Therefore, the \verb|\edef| may be accomplished via\\
- \rl\itshape\vb|\edef\tokenname{\csname %|\\
- \rl\rl\rl identifier\vb|X\roman{|plane\vb|}X\roman{|row\vb|}X\roman{|%
- column\vb|}\endcsname}|\upshape\\
-Note, however, that no error bounds-checking is performed when command
-syntax such as
-``\itshape\vb|\|identifier\vb|X|roman-plane\vb|X|roman-row\vb|X|%
-roman-column\upshape'' is employed.
+actual array-element content is suitable for an \verb|\edef|), the user
+should employ the \verb|\arrayij| and \verb|\arrayijk| commands, as
+alternatives.
+\margcmd{arrayij}\margcmd{arrayijk}%
+These commands do not perform any bounds checking (thus eliminating the
+need for an optional argument). Their advantage, however, is that they
+may be freely placed into an
+\verb|\edef|.
\section{Support Routines}
diff --git a/Master/texmf-dist/tex/latex/readarray/readarray.sty b/Master/texmf-dist/tex/latex/readarray/readarray.sty
index 535e4b76bc6..941e4b41851 100644
--- a/Master/texmf-dist/tex/latex/readarray/readarray.sty
+++ b/Master/texmf-dist/tex/latex/readarray/readarray.sty
@@ -1,7 +1,11 @@
\ProvidesPackage{readarray}
-[2013/04/18 v1.1
+[2013/05/09 v1.2
Routines for inputting array data and recalling it on an
element-by-element basis. Currently supports 2-D and 3-D array]
+%
+% This work may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.3
+% of this license or (at your option) any later version.
% The latest version of this license is in
% http://www.latex-project.org/lppl.txt
% and version 1.3c or later is part of all distributions of LaTeX
@@ -14,6 +18,10 @@ element-by-element basis. Currently supports 2-D and 3-D array]
% Revisions:
% v1.01 Documentation revision
% v1.1 Added \csname record\roman{@row}\endcsname to \readdef
+% v1.2 -Corrected the [truncated] LPPL license info
+% -Added \arrayij and \arrayijk, which can be put into \edef
+% -Used \romannumeral in preference to \roman{}, when possible,
+% to avoid unnecessary use of counters.
\usepackage{ifthen}
\usepackage{ifnextok}
%
@@ -94,10 +102,11 @@ element-by-element basis. Currently supports 2-D and 3-D array]
\def\rowmessage#1#2{{\tiny ROW=#2 exceeds limit for #1}}
\def\colmessage#1#2{{\tiny COL=#2 exceeds limit for #1}}
%
+\newcommand\arrayijk[4]{%
+ \csname#1X\romannumeral#2X\romannumeral#3X\romannumeral#4\endcsname%
+}
+%
\newcommand\Arrayijk[5][$]{%
- \setcounter{@plane}{#3}%
- \setcounter{@row}{#4}%
- \setcounter{@col}{#5}%
\ifthenelse{\value{@plane}<1 \OR \value{@row}<1 \OR \value{@col}<1}{%
\if$#1\nonposmessage\else#1\fi}{%
\ifthenelse{#3 > \csname#2PLANES\endcsname}{%
@@ -106,22 +115,24 @@ element-by-element basis. Currently supports 2-D and 3-D array]
\if$#1\rowmessage{#2}{#4}\else#1\fi}{%
\ifthenelse{#5 > \csname#2COLS\endcsname}{%
\if$#1\colmessage{#2}{#5}\else#1\fi}{%
- \csname#2X\roman{@plane}X\roman{@row}X\roman{@col}\endcsname}%
+ \csname#2X\romannumeral#3X\romannumeral#4X\romannumeral#5\endcsname}%
}%
}%
}%
}
%
+\newcommand\arrayij[3]{%
+ \csname#1X\romannumeral#2X\romannumeral#3\endcsname%
+}
+%
\newcommand\Arrayij[4][$]{%
- \setcounter{@row}{#3}%
- \setcounter{@col}{#4}%
\ifthenelse{\value{@row}<1 \OR \value{@col}<1}{%
\if$#1\nonposmessage\else#1\fi}{%
\ifthenelse{#3 > \csname#2ROWS\endcsname}{%
\if$#1\rowmessage{#2}{#3}\else#1\fi}{%
\ifthenelse{#4 > \csname#2COLS\endcsname}{%
\if$#1\colmessage{#2}{#4}\else#1\fi}{%
- \csname#2X\roman{@row}X\roman{@col}\endcsname}%
+ \csname#2X\romannumeral#3X\romannumeral#4\endcsname}%
}%
}%
}
@@ -140,12 +151,11 @@ element-by-element basis. Currently supports 2-D and 3-D array]
}
%
\newcommand\showrecord[2][$]{%
- \setcounter{@record}{#2}%
- \ifthenelse{\value{@record}<1}{%
+ \ifthenelse{#2<1}{%
\if$#1\nonposrecordmessage\else#1\fi}{%
\ifthenelse{#2 > \nrecords}{%
\if$#1\recordmessage{#2}\else#1\fi}{%
- \csname record\roman{@record}\endcsname}%
+ \csname record\romannumeral#2\endcsname}%
}%
}
%