latex text above equal code example
Example 1: latex equals with text
$\stackrel{sometext}{=}$
Example 2: text over equal latex
\documentclass[preview]{standalone}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\newcommand{\approxtext}[1]{\ensuremath{\stackrel{\text{#1}}{\approx}}}
\begin{document}
$\displaystyle
A \stackrel{\text{text}}{\approx} B
$,
$\displaystyle
A \approxtext{test} B
$
\end{document}