20

I have a command that has been floating around in my standard preamble for a while:

\newcommand{\xeq}[1]{\stackrel{\;#1}{\cleaders\hbox{=\!}\hfill}\:}

It is meant to mimic the AMS-LaTeX extendible arrow symbols \xleftarrow and \xrightarrow.

It's not perfect for two reasons:

  1. It does not take the optional lower argument like the AMS \xrightarrow[down]{up}
  2. The overlap of the constituent equals signs is slightly visible.

Does anyone have a better command or know of a package with such a command?

Stefan Kottwitz
  • 231,401
Simon
  • 4,262

2 Answers2

22

I think you can more or less copy the definitions from amsmath.sty:

\documentclass{minimal}

\usepackage{amsmath}

\makeatletter
\newcommand*{\Relbarfill@}{\arrowfill@\Relbar\Relbar\Relbar}
\newcommand*{\xeq}[2][]{\ext@arrow 0055\Relbarfill@{#1}{#2}}
\makeatother

\begin{document}

$a \xeq[uuuuu]{vvv} b$

\end{document}
Philipp
  • 17,641
15

The extarrows package provides \xlongequal[below]{above}.

Werner
  • 603,163
Caramdir
  • 89,023
  • 26
  • 255
  • 291