I don't quite understand how \ext@arrow of amsmath is working. When I look at the code, its functionality seems straight forward to me at the first glance.
\def\ext@arrow#1#2#3#4#5#6#7{%
\mathrel{\mathop{%
\setbox\z@\hbox{#5\displaystyle}%
\setbox\tw@\vbox{\m@th
\hbox{$\scriptstyle\mkern#3mu{#6}\mkern#4mu$}%
\hbox{$\scriptstyle\mkern#3mu{#7}\mkern#4mu$}%
\copy\z@
}%
\hbox to\wd\tw@{\unhbox\z@}}%
\limits
\@ifnotempty{#7}{^{\if0#1\else\mkern#1mu\fi
#7\if0#2\else\mkern#2mu\fi}}%
\@ifnotempty{#6}{_{\if0#1\else\mkern#1mu\fi
#6\if0#2\else\mkern#2mu\fi}}}%
}
The first part uses #3 and #4 to determine how long the arrow should be (I call that length A). The second part does then set the text above or below the arrow and uses #1 and #2 as left and right margin (I call that length B).
First of all, I think that the separate declaration of #3 and #4 is not necessary, the sum of both would suffice (as text is always set centered on an arrow enlarged by use of #3 and #4).
While playing around with different values, I realized that the arrow does not always have length A. If the text is longer (B > A), then the arrow is longer as well. The following two examples read to the same results.
\documentclass{minimal}
\usepackage{amsmath}
\begin{document}
\makeatletter\noindent
$\ext@arrow 00{20}{20}\rightarrowfill@{a}{b}$\\
$\ext@arrow {20}{20}00\rightarrowfill@{a}{b}$
\end{document}
So, in that case, one does not need #3 and #4 at all. #1 and #2 would suffice.
The only reason for #3 and #4, I can see, is to specify a minimum length of the arrow in case there is no text (and #1 and #2 are never used in that case). However, I do not quite understand while the calculation of value A is so complicated then (incorporating the text, that is empty in that case).
Is this historic ballast? Or did I understand something wrong?
#3and#4arguments allow you to generate extended arrows that are horizontally offset (either left or right) from the centre. – Werner May 24 '12 at 07:32#1and#2. – egreg May 24 '12 at 09:32