I would like to know how can I use a counter for defining other new counters.
Something like this:
\newcounter{foo}
\stepcounter{foo}
%% Perhaps more increments, this depends of the user.
%% And now, to create a new counter and command from foo.
\newcounter{\csname foofoo\thefoo\endcsname}
\def\csname mydyndef\thefoo\endcsname{definition...}
For example, with foo = 5, to create the counter foofoo5 and the command \mydyndef5.
And of course, to use it now:
This is my example \csname mydyndef\thefoo\endcsname,
with counter \csname thefoofoo\thefoo \endcsname.
But, of course, nothing of this works for me. And that is the question:
How can I achieve this?
This problem arises from searching a pure manual solution to this question: New list environment: automatic enumeration with "a posteriori" format, creating a counter (label@counterx) and saving the format in a command (\label@formatx) for each new depth (controlled by list@depth counter):
\newenvironment{labelist}{%%%
\stepcounter{list@depth} %% Actual depth
\ifnumcomp{\value{list@depth}}{=}{1} {
\newcounter{label@counter1}
\setcounter{label@coutner1}{0}
\def\label@format1{\Alph{label@counter1}}
\begin{list}{ \textbf{(\label@format1)} }
{ \usecounter{label@counter1 }
}{
%% Similar to the first case, but replacing 1 with the actual depth.
}
}{
%% Other code not-important here.
}
labelistquestion doesn't satisfy you? An approach such as this is definitely not recommendable. – egreg Nov 02 '12 at 15:08