This was inspired by How to have nice-looking symbols within an \itemize environment? and Sigur's comment which remind me about the display style of math formulas and the fractions.

I know that, in the amsmath package there is already \dfrac{}{} for us to have display-style fractions (as well as \tfrac{}{} for in-line fraction).

Enter image description here

Then why don't \dsum, \dprod, \dint, etc. exist?

If they are not to exist, then why does \dfrac exist?

Actually, we can define, for example, \dint as


but I want to know the reason why there are no \dint, etc. Or can you tell me the packages in which these \d- are in?

  • Essentially because \displaystyle\int will make everything in the formula in display style. Or not work as you intend. – egreg Nov 17 '18 at 15:38
  • 1
    Of course \dfrac is not defined as \displaystyle\frac. – egreg Nov 17 '18 at 15:43

The command \dfrac exists for rendering multistory fractions, say


and is not generally intended for usage in an inline formula. It is not defined using the simplistic format \displaystyle\frac, but rather

% amsmath.sty, line 214:

where \genfrac is

% amsmath.sty, line 221:
    \csname @@\ifx @#3@over\else above\fi
    \ifx\@tempa\@empty \else withdelims\fi\endcsname}

% amsmath.sty, line 289:
  \else\ifcase#1\displaystyle % case 0

What happens with \dfrac{a}{b}? By definition this becomes \genfrac{}{}{}0{a}{b}, so

    \csname @@\ifx @@over\else above\fi
    \ifx\@tempa\@empty \else withdelims\fi\endcsname}

By definition of \@mathstyle, \@tempb is defined to be \@genfrac\displaystyle\@@over, so we're left with


which in turn becomes

{\displaystyle{\begingroup a\endgroup\@@over\relax b}}

and \@@over is the primitive \over. Note the braces around the whole construction. You may enjoy chasing the expansion of \frac, \binom and \dbinom.

With \int one cannot do \displaystyle\int, because this wouldn't confine the scope of \displaystyle, nor {\displaystyle\int}, because this would not place correctly the limits. Indeed, the test file







produces wrong output in either case:

enter image description here

Can one do something about this? Yes, but I don't think it's worth the pain. Anyway, here it is:


\NewDocumentCommand{\dint}{t\limits e{_^}}{%




enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy