How do you resize the box of a symbol, while vertically centering it?
Consider the following MWE:
documentclass[margin=2mm]{standalone}
usepackage{amsmath,amssymb}
usepackage{graphics}
defmyboxmin{mathop{raisebox{.15em}{scalebox{.5}{$boxminus$}}}}
begin{document}
$A myboxmin B$
end{document}
I would like to make it better in two ways
- Define a
RescaleSymbol
command in such a way the above output is obtained typingRescaleSymbol[.5]{boxminus}
(say, the default value for rescaling is.75
) - Without the
raisebox
, the rescaled symbol is aligned to the baseline. Now, it must take as values (half of) the height of the symbol to be rescaled.
How can I do?
horizontal-alignment math-operators scaling
add a comment |
Consider the following MWE:
documentclass[margin=2mm]{standalone}
usepackage{amsmath,amssymb}
usepackage{graphics}
defmyboxmin{mathop{raisebox{.15em}{scalebox{.5}{$boxminus$}}}}
begin{document}
$A myboxmin B$
end{document}
I would like to make it better in two ways
- Define a
RescaleSymbol
command in such a way the above output is obtained typingRescaleSymbol[.5]{boxminus}
(say, the default value for rescaling is.75
) - Without the
raisebox
, the rescaled symbol is aligned to the baseline. Now, it must take as values (half of) the height of the symbol to be rescaled.
How can I do?
horizontal-alignment math-operators scaling
1
Are you sure it should bemathop
? The use example suggestsmathbin
.
– egreg
Nov 22 '18 at 11:09
Mh. Of course it depends on the kind of symbol you have to rescale...
– Fosco Loregian
Nov 22 '18 at 11:12
add a comment |
Consider the following MWE:
documentclass[margin=2mm]{standalone}
usepackage{amsmath,amssymb}
usepackage{graphics}
defmyboxmin{mathop{raisebox{.15em}{scalebox{.5}{$boxminus$}}}}
begin{document}
$A myboxmin B$
end{document}
I would like to make it better in two ways
- Define a
RescaleSymbol
command in such a way the above output is obtained typingRescaleSymbol[.5]{boxminus}
(say, the default value for rescaling is.75
) - Without the
raisebox
, the rescaled symbol is aligned to the baseline. Now, it must take as values (half of) the height of the symbol to be rescaled.
How can I do?
horizontal-alignment math-operators scaling
Consider the following MWE:
documentclass[margin=2mm]{standalone}
usepackage{amsmath,amssymb}
usepackage{graphics}
defmyboxmin{mathop{raisebox{.15em}{scalebox{.5}{$boxminus$}}}}
begin{document}
$A myboxmin B$
end{document}
I would like to make it better in two ways
- Define a
RescaleSymbol
command in such a way the above output is obtained typingRescaleSymbol[.5]{boxminus}
(say, the default value for rescaling is.75
) - Without the
raisebox
, the rescaled symbol is aligned to the baseline. Now, it must take as values (half of) the height of the symbol to be rescaled.
How can I do?
horizontal-alignment math-operators scaling
horizontal-alignment math-operators scaling
edited Nov 22 '18 at 11:36
Martin Scharrer♦
199k45632815
199k45632815
asked Nov 22 '18 at 10:23
Fosco Loregian
591515
591515
1
Are you sure it should bemathop
? The use example suggestsmathbin
.
– egreg
Nov 22 '18 at 11:09
Mh. Of course it depends on the kind of symbol you have to rescale...
– Fosco Loregian
Nov 22 '18 at 11:12
add a comment |
1
Are you sure it should bemathop
? The use example suggestsmathbin
.
– egreg
Nov 22 '18 at 11:09
Mh. Of course it depends on the kind of symbol you have to rescale...
– Fosco Loregian
Nov 22 '18 at 11:12
1
1
Are you sure it should be
mathop
? The use example suggests mathbin
.– egreg
Nov 22 '18 at 11:09
Are you sure it should be
mathop
? The use example suggests mathbin
.– egreg
Nov 22 '18 at 11:09
Mh. Of course it depends on the kind of symbol you have to rescale...
– Fosco Loregian
Nov 22 '18 at 11:12
Mh. Of course it depends on the kind of symbol you have to rescale...
– Fosco Loregian
Nov 22 '18 at 11:12
add a comment |
2 Answers
2
active
oldest
votes
You can define your new macro as: newcommand{RescaleSymbol}[2][<default_optional>]{..}
with #1
the optional parameter and #2
the mandatory one. The default value for the first (optional) parameter is written in the second pair of brackets. Use the new command as RescaleSymbol[<scale>]{<symbol>}
or RescaleSymbol{<symbol>}
with the default scale of 0.75.
documentclass[margin=2mm]{standalone}
usepackage{amsmath,amssymb}
usepackage{graphics}
newcommand{RescaleSymbol}[2][.75]{mathop{vcenter{hbox{scalebox{#1}{$#2$}}}}}
begin{document}
$A - RescaleSymbol[.5]{boxminus} B$
end{document}
For some reasonvcenter
didn't work, but I guess the reason is I didn't enclose the rescaled symbol in ahbox
command. This seems to work fine, thank you.
– Fosco Loregian
Nov 22 '18 at 11:10
add a comment |
You probably have mathop
to vertically center the symbol with respect to the formula axis, but this only works if the argument to mathop
is a single character.
The amsmath
package has a built-in mechanism for deciding whether a symbol is a mathbin
or a mathrel
, which is used for underset
and overset
.
documentclass{article}
usepackage{amsmath}
usepackage{amssymb}
usepackage{graphicx}
makeatletter
newcommand{rescalesymbol}[2][0.75]{%
binrel@{#2}% this makes binrel@@ to mean mathbin, mathrel or empty
binrel@@{rescale@symbol{#1}{#2}}%
}
newcommand{rescale@symbol}[2]{%
mathpaletterescale@@symbol{{#1}{#2}}%
}
newcommand{rescale@@symbol}[2]{%
rescale@@@symbol#1#2%
}
newcommand{rescale@@@symbol}[3]{%
% #1=math style, #2=scale factor, #3=symbol
vcenter{hbox{scalebox{#2}{$m@th#1#3$}}}%
}
makeatother
begin{document}
$A rescalesymbol{boxminus} B$
$scriptstyle A rescalesymbol{boxminus} B$
$A rescalesymbol[0.5]{boxminus} B$
$scriptstyle A rescalesymbol[0.5]{boxminus} B$
$A rescalesymbol{pitchfork} B$
$scriptstyle A rescalesymbol{pitchfork} B$
$A rescalesymbol[0.5]{pitchfork} B$
$scriptstyle A rescalesymbol[0.5]{pitchfork} B$
end{document}
If you want to set the kind of the symbol differently from its standard status of mathbin
or mathrel
, or you need a totally different kind, I suggest a trailing optional argument:
documentclass{article}
usepackage{amsmath}
usepackage{amssymb}
usepackage{graphicx}
usepackage{xparse}
makeatletter
NewDocumentCommand{rescalesymbol}{O{0.75}mo}{%
IfNoValueTF{#3}
{%
binrel@{#2}% this makes binrel@@ become mathbin, mathrel or empty
binrel@@{rescale@symbol{#1}{#2}}%
}
{#3binrel@@{rescale@symbol{#1}{#2}}}%
}
newcommand{rescale@symbol}[2]{%
mathpaletterescale@@symbol{{#1}{#2}}%
}
newcommand{rescale@@symbol}[2]{%
rescale@@@symbol#1#2%
}
newcommand{rescale@@@symbol}[3]{%
% #1=math style, #2=scale factor, #3=symbol
vcenter{hbox{scalebox{#2}{$m@th#1#3$}}}%
}
makeatother
begin{document}
$A rescalesymbol{boxminus} B$
$scriptstyle A rescalesymbol{boxminus} B$
$A rescalesymbol[0.5]{boxminus} B$
$scriptstyle A rescalesymbol[0.5]{boxminus} B$
$A rescalesymbol{pitchfork} B$
$scriptstyle A rescalesymbol{pitchfork} B$
$A rescalesymbol[0.5]{pitchfork}[mathop] B$
$scriptstyle A rescalesymbol[0.5]{pitchfork}[mathop] B$
end{document}
add a comment |
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
});
}
});
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
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f461249%2fhow-do-you-resize-the-box-of-a-symbol-while-vertically-centering-it%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
You can define your new macro as: newcommand{RescaleSymbol}[2][<default_optional>]{..}
with #1
the optional parameter and #2
the mandatory one. The default value for the first (optional) parameter is written in the second pair of brackets. Use the new command as RescaleSymbol[<scale>]{<symbol>}
or RescaleSymbol{<symbol>}
with the default scale of 0.75.
documentclass[margin=2mm]{standalone}
usepackage{amsmath,amssymb}
usepackage{graphics}
newcommand{RescaleSymbol}[2][.75]{mathop{vcenter{hbox{scalebox{#1}{$#2$}}}}}
begin{document}
$A - RescaleSymbol[.5]{boxminus} B$
end{document}
For some reasonvcenter
didn't work, but I guess the reason is I didn't enclose the rescaled symbol in ahbox
command. This seems to work fine, thank you.
– Fosco Loregian
Nov 22 '18 at 11:10
add a comment |
You can define your new macro as: newcommand{RescaleSymbol}[2][<default_optional>]{..}
with #1
the optional parameter and #2
the mandatory one. The default value for the first (optional) parameter is written in the second pair of brackets. Use the new command as RescaleSymbol[<scale>]{<symbol>}
or RescaleSymbol{<symbol>}
with the default scale of 0.75.
documentclass[margin=2mm]{standalone}
usepackage{amsmath,amssymb}
usepackage{graphics}
newcommand{RescaleSymbol}[2][.75]{mathop{vcenter{hbox{scalebox{#1}{$#2$}}}}}
begin{document}
$A - RescaleSymbol[.5]{boxminus} B$
end{document}
For some reasonvcenter
didn't work, but I guess the reason is I didn't enclose the rescaled symbol in ahbox
command. This seems to work fine, thank you.
– Fosco Loregian
Nov 22 '18 at 11:10
add a comment |
You can define your new macro as: newcommand{RescaleSymbol}[2][<default_optional>]{..}
with #1
the optional parameter and #2
the mandatory one. The default value for the first (optional) parameter is written in the second pair of brackets. Use the new command as RescaleSymbol[<scale>]{<symbol>}
or RescaleSymbol{<symbol>}
with the default scale of 0.75.
documentclass[margin=2mm]{standalone}
usepackage{amsmath,amssymb}
usepackage{graphics}
newcommand{RescaleSymbol}[2][.75]{mathop{vcenter{hbox{scalebox{#1}{$#2$}}}}}
begin{document}
$A - RescaleSymbol[.5]{boxminus} B$
end{document}
You can define your new macro as: newcommand{RescaleSymbol}[2][<default_optional>]{..}
with #1
the optional parameter and #2
the mandatory one. The default value for the first (optional) parameter is written in the second pair of brackets. Use the new command as RescaleSymbol[<scale>]{<symbol>}
or RescaleSymbol{<symbol>}
with the default scale of 0.75.
documentclass[margin=2mm]{standalone}
usepackage{amsmath,amssymb}
usepackage{graphics}
newcommand{RescaleSymbol}[2][.75]{mathop{vcenter{hbox{scalebox{#1}{$#2$}}}}}
begin{document}
$A - RescaleSymbol[.5]{boxminus} B$
end{document}
edited Nov 22 '18 at 11:03
answered Nov 22 '18 at 10:55
AboAmmar
33.3k22882
33.3k22882
For some reasonvcenter
didn't work, but I guess the reason is I didn't enclose the rescaled symbol in ahbox
command. This seems to work fine, thank you.
– Fosco Loregian
Nov 22 '18 at 11:10
add a comment |
For some reasonvcenter
didn't work, but I guess the reason is I didn't enclose the rescaled symbol in ahbox
command. This seems to work fine, thank you.
– Fosco Loregian
Nov 22 '18 at 11:10
For some reason
vcenter
didn't work, but I guess the reason is I didn't enclose the rescaled symbol in a hbox
command. This seems to work fine, thank you.– Fosco Loregian
Nov 22 '18 at 11:10
For some reason
vcenter
didn't work, but I guess the reason is I didn't enclose the rescaled symbol in a hbox
command. This seems to work fine, thank you.– Fosco Loregian
Nov 22 '18 at 11:10
add a comment |
You probably have mathop
to vertically center the symbol with respect to the formula axis, but this only works if the argument to mathop
is a single character.
The amsmath
package has a built-in mechanism for deciding whether a symbol is a mathbin
or a mathrel
, which is used for underset
and overset
.
documentclass{article}
usepackage{amsmath}
usepackage{amssymb}
usepackage{graphicx}
makeatletter
newcommand{rescalesymbol}[2][0.75]{%
binrel@{#2}% this makes binrel@@ to mean mathbin, mathrel or empty
binrel@@{rescale@symbol{#1}{#2}}%
}
newcommand{rescale@symbol}[2]{%
mathpaletterescale@@symbol{{#1}{#2}}%
}
newcommand{rescale@@symbol}[2]{%
rescale@@@symbol#1#2%
}
newcommand{rescale@@@symbol}[3]{%
% #1=math style, #2=scale factor, #3=symbol
vcenter{hbox{scalebox{#2}{$m@th#1#3$}}}%
}
makeatother
begin{document}
$A rescalesymbol{boxminus} B$
$scriptstyle A rescalesymbol{boxminus} B$
$A rescalesymbol[0.5]{boxminus} B$
$scriptstyle A rescalesymbol[0.5]{boxminus} B$
$A rescalesymbol{pitchfork} B$
$scriptstyle A rescalesymbol{pitchfork} B$
$A rescalesymbol[0.5]{pitchfork} B$
$scriptstyle A rescalesymbol[0.5]{pitchfork} B$
end{document}
If you want to set the kind of the symbol differently from its standard status of mathbin
or mathrel
, or you need a totally different kind, I suggest a trailing optional argument:
documentclass{article}
usepackage{amsmath}
usepackage{amssymb}
usepackage{graphicx}
usepackage{xparse}
makeatletter
NewDocumentCommand{rescalesymbol}{O{0.75}mo}{%
IfNoValueTF{#3}
{%
binrel@{#2}% this makes binrel@@ become mathbin, mathrel or empty
binrel@@{rescale@symbol{#1}{#2}}%
}
{#3binrel@@{rescale@symbol{#1}{#2}}}%
}
newcommand{rescale@symbol}[2]{%
mathpaletterescale@@symbol{{#1}{#2}}%
}
newcommand{rescale@@symbol}[2]{%
rescale@@@symbol#1#2%
}
newcommand{rescale@@@symbol}[3]{%
% #1=math style, #2=scale factor, #3=symbol
vcenter{hbox{scalebox{#2}{$m@th#1#3$}}}%
}
makeatother
begin{document}
$A rescalesymbol{boxminus} B$
$scriptstyle A rescalesymbol{boxminus} B$
$A rescalesymbol[0.5]{boxminus} B$
$scriptstyle A rescalesymbol[0.5]{boxminus} B$
$A rescalesymbol{pitchfork} B$
$scriptstyle A rescalesymbol{pitchfork} B$
$A rescalesymbol[0.5]{pitchfork}[mathop] B$
$scriptstyle A rescalesymbol[0.5]{pitchfork}[mathop] B$
end{document}
add a comment |
You probably have mathop
to vertically center the symbol with respect to the formula axis, but this only works if the argument to mathop
is a single character.
The amsmath
package has a built-in mechanism for deciding whether a symbol is a mathbin
or a mathrel
, which is used for underset
and overset
.
documentclass{article}
usepackage{amsmath}
usepackage{amssymb}
usepackage{graphicx}
makeatletter
newcommand{rescalesymbol}[2][0.75]{%
binrel@{#2}% this makes binrel@@ to mean mathbin, mathrel or empty
binrel@@{rescale@symbol{#1}{#2}}%
}
newcommand{rescale@symbol}[2]{%
mathpaletterescale@@symbol{{#1}{#2}}%
}
newcommand{rescale@@symbol}[2]{%
rescale@@@symbol#1#2%
}
newcommand{rescale@@@symbol}[3]{%
% #1=math style, #2=scale factor, #3=symbol
vcenter{hbox{scalebox{#2}{$m@th#1#3$}}}%
}
makeatother
begin{document}
$A rescalesymbol{boxminus} B$
$scriptstyle A rescalesymbol{boxminus} B$
$A rescalesymbol[0.5]{boxminus} B$
$scriptstyle A rescalesymbol[0.5]{boxminus} B$
$A rescalesymbol{pitchfork} B$
$scriptstyle A rescalesymbol{pitchfork} B$
$A rescalesymbol[0.5]{pitchfork} B$
$scriptstyle A rescalesymbol[0.5]{pitchfork} B$
end{document}
If you want to set the kind of the symbol differently from its standard status of mathbin
or mathrel
, or you need a totally different kind, I suggest a trailing optional argument:
documentclass{article}
usepackage{amsmath}
usepackage{amssymb}
usepackage{graphicx}
usepackage{xparse}
makeatletter
NewDocumentCommand{rescalesymbol}{O{0.75}mo}{%
IfNoValueTF{#3}
{%
binrel@{#2}% this makes binrel@@ become mathbin, mathrel or empty
binrel@@{rescale@symbol{#1}{#2}}%
}
{#3binrel@@{rescale@symbol{#1}{#2}}}%
}
newcommand{rescale@symbol}[2]{%
mathpaletterescale@@symbol{{#1}{#2}}%
}
newcommand{rescale@@symbol}[2]{%
rescale@@@symbol#1#2%
}
newcommand{rescale@@@symbol}[3]{%
% #1=math style, #2=scale factor, #3=symbol
vcenter{hbox{scalebox{#2}{$m@th#1#3$}}}%
}
makeatother
begin{document}
$A rescalesymbol{boxminus} B$
$scriptstyle A rescalesymbol{boxminus} B$
$A rescalesymbol[0.5]{boxminus} B$
$scriptstyle A rescalesymbol[0.5]{boxminus} B$
$A rescalesymbol{pitchfork} B$
$scriptstyle A rescalesymbol{pitchfork} B$
$A rescalesymbol[0.5]{pitchfork}[mathop] B$
$scriptstyle A rescalesymbol[0.5]{pitchfork}[mathop] B$
end{document}
add a comment |
You probably have mathop
to vertically center the symbol with respect to the formula axis, but this only works if the argument to mathop
is a single character.
The amsmath
package has a built-in mechanism for deciding whether a symbol is a mathbin
or a mathrel
, which is used for underset
and overset
.
documentclass{article}
usepackage{amsmath}
usepackage{amssymb}
usepackage{graphicx}
makeatletter
newcommand{rescalesymbol}[2][0.75]{%
binrel@{#2}% this makes binrel@@ to mean mathbin, mathrel or empty
binrel@@{rescale@symbol{#1}{#2}}%
}
newcommand{rescale@symbol}[2]{%
mathpaletterescale@@symbol{{#1}{#2}}%
}
newcommand{rescale@@symbol}[2]{%
rescale@@@symbol#1#2%
}
newcommand{rescale@@@symbol}[3]{%
% #1=math style, #2=scale factor, #3=symbol
vcenter{hbox{scalebox{#2}{$m@th#1#3$}}}%
}
makeatother
begin{document}
$A rescalesymbol{boxminus} B$
$scriptstyle A rescalesymbol{boxminus} B$
$A rescalesymbol[0.5]{boxminus} B$
$scriptstyle A rescalesymbol[0.5]{boxminus} B$
$A rescalesymbol{pitchfork} B$
$scriptstyle A rescalesymbol{pitchfork} B$
$A rescalesymbol[0.5]{pitchfork} B$
$scriptstyle A rescalesymbol[0.5]{pitchfork} B$
end{document}
If you want to set the kind of the symbol differently from its standard status of mathbin
or mathrel
, or you need a totally different kind, I suggest a trailing optional argument:
documentclass{article}
usepackage{amsmath}
usepackage{amssymb}
usepackage{graphicx}
usepackage{xparse}
makeatletter
NewDocumentCommand{rescalesymbol}{O{0.75}mo}{%
IfNoValueTF{#3}
{%
binrel@{#2}% this makes binrel@@ become mathbin, mathrel or empty
binrel@@{rescale@symbol{#1}{#2}}%
}
{#3binrel@@{rescale@symbol{#1}{#2}}}%
}
newcommand{rescale@symbol}[2]{%
mathpaletterescale@@symbol{{#1}{#2}}%
}
newcommand{rescale@@symbol}[2]{%
rescale@@@symbol#1#2%
}
newcommand{rescale@@@symbol}[3]{%
% #1=math style, #2=scale factor, #3=symbol
vcenter{hbox{scalebox{#2}{$m@th#1#3$}}}%
}
makeatother
begin{document}
$A rescalesymbol{boxminus} B$
$scriptstyle A rescalesymbol{boxminus} B$
$A rescalesymbol[0.5]{boxminus} B$
$scriptstyle A rescalesymbol[0.5]{boxminus} B$
$A rescalesymbol{pitchfork} B$
$scriptstyle A rescalesymbol{pitchfork} B$
$A rescalesymbol[0.5]{pitchfork}[mathop] B$
$scriptstyle A rescalesymbol[0.5]{pitchfork}[mathop] B$
end{document}
You probably have mathop
to vertically center the symbol with respect to the formula axis, but this only works if the argument to mathop
is a single character.
The amsmath
package has a built-in mechanism for deciding whether a symbol is a mathbin
or a mathrel
, which is used for underset
and overset
.
documentclass{article}
usepackage{amsmath}
usepackage{amssymb}
usepackage{graphicx}
makeatletter
newcommand{rescalesymbol}[2][0.75]{%
binrel@{#2}% this makes binrel@@ to mean mathbin, mathrel or empty
binrel@@{rescale@symbol{#1}{#2}}%
}
newcommand{rescale@symbol}[2]{%
mathpaletterescale@@symbol{{#1}{#2}}%
}
newcommand{rescale@@symbol}[2]{%
rescale@@@symbol#1#2%
}
newcommand{rescale@@@symbol}[3]{%
% #1=math style, #2=scale factor, #3=symbol
vcenter{hbox{scalebox{#2}{$m@th#1#3$}}}%
}
makeatother
begin{document}
$A rescalesymbol{boxminus} B$
$scriptstyle A rescalesymbol{boxminus} B$
$A rescalesymbol[0.5]{boxminus} B$
$scriptstyle A rescalesymbol[0.5]{boxminus} B$
$A rescalesymbol{pitchfork} B$
$scriptstyle A rescalesymbol{pitchfork} B$
$A rescalesymbol[0.5]{pitchfork} B$
$scriptstyle A rescalesymbol[0.5]{pitchfork} B$
end{document}
If you want to set the kind of the symbol differently from its standard status of mathbin
or mathrel
, or you need a totally different kind, I suggest a trailing optional argument:
documentclass{article}
usepackage{amsmath}
usepackage{amssymb}
usepackage{graphicx}
usepackage{xparse}
makeatletter
NewDocumentCommand{rescalesymbol}{O{0.75}mo}{%
IfNoValueTF{#3}
{%
binrel@{#2}% this makes binrel@@ become mathbin, mathrel or empty
binrel@@{rescale@symbol{#1}{#2}}%
}
{#3binrel@@{rescale@symbol{#1}{#2}}}%
}
newcommand{rescale@symbol}[2]{%
mathpaletterescale@@symbol{{#1}{#2}}%
}
newcommand{rescale@@symbol}[2]{%
rescale@@@symbol#1#2%
}
newcommand{rescale@@@symbol}[3]{%
% #1=math style, #2=scale factor, #3=symbol
vcenter{hbox{scalebox{#2}{$m@th#1#3$}}}%
}
makeatother
begin{document}
$A rescalesymbol{boxminus} B$
$scriptstyle A rescalesymbol{boxminus} B$
$A rescalesymbol[0.5]{boxminus} B$
$scriptstyle A rescalesymbol[0.5]{boxminus} B$
$A rescalesymbol{pitchfork} B$
$scriptstyle A rescalesymbol{pitchfork} B$
$A rescalesymbol[0.5]{pitchfork}[mathop] B$
$scriptstyle A rescalesymbol[0.5]{pitchfork}[mathop] B$
end{document}
edited Nov 22 '18 at 11:39
answered Nov 22 '18 at 11:29
egreg
710k8618863171
710k8618863171
add a comment |
add a comment |
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.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- 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.
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
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f461249%2fhow-do-you-resize-the-box-of-a-symbol-while-vertically-centering-it%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
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
Required, but never shown
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
Required, but never shown
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
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
1
Are you sure it should be
mathop
? The use example suggestsmathbin
.– egreg
Nov 22 '18 at 11:09
Mh. Of course it depends on the kind of symbol you have to rescale...
– Fosco Loregian
Nov 22 '18 at 11:12