[Tex/LaTex] Superscript directly above character

superscripts

In math mode, I want to typeset a beta character over an equals sign.

I've tried $=^{\beta}$, but that produces a superscript to the right.

beta superscript

I want the beta to be exactly above the equals sign. How do I do this?

Best Answer

As suggested in my comment, the \overset macro of the amsmath package is designed to accomplish this task.

\documentclass{article}
\usepackage{amsmath}
\begin{document}
\[ A \overset{\beta}{=} B \]
\end{document}

enter image description here

Using \stackrel, this is the syntax:

\documentclass{article}
\begin{document}
\[ A \stackrel{\beta}{=} B \]
\end{document}

And, finally, with stackengine,

\documentclass{article}
\usepackage{stackengine}
\stackMath
\begin{document}
\[ A \mathrel{\stackon[1pt]{=}{\scriptstyle\beta}} B \]
\end{document}

For something this straightforward, stackengine is overkill, but it can be useful if there are multiple things to be stacked, if the vertical stacking gaps need tweaking, or if special horizontal alignments must be applied.