How to put a symbol above another in LaTeX? [closed]

How to put a symbol above (on the head of) another? For example, I want to produce something like this in one line.

a
#

i.e., a above #.

The effect should be almost the same with $#^a$ except that a is on the top instead of top right of #.


Solution 1:

Use \overset{above}{main} in math mode. In your case, \overset{a}{\#}.

Solution 2:

If you're using # as an operator, consider defining a new operator for it:

\newcommand{\pound}{\operatornamewithlimits{\#}}

You can then write things like \pound_{n = 1}^N and get:

alt text

Solution 3:

${a \atop \#}$

or

${a \above 0pt \#}$