[comp.text.tex] Help with \thecounter

sommer@BINAH.CC.BRANDEIS.EDU (01/08/91)

In reply to my \citem question, someone (sorry, lost his name) gave a
really good suggestion that I tried to put into the macro below. Except:

How do you get a parameter to be read as a string or token to become part
of a command?

In particular, I want to use \the#1 in the definition below, but even with
\expandafter, \string, and all sorts of other things I don't really know
about, I get the error that
	! You can't use `the <first letter of #1>' after \the.
Actually, all I really need is the value of #1's counter whether using
\the#1 or some other trick. So what's the trick?
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
\newcommand{\setfoot}[1]{\newcounter{#1}\setcounter{#1}{\value{footnote}}}
\newcommand{\refoot}[1]{$^{\the#1}$}

This is supposed to be a macro to let me save a footnote number and re-use
it later.\footnote{text}\setfoot{label_name} [...] Later on, I can re-use
it here,\refoot{label_name} but only if the def'n of refoot works!
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
Eventually, I'd like to have something like:
\renewcommand{\footnote}[2]{\footnote{#1}%\setfoot{#2} or
	%% a better version of \setfoot{#2} that won't crash or 
	%% generate too many false counters if there is no {#2} 
	}
Per usual, THANK YOU VERY MUCH!