6

I have the following:

\underset{{}^u}{\sim}

which looks like the left; I would like it to look more like the right image.

enter image description here

The changes were shrinking the "u", bringing it closer to the tilde, and raising the whole thing so it doesn't hang below the line. I tried using a \raisebox but had no success.

  • \raisebox apparently works only in text mode (and not in math mode). A soft hack could bypass this limitation by first creating a text environment with the \text{...} command from amsmath, and implement raisbox inside it-- of course again surrounding the math symbol to be underset within $s. – Partha D. Feb 14 at 5:42
5

Welcome to TeX.Stackexchange.

Edit # 2

To raise the whole operator, could use \scalebox from the graphics package. This translates better, as is found independent of the font size option of the documentclass (the original version doesn't scale equally well to a 10pt or 11pt document)

\documentclass{standalone}
\usepackage{amsmath, graphics}
\newcommand{\upperset}[2]{\:
  \underset{
            \text{\raisebox{1.2ex}{\smash{\scalebox{0.8}{$#1$}}}}%
           }
           {
            \text{\raisebox{0.2ex}{\smash{$#2$}}}
           }
                       \:}
\begin{document}
    $x \underset{{}^u}{\sim} y$ \quad\phantom{\strut}
    $x \upperset{{}^u}{\sim} y$
\end{document}

giving very near to what you wanted:

enter image description here

Original post

Maybe this could be a possible solution:

\documentclass[12pt]{standalone}
\usepackage{amsmath}
\newcommand{\upperset}[2]{%
    \underset{%
        \text{\raisebox{1ex}{\smash{\fontsize{5}{5}$#1$}}}
              }{#2}%
                         }
\begin{document}
    $x \underset{{}^u}{\sim} y$ \quad\phantom{\strut}
    $x \upperset{{}^u}{\sim} y$
\end{document}

which gives this:

enter image description here

  • 2nd edit is perfect, thanks! – Jordan Feb 13 at 22:53
4

If I understand correctly, the OP wants the underset to sit on the baseline.

\documentclass{article}
\usepackage{stackengine,amsmath}
\newcommand\runderset[2][\sim]{\mathrel{\ensurestackMath{%
  \stackengine{-.2pt}{\scriptscriptstyle#2}{#1}{O}{c}{F}{F}{S}}}}
\begin{document}
$a\runderset{x}b$

$a\runderset[=]y b$
\end{document}

enter image description here

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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