This question is clearly related to How can I store variables and iterate over them?.
I'm sorry to ask such a close one, but I really don't understand the answer in plain TeX by David Carlisle.
Basically, I'd like to make a template in LaTeX, compatible with plain LaTeX/pdfLaTeX (no lua code), with as few dependencies as possible, that would allow me to get personal information this way:
\adduser{John Doe}{UK}
\adduser{M. Dupont}{France}
\adduser{M. Martin}{Belgium}{France}
\adduser{Jan Jansen}{Netherlands}
\adduser{Matti Meikäläinen}{Netherlands}{Finland}
And output something like that:
John Doe(a), M.Dupont(b), M. Martin(b, c), Jan Jansen(d), Matti Meikäläinen(d, e)
a: UK
b: France
c: Belgium
d: Netherlands
e: Finland
I'm sure this is possible, but in plain LaTeX, this seems very difficult. Any idea?


\def\xdo##1{\advance\count0 by 1 Input \the\count0 \space is: '##1'. }, I know what it does (extract the variable from the stack and display it instead of the ##1 token) but I really don't understand how which is really frustrating. – Gael Feb 12 at 18:03