3

I currently have the following shortcut in my LaTeX document for an isomorphism arrow:

\usepackage{kpfonts,Baskervaldx,mathrsfs,calligra}

\newcommand{\congto}{\xrightarrow{\sim}}

This works fine, except for the fact that there is a bit too much vertical space below the \sim.
In particular, if the arrow happens to appear below any other inline maths, then things seem a little bit too squished.
How can I lower the \sim to be closer to my \xrightarrow?

Here is how things look at the moment:

current situation

1

2 Answers 2

3

If you don't need it in \scriptstyle (though I think \xrightarrow only comes in \textstyle), then

\documentclass{article}
\usepackage{kpfonts,Baskervaldx,mathrsfs,calligra}
\newcommand{\congto}{\altxrightarrow{\sim}}
\usepackage{stackengine,amsmath}
\newcommand\altxrightarrow[2][0pt]{\mathrel{\ensurestackMath{\stackengine%
  {\dimexpr#1-7.5pt}{\xrightarrow{\phantom{#2}}}{\scriptstyle\!#2\,}%
  {O}{c}{F}{F}{S}}}}
\begin{document}
$A\congto B$

$A\altxrightarrow{\equiv} B$

$A\altxrightarrow[-2pt]{\mathrm{wth}} B$
\end{document}

enter image description here

\altxrightarrow thrown in for free.

2

Following the links in a comment, I just used

\newcommand{\congto}{\xrightarrow{\raisebox{-1ex}[0ex][0ex]{$\sim$}}}

which worked great:

enter image description here

You must log in to answer this question.

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