summaryrefslogtreecommitdiff
path: root/Master
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2007-10-08 16:33:10 +0000
committerKarl Berry <karl@freefriends.org>2007-10-08 16:33:10 +0000
commiteb15e60943eb3e31e4fab8cdaf8b0178b640f496 (patch)
tree13ba1b504d61db748db5a0090f133133e7677d63 /Master
parent916ce7699b1500b6cb97f5534039b37eb5d33fb4 (diff)
coollist update (6oct07)
git-svn-id: svn://tug.org/texlive/trunk@5139 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master')
-rw-r--r--Master/texmf-dist/doc/latex/coollist/README4
-rw-r--r--Master/texmf-dist/doc/latex/coollist/coollist.pdfbin95831 -> 109672 bytes
-rw-r--r--Master/texmf-dist/source/latex/coollist/coollist.dtx176
-rw-r--r--Master/texmf-dist/source/latex/coollist/coollist.ins78
-rw-r--r--Master/texmf-dist/tex/latex/coollist/coollist.sty10
5 files changed, 213 insertions, 55 deletions
diff --git a/Master/texmf-dist/doc/latex/coollist/README b/Master/texmf-dist/doc/latex/coollist/README
index 54b2400f5ef..a0cd606cdff 100644
--- a/Master/texmf-dist/doc/latex/coollist/README
+++ b/Master/texmf-dist/doc/latex/coollist/README
@@ -1,3 +1,3 @@
-This is the coollist package: a LaTeX package intended for the manipulation of lists (defined as sequences of tokens delimited by commas).
-
+This is the coollist package: a LaTeX package intended for the manipulation of lists (defined as sequences of tokens delimited by commas).
+
It is released under the Limited General Product License. \ No newline at end of file
diff --git a/Master/texmf-dist/doc/latex/coollist/coollist.pdf b/Master/texmf-dist/doc/latex/coollist/coollist.pdf
index 3b80312d767..dec64d6d722 100644
--- a/Master/texmf-dist/doc/latex/coollist/coollist.pdf
+++ b/Master/texmf-dist/doc/latex/coollist/coollist.pdf
Binary files differ
diff --git a/Master/texmf-dist/source/latex/coollist/coollist.dtx b/Master/texmf-dist/source/latex/coollist/coollist.dtx
index 55100f3c6e2..964cda37de4 100644
--- a/Master/texmf-dist/source/latex/coollist/coollist.dtx
+++ b/Master/texmf-dist/source/latex/coollist/coollist.dtx
@@ -2,7 +2,7 @@
%
%<package>\NeedsTeXFormat{LaTeX2e}[1999/12/01]
%<package>\ProvidesPackage{coollist}
-%<package> [2006/08/14 v1 COntent Oriented LaTeX Lists]
+%<package> [2007/10/06 v1.1 COntent Oriented LaTeX Lists]
%<package>\RequirePackage{ifthen}
%<package>\RequirePackage{amsmath}
%<package>\RequirePackage{amssymb}
@@ -21,10 +21,9 @@
%</driver>
% \fi
%
-% \iffalse meta-comment
-% remove this comment to get a checksum
-% \CheckSum{0}
-% \fi
+%
+% \CheckSum{74}
+%
%
%% \CharacterTable
%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
@@ -43,6 +42,8 @@
%% Right brace \} Tilde \~}
%
% \changes{v1.0}{2006/08/14}{Initial Release}
+% \changes{v1.1}{2001/10/06}{Added documentation for commands in separate section.}
+% \changes{v1.1}{2001/10/06}{Added test cases/examples}
%
% \GetFileInfo{coollist.sty}
%
@@ -101,8 +102,138 @@
% to access certain elements of the list while neglecting others---essentially turning lists into a sort of
% array.
%
-% Lists elements are accessed by specifying the position of the object within the list (the index of the item)
-% Lists start indexing at |1|.
+% List elements are accessed by specifying the position of the object within the list (the index of the item) and
+% all lists start indexing at |1|.
+%
+%
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%\section{Commands \& Descriptions}
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% \DescribeMacro{\setlistStop}
+% \DescribeMacro{\setlistEnd}
+% |\setlistStop|\marg{string} and |\setlistEnd|\marg{string} allow the user to set the end of a list
+% `character' in the rare event that the default values actually appear in the list.
+% |listStop| is used to identify when the list actually terminates, while |listEnd| forces the reading macro to
+% take in the entire list (without both entities, errors would occur if macros were included in the list).
+%
+% The default values are
+%
+% \begin{tabular}{ll}
+% |listStop| & \makeatletter |@@| \makeatother \\
+% |listEnd| & \makeatletter |@@@| \makeatother
+% \end{tabular}
+%
+%
+%
+% \DescribeMacro{\listval}
+% |\listval|\marg{list}\marg{index} returns the \meta{index} item of the comma delimited list \meta{list}
+% or nothing if \meta{index} is outside the number of elements of the list.
+% The first element of the list has index $1$.
+%
+%
+%
+% \DescribeMacro{\liststore}
+% |\liststore|\marg{list}\marg{macro\_base\_name} stores the elements of comma delimited list \meta{list}
+% in a set of macros having the first part of \meta{macro\_base\_name} and ending with the roman numermal
+% index of the list.
+%
+% For example, |\liststore{1,2,3}{list}| would define |\listi|, |\listii|, and |\listiii| each
+% holding |1|, |2|, |3|, respectively.
+%
+%
+%
+% \DescribeMacro{\listlen}
+% |\listlen|\marg{list} returns the length of the comma delimited list \meta{list}, though it is not useful for
+% storing this length.
+% If you need to record the list's length for later use, it is better to use the function |\listlenstore|.
+%
+%
+%
+% \DescribeMacro{\listlenstore}
+% |\listlenstore|\marg{counter}\marg{list} stores the length of the comma delimited list \meta{list} is the counter
+% \meta{counter}.
+%
+%
+%
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%\section{Test Cases}
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %
+%\subsection{\texttt{$\backslash$listval}}
+% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% \DescribeMacro{\listval}
+%
+% \begin{tabular}{ll}
+% |\listval{1,2,3,4}{0}| & \listval{1,2,3,4}{0} (the null string) \\
+% |$\listval{\alpha,\beta,\gamma}{2}$| & $\listval{\alpha,\beta,\gamma}{2}$ \\
+% |\listval{a,b,c}{4}| & \listval{a,b,c}{4} (the null string)
+% \end{tabular}
+%
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %
+%\subsection{\texttt{$\backslash$liststore}}
+% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% \DescribeMacro{\liststore}
+%
+% \begin{tabular}{ll}
+% |\liststore{1,2,3,4}{temp}|
+% \\
+% |\tempi;\tempii;\tempiii;\tempiv| & \liststore{1,2,3,4}{temp} \tempi;\tempii;\tempiii;\tempiv
+% \\[1cm]
+% |\liststore{a_1,a_2,a_3,a_4}{temp}|
+% \\
+% |$\tempi;\tempii;\tempiii;\tempiv$| & \liststore{a_1,a_2,a_3,a_4}{temp} $\tempi;\tempii;\tempiii;\tempiv$
+% \\[1cm]
+% |\liststore{a,b}{temp}|
+% \\
+% |\tempi;\tempii| & \liststore{a,b,c}{temp} \tempi;\tempii
+% \end{tabular}
+%
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %
+%\subsection{\texttt{$\backslash$listlen}}
+% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% \DescribeMacro{\listlen}
+%
+% \begin{tabular}{ll}
+% |\listlen{1,2,3,4,5}| & \listlen{1,2,3,4,5} \\
+% |\listlen{}| & \listlen{} \\
+% |\listlen{1,2}| & \listlen{1,2} \\
+% |\listlen{1}| & \listlen{1}
+% \end{tabular}
+%
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %
+%\subsection{\texttt{$\backslash$listlenstore}}
+% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% \DescribeMacro{\listlen}
+% |\newcounter{thelistlength}| \newcounter{thelistlength}
+%
+% \begin{tabular}{ll}
+% |\listlenstore{thelistlength}{1,2,3,4,5}|
+% \\
+% |\arabic{thelistlength}| & \listlenstore{thelistlength}{1,2,3,4,5} \arabic{thelistlength}
+% \\[1cm]
+% |\listlenstore{thelistlength}{}|
+% \\
+% |\arabic{thelistlength}| & \listlenstore{thelistlength}{} \arabic{thelistlength}
+% \\[1cm]
+% \end{tabular}
%
%
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -200,6 +331,7 @@
%
%
% \begin{macro}{\listval}
+% \changes{v1.1}{2007/10/06}{alter behavior to do nothing for empty lists}
%
% |\listval|\marg{comma\_deliminated\_list}\marg{index}
%
@@ -213,16 +345,35 @@
\newcommand{\listval}[2]{%
% \end{macrocode}
%
-% start at the beginning of the list, so initialize |listpointer|
+% check to see if the submitted list is empty. if it is, do nothing
%
% \begin{macrocode}
- \setcounter{COOL@listpointer}{1}%
+\ifthenelse{\equal{#1}{}}%
+ {%
+% \end{macrocode}
+%
+% set the listpointer to zero because the list has no length
+% \begin{macrocode}
+ \setcounter{COOL@listpointer}{0}%
+ }%
+% \end{macrocode}
+%
+% Else
+%
+% \begin{macrocode}
+ {%
+% \end{macrocode}
+%
+% start at the beginning of the list, so initialize |listpointer|
+%
+% \begin{macrocode}
+ \setcounter{COOL@listpointer}{1}%
% \end{macrocode}
%
-% Assume that the target will not be found---it will be set to true by ``the gobbler" if it is
+% Assume that the target will not be found---it will be set to true by ``the gobbler" if it is
%
% \begin{macrocode}
-\setboolean{COOL@found}{false}%
+ \setboolean{COOL@found}{false}%
% \end{macrocode}
%
% Now call the gobbler---since the user shouldn't be forced to submit the end character (in fact
@@ -231,7 +382,8 @@
% the entire list is read in by |\COOL@listgobbler| we need the list stop `character' too.
%
% \begin{macrocode}
-\COOL@listgobble[#2]#1,\COOL@listStop,\COOL@listEnd%
+ \COOL@listgobble[#2]#1,\COOL@listStop,\COOL@listEnd%
+ }%
}%
% \end{macrocode}
%
diff --git a/Master/texmf-dist/source/latex/coollist/coollist.ins b/Master/texmf-dist/source/latex/coollist/coollist.ins
index fb4089a1c29..cede022fdb1 100644
--- a/Master/texmf-dist/source/latex/coollist/coollist.ins
+++ b/Master/texmf-dist/source/latex/coollist/coollist.ins
@@ -1,40 +1,40 @@
-%%
-%% Copyright (C) 2005 by nsetzer
-%%
-%% This file may be distributed and/or modified under the
-%% conditions of the Limited General Product License
-%%
-
-\input docstrip.tex
-
-\keepsilent
-
-\usedir{tex/latex/coollist}
-
-\preamble
-
-This is a generated file
-
-This file may be distributed and/or modified under the
-conditions of the Limited General Product License
-
-\endpreamble
-
-
-\generate{\file{coollist.sty}{\from{coollist.dtx}{package}}}
-
-\obeyspaces
-\Msg{****************************************************}
-\Msg{* *}
-\Msg{* To finish the installation you have to move the *}
-\Msg{* following file into a directory searched by TeX: *}
-\Msg{* *}
-\Msg{* coollist.sty *}
-\Msg{* *}
-\Msg{* To produce the documentation run the file *}
-\Msg{* coollist.dtx through LaTeX. *}
-\Msg{* *}
-\Msg{* *}
-\Msg{****************************************************}
-
+%%
+%% Copyright (C) 2005 by nsetzer
+%%
+%% This file may be distributed and/or modified under the
+%% conditions of the Limited General Product License
+%%
+
+\input docstrip.tex
+
+\keepsilent
+
+\usedir{tex/latex/coollist}
+
+\preamble
+
+This is a generated file
+
+This file may be distributed and/or modified under the
+conditions of the Limited General Product License
+
+\endpreamble
+
+
+\generate{\file{coollist.sty}{\from{coollist.dtx}{package}}}
+
+\obeyspaces
+\Msg{****************************************************}
+\Msg{* *}
+\Msg{* To finish the installation you have to move the *}
+\Msg{* following file into a directory searched by TeX: *}
+\Msg{* *}
+\Msg{* coollist.sty *}
+\Msg{* *}
+\Msg{* To produce the documentation run the file *}
+\Msg{* coollist.dtx through LaTeX. *}
+\Msg{* *}
+\Msg{* *}
+\Msg{****************************************************}
+
\endbatchfile \ No newline at end of file
diff --git a/Master/texmf-dist/tex/latex/coollist/coollist.sty b/Master/texmf-dist/tex/latex/coollist/coollist.sty
index 9755c476d24..05c1c43914a 100644
--- a/Master/texmf-dist/tex/latex/coollist/coollist.sty
+++ b/Master/texmf-dist/tex/latex/coollist/coollist.sty
@@ -13,7 +13,7 @@
%%
\NeedsTeXFormat{LaTeX2e}[1999/12/01]
\ProvidesPackage{coollist}
- [2006/08/14 v1 COntent Oriented LaTeX Lists]
+ [2007/10/06 v1.1 COntent Oriented LaTeX Lists]
\RequirePackage{ifthen}
\RequirePackage{amsmath}
\RequirePackage{amssymb}
@@ -63,10 +63,16 @@
}%
}%
\newcommand{\listval}[2]{%
- \setcounter{COOL@listpointer}{1}%
+\ifthenelse{\equal{#1}{}}%
+{%
+\setcounter{COOL@listpointer}{0}%
+}%
+{%
+\setcounter{COOL@listpointer}{1}%
\setboolean{COOL@found}{false}%
\COOL@listgobble[#2]#1,\COOL@listStop,\COOL@listEnd%
}%
+}%
\def\COOL@liststore@gobbler[#1]#2,#3,\COOL@listEnd{%
\ifthenelse{\equal{#3}{\COOL@listStop}}%
{%