Short horizontal and vertical bar of same length in math
Clash Royale CLAN TAG#URR8PPP
up vote
3
down vote
favorite
I want to mark a variable I with a short vertical or horizontal bar in order to relate it to something being vertical or horizontal in real life. For the vertical line, $I^shortmid$
(from amssymb
) is looking very nicely, but I can't produce a horizontal line of equal length. I tried $I^rotatebox[origin=c]90$shortmid$$
, however this makes the bar longer for reasons I don't understand:
Taking a different symbol like I^-
and I^text-
produces ugly results as well. Can someone please explain what is happening inside the rotatebox
and suggest a fix? I will also appreciate any alternative markup.
math-mode amssymb
add a comment |Â
up vote
3
down vote
favorite
I want to mark a variable I with a short vertical or horizontal bar in order to relate it to something being vertical or horizontal in real life. For the vertical line, $I^shortmid$
(from amssymb
) is looking very nicely, but I can't produce a horizontal line of equal length. I tried $I^rotatebox[origin=c]90$shortmid$$
, however this makes the bar longer for reasons I don't understand:
Taking a different symbol like I^-
and I^text-
produces ugly results as well. Can someone please explain what is happening inside the rotatebox
and suggest a fix? I will also appreciate any alternative markup.
math-mode amssymb
add a comment |Â
up vote
3
down vote
favorite
up vote
3
down vote
favorite
I want to mark a variable I with a short vertical or horizontal bar in order to relate it to something being vertical or horizontal in real life. For the vertical line, $I^shortmid$
(from amssymb
) is looking very nicely, but I can't produce a horizontal line of equal length. I tried $I^rotatebox[origin=c]90$shortmid$$
, however this makes the bar longer for reasons I don't understand:
Taking a different symbol like I^-
and I^text-
produces ugly results as well. Can someone please explain what is happening inside the rotatebox
and suggest a fix? I will also appreciate any alternative markup.
math-mode amssymb
I want to mark a variable I with a short vertical or horizontal bar in order to relate it to something being vertical or horizontal in real life. For the vertical line, $I^shortmid$
(from amssymb
) is looking very nicely, but I can't produce a horizontal line of equal length. I tried $I^rotatebox[origin=c]90$shortmid$$
, however this makes the bar longer for reasons I don't understand:
Taking a different symbol like I^-
and I^text-
produces ugly results as well. Can someone please explain what is happening inside the rotatebox
and suggest a fix? I will also appreciate any alternative markup.
math-mode amssymb
math-mode amssymb
asked 59 mins ago
Eldrad
604
604
add a comment |Â
add a comment |Â
3 Answers
3
active
oldest
votes
up vote
3
down vote
accepted
You need to take care of the current math style:
documentclassarticle
usepackageamsmath,amssymb,graphicx
newcommandvrtshortmid
makeatletter
newcommandhrzmathpalettehrz@relax
newcommandhrz@[2]%
mspace-1mu%
rotatebox[origin=c]90$m@th#1,vrt$%
mspace-1mu%
makeatother
begindocument
$I^hrz I^vrt$
enddocument
add a comment |Â
up vote
2
down vote
The reason why the rotated shortmid
seems larger is because the default math size setting within rotatebox
would be textstyle
, while it should be scripstyle
if you're using it in a superscript.
You could try with the following definitions of vertical
and horizontal
:
documentclassarticle
usepackageamssymb,graphicx
newcommandhorizontal[1]%
#1^rotatebox[origin=c]90$scriptstyleshortmid$
newcommandvertical[1]%
#1^shortmid
begindocument
$verticalI horizontalI$
enddocument
Thank you for your explanation, now I understand what's going on. However, because @egreg proposed a more general solution and also took care of positioning, I accepted his answer.
â Eldrad
6 mins ago
add a comment |Â
up vote
1
down vote
Preserves the proper math style.
documentclassarticle
usepackageamssymb,graphicx,scalerel
newcommandvrtshortmid
newcommandhrzThisStylerotatebox[origin=c]90$SavedStylevrt$
begindocument
$I^hrz I^vrt$
$scriptstyle I^hrz I^vrt$
enddocument
add a comment |Â
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
3
down vote
accepted
You need to take care of the current math style:
documentclassarticle
usepackageamsmath,amssymb,graphicx
newcommandvrtshortmid
makeatletter
newcommandhrzmathpalettehrz@relax
newcommandhrz@[2]%
mspace-1mu%
rotatebox[origin=c]90$m@th#1,vrt$%
mspace-1mu%
makeatother
begindocument
$I^hrz I^vrt$
enddocument
add a comment |Â
up vote
3
down vote
accepted
You need to take care of the current math style:
documentclassarticle
usepackageamsmath,amssymb,graphicx
newcommandvrtshortmid
makeatletter
newcommandhrzmathpalettehrz@relax
newcommandhrz@[2]%
mspace-1mu%
rotatebox[origin=c]90$m@th#1,vrt$%
mspace-1mu%
makeatother
begindocument
$I^hrz I^vrt$
enddocument
add a comment |Â
up vote
3
down vote
accepted
up vote
3
down vote
accepted
You need to take care of the current math style:
documentclassarticle
usepackageamsmath,amssymb,graphicx
newcommandvrtshortmid
makeatletter
newcommandhrzmathpalettehrz@relax
newcommandhrz@[2]%
mspace-1mu%
rotatebox[origin=c]90$m@th#1,vrt$%
mspace-1mu%
makeatother
begindocument
$I^hrz I^vrt$
enddocument
You need to take care of the current math style:
documentclassarticle
usepackageamsmath,amssymb,graphicx
newcommandvrtshortmid
makeatletter
newcommandhrzmathpalettehrz@relax
newcommandhrz@[2]%
mspace-1mu%
rotatebox[origin=c]90$m@th#1,vrt$%
mspace-1mu%
makeatother
begindocument
$I^hrz I^vrt$
enddocument
answered 17 mins ago
egreg
694k8518443101
694k8518443101
add a comment |Â
add a comment |Â
up vote
2
down vote
The reason why the rotated shortmid
seems larger is because the default math size setting within rotatebox
would be textstyle
, while it should be scripstyle
if you're using it in a superscript.
You could try with the following definitions of vertical
and horizontal
:
documentclassarticle
usepackageamssymb,graphicx
newcommandhorizontal[1]%
#1^rotatebox[origin=c]90$scriptstyleshortmid$
newcommandvertical[1]%
#1^shortmid
begindocument
$verticalI horizontalI$
enddocument
Thank you for your explanation, now I understand what's going on. However, because @egreg proposed a more general solution and also took care of positioning, I accepted his answer.
â Eldrad
6 mins ago
add a comment |Â
up vote
2
down vote
The reason why the rotated shortmid
seems larger is because the default math size setting within rotatebox
would be textstyle
, while it should be scripstyle
if you're using it in a superscript.
You could try with the following definitions of vertical
and horizontal
:
documentclassarticle
usepackageamssymb,graphicx
newcommandhorizontal[1]%
#1^rotatebox[origin=c]90$scriptstyleshortmid$
newcommandvertical[1]%
#1^shortmid
begindocument
$verticalI horizontalI$
enddocument
Thank you for your explanation, now I understand what's going on. However, because @egreg proposed a more general solution and also took care of positioning, I accepted his answer.
â Eldrad
6 mins ago
add a comment |Â
up vote
2
down vote
up vote
2
down vote
The reason why the rotated shortmid
seems larger is because the default math size setting within rotatebox
would be textstyle
, while it should be scripstyle
if you're using it in a superscript.
You could try with the following definitions of vertical
and horizontal
:
documentclassarticle
usepackageamssymb,graphicx
newcommandhorizontal[1]%
#1^rotatebox[origin=c]90$scriptstyleshortmid$
newcommandvertical[1]%
#1^shortmid
begindocument
$verticalI horizontalI$
enddocument
The reason why the rotated shortmid
seems larger is because the default math size setting within rotatebox
would be textstyle
, while it should be scripstyle
if you're using it in a superscript.
You could try with the following definitions of vertical
and horizontal
:
documentclassarticle
usepackageamssymb,graphicx
newcommandhorizontal[1]%
#1^rotatebox[origin=c]90$scriptstyleshortmid$
newcommandvertical[1]%
#1^shortmid
begindocument
$verticalI horizontalI$
enddocument
answered 45 mins ago
Werner
428k589381615
428k589381615
Thank you for your explanation, now I understand what's going on. However, because @egreg proposed a more general solution and also took care of positioning, I accepted his answer.
â Eldrad
6 mins ago
add a comment |Â
Thank you for your explanation, now I understand what's going on. However, because @egreg proposed a more general solution and also took care of positioning, I accepted his answer.
â Eldrad
6 mins ago
Thank you for your explanation, now I understand what's going on. However, because @egreg proposed a more general solution and also took care of positioning, I accepted his answer.
â Eldrad
6 mins ago
Thank you for your explanation, now I understand what's going on. However, because @egreg proposed a more general solution and also took care of positioning, I accepted his answer.
â Eldrad
6 mins ago
add a comment |Â
up vote
1
down vote
Preserves the proper math style.
documentclassarticle
usepackageamssymb,graphicx,scalerel
newcommandvrtshortmid
newcommandhrzThisStylerotatebox[origin=c]90$SavedStylevrt$
begindocument
$I^hrz I^vrt$
$scriptstyle I^hrz I^vrt$
enddocument
add a comment |Â
up vote
1
down vote
Preserves the proper math style.
documentclassarticle
usepackageamssymb,graphicx,scalerel
newcommandvrtshortmid
newcommandhrzThisStylerotatebox[origin=c]90$SavedStylevrt$
begindocument
$I^hrz I^vrt$
$scriptstyle I^hrz I^vrt$
enddocument
add a comment |Â
up vote
1
down vote
up vote
1
down vote
Preserves the proper math style.
documentclassarticle
usepackageamssymb,graphicx,scalerel
newcommandvrtshortmid
newcommandhrzThisStylerotatebox[origin=c]90$SavedStylevrt$
begindocument
$I^hrz I^vrt$
$scriptstyle I^hrz I^vrt$
enddocument
Preserves the proper math style.
documentclassarticle
usepackageamssymb,graphicx,scalerel
newcommandvrtshortmid
newcommandhrzThisStylerotatebox[origin=c]90$SavedStylevrt$
begindocument
$I^hrz I^vrt$
$scriptstyle I^hrz I^vrt$
enddocument
answered 6 mins ago
Steven B. Segletes
150k9188396
150k9188396
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%2f458521%2fshort-horizontal-and-vertical-bar-of-same-length-in-math%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