# How to define a command that returns its argument as a superscript?

How can I write the following code more concisely, without an ifcase statement? Please assume the command will only be called with integer arguments between 1 and 8, inclusive. Sorry for asking such a basic question---I'm new to macros.

\renewcommand{\@fnsymbol}[1]{\ifcase#1\or ^0 \or ^1\or ^2\or
^3\or ^4\or ^5\or ^6\or ^7 \or ^8 \fi\relax}

-
Do you mean something like \newcommand{\mysuperscript}[1]{$^{#1}$}? Do you plan on using this in text mode or in math mode? – Neo Jan 23 '13 at 3:38
LaTeX provides \textsuperscript{<stuff>} which "returns its argument as a superscript." – Werner Jan 23 '13 at 4:00
Welcome to TeX.SE. It might be helpful if you included some details as to exactly what you are trying to accomplish as there might be an easier way to do what you want. Also, for the way you have specd it, what do you want to happen if the parameter is not a single digit? – Peter Grill Jan 23 '13 at 4:15
Thanks, here's some context: I'm using a .cls file that defines a custom footer symbol. I don't like those footer symbols though, so I'm redefining the command (@fnsymbol) that generates the footer symbols. My command appears above, in the question. It works, but seems ridiculous to use "ifcase", just to write a command that returns its argument as a superscript. So I'm looking for a better way to duplicate the functionality of the above command. – Jeff Jan 23 '13 at 4:20
How about including a minimal working example (MWE) which would provide even more context to your current discussion? – Werner Jan 23 '13 at 4:43

\let\@fnsymbol^

Is probably as concise as you could get as an answer to the question, although given the command name you used, you need a bit more as it needs to work with count registers not just literal digits \@fnsymbol{33} would work but not \@fnsymbol\c@footnote and it needs to work out of math mode so you need
\def\@fnsymbol#1{\ensuremath{^{\number#1}}}

But \textsuperscript is a better option as it uses the text fonts not the math ones.