0

I would like to have a command \simrightarrow, that is, a \rightarrow with a \sim over it. Stealing code from @egreg, I got:

\documentclass{article}

\usepackage{unicode-math}

  \newcommand{\simrightarrow}{\mathrel{\ooalign{
     $\to$\cr
     \hidewidth\raise.3em\hbox{$\sim\mkern3mu$}\cr
    }
  }
}


\begin{document}
\( M \simrightarrow N \)
\end{document}

However, the tilde is still too big. How can I scale it down?

  • 2
    or from what you have perhaps $\scriptstyle\sim ? but as you are using unicode-math anyway then using \similarrightarrow seems most natural as that is a single glyph not an oalign construct – David Carlisle May 18 '19 at 5:39
  • @DavidCarlisle I will check your recommendations. Unfortunately many fonts (including Latin Modern) don't contain \similarrightarrow. That's why I got into \ooalign. – John Dorian May 18 '19 at 5:42
  • @DavidCarlisle I did not try out \scriptstyle because I did not expect it to behave correctly under scaling (\simrightarrow_{\simrightarrow}) but it seems, it actually does. Thank you! – John Dorian May 18 '19 at 5:47
1

I have used this approach: the use of the scalerel package with the option \scaleobj{.5}{\sim} to decrease the size of \sim. I have searched a good compromise between the dimension of \sim and \to. After I have edited a little your code. Here there is the output and the MWE.

enter image description here

\documentclass{article}
\usepackage{unicode-math}
\usepackage{scalerel}
  \newcommand{\simrightarrow}{\mathrel{\ooalign{
     $\to$\cr
     \hidewidth\raise.3em\hbox{$\scaleobj{.5}{\sim}\mkern7mu$}\cr
    }
  }
}
\begin{document}
\( M \simrightarrow N \)
\end{document}

Addendum: 12-april-2020

With stix package there is the exact symbol without to use \ooalign if you prefer like suggested by @David Carlisle.

\documentclass[a4paper,12pt]{article}
\usepackage{amsmath}
\usepackage{stix}
\begin{document}
$a \similarrightarrow n$
\end{document}

enter image description here

| improve this answer | |

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