3

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}

S relation

  • 5
    ~ 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. – Moriambar Apr 15 '17 at 15:34
  • @Moriambar Ah! thx. If you put that line as an answer, I'd be happy to accept it. – Athena Widget Apr 15 '17 at 15:35
  • Done as you wished – Moriambar Apr 15 '17 at 15:38
6

~ 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.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.