[Tex/LaTex] Two-headed version of \xrightarrow

arrows

I would like a double-headed extensible right-arrow similar to \xrightarrow from amsmath.

I tried using \xtwoheadrightarrow from extpfeil, but the result differs from \xrightarrow in three respects:

  • the arrow head has a different style
  • the arrow itself is longer than I would like it
  • the text above the arrow is too high

enter image description here

What's the most straightforward way of achieving a two-headed version of \xrightarrow?

\documentclass{article}
\usepackage{extpfeil}

\begin{document}
\begin{align*}
  & \xrightarrow{ABCD} \\
  & \xtwoheadrightarrow{ABCD}
\end{align*}
\end{document}

Best Answer

I'd typeset \xrightarrow, back up a little and add \rightarrow:

\documentclass{article}
\usepackage{amsmath,amssymb}

\newcommand{\rightarrowdbl}{\rightarrow\mathrel{\mkern-14mu}\rightarrow}

\newcommand{\xrightarrowdbl}[2][]{%
  \xrightarrow[#1]{#2}\mathrel{\mkern-14mu}\rightarrow
}

\begin{document}
$A \rightarrowdbl B$

$A \xrightarrow[\beta]{\alpha} B$

$A \xrightarrowdbl[\beta]{\alpha} B$

$A \xrightarrowdbl{\text{overlong text}} B$
\end{document}

enter image description here