diff options
author | Karl Berry <karl@freefriends.org> | 2013-05-15 21:52:42 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2013-05-15 21:52:42 +0000 |
commit | f6e1d9fa85c54742b7ac40117c1631cd744227d1 (patch) | |
tree | f1de13a19b54b3c5381c617b37855fe7edab6eb1 /Master/texmf-dist/tex/latex/readarray | |
parent | 2f2f8135aece956533150760a0b8fabbb491239e (diff) |
readarray (15may13)
git-svn-id: svn://tug.org/texlive/trunk@30489 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/readarray')
-rw-r--r-- | Master/texmf-dist/tex/latex/readarray/readarray.sty | 32 |
1 files changed, 21 insertions, 11 deletions
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}% }% } % |