4

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

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

1 Answer 1

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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .