How to get a stairway symbol in math mode?
Clash Royale CLAN TAG#URR8PPP
up vote
13
down vote
favorite
I am looking for a 'stair' or 'stairway' symbol that I can use in math mode to denote a stair-like curve, for example to be used as an integration path. I have included some pictures as examples below:
and for "full" stairs:
Feel free to add more appropriate tags.
math-mode symbols
add a comment |Â
up vote
13
down vote
favorite
I am looking for a 'stair' or 'stairway' symbol that I can use in math mode to denote a stair-like curve, for example to be used as an integration path. I have included some pictures as examples below:
and for "full" stairs:
Feel free to add more appropriate tags.
math-mode symbols
There might be something here.
– luchonacho
Sep 1 at 11:42
@luchonacho: I thought so too, but I wasn't able to find anything even remotely close in there. Maybe I have overlooked something.
– M.G.
Sep 1 at 12:14
add a comment |Â
up vote
13
down vote
favorite
up vote
13
down vote
favorite
I am looking for a 'stair' or 'stairway' symbol that I can use in math mode to denote a stair-like curve, for example to be used as an integration path. I have included some pictures as examples below:
and for "full" stairs:
Feel free to add more appropriate tags.
math-mode symbols
I am looking for a 'stair' or 'stairway' symbol that I can use in math mode to denote a stair-like curve, for example to be used as an integration path. I have included some pictures as examples below:
and for "full" stairs:
Feel free to add more appropriate tags.
math-mode symbols
asked Sep 1 at 10:14
M.G.
24617
24617
There might be something here.
– luchonacho
Sep 1 at 11:42
@luchonacho: I thought so too, but I wasn't able to find anything even remotely close in there. Maybe I have overlooked something.
– M.G.
Sep 1 at 12:14
add a comment |Â
There might be something here.
– luchonacho
Sep 1 at 11:42
@luchonacho: I thought so too, but I wasn't able to find anything even remotely close in there. Maybe I have overlooked something.
– M.G.
Sep 1 at 12:14
There might be something here.
– luchonacho
Sep 1 at 11:42
There might be something here.
– luchonacho
Sep 1 at 11:42
@luchonacho: I thought so too, but I wasn't able to find anything even remotely close in there. Maybe I have overlooked something.
– M.G.
Sep 1 at 12:14
@luchonacho: I thought so too, but I wasn't able to find anything even remotely close in there. Maybe I have overlooked something.
– M.G.
Sep 1 at 12:14
add a comment |Â
2 Answers
2
active
oldest
votes
up vote
19
down vote
accepted
You could build something on your own, like:
documentclassmemoir
usepackagetikz,xcolor, amsmath
usetikzlibrarycalc
tikzsetstairwayStyleLineWidth/.style=line width=0.04em
tikzsetstairwayStyleRound/.style=line join=round,line cap=round,stairwayStyleLineWidth
tikzsetstairwayStyleSharp/.style=stairwayStyleLineWidth
tikzsetstairwayStyle/.style=stairwayStyleRound
newcommandstairwayupmathbin
tikz[baseline=(stairwayanchor.base)]
node (stairwayanchor) quad;
draw[stairwayStyle]
($(stairwayanchor.south west) + (0.0em,0.4em)$)
-- ++(0.20em,0) -- ++(0,0.20em)
-- ++(0.20em,0) -- ++(0,0.20em)
-- ++(0.20em,0) -- ++(0,0.20em)
-- ++(0.20em,0) %-- ++(0,0.25em)
;
newcommandstairwaydownmathbin
tikz[baseline=(stairwayanchor.base)]
node (stairwayanchor) quad;
draw[stairwayStyle]
($(stairwayanchor.south east) + (0.0em,0.4em)$)
-- ++(-0.20em,0) -- ++(0,0.20em)
-- ++(-0.20em,0) -- ++(0,0.20em)
-- ++(-0.20em,0) -- ++(0,0.20em)
-- ++(-0.20em,0) %-- ++(0,-0.25em)
;
newcommandstairwayupfilledmathbin
tikz[baseline=(stairwayanchor.base)]
node (stairwayanchor) quad;
draw[stairwayStyle,fill=.]
($(stairwayanchor.south west) + (0.0em,0.4em)$)
-- ++(0,0.20em)
-- ++(0.20em,0) -- ++(0,0.20em)
-- ++(0.20em,0) -- ++(0,0.20em)
-- ++(0.20em,0) %-- ++(0,0.25em)
-- ++(0,-0.60em)
-- cycle
;
newcommandstairwayuphollowmathbin
tikz[baseline=(stairwayanchor.base)]
node (stairwayanchor) quad;
draw[stairwayStyle]
($(stairwayanchor.south west) + (0.0em,0.4em)$)
-- ++(0,0.20em)
-- ++(0.20em,0) -- ++(0,0.20em)
-- ++(0.20em,0) -- ++(0,0.20em)
-- ++(0.20em,0) %-- ++(0,0.25em)
-- ++(0,-0.60em)
-- cycle
;
begindocument
centering
Foo $5stairwayup6 stairwaydown 7, int_stairwayup, int_stairwaydown$ bar. \
$stairwayupfilled stairwayup stairwayuphollow$
colorboxbluecolor-blue $stairwayupfilled stairwayup stairwayuphollow$
$tiny stairwayup hugestairwayup$
beginalign*
6 &stairwayup 5 stairwaydown 7\
6 &> 5<7\
int_stairwayup & int_stairwaydown
endalign*
tiny
beginalign*
6 &stairwayup 5 stairwaydown 7\
6 &> 5<7\
int_stairwayup & int_stairwaydown
endalign*
huge
beginalign*
6 &stairwayup 5 stairwaydown 7\
6 &> 5<7\
int_stairwayup & int_stairwaydown
endalign*
enddocument
Observe that the stairs have a round appeal. This way they blend better with <
. You can choose sharp corners if you change
tikzsetstairwayStyle/.style=stairwayStyleRound
to
tikzsetstairwayStyle/.style=stairwayStyleSharp
if you want to. The thickness of the strokes varies with the font size and the symbols do change their color appropriately.
2
Thanks a lot for this and for the code example! I am still very new to tikz, so the code example really helps!
– M.G.
Sep 1 at 10:36
1
@M.G. TikZ is definitely worth learning. It comes with a great manual at ctan.org/pkg/pgf.
– CampanIgnis
Sep 1 at 10:38
1
Thanks for including the other examples as well!
– M.G.
Sep 2 at 9:04
add a comment |Â
up vote
16
down vote
Yet another question of this type: I begin to think that I should seriously consider the idea of turning my halloweenmath
package into a package generally aimed to making mathematical symbols out of arbitrary pictures. In this way, you get several frills for free, like the bolder look when the bold
math version is in force, and automatic scaling in sub/superscripts. I see no reason, however, why the symbols in question should behave as binary operators.
% My standard header for TeX.SX answers:
documentclass[a4paper]article % To avoid confusion, let us explicitly
% declare the paper format.
usepackage[T1]fontenc % Not always necessary, but recommended.
% End of standard header. What follows pertains to the problem at hand.
usepackagehalloweenmath % also loads "amsmath''
makeatletter
newcommand*@HwM@ironwire@stairway[2]%
% #1 := font selector (e.g., "textfont")
% #2 := line thickness, in unit of default-rule-thickness "fontdimen"
begin@HwM@small@picture#14.6-2.3%
roundcap
linethickness#2@HwM@thickness@units@for #1%
polyline(-2,-2)(-2,-1)(-1,-1)(-1,0)%
(0,0)(0,1)(+1,1)(+1,2)(+2,2)relax
end@HwM@small@picture%
newcommand*@HwM@Ironwire@Stairway[2]%
% #1 := style selector (e.g., "textstyle")
% #2 := font selector (e.g., "textfont")
@HwM@choose@thicknesses@HwM@ironwire@stairway #2%
1.25%
2.5%
newcommand*@HwM@hollow@stairway[2]%
% #1 := font selector (e.g., "textfont")
% #2 := line thickness, in unit of default-rule-thickness "fontdimen"
begin@HwM@small@picture#14.6-2.3%
roundcap
linethickness#2@HwM@thickness@units@for #1%
polygon(-2,-2)(-2,-1)(-1,-1)(-1,0)%
(0,0)(0,1)(+1,1)(+1,2)(+2,2)%
(+2,-2)relax
end@HwM@small@picture%
newcommand*@HwM@Hollow@Stairway[2]%
% #1 := style selector (e.g., "textstyle")
% #2 := font selector (e.g., "textfont")
@HwM@choose@thicknesses@HwM@hollow@stairway #2%
1.25%
2.5%
newcommand*mathsimplerightstair@HwM@set@right@dir @HwM@mathsimplestair
newcommand*mathsimpleleftstair @HwM@set@left@dir @HwM@mathsimplestair
newcommand*@HwM@mathsimplestair%
@HwM@general@ordinary@symbol @HwM@Ironwire@Stairway
newcommand*mathhollowrightstair@HwM@set@right@dir @HwM@mathhollowstair
newcommand*mathhollowleftstair @HwM@set@left@dir @HwM@mathhollowstair
newcommand*@HwM@mathhollowstair%
@HwM@general@ordinary@symbol @HwM@Hollow@Stairway
makeatother
begindocument
In text, surrounded by square brackets so to check the sidebearings:
( [ mathsimplerightstair mathsimpleleftstair] ),
or ( [mathhollowrightstair mathhollowleftstair] ).
Now in display:
[
mathsimplerightstair + int_mathsimplerightstair f(z),dz
- mathhollowleftstair - int_mathhollowleftstair g(z),dz
]
Note that the symbols get smaller in the subscript, even if the main font size
doesn't change. This behavior extends to double scripts, emphe.g.,
( [mathhollowrightstair_mathhollowrightstair^mathhollowrightstair] ),
as one would expect.footnoteOf course, changes in the main font size are
honored too:
( [mathhollowrightstair_mathhollowrightstair^mathhollowrightstair] ).
Furthemore, compare the looks of the four symbols in the textttnormal and in
the textttbold math versions:
( [mathsimplerightstair mathsimpleleftstair
mathhollowrightstair mathhollowleftstair] )
bfseries boldmath versus
( [mathsimplerightstair mathsimpleleftstair
mathhollowrightstair mathhollowleftstair] ).
As already mentioned in a footnote, the symbols also scale with the main font
size (compare them with the brackets).
bigskip
:
( [ mathsimplerightstair mathsimpleleftstair] +
mathhollowrightstair_mathhollowrightstair).
bigskip
Huge
bigskip
footnotesize
enddocument
See the comments in halloweenmath.dtx
for an explanation of how the macros work. Some fine-tuning of the sidebearings and of the line thicknesses might still be necessary, of course.
This is the output:
Addition:
It crossed my mind that, in the above code, you might want to replace all occurrences of roundcap
with roundcap roundjoin
, to get round joins between the segments of the stairs as well as round caps; and as a matter of fact, roundcap
is even useless in the case of @HwM@hollow@stairway
, which has no caps at all!
This is great! I will admit to my shame that I wasn't aware of the existence of your package. But now I am!
– M.G.
Sep 1 at 15:22
add a comment |Â
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
19
down vote
accepted
You could build something on your own, like:
documentclassmemoir
usepackagetikz,xcolor, amsmath
usetikzlibrarycalc
tikzsetstairwayStyleLineWidth/.style=line width=0.04em
tikzsetstairwayStyleRound/.style=line join=round,line cap=round,stairwayStyleLineWidth
tikzsetstairwayStyleSharp/.style=stairwayStyleLineWidth
tikzsetstairwayStyle/.style=stairwayStyleRound
newcommandstairwayupmathbin
tikz[baseline=(stairwayanchor.base)]
node (stairwayanchor) quad;
draw[stairwayStyle]
($(stairwayanchor.south west) + (0.0em,0.4em)$)
-- ++(0.20em,0) -- ++(0,0.20em)
-- ++(0.20em,0) -- ++(0,0.20em)
-- ++(0.20em,0) -- ++(0,0.20em)
-- ++(0.20em,0) %-- ++(0,0.25em)
;
newcommandstairwaydownmathbin
tikz[baseline=(stairwayanchor.base)]
node (stairwayanchor) quad;
draw[stairwayStyle]
($(stairwayanchor.south east) + (0.0em,0.4em)$)
-- ++(-0.20em,0) -- ++(0,0.20em)
-- ++(-0.20em,0) -- ++(0,0.20em)
-- ++(-0.20em,0) -- ++(0,0.20em)
-- ++(-0.20em,0) %-- ++(0,-0.25em)
;
newcommandstairwayupfilledmathbin
tikz[baseline=(stairwayanchor.base)]
node (stairwayanchor) quad;
draw[stairwayStyle,fill=.]
($(stairwayanchor.south west) + (0.0em,0.4em)$)
-- ++(0,0.20em)
-- ++(0.20em,0) -- ++(0,0.20em)
-- ++(0.20em,0) -- ++(0,0.20em)
-- ++(0.20em,0) %-- ++(0,0.25em)
-- ++(0,-0.60em)
-- cycle
;
newcommandstairwayuphollowmathbin
tikz[baseline=(stairwayanchor.base)]
node (stairwayanchor) quad;
draw[stairwayStyle]
($(stairwayanchor.south west) + (0.0em,0.4em)$)
-- ++(0,0.20em)
-- ++(0.20em,0) -- ++(0,0.20em)
-- ++(0.20em,0) -- ++(0,0.20em)
-- ++(0.20em,0) %-- ++(0,0.25em)
-- ++(0,-0.60em)
-- cycle
;
begindocument
centering
Foo $5stairwayup6 stairwaydown 7, int_stairwayup, int_stairwaydown$ bar. \
$stairwayupfilled stairwayup stairwayuphollow$
colorboxbluecolor-blue $stairwayupfilled stairwayup stairwayuphollow$
$tiny stairwayup hugestairwayup$
beginalign*
6 &stairwayup 5 stairwaydown 7\
6 &> 5<7\
int_stairwayup & int_stairwaydown
endalign*
tiny
beginalign*
6 &stairwayup 5 stairwaydown 7\
6 &> 5<7\
int_stairwayup & int_stairwaydown
endalign*
huge
beginalign*
6 &stairwayup 5 stairwaydown 7\
6 &> 5<7\
int_stairwayup & int_stairwaydown
endalign*
enddocument
Observe that the stairs have a round appeal. This way they blend better with <
. You can choose sharp corners if you change
tikzsetstairwayStyle/.style=stairwayStyleRound
to
tikzsetstairwayStyle/.style=stairwayStyleSharp
if you want to. The thickness of the strokes varies with the font size and the symbols do change their color appropriately.
2
Thanks a lot for this and for the code example! I am still very new to tikz, so the code example really helps!
– M.G.
Sep 1 at 10:36
1
@M.G. TikZ is definitely worth learning. It comes with a great manual at ctan.org/pkg/pgf.
– CampanIgnis
Sep 1 at 10:38
1
Thanks for including the other examples as well!
– M.G.
Sep 2 at 9:04
add a comment |Â
up vote
19
down vote
accepted
You could build something on your own, like:
documentclassmemoir
usepackagetikz,xcolor, amsmath
usetikzlibrarycalc
tikzsetstairwayStyleLineWidth/.style=line width=0.04em
tikzsetstairwayStyleRound/.style=line join=round,line cap=round,stairwayStyleLineWidth
tikzsetstairwayStyleSharp/.style=stairwayStyleLineWidth
tikzsetstairwayStyle/.style=stairwayStyleRound
newcommandstairwayupmathbin
tikz[baseline=(stairwayanchor.base)]
node (stairwayanchor) quad;
draw[stairwayStyle]
($(stairwayanchor.south west) + (0.0em,0.4em)$)
-- ++(0.20em,0) -- ++(0,0.20em)
-- ++(0.20em,0) -- ++(0,0.20em)
-- ++(0.20em,0) -- ++(0,0.20em)
-- ++(0.20em,0) %-- ++(0,0.25em)
;
newcommandstairwaydownmathbin
tikz[baseline=(stairwayanchor.base)]
node (stairwayanchor) quad;
draw[stairwayStyle]
($(stairwayanchor.south east) + (0.0em,0.4em)$)
-- ++(-0.20em,0) -- ++(0,0.20em)
-- ++(-0.20em,0) -- ++(0,0.20em)
-- ++(-0.20em,0) -- ++(0,0.20em)
-- ++(-0.20em,0) %-- ++(0,-0.25em)
;
newcommandstairwayupfilledmathbin
tikz[baseline=(stairwayanchor.base)]
node (stairwayanchor) quad;
draw[stairwayStyle,fill=.]
($(stairwayanchor.south west) + (0.0em,0.4em)$)
-- ++(0,0.20em)
-- ++(0.20em,0) -- ++(0,0.20em)
-- ++(0.20em,0) -- ++(0,0.20em)
-- ++(0.20em,0) %-- ++(0,0.25em)
-- ++(0,-0.60em)
-- cycle
;
newcommandstairwayuphollowmathbin
tikz[baseline=(stairwayanchor.base)]
node (stairwayanchor) quad;
draw[stairwayStyle]
($(stairwayanchor.south west) + (0.0em,0.4em)$)
-- ++(0,0.20em)
-- ++(0.20em,0) -- ++(0,0.20em)
-- ++(0.20em,0) -- ++(0,0.20em)
-- ++(0.20em,0) %-- ++(0,0.25em)
-- ++(0,-0.60em)
-- cycle
;
begindocument
centering
Foo $5stairwayup6 stairwaydown 7, int_stairwayup, int_stairwaydown$ bar. \
$stairwayupfilled stairwayup stairwayuphollow$
colorboxbluecolor-blue $stairwayupfilled stairwayup stairwayuphollow$
$tiny stairwayup hugestairwayup$
beginalign*
6 &stairwayup 5 stairwaydown 7\
6 &> 5<7\
int_stairwayup & int_stairwaydown
endalign*
tiny
beginalign*
6 &stairwayup 5 stairwaydown 7\
6 &> 5<7\
int_stairwayup & int_stairwaydown
endalign*
huge
beginalign*
6 &stairwayup 5 stairwaydown 7\
6 &> 5<7\
int_stairwayup & int_stairwaydown
endalign*
enddocument
Observe that the stairs have a round appeal. This way they blend better with <
. You can choose sharp corners if you change
tikzsetstairwayStyle/.style=stairwayStyleRound
to
tikzsetstairwayStyle/.style=stairwayStyleSharp
if you want to. The thickness of the strokes varies with the font size and the symbols do change their color appropriately.
2
Thanks a lot for this and for the code example! I am still very new to tikz, so the code example really helps!
– M.G.
Sep 1 at 10:36
1
@M.G. TikZ is definitely worth learning. It comes with a great manual at ctan.org/pkg/pgf.
– CampanIgnis
Sep 1 at 10:38
1
Thanks for including the other examples as well!
– M.G.
Sep 2 at 9:04
add a comment |Â
up vote
19
down vote
accepted
up vote
19
down vote
accepted
You could build something on your own, like:
documentclassmemoir
usepackagetikz,xcolor, amsmath
usetikzlibrarycalc
tikzsetstairwayStyleLineWidth/.style=line width=0.04em
tikzsetstairwayStyleRound/.style=line join=round,line cap=round,stairwayStyleLineWidth
tikzsetstairwayStyleSharp/.style=stairwayStyleLineWidth
tikzsetstairwayStyle/.style=stairwayStyleRound
newcommandstairwayupmathbin
tikz[baseline=(stairwayanchor.base)]
node (stairwayanchor) quad;
draw[stairwayStyle]
($(stairwayanchor.south west) + (0.0em,0.4em)$)
-- ++(0.20em,0) -- ++(0,0.20em)
-- ++(0.20em,0) -- ++(0,0.20em)
-- ++(0.20em,0) -- ++(0,0.20em)
-- ++(0.20em,0) %-- ++(0,0.25em)
;
newcommandstairwaydownmathbin
tikz[baseline=(stairwayanchor.base)]
node (stairwayanchor) quad;
draw[stairwayStyle]
($(stairwayanchor.south east) + (0.0em,0.4em)$)
-- ++(-0.20em,0) -- ++(0,0.20em)
-- ++(-0.20em,0) -- ++(0,0.20em)
-- ++(-0.20em,0) -- ++(0,0.20em)
-- ++(-0.20em,0) %-- ++(0,-0.25em)
;
newcommandstairwayupfilledmathbin
tikz[baseline=(stairwayanchor.base)]
node (stairwayanchor) quad;
draw[stairwayStyle,fill=.]
($(stairwayanchor.south west) + (0.0em,0.4em)$)
-- ++(0,0.20em)
-- ++(0.20em,0) -- ++(0,0.20em)
-- ++(0.20em,0) -- ++(0,0.20em)
-- ++(0.20em,0) %-- ++(0,0.25em)
-- ++(0,-0.60em)
-- cycle
;
newcommandstairwayuphollowmathbin
tikz[baseline=(stairwayanchor.base)]
node (stairwayanchor) quad;
draw[stairwayStyle]
($(stairwayanchor.south west) + (0.0em,0.4em)$)
-- ++(0,0.20em)
-- ++(0.20em,0) -- ++(0,0.20em)
-- ++(0.20em,0) -- ++(0,0.20em)
-- ++(0.20em,0) %-- ++(0,0.25em)
-- ++(0,-0.60em)
-- cycle
;
begindocument
centering
Foo $5stairwayup6 stairwaydown 7, int_stairwayup, int_stairwaydown$ bar. \
$stairwayupfilled stairwayup stairwayuphollow$
colorboxbluecolor-blue $stairwayupfilled stairwayup stairwayuphollow$
$tiny stairwayup hugestairwayup$
beginalign*
6 &stairwayup 5 stairwaydown 7\
6 &> 5<7\
int_stairwayup & int_stairwaydown
endalign*
tiny
beginalign*
6 &stairwayup 5 stairwaydown 7\
6 &> 5<7\
int_stairwayup & int_stairwaydown
endalign*
huge
beginalign*
6 &stairwayup 5 stairwaydown 7\
6 &> 5<7\
int_stairwayup & int_stairwaydown
endalign*
enddocument
Observe that the stairs have a round appeal. This way they blend better with <
. You can choose sharp corners if you change
tikzsetstairwayStyle/.style=stairwayStyleRound
to
tikzsetstairwayStyle/.style=stairwayStyleSharp
if you want to. The thickness of the strokes varies with the font size and the symbols do change their color appropriately.
You could build something on your own, like:
documentclassmemoir
usepackagetikz,xcolor, amsmath
usetikzlibrarycalc
tikzsetstairwayStyleLineWidth/.style=line width=0.04em
tikzsetstairwayStyleRound/.style=line join=round,line cap=round,stairwayStyleLineWidth
tikzsetstairwayStyleSharp/.style=stairwayStyleLineWidth
tikzsetstairwayStyle/.style=stairwayStyleRound
newcommandstairwayupmathbin
tikz[baseline=(stairwayanchor.base)]
node (stairwayanchor) quad;
draw[stairwayStyle]
($(stairwayanchor.south west) + (0.0em,0.4em)$)
-- ++(0.20em,0) -- ++(0,0.20em)
-- ++(0.20em,0) -- ++(0,0.20em)
-- ++(0.20em,0) -- ++(0,0.20em)
-- ++(0.20em,0) %-- ++(0,0.25em)
;
newcommandstairwaydownmathbin
tikz[baseline=(stairwayanchor.base)]
node (stairwayanchor) quad;
draw[stairwayStyle]
($(stairwayanchor.south east) + (0.0em,0.4em)$)
-- ++(-0.20em,0) -- ++(0,0.20em)
-- ++(-0.20em,0) -- ++(0,0.20em)
-- ++(-0.20em,0) -- ++(0,0.20em)
-- ++(-0.20em,0) %-- ++(0,-0.25em)
;
newcommandstairwayupfilledmathbin
tikz[baseline=(stairwayanchor.base)]
node (stairwayanchor) quad;
draw[stairwayStyle,fill=.]
($(stairwayanchor.south west) + (0.0em,0.4em)$)
-- ++(0,0.20em)
-- ++(0.20em,0) -- ++(0,0.20em)
-- ++(0.20em,0) -- ++(0,0.20em)
-- ++(0.20em,0) %-- ++(0,0.25em)
-- ++(0,-0.60em)
-- cycle
;
newcommandstairwayuphollowmathbin
tikz[baseline=(stairwayanchor.base)]
node (stairwayanchor) quad;
draw[stairwayStyle]
($(stairwayanchor.south west) + (0.0em,0.4em)$)
-- ++(0,0.20em)
-- ++(0.20em,0) -- ++(0,0.20em)
-- ++(0.20em,0) -- ++(0,0.20em)
-- ++(0.20em,0) %-- ++(0,0.25em)
-- ++(0,-0.60em)
-- cycle
;
begindocument
centering
Foo $5stairwayup6 stairwaydown 7, int_stairwayup, int_stairwaydown$ bar. \
$stairwayupfilled stairwayup stairwayuphollow$
colorboxbluecolor-blue $stairwayupfilled stairwayup stairwayuphollow$
$tiny stairwayup hugestairwayup$
beginalign*
6 &stairwayup 5 stairwaydown 7\
6 &> 5<7\
int_stairwayup & int_stairwaydown
endalign*
tiny
beginalign*
6 &stairwayup 5 stairwaydown 7\
6 &> 5<7\
int_stairwayup & int_stairwaydown
endalign*
huge
beginalign*
6 &stairwayup 5 stairwaydown 7\
6 &> 5<7\
int_stairwayup & int_stairwaydown
endalign*
enddocument
Observe that the stairs have a round appeal. This way they blend better with <
. You can choose sharp corners if you change
tikzsetstairwayStyle/.style=stairwayStyleRound
to
tikzsetstairwayStyle/.style=stairwayStyleSharp
if you want to. The thickness of the strokes varies with the font size and the symbols do change their color appropriately.
edited Sep 2 at 12:15
answered Sep 1 at 10:29
CampanIgnis
1,7562628
1,7562628
2
Thanks a lot for this and for the code example! I am still very new to tikz, so the code example really helps!
– M.G.
Sep 1 at 10:36
1
@M.G. TikZ is definitely worth learning. It comes with a great manual at ctan.org/pkg/pgf.
– CampanIgnis
Sep 1 at 10:38
1
Thanks for including the other examples as well!
– M.G.
Sep 2 at 9:04
add a comment |Â
2
Thanks a lot for this and for the code example! I am still very new to tikz, so the code example really helps!
– M.G.
Sep 1 at 10:36
1
@M.G. TikZ is definitely worth learning. It comes with a great manual at ctan.org/pkg/pgf.
– CampanIgnis
Sep 1 at 10:38
1
Thanks for including the other examples as well!
– M.G.
Sep 2 at 9:04
2
2
Thanks a lot for this and for the code example! I am still very new to tikz, so the code example really helps!
– M.G.
Sep 1 at 10:36
Thanks a lot for this and for the code example! I am still very new to tikz, so the code example really helps!
– M.G.
Sep 1 at 10:36
1
1
@M.G. TikZ is definitely worth learning. It comes with a great manual at ctan.org/pkg/pgf.
– CampanIgnis
Sep 1 at 10:38
@M.G. TikZ is definitely worth learning. It comes with a great manual at ctan.org/pkg/pgf.
– CampanIgnis
Sep 1 at 10:38
1
1
Thanks for including the other examples as well!
– M.G.
Sep 2 at 9:04
Thanks for including the other examples as well!
– M.G.
Sep 2 at 9:04
add a comment |Â
up vote
16
down vote
Yet another question of this type: I begin to think that I should seriously consider the idea of turning my halloweenmath
package into a package generally aimed to making mathematical symbols out of arbitrary pictures. In this way, you get several frills for free, like the bolder look when the bold
math version is in force, and automatic scaling in sub/superscripts. I see no reason, however, why the symbols in question should behave as binary operators.
% My standard header for TeX.SX answers:
documentclass[a4paper]article % To avoid confusion, let us explicitly
% declare the paper format.
usepackage[T1]fontenc % Not always necessary, but recommended.
% End of standard header. What follows pertains to the problem at hand.
usepackagehalloweenmath % also loads "amsmath''
makeatletter
newcommand*@HwM@ironwire@stairway[2]%
% #1 := font selector (e.g., "textfont")
% #2 := line thickness, in unit of default-rule-thickness "fontdimen"
begin@HwM@small@picture#14.6-2.3%
roundcap
linethickness#2@HwM@thickness@units@for #1%
polyline(-2,-2)(-2,-1)(-1,-1)(-1,0)%
(0,0)(0,1)(+1,1)(+1,2)(+2,2)relax
end@HwM@small@picture%
newcommand*@HwM@Ironwire@Stairway[2]%
% #1 := style selector (e.g., "textstyle")
% #2 := font selector (e.g., "textfont")
@HwM@choose@thicknesses@HwM@ironwire@stairway #2%
1.25%
2.5%
newcommand*@HwM@hollow@stairway[2]%
% #1 := font selector (e.g., "textfont")
% #2 := line thickness, in unit of default-rule-thickness "fontdimen"
begin@HwM@small@picture#14.6-2.3%
roundcap
linethickness#2@HwM@thickness@units@for #1%
polygon(-2,-2)(-2,-1)(-1,-1)(-1,0)%
(0,0)(0,1)(+1,1)(+1,2)(+2,2)%
(+2,-2)relax
end@HwM@small@picture%
newcommand*@HwM@Hollow@Stairway[2]%
% #1 := style selector (e.g., "textstyle")
% #2 := font selector (e.g., "textfont")
@HwM@choose@thicknesses@HwM@hollow@stairway #2%
1.25%
2.5%
newcommand*mathsimplerightstair@HwM@set@right@dir @HwM@mathsimplestair
newcommand*mathsimpleleftstair @HwM@set@left@dir @HwM@mathsimplestair
newcommand*@HwM@mathsimplestair%
@HwM@general@ordinary@symbol @HwM@Ironwire@Stairway
newcommand*mathhollowrightstair@HwM@set@right@dir @HwM@mathhollowstair
newcommand*mathhollowleftstair @HwM@set@left@dir @HwM@mathhollowstair
newcommand*@HwM@mathhollowstair%
@HwM@general@ordinary@symbol @HwM@Hollow@Stairway
makeatother
begindocument
In text, surrounded by square brackets so to check the sidebearings:
( [ mathsimplerightstair mathsimpleleftstair] ),
or ( [mathhollowrightstair mathhollowleftstair] ).
Now in display:
[
mathsimplerightstair + int_mathsimplerightstair f(z),dz
- mathhollowleftstair - int_mathhollowleftstair g(z),dz
]
Note that the symbols get smaller in the subscript, even if the main font size
doesn't change. This behavior extends to double scripts, emphe.g.,
( [mathhollowrightstair_mathhollowrightstair^mathhollowrightstair] ),
as one would expect.footnoteOf course, changes in the main font size are
honored too:
( [mathhollowrightstair_mathhollowrightstair^mathhollowrightstair] ).
Furthemore, compare the looks of the four symbols in the textttnormal and in
the textttbold math versions:
( [mathsimplerightstair mathsimpleleftstair
mathhollowrightstair mathhollowleftstair] )
bfseries boldmath versus
( [mathsimplerightstair mathsimpleleftstair
mathhollowrightstair mathhollowleftstair] ).
As already mentioned in a footnote, the symbols also scale with the main font
size (compare them with the brackets).
bigskip
:
( [ mathsimplerightstair mathsimpleleftstair] +
mathhollowrightstair_mathhollowrightstair).
bigskip
Huge
bigskip
footnotesize
enddocument
See the comments in halloweenmath.dtx
for an explanation of how the macros work. Some fine-tuning of the sidebearings and of the line thicknesses might still be necessary, of course.
This is the output:
Addition:
It crossed my mind that, in the above code, you might want to replace all occurrences of roundcap
with roundcap roundjoin
, to get round joins between the segments of the stairs as well as round caps; and as a matter of fact, roundcap
is even useless in the case of @HwM@hollow@stairway
, which has no caps at all!
This is great! I will admit to my shame that I wasn't aware of the existence of your package. But now I am!
– M.G.
Sep 1 at 15:22
add a comment |Â
up vote
16
down vote
Yet another question of this type: I begin to think that I should seriously consider the idea of turning my halloweenmath
package into a package generally aimed to making mathematical symbols out of arbitrary pictures. In this way, you get several frills for free, like the bolder look when the bold
math version is in force, and automatic scaling in sub/superscripts. I see no reason, however, why the symbols in question should behave as binary operators.
% My standard header for TeX.SX answers:
documentclass[a4paper]article % To avoid confusion, let us explicitly
% declare the paper format.
usepackage[T1]fontenc % Not always necessary, but recommended.
% End of standard header. What follows pertains to the problem at hand.
usepackagehalloweenmath % also loads "amsmath''
makeatletter
newcommand*@HwM@ironwire@stairway[2]%
% #1 := font selector (e.g., "textfont")
% #2 := line thickness, in unit of default-rule-thickness "fontdimen"
begin@HwM@small@picture#14.6-2.3%
roundcap
linethickness#2@HwM@thickness@units@for #1%
polyline(-2,-2)(-2,-1)(-1,-1)(-1,0)%
(0,0)(0,1)(+1,1)(+1,2)(+2,2)relax
end@HwM@small@picture%
newcommand*@HwM@Ironwire@Stairway[2]%
% #1 := style selector (e.g., "textstyle")
% #2 := font selector (e.g., "textfont")
@HwM@choose@thicknesses@HwM@ironwire@stairway #2%
1.25%
2.5%
newcommand*@HwM@hollow@stairway[2]%
% #1 := font selector (e.g., "textfont")
% #2 := line thickness, in unit of default-rule-thickness "fontdimen"
begin@HwM@small@picture#14.6-2.3%
roundcap
linethickness#2@HwM@thickness@units@for #1%
polygon(-2,-2)(-2,-1)(-1,-1)(-1,0)%
(0,0)(0,1)(+1,1)(+1,2)(+2,2)%
(+2,-2)relax
end@HwM@small@picture%
newcommand*@HwM@Hollow@Stairway[2]%
% #1 := style selector (e.g., "textstyle")
% #2 := font selector (e.g., "textfont")
@HwM@choose@thicknesses@HwM@hollow@stairway #2%
1.25%
2.5%
newcommand*mathsimplerightstair@HwM@set@right@dir @HwM@mathsimplestair
newcommand*mathsimpleleftstair @HwM@set@left@dir @HwM@mathsimplestair
newcommand*@HwM@mathsimplestair%
@HwM@general@ordinary@symbol @HwM@Ironwire@Stairway
newcommand*mathhollowrightstair@HwM@set@right@dir @HwM@mathhollowstair
newcommand*mathhollowleftstair @HwM@set@left@dir @HwM@mathhollowstair
newcommand*@HwM@mathhollowstair%
@HwM@general@ordinary@symbol @HwM@Hollow@Stairway
makeatother
begindocument
In text, surrounded by square brackets so to check the sidebearings:
( [ mathsimplerightstair mathsimpleleftstair] ),
or ( [mathhollowrightstair mathhollowleftstair] ).
Now in display:
[
mathsimplerightstair + int_mathsimplerightstair f(z),dz
- mathhollowleftstair - int_mathhollowleftstair g(z),dz
]
Note that the symbols get smaller in the subscript, even if the main font size
doesn't change. This behavior extends to double scripts, emphe.g.,
( [mathhollowrightstair_mathhollowrightstair^mathhollowrightstair] ),
as one would expect.footnoteOf course, changes in the main font size are
honored too:
( [mathhollowrightstair_mathhollowrightstair^mathhollowrightstair] ).
Furthemore, compare the looks of the four symbols in the textttnormal and in
the textttbold math versions:
( [mathsimplerightstair mathsimpleleftstair
mathhollowrightstair mathhollowleftstair] )
bfseries boldmath versus
( [mathsimplerightstair mathsimpleleftstair
mathhollowrightstair mathhollowleftstair] ).
As already mentioned in a footnote, the symbols also scale with the main font
size (compare them with the brackets).
bigskip
:
( [ mathsimplerightstair mathsimpleleftstair] +
mathhollowrightstair_mathhollowrightstair).
bigskip
Huge
bigskip
footnotesize
enddocument
See the comments in halloweenmath.dtx
for an explanation of how the macros work. Some fine-tuning of the sidebearings and of the line thicknesses might still be necessary, of course.
This is the output:
Addition:
It crossed my mind that, in the above code, you might want to replace all occurrences of roundcap
with roundcap roundjoin
, to get round joins between the segments of the stairs as well as round caps; and as a matter of fact, roundcap
is even useless in the case of @HwM@hollow@stairway
, which has no caps at all!
This is great! I will admit to my shame that I wasn't aware of the existence of your package. But now I am!
– M.G.
Sep 1 at 15:22
add a comment |Â
up vote
16
down vote
up vote
16
down vote
Yet another question of this type: I begin to think that I should seriously consider the idea of turning my halloweenmath
package into a package generally aimed to making mathematical symbols out of arbitrary pictures. In this way, you get several frills for free, like the bolder look when the bold
math version is in force, and automatic scaling in sub/superscripts. I see no reason, however, why the symbols in question should behave as binary operators.
% My standard header for TeX.SX answers:
documentclass[a4paper]article % To avoid confusion, let us explicitly
% declare the paper format.
usepackage[T1]fontenc % Not always necessary, but recommended.
% End of standard header. What follows pertains to the problem at hand.
usepackagehalloweenmath % also loads "amsmath''
makeatletter
newcommand*@HwM@ironwire@stairway[2]%
% #1 := font selector (e.g., "textfont")
% #2 := line thickness, in unit of default-rule-thickness "fontdimen"
begin@HwM@small@picture#14.6-2.3%
roundcap
linethickness#2@HwM@thickness@units@for #1%
polyline(-2,-2)(-2,-1)(-1,-1)(-1,0)%
(0,0)(0,1)(+1,1)(+1,2)(+2,2)relax
end@HwM@small@picture%
newcommand*@HwM@Ironwire@Stairway[2]%
% #1 := style selector (e.g., "textstyle")
% #2 := font selector (e.g., "textfont")
@HwM@choose@thicknesses@HwM@ironwire@stairway #2%
1.25%
2.5%
newcommand*@HwM@hollow@stairway[2]%
% #1 := font selector (e.g., "textfont")
% #2 := line thickness, in unit of default-rule-thickness "fontdimen"
begin@HwM@small@picture#14.6-2.3%
roundcap
linethickness#2@HwM@thickness@units@for #1%
polygon(-2,-2)(-2,-1)(-1,-1)(-1,0)%
(0,0)(0,1)(+1,1)(+1,2)(+2,2)%
(+2,-2)relax
end@HwM@small@picture%
newcommand*@HwM@Hollow@Stairway[2]%
% #1 := style selector (e.g., "textstyle")
% #2 := font selector (e.g., "textfont")
@HwM@choose@thicknesses@HwM@hollow@stairway #2%
1.25%
2.5%
newcommand*mathsimplerightstair@HwM@set@right@dir @HwM@mathsimplestair
newcommand*mathsimpleleftstair @HwM@set@left@dir @HwM@mathsimplestair
newcommand*@HwM@mathsimplestair%
@HwM@general@ordinary@symbol @HwM@Ironwire@Stairway
newcommand*mathhollowrightstair@HwM@set@right@dir @HwM@mathhollowstair
newcommand*mathhollowleftstair @HwM@set@left@dir @HwM@mathhollowstair
newcommand*@HwM@mathhollowstair%
@HwM@general@ordinary@symbol @HwM@Hollow@Stairway
makeatother
begindocument
In text, surrounded by square brackets so to check the sidebearings:
( [ mathsimplerightstair mathsimpleleftstair] ),
or ( [mathhollowrightstair mathhollowleftstair] ).
Now in display:
[
mathsimplerightstair + int_mathsimplerightstair f(z),dz
- mathhollowleftstair - int_mathhollowleftstair g(z),dz
]
Note that the symbols get smaller in the subscript, even if the main font size
doesn't change. This behavior extends to double scripts, emphe.g.,
( [mathhollowrightstair_mathhollowrightstair^mathhollowrightstair] ),
as one would expect.footnoteOf course, changes in the main font size are
honored too:
( [mathhollowrightstair_mathhollowrightstair^mathhollowrightstair] ).
Furthemore, compare the looks of the four symbols in the textttnormal and in
the textttbold math versions:
( [mathsimplerightstair mathsimpleleftstair
mathhollowrightstair mathhollowleftstair] )
bfseries boldmath versus
( [mathsimplerightstair mathsimpleleftstair
mathhollowrightstair mathhollowleftstair] ).
As already mentioned in a footnote, the symbols also scale with the main font
size (compare them with the brackets).
bigskip
:
( [ mathsimplerightstair mathsimpleleftstair] +
mathhollowrightstair_mathhollowrightstair).
bigskip
Huge
bigskip
footnotesize
enddocument
See the comments in halloweenmath.dtx
for an explanation of how the macros work. Some fine-tuning of the sidebearings and of the line thicknesses might still be necessary, of course.
This is the output:
Addition:
It crossed my mind that, in the above code, you might want to replace all occurrences of roundcap
with roundcap roundjoin
, to get round joins between the segments of the stairs as well as round caps; and as a matter of fact, roundcap
is even useless in the case of @HwM@hollow@stairway
, which has no caps at all!
Yet another question of this type: I begin to think that I should seriously consider the idea of turning my halloweenmath
package into a package generally aimed to making mathematical symbols out of arbitrary pictures. In this way, you get several frills for free, like the bolder look when the bold
math version is in force, and automatic scaling in sub/superscripts. I see no reason, however, why the symbols in question should behave as binary operators.
% My standard header for TeX.SX answers:
documentclass[a4paper]article % To avoid confusion, let us explicitly
% declare the paper format.
usepackage[T1]fontenc % Not always necessary, but recommended.
% End of standard header. What follows pertains to the problem at hand.
usepackagehalloweenmath % also loads "amsmath''
makeatletter
newcommand*@HwM@ironwire@stairway[2]%
% #1 := font selector (e.g., "textfont")
% #2 := line thickness, in unit of default-rule-thickness "fontdimen"
begin@HwM@small@picture#14.6-2.3%
roundcap
linethickness#2@HwM@thickness@units@for #1%
polyline(-2,-2)(-2,-1)(-1,-1)(-1,0)%
(0,0)(0,1)(+1,1)(+1,2)(+2,2)relax
end@HwM@small@picture%
newcommand*@HwM@Ironwire@Stairway[2]%
% #1 := style selector (e.g., "textstyle")
% #2 := font selector (e.g., "textfont")
@HwM@choose@thicknesses@HwM@ironwire@stairway #2%
1.25%
2.5%
newcommand*@HwM@hollow@stairway[2]%
% #1 := font selector (e.g., "textfont")
% #2 := line thickness, in unit of default-rule-thickness "fontdimen"
begin@HwM@small@picture#14.6-2.3%
roundcap
linethickness#2@HwM@thickness@units@for #1%
polygon(-2,-2)(-2,-1)(-1,-1)(-1,0)%
(0,0)(0,1)(+1,1)(+1,2)(+2,2)%
(+2,-2)relax
end@HwM@small@picture%
newcommand*@HwM@Hollow@Stairway[2]%
% #1 := style selector (e.g., "textstyle")
% #2 := font selector (e.g., "textfont")
@HwM@choose@thicknesses@HwM@hollow@stairway #2%
1.25%
2.5%
newcommand*mathsimplerightstair@HwM@set@right@dir @HwM@mathsimplestair
newcommand*mathsimpleleftstair @HwM@set@left@dir @HwM@mathsimplestair
newcommand*@HwM@mathsimplestair%
@HwM@general@ordinary@symbol @HwM@Ironwire@Stairway
newcommand*mathhollowrightstair@HwM@set@right@dir @HwM@mathhollowstair
newcommand*mathhollowleftstair @HwM@set@left@dir @HwM@mathhollowstair
newcommand*@HwM@mathhollowstair%
@HwM@general@ordinary@symbol @HwM@Hollow@Stairway
makeatother
begindocument
In text, surrounded by square brackets so to check the sidebearings:
( [ mathsimplerightstair mathsimpleleftstair] ),
or ( [mathhollowrightstair mathhollowleftstair] ).
Now in display:
[
mathsimplerightstair + int_mathsimplerightstair f(z),dz
- mathhollowleftstair - int_mathhollowleftstair g(z),dz
]
Note that the symbols get smaller in the subscript, even if the main font size
doesn't change. This behavior extends to double scripts, emphe.g.,
( [mathhollowrightstair_mathhollowrightstair^mathhollowrightstair] ),
as one would expect.footnoteOf course, changes in the main font size are
honored too:
( [mathhollowrightstair_mathhollowrightstair^mathhollowrightstair] ).
Furthemore, compare the looks of the four symbols in the textttnormal and in
the textttbold math versions:
( [mathsimplerightstair mathsimpleleftstair
mathhollowrightstair mathhollowleftstair] )
bfseries boldmath versus
( [mathsimplerightstair mathsimpleleftstair
mathhollowrightstair mathhollowleftstair] ).
As already mentioned in a footnote, the symbols also scale with the main font
size (compare them with the brackets).
bigskip
:
( [ mathsimplerightstair mathsimpleleftstair] +
mathhollowrightstair_mathhollowrightstair).
bigskip
Huge
bigskip
footnotesize
enddocument
See the comments in halloweenmath.dtx
for an explanation of how the macros work. Some fine-tuning of the sidebearings and of the line thicknesses might still be necessary, of course.
This is the output:
Addition:
It crossed my mind that, in the above code, you might want to replace all occurrences of roundcap
with roundcap roundjoin
, to get round joins between the segments of the stairs as well as round caps; and as a matter of fact, roundcap
is even useless in the case of @HwM@hollow@stairway
, which has no caps at all!
edited Sep 3 at 20:37
answered Sep 1 at 15:09
GuM
15.5k2253
15.5k2253
This is great! I will admit to my shame that I wasn't aware of the existence of your package. But now I am!
– M.G.
Sep 1 at 15:22
add a comment |Â
This is great! I will admit to my shame that I wasn't aware of the existence of your package. But now I am!
– M.G.
Sep 1 at 15:22
This is great! I will admit to my shame that I wasn't aware of the existence of your package. But now I am!
– M.G.
Sep 1 at 15:22
This is great! I will admit to my shame that I wasn't aware of the existence of your package. But now I am!
– M.G.
Sep 1 at 15:22
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%2f448817%2fhow-to-get-a-stairway-symbol-in-math-mode%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
There might be something here.
– luchonacho
Sep 1 at 11:42
@luchonacho: I thought so too, but I wasn't able to find anything even remotely close in there. Maybe I have overlooked something.
– M.G.
Sep 1 at 12:14