text vs scalebox

Clash Royale CLAN TAG#URR8PPP
up vote
17
down vote
favorite
The author of a manuscript I'm editing is using the medcup macro in the MWE below. We've noticed the scaling it totally off if used inside the text command. Can anyone explain why?
documentclass[a4paper]memoir
usepackageamsmath%,scalerel}
usepackagegraphicx
defmedcup%
operatornamewithlimits%
mathchoicevcenterhboxscalebox1.2$bigcup$
vcenterhbox$bigcup$%
bigcup%
bigcup%
%
begindocument
[
textInside cstext: $ medcup_n = 1^infty $
]
[
textNot inside cstext: medcup_n = 1^infty
]
enddocument

graphics amsmath
 |Â
show 1 more comment
up vote
17
down vote
favorite
The author of a manuscript I'm editing is using the medcup macro in the MWE below. We've noticed the scaling it totally off if used inside the text command. Can anyone explain why?
documentclass[a4paper]memoir
usepackageamsmath%,scalerel}
usepackagegraphicx
defmedcup%
operatornamewithlimits%
mathchoicevcenterhboxscalebox1.2$bigcup$
vcenterhbox$bigcup$%
bigcup%
bigcup%
%
begindocument
[
textInside cstext: $ medcup_n = 1^infty $
]
[
textNot inside cstext: medcup_n = 1^infty
]
enddocument

graphics amsmath
Interesting, I have never noticed it: alsodeffoomathchoiceDTSSSand then[foo text$foo$]yields D in both cases.
â campa
Aug 17 at 12:10
@campa I think this is a specifically designed feature, it is nice thattextxxx $int_1^2 f dx$does get the same size as outsidetext. But it does not explain why the size goes of the charts in this case.
â daleif
Aug 17 at 12:15
1
Becausemedcupjust uses$bigcup$it would normally show a scaled version of the text style symbol in a display environment. Whentextis called in a display environment it callseverymathdisplaystylewhich means that the top equation contains a display stylebigcup, scaled by a factor 1.2, and the bottom one is a text stylebigcup, also scaled by a factor 1.2.
â Circumscribe
Aug 17 at 12:15
I think it has something to do with the fact that[text$mathchoiceDTSs$]produces aDand not aT.
â Steven B. Segletes
Aug 17 at 12:18
@Circumscribe, right, that makes sense and explicitly adding atextstyleinto the definition fixes it. Thanks. Do you mind submitting that as an answer.
â daleif
Aug 17 at 12:23
 |Â
show 1 more comment
up vote
17
down vote
favorite
up vote
17
down vote
favorite
The author of a manuscript I'm editing is using the medcup macro in the MWE below. We've noticed the scaling it totally off if used inside the text command. Can anyone explain why?
documentclass[a4paper]memoir
usepackageamsmath%,scalerel}
usepackagegraphicx
defmedcup%
operatornamewithlimits%
mathchoicevcenterhboxscalebox1.2$bigcup$
vcenterhbox$bigcup$%
bigcup%
bigcup%
%
begindocument
[
textInside cstext: $ medcup_n = 1^infty $
]
[
textNot inside cstext: medcup_n = 1^infty
]
enddocument

graphics amsmath
The author of a manuscript I'm editing is using the medcup macro in the MWE below. We've noticed the scaling it totally off if used inside the text command. Can anyone explain why?
documentclass[a4paper]memoir
usepackageamsmath%,scalerel}
usepackagegraphicx
defmedcup%
operatornamewithlimits%
mathchoicevcenterhboxscalebox1.2$bigcup$
vcenterhbox$bigcup$%
bigcup%
bigcup%
%
begindocument
[
textInside cstext: $ medcup_n = 1^infty $
]
[
textNot inside cstext: medcup_n = 1^infty
]
enddocument

graphics amsmath
graphics amsmath
asked Aug 17 at 11:56
daleif
31.3k247108
31.3k247108
Interesting, I have never noticed it: alsodeffoomathchoiceDTSSSand then[foo text$foo$]yields D in both cases.
â campa
Aug 17 at 12:10
@campa I think this is a specifically designed feature, it is nice thattextxxx $int_1^2 f dx$does get the same size as outsidetext. But it does not explain why the size goes of the charts in this case.
â daleif
Aug 17 at 12:15
1
Becausemedcupjust uses$bigcup$it would normally show a scaled version of the text style symbol in a display environment. Whentextis called in a display environment it callseverymathdisplaystylewhich means that the top equation contains a display stylebigcup, scaled by a factor 1.2, and the bottom one is a text stylebigcup, also scaled by a factor 1.2.
â Circumscribe
Aug 17 at 12:15
I think it has something to do with the fact that[text$mathchoiceDTSs$]produces aDand not aT.
â Steven B. Segletes
Aug 17 at 12:18
@Circumscribe, right, that makes sense and explicitly adding atextstyleinto the definition fixes it. Thanks. Do you mind submitting that as an answer.
â daleif
Aug 17 at 12:23
 |Â
show 1 more comment
Interesting, I have never noticed it: alsodeffoomathchoiceDTSSSand then[foo text$foo$]yields D in both cases.
â campa
Aug 17 at 12:10
@campa I think this is a specifically designed feature, it is nice thattextxxx $int_1^2 f dx$does get the same size as outsidetext. But it does not explain why the size goes of the charts in this case.
â daleif
Aug 17 at 12:15
1
Becausemedcupjust uses$bigcup$it would normally show a scaled version of the text style symbol in a display environment. Whentextis called in a display environment it callseverymathdisplaystylewhich means that the top equation contains a display stylebigcup, scaled by a factor 1.2, and the bottom one is a text stylebigcup, also scaled by a factor 1.2.
â Circumscribe
Aug 17 at 12:15
I think it has something to do with the fact that[text$mathchoiceDTSs$]produces aDand not aT.
â Steven B. Segletes
Aug 17 at 12:18
@Circumscribe, right, that makes sense and explicitly adding atextstyleinto the definition fixes it. Thanks. Do you mind submitting that as an answer.
â daleif
Aug 17 at 12:23
Interesting, I have never noticed it: also
deffoomathchoiceDTSSS and then [foo text$foo$] yields D in both cases.â campa
Aug 17 at 12:10
Interesting, I have never noticed it: also
deffoomathchoiceDTSSS and then [foo text$foo$] yields D in both cases.â campa
Aug 17 at 12:10
@campa I think this is a specifically designed feature, it is nice that
textxxx $int_1^2 f dx$ does get the same size as outside text. But it does not explain why the size goes of the charts in this case.â daleif
Aug 17 at 12:15
@campa I think this is a specifically designed feature, it is nice that
textxxx $int_1^2 f dx$ does get the same size as outside text. But it does not explain why the size goes of the charts in this case.â daleif
Aug 17 at 12:15
1
1
Because
medcup just uses $bigcup$ it would normally show a scaled version of the text style symbol in a display environment. When text is called in a display environment it calls everymathdisplaystyle which means that the top equation contains a display style bigcup, scaled by a factor 1.2, and the bottom one is a text style bigcup, also scaled by a factor 1.2.â Circumscribe
Aug 17 at 12:15
Because
medcup just uses $bigcup$ it would normally show a scaled version of the text style symbol in a display environment. When text is called in a display environment it calls everymathdisplaystyle which means that the top equation contains a display style bigcup, scaled by a factor 1.2, and the bottom one is a text style bigcup, also scaled by a factor 1.2.â Circumscribe
Aug 17 at 12:15
I think it has something to do with the fact that
[text$mathchoiceDTSs$] produces a D and not a T.â Steven B. Segletes
Aug 17 at 12:18
I think it has something to do with the fact that
[text$mathchoiceDTSs$] produces a D and not a T.â Steven B. Segletes
Aug 17 at 12:18
@Circumscribe, right, that makes sense and explicitly adding a
textstyle into the definition fixes it. Thanks. Do you mind submitting that as an answer.â daleif
Aug 17 at 12:23
@Circumscribe, right, that makes sense and explicitly adding a
textstyle into the definition fixes it. Thanks. Do you mind submitting that as an answer.â daleif
Aug 17 at 12:23
 |Â
show 1 more comment
2 Answers
2
active
oldest
votes
up vote
11
down vote
accepted
When medcup is used in a display equation, it normally produces a scaled version of a text style bigcup. What is happening in your first equation, however, is that a scaled version of the display style bigcup is used instead because text causes a displaystyle command to be inserted in $bigcup$.
The text command is designed so that any equations in its argument are typeset in the current math style, which is displaystyle in this case.
Its definition contains a mathcoice, whose displaystyle branch is effectively given by
hboxeverymathdisplaystyleletf@sizef@sizeselectfont #1
Because this sets everymath=displaystyle, displaystyle will be inserted at the start of every equation inside the argument of text.
This includes the first $bigcup$ in the definition of medcup.
Your first equation therefore effectively becomes
[
hboxInside cstext:
$displaystyle
operatornamewithlimits
vcenterhboxscalebox1.2$displaystylebigcup$
_n = 1^infty
$
]
and thus produces a scaled version of the display style version of bigcup, rather than the text style version.
To ensure that the text style version of bigcup is always used, you can explicitly insert a textstyle in the definition of medcup:
newcommand*medcup%
operatorname*%
mathchoicevcenterhboxscalebox1.2$textstylebigcup$%
bigcup%
bigcup%
bigcup%
%
(I also replaced the deprecated operatnamewithlimits by operatorname* and simplified the textstyle branch, as suggested by egreg in this comment.)
add a comment |Â
up vote
8
down vote
It has to do with the fact that [text$mathchoiceDTSs$] produces Displaystyle and not Textstyle.
Thus, adding textstyle in the definition is needed to overcome this behavior.
documentclass[a4paper]memoir
usepackageamsmath%,scalerel}
usepackagegraphicx
defmedcup%
operatornamewithlimits%
mathchoicevcenterhboxscalebox1.2$bigcup$
vcenterhbox$bigcup$%
bigcup%
bigcup%
%
begindocument
[
textInside cstext: $textstyle medcup_n = 1^infty $
]
[
textNot inside cstext: medcup_n = 1^infty
]
[text$mathchoiceDTSs$]
[bigcupscalebox1.2$bigcup$text$scalebox1.2$bigcup$$]
[bigcupscalebox1.2$bigcup$text$scalebox1.2$textstylebigcup$$]
defmedcup%
operatornamewithlimits%
mathchoicevcenterhboxscalebox1.2$textstylebigcup$
vcenterhbox$textstylebigcup$%
bigcup%
bigcup%
%
[
textInside cstext: $textstyle medcup_n = 1^infty $
]
[
textNot inside cstext: medcup_n = 1^infty
]
enddocument

The first two lines of output are from the OP's original definition. Then I demonstrate the display/text-style issue with the "D" line.
Then I show on the next line how the 3rd bigcup should be the same as the 2nd but isn't because of this behavior.
The next line fixes that by explicitly invoking textstyle.
Finally, I change the OP's definition, explicitly adding textstyle, to fix the overall issue.
add a comment |Â
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
11
down vote
accepted
When medcup is used in a display equation, it normally produces a scaled version of a text style bigcup. What is happening in your first equation, however, is that a scaled version of the display style bigcup is used instead because text causes a displaystyle command to be inserted in $bigcup$.
The text command is designed so that any equations in its argument are typeset in the current math style, which is displaystyle in this case.
Its definition contains a mathcoice, whose displaystyle branch is effectively given by
hboxeverymathdisplaystyleletf@sizef@sizeselectfont #1
Because this sets everymath=displaystyle, displaystyle will be inserted at the start of every equation inside the argument of text.
This includes the first $bigcup$ in the definition of medcup.
Your first equation therefore effectively becomes
[
hboxInside cstext:
$displaystyle
operatornamewithlimits
vcenterhboxscalebox1.2$displaystylebigcup$
_n = 1^infty
$
]
and thus produces a scaled version of the display style version of bigcup, rather than the text style version.
To ensure that the text style version of bigcup is always used, you can explicitly insert a textstyle in the definition of medcup:
newcommand*medcup%
operatorname*%
mathchoicevcenterhboxscalebox1.2$textstylebigcup$%
bigcup%
bigcup%
bigcup%
%
(I also replaced the deprecated operatnamewithlimits by operatorname* and simplified the textstyle branch, as suggested by egreg in this comment.)
add a comment |Â
up vote
11
down vote
accepted
When medcup is used in a display equation, it normally produces a scaled version of a text style bigcup. What is happening in your first equation, however, is that a scaled version of the display style bigcup is used instead because text causes a displaystyle command to be inserted in $bigcup$.
The text command is designed so that any equations in its argument are typeset in the current math style, which is displaystyle in this case.
Its definition contains a mathcoice, whose displaystyle branch is effectively given by
hboxeverymathdisplaystyleletf@sizef@sizeselectfont #1
Because this sets everymath=displaystyle, displaystyle will be inserted at the start of every equation inside the argument of text.
This includes the first $bigcup$ in the definition of medcup.
Your first equation therefore effectively becomes
[
hboxInside cstext:
$displaystyle
operatornamewithlimits
vcenterhboxscalebox1.2$displaystylebigcup$
_n = 1^infty
$
]
and thus produces a scaled version of the display style version of bigcup, rather than the text style version.
To ensure that the text style version of bigcup is always used, you can explicitly insert a textstyle in the definition of medcup:
newcommand*medcup%
operatorname*%
mathchoicevcenterhboxscalebox1.2$textstylebigcup$%
bigcup%
bigcup%
bigcup%
%
(I also replaced the deprecated operatnamewithlimits by operatorname* and simplified the textstyle branch, as suggested by egreg in this comment.)
add a comment |Â
up vote
11
down vote
accepted
up vote
11
down vote
accepted
When medcup is used in a display equation, it normally produces a scaled version of a text style bigcup. What is happening in your first equation, however, is that a scaled version of the display style bigcup is used instead because text causes a displaystyle command to be inserted in $bigcup$.
The text command is designed so that any equations in its argument are typeset in the current math style, which is displaystyle in this case.
Its definition contains a mathcoice, whose displaystyle branch is effectively given by
hboxeverymathdisplaystyleletf@sizef@sizeselectfont #1
Because this sets everymath=displaystyle, displaystyle will be inserted at the start of every equation inside the argument of text.
This includes the first $bigcup$ in the definition of medcup.
Your first equation therefore effectively becomes
[
hboxInside cstext:
$displaystyle
operatornamewithlimits
vcenterhboxscalebox1.2$displaystylebigcup$
_n = 1^infty
$
]
and thus produces a scaled version of the display style version of bigcup, rather than the text style version.
To ensure that the text style version of bigcup is always used, you can explicitly insert a textstyle in the definition of medcup:
newcommand*medcup%
operatorname*%
mathchoicevcenterhboxscalebox1.2$textstylebigcup$%
bigcup%
bigcup%
bigcup%
%
(I also replaced the deprecated operatnamewithlimits by operatorname* and simplified the textstyle branch, as suggested by egreg in this comment.)
When medcup is used in a display equation, it normally produces a scaled version of a text style bigcup. What is happening in your first equation, however, is that a scaled version of the display style bigcup is used instead because text causes a displaystyle command to be inserted in $bigcup$.
The text command is designed so that any equations in its argument are typeset in the current math style, which is displaystyle in this case.
Its definition contains a mathcoice, whose displaystyle branch is effectively given by
hboxeverymathdisplaystyleletf@sizef@sizeselectfont #1
Because this sets everymath=displaystyle, displaystyle will be inserted at the start of every equation inside the argument of text.
This includes the first $bigcup$ in the definition of medcup.
Your first equation therefore effectively becomes
[
hboxInside cstext:
$displaystyle
operatornamewithlimits
vcenterhboxscalebox1.2$displaystylebigcup$
_n = 1^infty
$
]
and thus produces a scaled version of the display style version of bigcup, rather than the text style version.
To ensure that the text style version of bigcup is always used, you can explicitly insert a textstyle in the definition of medcup:
newcommand*medcup%
operatorname*%
mathchoicevcenterhboxscalebox1.2$textstylebigcup$%
bigcup%
bigcup%
bigcup%
%
(I also replaced the deprecated operatnamewithlimits by operatorname* and simplified the textstyle branch, as suggested by egreg in this comment.)
edited Aug 17 at 17:41
answered Aug 17 at 12:44
Circumscribe
2,063320
2,063320
add a comment |Â
add a comment |Â
up vote
8
down vote
It has to do with the fact that [text$mathchoiceDTSs$] produces Displaystyle and not Textstyle.
Thus, adding textstyle in the definition is needed to overcome this behavior.
documentclass[a4paper]memoir
usepackageamsmath%,scalerel}
usepackagegraphicx
defmedcup%
operatornamewithlimits%
mathchoicevcenterhboxscalebox1.2$bigcup$
vcenterhbox$bigcup$%
bigcup%
bigcup%
%
begindocument
[
textInside cstext: $textstyle medcup_n = 1^infty $
]
[
textNot inside cstext: medcup_n = 1^infty
]
[text$mathchoiceDTSs$]
[bigcupscalebox1.2$bigcup$text$scalebox1.2$bigcup$$]
[bigcupscalebox1.2$bigcup$text$scalebox1.2$textstylebigcup$$]
defmedcup%
operatornamewithlimits%
mathchoicevcenterhboxscalebox1.2$textstylebigcup$
vcenterhbox$textstylebigcup$%
bigcup%
bigcup%
%
[
textInside cstext: $textstyle medcup_n = 1^infty $
]
[
textNot inside cstext: medcup_n = 1^infty
]
enddocument

The first two lines of output are from the OP's original definition. Then I demonstrate the display/text-style issue with the "D" line.
Then I show on the next line how the 3rd bigcup should be the same as the 2nd but isn't because of this behavior.
The next line fixes that by explicitly invoking textstyle.
Finally, I change the OP's definition, explicitly adding textstyle, to fix the overall issue.
add a comment |Â
up vote
8
down vote
It has to do with the fact that [text$mathchoiceDTSs$] produces Displaystyle and not Textstyle.
Thus, adding textstyle in the definition is needed to overcome this behavior.
documentclass[a4paper]memoir
usepackageamsmath%,scalerel}
usepackagegraphicx
defmedcup%
operatornamewithlimits%
mathchoicevcenterhboxscalebox1.2$bigcup$
vcenterhbox$bigcup$%
bigcup%
bigcup%
%
begindocument
[
textInside cstext: $textstyle medcup_n = 1^infty $
]
[
textNot inside cstext: medcup_n = 1^infty
]
[text$mathchoiceDTSs$]
[bigcupscalebox1.2$bigcup$text$scalebox1.2$bigcup$$]
[bigcupscalebox1.2$bigcup$text$scalebox1.2$textstylebigcup$$]
defmedcup%
operatornamewithlimits%
mathchoicevcenterhboxscalebox1.2$textstylebigcup$
vcenterhbox$textstylebigcup$%
bigcup%
bigcup%
%
[
textInside cstext: $textstyle medcup_n = 1^infty $
]
[
textNot inside cstext: medcup_n = 1^infty
]
enddocument

The first two lines of output are from the OP's original definition. Then I demonstrate the display/text-style issue with the "D" line.
Then I show on the next line how the 3rd bigcup should be the same as the 2nd but isn't because of this behavior.
The next line fixes that by explicitly invoking textstyle.
Finally, I change the OP's definition, explicitly adding textstyle, to fix the overall issue.
add a comment |Â
up vote
8
down vote
up vote
8
down vote
It has to do with the fact that [text$mathchoiceDTSs$] produces Displaystyle and not Textstyle.
Thus, adding textstyle in the definition is needed to overcome this behavior.
documentclass[a4paper]memoir
usepackageamsmath%,scalerel}
usepackagegraphicx
defmedcup%
operatornamewithlimits%
mathchoicevcenterhboxscalebox1.2$bigcup$
vcenterhbox$bigcup$%
bigcup%
bigcup%
%
begindocument
[
textInside cstext: $textstyle medcup_n = 1^infty $
]
[
textNot inside cstext: medcup_n = 1^infty
]
[text$mathchoiceDTSs$]
[bigcupscalebox1.2$bigcup$text$scalebox1.2$bigcup$$]
[bigcupscalebox1.2$bigcup$text$scalebox1.2$textstylebigcup$$]
defmedcup%
operatornamewithlimits%
mathchoicevcenterhboxscalebox1.2$textstylebigcup$
vcenterhbox$textstylebigcup$%
bigcup%
bigcup%
%
[
textInside cstext: $textstyle medcup_n = 1^infty $
]
[
textNot inside cstext: medcup_n = 1^infty
]
enddocument

The first two lines of output are from the OP's original definition. Then I demonstrate the display/text-style issue with the "D" line.
Then I show on the next line how the 3rd bigcup should be the same as the 2nd but isn't because of this behavior.
The next line fixes that by explicitly invoking textstyle.
Finally, I change the OP's definition, explicitly adding textstyle, to fix the overall issue.
It has to do with the fact that [text$mathchoiceDTSs$] produces Displaystyle and not Textstyle.
Thus, adding textstyle in the definition is needed to overcome this behavior.
documentclass[a4paper]memoir
usepackageamsmath%,scalerel}
usepackagegraphicx
defmedcup%
operatornamewithlimits%
mathchoicevcenterhboxscalebox1.2$bigcup$
vcenterhbox$bigcup$%
bigcup%
bigcup%
%
begindocument
[
textInside cstext: $textstyle medcup_n = 1^infty $
]
[
textNot inside cstext: medcup_n = 1^infty
]
[text$mathchoiceDTSs$]
[bigcupscalebox1.2$bigcup$text$scalebox1.2$bigcup$$]
[bigcupscalebox1.2$bigcup$text$scalebox1.2$textstylebigcup$$]
defmedcup%
operatornamewithlimits%
mathchoicevcenterhboxscalebox1.2$textstylebigcup$
vcenterhbox$textstylebigcup$%
bigcup%
bigcup%
%
[
textInside cstext: $textstyle medcup_n = 1^infty $
]
[
textNot inside cstext: medcup_n = 1^infty
]
enddocument

The first two lines of output are from the OP's original definition. Then I demonstrate the display/text-style issue with the "D" line.
Then I show on the next line how the 3rd bigcup should be the same as the 2nd but isn't because of this behavior.
The next line fixes that by explicitly invoking textstyle.
Finally, I change the OP's definition, explicitly adding textstyle, to fix the overall issue.
edited Aug 17 at 12:35
answered Aug 17 at 12:28
Steven B. Segletes
147k9186389
147k9186389
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f446413%2ftext-vs-scalebox%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Interesting, I have never noticed it: also
deffoomathchoiceDTSSSand then[foo text$foo$]yields D in both cases.â campa
Aug 17 at 12:10
@campa I think this is a specifically designed feature, it is nice that
textxxx $int_1^2 f dx$does get the same size as outsidetext. But it does not explain why the size goes of the charts in this case.â daleif
Aug 17 at 12:15
1
Because
medcupjust uses$bigcup$it would normally show a scaled version of the text style symbol in a display environment. Whentextis called in a display environment it callseverymathdisplaystylewhich means that the top equation contains a display stylebigcup, scaled by a factor 1.2, and the bottom one is a text stylebigcup, also scaled by a factor 1.2.â Circumscribe
Aug 17 at 12:15
I think it has something to do with the fact that
[text$mathchoiceDTSs$]produces aDand not aT.â Steven B. Segletes
Aug 17 at 12:18
@Circumscribe, right, that makes sense and explicitly adding a
textstyleinto the definition fixes it. Thanks. Do you mind submitting that as an answer.â daleif
Aug 17 at 12:23