7

In the answers to this question: What is the difference between \over and \frac?, one finds the ams and plain latex definitions of \frac, respectively:

\DeclareRobustCommand{\frac}[2]{{\begingroup#1\endgroup\@@over#2}}
\DeclareRobustCommand\frac[2]{{\begingroup#1\endgroup\over#2}}

Is there a reason grouping is not used around #2? That is, like this:

\DeclareRobustCommand{\frac}[2]{{\begingroup#1\endgroup\@@over\begingroup#2\endgroup}}
\DeclareRobustCommand\frac[2]{{\begingroup#1\endgroup\over\begingroup#2\endgroup}}
David Carlisle
  • 757,742

1 Answers1

11

declarations in the numerator of a primitive { ... \over ...} can leak in to the denominator, but an extra group in the denominator would do nothing.

enter image description here

\documentclass{article}

\begin{document}

[ { a \over b}

{ \fam0 a \over b}

{\begingroup \fam0 a \endgroup \over b} ]

\end{document}

David Carlisle
  • 757,742