[texhax] Handling arrays or lists in LaTeX command arguments

Brandon Kuczenski brandon at 301south.net
Thu Apr 22 01:49:37 CEST 2010

Hi TeXers,

I'm hunting for a TeX or LaTeX macro which processes an argument as a 
[c-style] array with a (possibly arbitrary, possibly fixed) number of 

For instance, I imagine three hypothetical LaTeX commands:


creates an array called \arrayname with num elements.  Here I assume the 
elements are comma-separated and enclosed in brackets, but that is just 
for example.


performs 'operation' once for each element in the array in succession.


(within \arraydo) expands to the current element in the array.

Is such a thing remotely possible?  Anything that points in this 
direction would be appreciated.  The ability to index into the array 
would be extra-special.

%% code sample

\newcommand{\boxnumbers}[1]{ %
   \arraydo{#1}{% hypothetical array expander
	} %

% The Sequence
\defarray{\foo}{6}{[4,8,15,16,23,42]} % hypothetical array constructor


%% end code sample

would create a series of boxes, each containing a number from The Sequence.

thanks for any pointers,


More information about the texhax mailing list