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}}

1 Answer 1

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}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .