How do I put text over symbols? gives some very good answers to placing text above a symbol (=), which works for many other symbols which as +, @ etc. However none of the solutions work for ~
, I had to resort to \sim
(see picture) to get the desired result.
Why do these not work?
\newcommand\myeq{\stackrel{\mathclap{\normalfont\mbox{s}}}{~}}
$\Lambda \stackrel{s}{~} A$
(Again, replacing ~
with \sim
worked.)
MWE
\documentclass[12pt,a4paper]{article}
%\usepackage[fleqn]{amsmath}
\usepackage{mathtools}
\newcommand\myeq{\stackrel{\mathclap{\normalfont\mbox{s}}}{~}}
% \newcommand\myeq{\stackrel{\mathclap{\normalfont\mbox{s}}}{\sim}}
\begin{document}
$\Lambda \stackrel{s}{~} A$
$\Lambda \stackrel{s}{\sim} A$
$\Lambda \myeq A$
\end{document}
~
is a special character in TeX System, an active character which usually represents non-breakable space. I does not print the symbol "~". The corect tilde symbol is printed with\sim
.