TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'd need a special symbol used in statistics.

What I need is a tilde with something written upon it.

I can get the tilde by using \sim, but I need to add a superscript over it (H_0). If I use \sim^{H_0}, I get a tilde with H_0 over it and on the right, not simply upon it.

share|improve this question
You might be interested in this question. – Thorsten Donig Feb 3 '12 at 22:07
up vote 17 down vote accepted

The following minimal example provides two possibilities: \distas{<stuff>} and \distras{<stuff>}. The former uses amsmath's \overset{<top>}{<bottom>} which sets <top> over top of <bottom>. The latter uses a resized version of <bottom> in case <top> is wider than <bottom>. In fact, it stretches <bottom> to 6pt wider than <top> (3pt on either side). In both instances, <bottom> is fixed to \sim and the symbol is spaced as a binary operator via \mathbin.

enter image description here

\usepackage{graphicx}% http://ctan.org/pkg/graphicx
\usepackage{amsmath}% http://ctan.org/pkg/amsmath

$X\distas{H_0}Y \quad X\distras{H_0}Y$
share|improve this answer
Thank you both Werner and Thorsten Donig! Your answers were very useful. I've solved by using: \overset{H_0}{\sim} – Luigi Feb 3 '12 at 22:12

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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