[Tex/LaTex] the limit arrow: its label too high

arrowslabelsmath-mode

My question is an extension of this one. I have the command

\documentclass{article}
\usepackage{amsmath}
\begin{document}
$a_n \xrightarrow{\scriptscriptstyle n\to\infty} 0$ 
\end{document}

which produces enter image description here.

How can I alter this command (hopefully in a simple way) to get enter image description here, i.e. the label is closer to the arrow, so the command doesn't produce ugly additional space between rows.

Best Answer

This is an ugly hack, but it does seem to work:

$a_n \xrightarrow{%
         \raisebox{-2pt}[0pt][0pt]{%
             \ensuremath{\scriptscriptstyle n\to\infty}}} 0$

If you want it to work more generally, you can throw something together using \mathchoice I presume.

Related Question