Why are there no dint or dsum like dfrac?












10















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



DeclareMathOperator{dint}{displaystyleint}


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?










share|improve this question

























  • Essentially because displaystyleint will make everything in the formula in display style. Or not work as you intend.

    – egreg
    Nov 17 '18 at 15:38













  • @egreg If they say displaystyleint is okay, they should also say displaystylefrac{}{} is okay :))

    – JouleV
    Nov 17 '18 at 15:41






  • 1





    Of course dfrac is not defined as displaystylefrac.

    – egreg
    Nov 17 '18 at 15:43











  • @egreg I agree. But they are the same, or nearly. If developers can find a way to define dfrac not as displaystylefrac, I think they can do the same for the rest :))

    – JouleV
    Nov 17 '18 at 15:48
















10















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



DeclareMathOperator{dint}{displaystyleint}


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?










share|improve this question

























  • Essentially because displaystyleint will make everything in the formula in display style. Or not work as you intend.

    – egreg
    Nov 17 '18 at 15:38













  • @egreg If they say displaystyleint is okay, they should also say displaystylefrac{}{} is okay :))

    – JouleV
    Nov 17 '18 at 15:41






  • 1





    Of course dfrac is not defined as displaystylefrac.

    – egreg
    Nov 17 '18 at 15:43











  • @egreg I agree. But they are the same, or nearly. If developers can find a way to define dfrac not as displaystylefrac, I think they can do the same for the rest :))

    – JouleV
    Nov 17 '18 at 15:48














10












10








10


2






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



DeclareMathOperator{dint}{displaystyleint}


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?










share|improve this question
















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



DeclareMathOperator{dint}{displaystyleint}


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?







macros amsmath inline displaystyle






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 18 '18 at 2:05









Peter Mortensen

54937




54937










asked Nov 17 '18 at 15:26









JouleVJouleV

2,499628




2,499628













  • Essentially because displaystyleint will make everything in the formula in display style. Or not work as you intend.

    – egreg
    Nov 17 '18 at 15:38













  • @egreg If they say displaystyleint is okay, they should also say displaystylefrac{}{} is okay :))

    – JouleV
    Nov 17 '18 at 15:41






  • 1





    Of course dfrac is not defined as displaystylefrac.

    – egreg
    Nov 17 '18 at 15:43











  • @egreg I agree. But they are the same, or nearly. If developers can find a way to define dfrac not as displaystylefrac, I think they can do the same for the rest :))

    – JouleV
    Nov 17 '18 at 15:48



















  • Essentially because displaystyleint will make everything in the formula in display style. Or not work as you intend.

    – egreg
    Nov 17 '18 at 15:38













  • @egreg If they say displaystyleint is okay, they should also say displaystylefrac{}{} is okay :))

    – JouleV
    Nov 17 '18 at 15:41






  • 1





    Of course dfrac is not defined as displaystylefrac.

    – egreg
    Nov 17 '18 at 15:43











  • @egreg I agree. But they are the same, or nearly. If developers can find a way to define dfrac not as displaystylefrac, I think they can do the same for the rest :))

    – JouleV
    Nov 17 '18 at 15:48

















Essentially because displaystyleint will make everything in the formula in display style. Or not work as you intend.

– egreg
Nov 17 '18 at 15:38







Essentially because displaystyleint will make everything in the formula in display style. Or not work as you intend.

– egreg
Nov 17 '18 at 15:38















@egreg If they say displaystyleint is okay, they should also say displaystylefrac{}{} is okay :))

– JouleV
Nov 17 '18 at 15:41





@egreg If they say displaystyleint is okay, they should also say displaystylefrac{}{} is okay :))

– JouleV
Nov 17 '18 at 15:41




1




1





Of course dfrac is not defined as displaystylefrac.

– egreg
Nov 17 '18 at 15:43





Of course dfrac is not defined as displaystylefrac.

– egreg
Nov 17 '18 at 15:43













@egreg I agree. But they are the same, or nearly. If developers can find a way to define dfrac not as displaystylefrac, I think they can do the same for the rest :))

– JouleV
Nov 17 '18 at 15:48





@egreg I agree. But they are the same, or nearly. If developers can find a way to define dfrac not as displaystylefrac, I think they can do the same for the rest :))

– JouleV
Nov 17 '18 at 15:48










1 Answer
1






active

oldest

votes


















13














The command dfrac exists for rendering multistory fractions, say



[
frac{dfrac{a}{b}-dfrac{c}{d}}{dfrac{a}{b}+dfrac{c}{d}
]


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



% amsmath.sty, line 214:
newcommand{dfrac}{genfrac{}{}{}0}


where genfrac is



% amsmath.sty, line 221:
DeclareRobustCommand{genfrac}[4]{%
def@tempa{#1#2}%
edef@tempb{@nx@genfrac@mathstyle{#4}%
csname @@ifx @#3@overelse abovefi
ifx@tempa@empty else withdelimsfiendcsname}
@tempb{#1#2#3}}

% amsmath.sty, line 289:
def@genfrac#1#2#3#4#5{{#1{begingroup#4endgroup#2#3relax#5}}}
def@mathstyle#1{%
ifx@empty#1@emptyrelax
elseifcase#1displaystyle % case 0
ortextstyleorscriptstyleelsescriptscriptstylefifi}


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



def@tempa{}%
edef@tempb{@nx@genfrac@mathstyle{0}%
csname @@ifx @@overelse abovefi
ifx@tempa@empty else withdelimsfiendcsname}
@tempb{}{a}{b}


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



@genfracdisplaystyle@@over{}{a}{b}


which in turn becomes



{displaystyle{begingroup aendgroup@@overrelax 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 displaystyleint, because this wouldn't confine the scope of displaystyle, nor {displaystyleint}, because this would not place correctly the limits. Indeed, the test file



documentclass{article}
usepackage{amsmath}

DeclareMathOperator{dint}{displaystyleint}
newcommand{ddint}{displaystyleint}

begin{document}

$dint_0^1frac{x}{2},dx$

$ddint_0^1frac{x}{2},dx$

end{document}


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:



documentclass{article}
usepackage{amsmath}
usepackage{xparse}

NewDocumentCommand{dint}{tlimits e{_^}}{%
mathop{
displaystyleint
IfBooleanT{#1}{limits}
IfValueT{#2}{_{#2}}
IfValueT{#3}{^{#3}}
}%
}

begin{document}

$dint_0^1frac{x}{2},dx$
$dintlimits_0^1frac{x}{2},dx$
$dintfrac{x}{2},dx$

end{document}


enter image description here






share|improve this answer


























  • Oh I see! Thank you very much!

    – JouleV
    Nov 17 '18 at 16:03











Your Answer








StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "85"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f460464%2fwhy-are-there-no-dint-or-dsum-like-dfrac%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









13














The command dfrac exists for rendering multistory fractions, say



[
frac{dfrac{a}{b}-dfrac{c}{d}}{dfrac{a}{b}+dfrac{c}{d}
]


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



% amsmath.sty, line 214:
newcommand{dfrac}{genfrac{}{}{}0}


where genfrac is



% amsmath.sty, line 221:
DeclareRobustCommand{genfrac}[4]{%
def@tempa{#1#2}%
edef@tempb{@nx@genfrac@mathstyle{#4}%
csname @@ifx @#3@overelse abovefi
ifx@tempa@empty else withdelimsfiendcsname}
@tempb{#1#2#3}}

% amsmath.sty, line 289:
def@genfrac#1#2#3#4#5{{#1{begingroup#4endgroup#2#3relax#5}}}
def@mathstyle#1{%
ifx@empty#1@emptyrelax
elseifcase#1displaystyle % case 0
ortextstyleorscriptstyleelsescriptscriptstylefifi}


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



def@tempa{}%
edef@tempb{@nx@genfrac@mathstyle{0}%
csname @@ifx @@overelse abovefi
ifx@tempa@empty else withdelimsfiendcsname}
@tempb{}{a}{b}


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



@genfracdisplaystyle@@over{}{a}{b}


which in turn becomes



{displaystyle{begingroup aendgroup@@overrelax 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 displaystyleint, because this wouldn't confine the scope of displaystyle, nor {displaystyleint}, because this would not place correctly the limits. Indeed, the test file



documentclass{article}
usepackage{amsmath}

DeclareMathOperator{dint}{displaystyleint}
newcommand{ddint}{displaystyleint}

begin{document}

$dint_0^1frac{x}{2},dx$

$ddint_0^1frac{x}{2},dx$

end{document}


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:



documentclass{article}
usepackage{amsmath}
usepackage{xparse}

NewDocumentCommand{dint}{tlimits e{_^}}{%
mathop{
displaystyleint
IfBooleanT{#1}{limits}
IfValueT{#2}{_{#2}}
IfValueT{#3}{^{#3}}
}%
}

begin{document}

$dint_0^1frac{x}{2},dx$
$dintlimits_0^1frac{x}{2},dx$
$dintfrac{x}{2},dx$

end{document}


enter image description here






share|improve this answer


























  • Oh I see! Thank you very much!

    – JouleV
    Nov 17 '18 at 16:03
















13














The command dfrac exists for rendering multistory fractions, say



[
frac{dfrac{a}{b}-dfrac{c}{d}}{dfrac{a}{b}+dfrac{c}{d}
]


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



% amsmath.sty, line 214:
newcommand{dfrac}{genfrac{}{}{}0}


where genfrac is



% amsmath.sty, line 221:
DeclareRobustCommand{genfrac}[4]{%
def@tempa{#1#2}%
edef@tempb{@nx@genfrac@mathstyle{#4}%
csname @@ifx @#3@overelse abovefi
ifx@tempa@empty else withdelimsfiendcsname}
@tempb{#1#2#3}}

% amsmath.sty, line 289:
def@genfrac#1#2#3#4#5{{#1{begingroup#4endgroup#2#3relax#5}}}
def@mathstyle#1{%
ifx@empty#1@emptyrelax
elseifcase#1displaystyle % case 0
ortextstyleorscriptstyleelsescriptscriptstylefifi}


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



def@tempa{}%
edef@tempb{@nx@genfrac@mathstyle{0}%
csname @@ifx @@overelse abovefi
ifx@tempa@empty else withdelimsfiendcsname}
@tempb{}{a}{b}


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



@genfracdisplaystyle@@over{}{a}{b}


which in turn becomes



{displaystyle{begingroup aendgroup@@overrelax 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 displaystyleint, because this wouldn't confine the scope of displaystyle, nor {displaystyleint}, because this would not place correctly the limits. Indeed, the test file



documentclass{article}
usepackage{amsmath}

DeclareMathOperator{dint}{displaystyleint}
newcommand{ddint}{displaystyleint}

begin{document}

$dint_0^1frac{x}{2},dx$

$ddint_0^1frac{x}{2},dx$

end{document}


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:



documentclass{article}
usepackage{amsmath}
usepackage{xparse}

NewDocumentCommand{dint}{tlimits e{_^}}{%
mathop{
displaystyleint
IfBooleanT{#1}{limits}
IfValueT{#2}{_{#2}}
IfValueT{#3}{^{#3}}
}%
}

begin{document}

$dint_0^1frac{x}{2},dx$
$dintlimits_0^1frac{x}{2},dx$
$dintfrac{x}{2},dx$

end{document}


enter image description here






share|improve this answer


























  • Oh I see! Thank you very much!

    – JouleV
    Nov 17 '18 at 16:03














13












13








13







The command dfrac exists for rendering multistory fractions, say



[
frac{dfrac{a}{b}-dfrac{c}{d}}{dfrac{a}{b}+dfrac{c}{d}
]


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



% amsmath.sty, line 214:
newcommand{dfrac}{genfrac{}{}{}0}


where genfrac is



% amsmath.sty, line 221:
DeclareRobustCommand{genfrac}[4]{%
def@tempa{#1#2}%
edef@tempb{@nx@genfrac@mathstyle{#4}%
csname @@ifx @#3@overelse abovefi
ifx@tempa@empty else withdelimsfiendcsname}
@tempb{#1#2#3}}

% amsmath.sty, line 289:
def@genfrac#1#2#3#4#5{{#1{begingroup#4endgroup#2#3relax#5}}}
def@mathstyle#1{%
ifx@empty#1@emptyrelax
elseifcase#1displaystyle % case 0
ortextstyleorscriptstyleelsescriptscriptstylefifi}


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



def@tempa{}%
edef@tempb{@nx@genfrac@mathstyle{0}%
csname @@ifx @@overelse abovefi
ifx@tempa@empty else withdelimsfiendcsname}
@tempb{}{a}{b}


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



@genfracdisplaystyle@@over{}{a}{b}


which in turn becomes



{displaystyle{begingroup aendgroup@@overrelax 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 displaystyleint, because this wouldn't confine the scope of displaystyle, nor {displaystyleint}, because this would not place correctly the limits. Indeed, the test file



documentclass{article}
usepackage{amsmath}

DeclareMathOperator{dint}{displaystyleint}
newcommand{ddint}{displaystyleint}

begin{document}

$dint_0^1frac{x}{2},dx$

$ddint_0^1frac{x}{2},dx$

end{document}


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:



documentclass{article}
usepackage{amsmath}
usepackage{xparse}

NewDocumentCommand{dint}{tlimits e{_^}}{%
mathop{
displaystyleint
IfBooleanT{#1}{limits}
IfValueT{#2}{_{#2}}
IfValueT{#3}{^{#3}}
}%
}

begin{document}

$dint_0^1frac{x}{2},dx$
$dintlimits_0^1frac{x}{2},dx$
$dintfrac{x}{2},dx$

end{document}


enter image description here






share|improve this answer















The command dfrac exists for rendering multistory fractions, say



[
frac{dfrac{a}{b}-dfrac{c}{d}}{dfrac{a}{b}+dfrac{c}{d}
]


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



% amsmath.sty, line 214:
newcommand{dfrac}{genfrac{}{}{}0}


where genfrac is



% amsmath.sty, line 221:
DeclareRobustCommand{genfrac}[4]{%
def@tempa{#1#2}%
edef@tempb{@nx@genfrac@mathstyle{#4}%
csname @@ifx @#3@overelse abovefi
ifx@tempa@empty else withdelimsfiendcsname}
@tempb{#1#2#3}}

% amsmath.sty, line 289:
def@genfrac#1#2#3#4#5{{#1{begingroup#4endgroup#2#3relax#5}}}
def@mathstyle#1{%
ifx@empty#1@emptyrelax
elseifcase#1displaystyle % case 0
ortextstyleorscriptstyleelsescriptscriptstylefifi}


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



def@tempa{}%
edef@tempb{@nx@genfrac@mathstyle{0}%
csname @@ifx @@overelse abovefi
ifx@tempa@empty else withdelimsfiendcsname}
@tempb{}{a}{b}


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



@genfracdisplaystyle@@over{}{a}{b}


which in turn becomes



{displaystyle{begingroup aendgroup@@overrelax 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 displaystyleint, because this wouldn't confine the scope of displaystyle, nor {displaystyleint}, because this would not place correctly the limits. Indeed, the test file



documentclass{article}
usepackage{amsmath}

DeclareMathOperator{dint}{displaystyleint}
newcommand{ddint}{displaystyleint}

begin{document}

$dint_0^1frac{x}{2},dx$

$ddint_0^1frac{x}{2},dx$

end{document}


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:



documentclass{article}
usepackage{amsmath}
usepackage{xparse}

NewDocumentCommand{dint}{tlimits e{_^}}{%
mathop{
displaystyleint
IfBooleanT{#1}{limits}
IfValueT{#2}{_{#2}}
IfValueT{#3}{^{#3}}
}%
}

begin{document}

$dint_0^1frac{x}{2},dx$
$dintlimits_0^1frac{x}{2},dx$
$dintfrac{x}{2},dx$

end{document}


enter image description here







share|improve this answer














share|improve this answer



share|improve this answer








edited Nov 17 '18 at 16:19

























answered Nov 17 '18 at 16:01









egregegreg

717k8719023194




717k8719023194













  • Oh I see! Thank you very much!

    – JouleV
    Nov 17 '18 at 16:03



















  • Oh I see! Thank you very much!

    – JouleV
    Nov 17 '18 at 16:03

















Oh I see! Thank you very much!

– JouleV
Nov 17 '18 at 16:03





Oh I see! Thank you very much!

– JouleV
Nov 17 '18 at 16:03


















draft saved

draft discarded




















































Thanks for contributing an answer to TeX - LaTeX Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f460464%2fwhy-are-there-no-dint-or-dsum-like-dfrac%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







這個網誌中的熱門文章

Academy of Television Arts & Sciences

L'Équipe

1995 France bombings