A macro that draws a half-disk for use in mathmode
up vote
10
down vote
favorite
I'd like to define macros to be able to use each of the following six shapes as subscripts in math mode.
I'd try to draw them using tikz, but I don't know if I could use those as subscripts.
math-mode subscripts
add a comment |
up vote
10
down vote
favorite
I'd like to define macros to be able to use each of the following six shapes as subscripts in math mode.
I'd try to draw them using tikz, but I don't know if I could use those as subscripts.
math-mode subscripts
1
Maybe you find some here: ctan.org/pkg/wasysym or www.ctan.org/pkg/stix
– Sigur
Nov 20 at 14:44
Thanks! That package has the commands Leftcircle and Rightcircle, I'll try to figure out how to rotate those. Still missing the ones with just the arc, though.
– Peter
Nov 20 at 14:46
1
Check here also: mirrors.ctan.org/info/symbols/comprehensive/symbols-a4.pdf
– Sigur
Nov 20 at 14:50
Also, if usingunicode-math
: mirrors.ctan.org/macros/latex/contrib/unicode-math/…
– Davislor
Nov 21 at 3:34
1
A few of those symbols are in Unicode, ◯ is U+25EF, ◠ is U+25E0 and ◡ is U+25E1.unicode-math
and some other packages give these the aliaseslgwhtcircle
,topsemicircle
andbotsemicircle
, respectively. There are several horizontal dashes. The other two symbols do not seem to be.
– Davislor
Nov 21 at 3:43
add a comment |
up vote
10
down vote
favorite
up vote
10
down vote
favorite
I'd like to define macros to be able to use each of the following six shapes as subscripts in math mode.
I'd try to draw them using tikz, but I don't know if I could use those as subscripts.
math-mode subscripts
I'd like to define macros to be able to use each of the following six shapes as subscripts in math mode.
I'd try to draw them using tikz, but I don't know if I could use those as subscripts.
math-mode subscripts
math-mode subscripts
asked Nov 20 at 14:39
Peter
1535
1535
1
Maybe you find some here: ctan.org/pkg/wasysym or www.ctan.org/pkg/stix
– Sigur
Nov 20 at 14:44
Thanks! That package has the commands Leftcircle and Rightcircle, I'll try to figure out how to rotate those. Still missing the ones with just the arc, though.
– Peter
Nov 20 at 14:46
1
Check here also: mirrors.ctan.org/info/symbols/comprehensive/symbols-a4.pdf
– Sigur
Nov 20 at 14:50
Also, if usingunicode-math
: mirrors.ctan.org/macros/latex/contrib/unicode-math/…
– Davislor
Nov 21 at 3:34
1
A few of those symbols are in Unicode, ◯ is U+25EF, ◠ is U+25E0 and ◡ is U+25E1.unicode-math
and some other packages give these the aliaseslgwhtcircle
,topsemicircle
andbotsemicircle
, respectively. There are several horizontal dashes. The other two symbols do not seem to be.
– Davislor
Nov 21 at 3:43
add a comment |
1
Maybe you find some here: ctan.org/pkg/wasysym or www.ctan.org/pkg/stix
– Sigur
Nov 20 at 14:44
Thanks! That package has the commands Leftcircle and Rightcircle, I'll try to figure out how to rotate those. Still missing the ones with just the arc, though.
– Peter
Nov 20 at 14:46
1
Check here also: mirrors.ctan.org/info/symbols/comprehensive/symbols-a4.pdf
– Sigur
Nov 20 at 14:50
Also, if usingunicode-math
: mirrors.ctan.org/macros/latex/contrib/unicode-math/…
– Davislor
Nov 21 at 3:34
1
A few of those symbols are in Unicode, ◯ is U+25EF, ◠ is U+25E0 and ◡ is U+25E1.unicode-math
and some other packages give these the aliaseslgwhtcircle
,topsemicircle
andbotsemicircle
, respectively. There are several horizontal dashes. The other two symbols do not seem to be.
– Davislor
Nov 21 at 3:43
1
1
Maybe you find some here: ctan.org/pkg/wasysym or www.ctan.org/pkg/stix
– Sigur
Nov 20 at 14:44
Maybe you find some here: ctan.org/pkg/wasysym or www.ctan.org/pkg/stix
– Sigur
Nov 20 at 14:44
Thanks! That package has the commands Leftcircle and Rightcircle, I'll try to figure out how to rotate those. Still missing the ones with just the arc, though.
– Peter
Nov 20 at 14:46
Thanks! That package has the commands Leftcircle and Rightcircle, I'll try to figure out how to rotate those. Still missing the ones with just the arc, though.
– Peter
Nov 20 at 14:46
1
1
Check here also: mirrors.ctan.org/info/symbols/comprehensive/symbols-a4.pdf
– Sigur
Nov 20 at 14:50
Check here also: mirrors.ctan.org/info/symbols/comprehensive/symbols-a4.pdf
– Sigur
Nov 20 at 14:50
Also, if using
unicode-math
: mirrors.ctan.org/macros/latex/contrib/unicode-math/…– Davislor
Nov 21 at 3:34
Also, if using
unicode-math
: mirrors.ctan.org/macros/latex/contrib/unicode-math/…– Davislor
Nov 21 at 3:34
1
1
A few of those symbols are in Unicode, ◯ is U+25EF, ◠ is U+25E0 and ◡ is U+25E1.
unicode-math
and some other packages give these the aliases lgwhtcircle
, topsemicircle
and botsemicircle
, respectively. There are several horizontal dashes. The other two symbols do not seem to be.– Davislor
Nov 21 at 3:43
A few of those symbols are in Unicode, ◯ is U+25EF, ◠ is U+25E0 and ◡ is U+25E1.
unicode-math
and some other packages give these the aliases lgwhtcircle
, topsemicircle
and botsemicircle
, respectively. There are several horizontal dashes. The other two symbols do not seem to be.– Davislor
Nov 21 at 3:43
add a comment |
3 Answers
3
active
oldest
votes
up vote
13
down vote
accepted
Picture mode!
documentclass{article}
usepackage{amsmath}
usepackage{pict2e}
DeclareRobustCommand{fullcircle}{%
mspace{2mu}mathord{
sbox{0}{$scriptstyle O$}%
setlength{unitlength}{ht0}%
begin{picture}(1,1)
put(0.5,0.5){arc{0.5}}
end{picture}
}mspace{2mu}
}
DeclareRobustCommand{upsemicircle}{%
mspace{2mu}mathord{
sbox{0}{$scriptstyle O$}%
setlength{unitlength}{ht0}%
begin{picture}(1,1)
put(0.5,0.5){arc[0,180]{0.5}}
end{picture}
}mspace{2mu}
}
DeclareRobustCommand{downsemicircle}{%
mspace{2mu}mathord{
sbox{0}{$scriptstyle O$}%
setlength{unitlength}{ht0}%
begin{picture}(1,1)
put(0.5,0.5){arc[180,360]{0.5}}
end{picture}
}mspace{2mu}
}
DeclareRobustCommand{upsemicirclediam}{%
mspace{2mu}mathord{
sbox{0}{$scriptstyle O$}%
setlength{unitlength}{ht0}%
begin{picture}(1,1)
moveto(0.5,0.5)
circlearc{0.5}{0.5}{0.5}{0}{180}
lineto(0.5,0.5)
strokepath
end{picture}
}mspace{2mu}
}
DeclareRobustCommand{downsemicirclediam}{%
mspace{2mu}mathord{
sbox{0}{$scriptstyle O$}%
setlength{unitlength}{ht0}%
begin{picture}(1,1)
moveto(0.5,0.5)
circlearc{0.5}{0.5}{0.5}{180}{360}
lineto(0.5,0.5)
strokepath
end{picture}
}mspace{2mu}
}
DeclareRobustCommand{diam}{%
mspace{2mu}mathord{
sbox{0}{$scriptstyle O$}%
setlength{unitlength}{ht0}%
begin{picture}(1,1)
Line(0,0.5)(1,0.5)
end{picture}
}mspace{2mu}
}
begin{document}
$X_{fullcircleupsemicircledownsemicircleupsemicirclediamdownsemicirclediamdiam}$
end{document}
An enhanced version that can cope with the symbols at every level.
documentclass{article}
usepackage{amsmath}
usepackage{pict2e}
makeatletter
DeclareRobustCommand{fullcircle}{peter@symbolpeter@fullcircle}
DeclareRobustCommand{upsemicircle}{peter@symbolpeter@upsemicircle}
DeclareRobustCommand{downsemicircle}{peter@symbolpeter@downsemicircle}
DeclareRobustCommand{upsemicirclediam}{peter@symbolpeter@upsemicirclediam}
DeclareRobustCommand{downsemicirclediam}{peter@symbolpeter@downsemicirclediam}
DeclareRobustCommand{diam}{peter@symbolpeter@diam}
newcommand{peter@symbol}[1]{mathord{mspace{2mu}mathpalette#1relaxmspace{2mu}}}
newcommand{peter@unitlength}[1]{%
settoheight{unitlength}{$m@th#1O$}%
linethickness{fontdimen 8
ifx#1displaystyletextfontelse
ifx#1textstyletextfontelse
ifx#1scriptstylescriptfontelse
scriptscriptfontfififi 3
}%
}
newcommand{peter@fullcircle}[2]{%
begingroup
peter@unitlength{#1}%
begin{picture}(1,1)
circlearc[1]{0.5}{0.5}{0.5}{0}{360}
strokepath
end{picture}%
endgroup
}
newcommand{peter@upsemicircle}[2]{%
begingroup
peter@unitlength{#1}%
begin{picture}(1,1)
circlearc[1]{0.5}{0.5}{0.5}{0}{180}
strokepath
end{picture}%
endgroup
}
newcommand{peter@downsemicircle}[2]{%
begingroup
peter@unitlength{#1}%
begin{picture}(1,1)
circlearc[1]{0.5}{0.5}{0.5}{180}{360}
strokepath
end{picture}%
endgroup
}
newcommand{peter@upsemicirclediam}[2]{%
begingroup
peter@unitlength{#1}%
begin{picture}(1,1)
moveto(0.5,0.5)
circlearc{0.5}{0.5}{0.5}{0}{180}
lineto(0.5,0.5)
strokepath
end{picture}%
endgroup
}
newcommand{peter@downsemicirclediam}[2]{%
begingroup
peter@unitlength{#1}%
begin{picture}(1,1)
moveto(0.5,0.5)
circlearc{0.5}{0.5}{0.5}{180}{360}
lineto(0.5,0.5)
strokepath
end{picture}%
endgroup
}
newcommand{peter@diam}[2]{%
begingroup
peter@unitlength{#1}%
begin{picture}(1,1)
Line(0,0.5)(1,0.5)
end{picture}%
endgroup
}
begin{document}
$Xfullcircleupsemicircledownsemicircleupsemicirclediamdownsemicirclediamdiam$
$X_{fullcircleupsemicircledownsemicircleupsemicirclediamdownsemicirclediamdiam}$
$X_{X_{fullcircleupsemicircledownsemicircleupsemicirclediamdownsemicirclediamdiam}}$
end{document}
add a comment |
up vote
7
down vote
TikZ in boxes! (Far inferior to picture mode unfortunately)
documentclass{article}
usepackage{tikz}
makeatletter
newcommandsetup@crazysubscripts[2]
{%
expandafternewsaveboxcsname crazysubscripts@#1endcsname
expandaftersboxcsname crazysubscripts@#1endcsname
{%
kern.1ex
begin{tikzpicture}
path[use as bounding box] circle[radius=.5ex];
#2%
end{tikzpicture}%
kern.1ex
}%
}
setup@crazysubscripts{fc}% fullcircle
{%
draw circle[radius=.5ex];%
}
setup@crazysubscripts{lo}% lower open
{%
draw (.5ex,0) arc[start angle=0, end angle=-180, radius=.5ex];%
}
setup@crazysubscripts{uo}% upper open
{%
draw (.5ex,0) arc[start angle=0, end angle=180, radius=.5ex];%
}
setup@crazysubscripts{lc}% lower closed
{%
draw (-.5ex,0) -- (.5ex,0) arc[start angle=0, end angle=-180, radius=.5ex]
--cycle;%
}
setup@crazysubscripts{uc}% upper closed
{%
draw (-.5ex,0) -- (.5ex,0) arc[start angle=0, end angle=180, radius=.5ex]
--cycle;%
}
setup@crazysubscripts{b}% boring line
{%
draw (-.5ex,0) -- (.5ex,0);%
}
newcommandcsubs[1]
{%
@ifundefined{crazysubscripts@#1}
{GenericError{}{Undefined crazysubscript `#1`}{}{}}%
{%
resizebox{.75ex}{!}
{expandafteruseboxcsname crazysubscripts@#1endcsname}%
}%
}
makeatother
begin{document}
$A_{csubs{fc}_{csubs{lo}_{csubs{lc}}}}$
csubs{fc}csubs{lo}csubs{uo}csubs{lc}csubs{uc}csubs{b}
end{document}
Could you elaborate how this is inferior to picture mode?
– Peter
Nov 20 at 15:34
@Peter because the other one is picture mode!
– Skillmon
Nov 20 at 15:43
2
@Peter no honestly, it's just a joke.
– Skillmon
Nov 20 at 15:44
add a comment |
up vote
3
down vote
Just a template.
documentclass[preview,border=12pt,varwidth,12pt]{standalone}
usepackage{tikz}
defalex{tikz draw (0,0) circle (2pt);}
defbobby{tikz draw (0,0) -- (3pt,0) -- (3pt,2pt) -- cycle;}
begin{document}
This is an equation $F_{alex}^{bobby}+1$.
end{document}
add a comment |
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
13
down vote
accepted
Picture mode!
documentclass{article}
usepackage{amsmath}
usepackage{pict2e}
DeclareRobustCommand{fullcircle}{%
mspace{2mu}mathord{
sbox{0}{$scriptstyle O$}%
setlength{unitlength}{ht0}%
begin{picture}(1,1)
put(0.5,0.5){arc{0.5}}
end{picture}
}mspace{2mu}
}
DeclareRobustCommand{upsemicircle}{%
mspace{2mu}mathord{
sbox{0}{$scriptstyle O$}%
setlength{unitlength}{ht0}%
begin{picture}(1,1)
put(0.5,0.5){arc[0,180]{0.5}}
end{picture}
}mspace{2mu}
}
DeclareRobustCommand{downsemicircle}{%
mspace{2mu}mathord{
sbox{0}{$scriptstyle O$}%
setlength{unitlength}{ht0}%
begin{picture}(1,1)
put(0.5,0.5){arc[180,360]{0.5}}
end{picture}
}mspace{2mu}
}
DeclareRobustCommand{upsemicirclediam}{%
mspace{2mu}mathord{
sbox{0}{$scriptstyle O$}%
setlength{unitlength}{ht0}%
begin{picture}(1,1)
moveto(0.5,0.5)
circlearc{0.5}{0.5}{0.5}{0}{180}
lineto(0.5,0.5)
strokepath
end{picture}
}mspace{2mu}
}
DeclareRobustCommand{downsemicirclediam}{%
mspace{2mu}mathord{
sbox{0}{$scriptstyle O$}%
setlength{unitlength}{ht0}%
begin{picture}(1,1)
moveto(0.5,0.5)
circlearc{0.5}{0.5}{0.5}{180}{360}
lineto(0.5,0.5)
strokepath
end{picture}
}mspace{2mu}
}
DeclareRobustCommand{diam}{%
mspace{2mu}mathord{
sbox{0}{$scriptstyle O$}%
setlength{unitlength}{ht0}%
begin{picture}(1,1)
Line(0,0.5)(1,0.5)
end{picture}
}mspace{2mu}
}
begin{document}
$X_{fullcircleupsemicircledownsemicircleupsemicirclediamdownsemicirclediamdiam}$
end{document}
An enhanced version that can cope with the symbols at every level.
documentclass{article}
usepackage{amsmath}
usepackage{pict2e}
makeatletter
DeclareRobustCommand{fullcircle}{peter@symbolpeter@fullcircle}
DeclareRobustCommand{upsemicircle}{peter@symbolpeter@upsemicircle}
DeclareRobustCommand{downsemicircle}{peter@symbolpeter@downsemicircle}
DeclareRobustCommand{upsemicirclediam}{peter@symbolpeter@upsemicirclediam}
DeclareRobustCommand{downsemicirclediam}{peter@symbolpeter@downsemicirclediam}
DeclareRobustCommand{diam}{peter@symbolpeter@diam}
newcommand{peter@symbol}[1]{mathord{mspace{2mu}mathpalette#1relaxmspace{2mu}}}
newcommand{peter@unitlength}[1]{%
settoheight{unitlength}{$m@th#1O$}%
linethickness{fontdimen 8
ifx#1displaystyletextfontelse
ifx#1textstyletextfontelse
ifx#1scriptstylescriptfontelse
scriptscriptfontfififi 3
}%
}
newcommand{peter@fullcircle}[2]{%
begingroup
peter@unitlength{#1}%
begin{picture}(1,1)
circlearc[1]{0.5}{0.5}{0.5}{0}{360}
strokepath
end{picture}%
endgroup
}
newcommand{peter@upsemicircle}[2]{%
begingroup
peter@unitlength{#1}%
begin{picture}(1,1)
circlearc[1]{0.5}{0.5}{0.5}{0}{180}
strokepath
end{picture}%
endgroup
}
newcommand{peter@downsemicircle}[2]{%
begingroup
peter@unitlength{#1}%
begin{picture}(1,1)
circlearc[1]{0.5}{0.5}{0.5}{180}{360}
strokepath
end{picture}%
endgroup
}
newcommand{peter@upsemicirclediam}[2]{%
begingroup
peter@unitlength{#1}%
begin{picture}(1,1)
moveto(0.5,0.5)
circlearc{0.5}{0.5}{0.5}{0}{180}
lineto(0.5,0.5)
strokepath
end{picture}%
endgroup
}
newcommand{peter@downsemicirclediam}[2]{%
begingroup
peter@unitlength{#1}%
begin{picture}(1,1)
moveto(0.5,0.5)
circlearc{0.5}{0.5}{0.5}{180}{360}
lineto(0.5,0.5)
strokepath
end{picture}%
endgroup
}
newcommand{peter@diam}[2]{%
begingroup
peter@unitlength{#1}%
begin{picture}(1,1)
Line(0,0.5)(1,0.5)
end{picture}%
endgroup
}
begin{document}
$Xfullcircleupsemicircledownsemicircleupsemicirclediamdownsemicirclediamdiam$
$X_{fullcircleupsemicircledownsemicircleupsemicirclediamdownsemicirclediamdiam}$
$X_{X_{fullcircleupsemicircledownsemicircleupsemicirclediamdownsemicirclediamdiam}}$
end{document}
add a comment |
up vote
13
down vote
accepted
Picture mode!
documentclass{article}
usepackage{amsmath}
usepackage{pict2e}
DeclareRobustCommand{fullcircle}{%
mspace{2mu}mathord{
sbox{0}{$scriptstyle O$}%
setlength{unitlength}{ht0}%
begin{picture}(1,1)
put(0.5,0.5){arc{0.5}}
end{picture}
}mspace{2mu}
}
DeclareRobustCommand{upsemicircle}{%
mspace{2mu}mathord{
sbox{0}{$scriptstyle O$}%
setlength{unitlength}{ht0}%
begin{picture}(1,1)
put(0.5,0.5){arc[0,180]{0.5}}
end{picture}
}mspace{2mu}
}
DeclareRobustCommand{downsemicircle}{%
mspace{2mu}mathord{
sbox{0}{$scriptstyle O$}%
setlength{unitlength}{ht0}%
begin{picture}(1,1)
put(0.5,0.5){arc[180,360]{0.5}}
end{picture}
}mspace{2mu}
}
DeclareRobustCommand{upsemicirclediam}{%
mspace{2mu}mathord{
sbox{0}{$scriptstyle O$}%
setlength{unitlength}{ht0}%
begin{picture}(1,1)
moveto(0.5,0.5)
circlearc{0.5}{0.5}{0.5}{0}{180}
lineto(0.5,0.5)
strokepath
end{picture}
}mspace{2mu}
}
DeclareRobustCommand{downsemicirclediam}{%
mspace{2mu}mathord{
sbox{0}{$scriptstyle O$}%
setlength{unitlength}{ht0}%
begin{picture}(1,1)
moveto(0.5,0.5)
circlearc{0.5}{0.5}{0.5}{180}{360}
lineto(0.5,0.5)
strokepath
end{picture}
}mspace{2mu}
}
DeclareRobustCommand{diam}{%
mspace{2mu}mathord{
sbox{0}{$scriptstyle O$}%
setlength{unitlength}{ht0}%
begin{picture}(1,1)
Line(0,0.5)(1,0.5)
end{picture}
}mspace{2mu}
}
begin{document}
$X_{fullcircleupsemicircledownsemicircleupsemicirclediamdownsemicirclediamdiam}$
end{document}
An enhanced version that can cope with the symbols at every level.
documentclass{article}
usepackage{amsmath}
usepackage{pict2e}
makeatletter
DeclareRobustCommand{fullcircle}{peter@symbolpeter@fullcircle}
DeclareRobustCommand{upsemicircle}{peter@symbolpeter@upsemicircle}
DeclareRobustCommand{downsemicircle}{peter@symbolpeter@downsemicircle}
DeclareRobustCommand{upsemicirclediam}{peter@symbolpeter@upsemicirclediam}
DeclareRobustCommand{downsemicirclediam}{peter@symbolpeter@downsemicirclediam}
DeclareRobustCommand{diam}{peter@symbolpeter@diam}
newcommand{peter@symbol}[1]{mathord{mspace{2mu}mathpalette#1relaxmspace{2mu}}}
newcommand{peter@unitlength}[1]{%
settoheight{unitlength}{$m@th#1O$}%
linethickness{fontdimen 8
ifx#1displaystyletextfontelse
ifx#1textstyletextfontelse
ifx#1scriptstylescriptfontelse
scriptscriptfontfififi 3
}%
}
newcommand{peter@fullcircle}[2]{%
begingroup
peter@unitlength{#1}%
begin{picture}(1,1)
circlearc[1]{0.5}{0.5}{0.5}{0}{360}
strokepath
end{picture}%
endgroup
}
newcommand{peter@upsemicircle}[2]{%
begingroup
peter@unitlength{#1}%
begin{picture}(1,1)
circlearc[1]{0.5}{0.5}{0.5}{0}{180}
strokepath
end{picture}%
endgroup
}
newcommand{peter@downsemicircle}[2]{%
begingroup
peter@unitlength{#1}%
begin{picture}(1,1)
circlearc[1]{0.5}{0.5}{0.5}{180}{360}
strokepath
end{picture}%
endgroup
}
newcommand{peter@upsemicirclediam}[2]{%
begingroup
peter@unitlength{#1}%
begin{picture}(1,1)
moveto(0.5,0.5)
circlearc{0.5}{0.5}{0.5}{0}{180}
lineto(0.5,0.5)
strokepath
end{picture}%
endgroup
}
newcommand{peter@downsemicirclediam}[2]{%
begingroup
peter@unitlength{#1}%
begin{picture}(1,1)
moveto(0.5,0.5)
circlearc{0.5}{0.5}{0.5}{180}{360}
lineto(0.5,0.5)
strokepath
end{picture}%
endgroup
}
newcommand{peter@diam}[2]{%
begingroup
peter@unitlength{#1}%
begin{picture}(1,1)
Line(0,0.5)(1,0.5)
end{picture}%
endgroup
}
begin{document}
$Xfullcircleupsemicircledownsemicircleupsemicirclediamdownsemicirclediamdiam$
$X_{fullcircleupsemicircledownsemicircleupsemicirclediamdownsemicirclediamdiam}$
$X_{X_{fullcircleupsemicircledownsemicircleupsemicirclediamdownsemicirclediamdiam}}$
end{document}
add a comment |
up vote
13
down vote
accepted
up vote
13
down vote
accepted
Picture mode!
documentclass{article}
usepackage{amsmath}
usepackage{pict2e}
DeclareRobustCommand{fullcircle}{%
mspace{2mu}mathord{
sbox{0}{$scriptstyle O$}%
setlength{unitlength}{ht0}%
begin{picture}(1,1)
put(0.5,0.5){arc{0.5}}
end{picture}
}mspace{2mu}
}
DeclareRobustCommand{upsemicircle}{%
mspace{2mu}mathord{
sbox{0}{$scriptstyle O$}%
setlength{unitlength}{ht0}%
begin{picture}(1,1)
put(0.5,0.5){arc[0,180]{0.5}}
end{picture}
}mspace{2mu}
}
DeclareRobustCommand{downsemicircle}{%
mspace{2mu}mathord{
sbox{0}{$scriptstyle O$}%
setlength{unitlength}{ht0}%
begin{picture}(1,1)
put(0.5,0.5){arc[180,360]{0.5}}
end{picture}
}mspace{2mu}
}
DeclareRobustCommand{upsemicirclediam}{%
mspace{2mu}mathord{
sbox{0}{$scriptstyle O$}%
setlength{unitlength}{ht0}%
begin{picture}(1,1)
moveto(0.5,0.5)
circlearc{0.5}{0.5}{0.5}{0}{180}
lineto(0.5,0.5)
strokepath
end{picture}
}mspace{2mu}
}
DeclareRobustCommand{downsemicirclediam}{%
mspace{2mu}mathord{
sbox{0}{$scriptstyle O$}%
setlength{unitlength}{ht0}%
begin{picture}(1,1)
moveto(0.5,0.5)
circlearc{0.5}{0.5}{0.5}{180}{360}
lineto(0.5,0.5)
strokepath
end{picture}
}mspace{2mu}
}
DeclareRobustCommand{diam}{%
mspace{2mu}mathord{
sbox{0}{$scriptstyle O$}%
setlength{unitlength}{ht0}%
begin{picture}(1,1)
Line(0,0.5)(1,0.5)
end{picture}
}mspace{2mu}
}
begin{document}
$X_{fullcircleupsemicircledownsemicircleupsemicirclediamdownsemicirclediamdiam}$
end{document}
An enhanced version that can cope with the symbols at every level.
documentclass{article}
usepackage{amsmath}
usepackage{pict2e}
makeatletter
DeclareRobustCommand{fullcircle}{peter@symbolpeter@fullcircle}
DeclareRobustCommand{upsemicircle}{peter@symbolpeter@upsemicircle}
DeclareRobustCommand{downsemicircle}{peter@symbolpeter@downsemicircle}
DeclareRobustCommand{upsemicirclediam}{peter@symbolpeter@upsemicirclediam}
DeclareRobustCommand{downsemicirclediam}{peter@symbolpeter@downsemicirclediam}
DeclareRobustCommand{diam}{peter@symbolpeter@diam}
newcommand{peter@symbol}[1]{mathord{mspace{2mu}mathpalette#1relaxmspace{2mu}}}
newcommand{peter@unitlength}[1]{%
settoheight{unitlength}{$m@th#1O$}%
linethickness{fontdimen 8
ifx#1displaystyletextfontelse
ifx#1textstyletextfontelse
ifx#1scriptstylescriptfontelse
scriptscriptfontfififi 3
}%
}
newcommand{peter@fullcircle}[2]{%
begingroup
peter@unitlength{#1}%
begin{picture}(1,1)
circlearc[1]{0.5}{0.5}{0.5}{0}{360}
strokepath
end{picture}%
endgroup
}
newcommand{peter@upsemicircle}[2]{%
begingroup
peter@unitlength{#1}%
begin{picture}(1,1)
circlearc[1]{0.5}{0.5}{0.5}{0}{180}
strokepath
end{picture}%
endgroup
}
newcommand{peter@downsemicircle}[2]{%
begingroup
peter@unitlength{#1}%
begin{picture}(1,1)
circlearc[1]{0.5}{0.5}{0.5}{180}{360}
strokepath
end{picture}%
endgroup
}
newcommand{peter@upsemicirclediam}[2]{%
begingroup
peter@unitlength{#1}%
begin{picture}(1,1)
moveto(0.5,0.5)
circlearc{0.5}{0.5}{0.5}{0}{180}
lineto(0.5,0.5)
strokepath
end{picture}%
endgroup
}
newcommand{peter@downsemicirclediam}[2]{%
begingroup
peter@unitlength{#1}%
begin{picture}(1,1)
moveto(0.5,0.5)
circlearc{0.5}{0.5}{0.5}{180}{360}
lineto(0.5,0.5)
strokepath
end{picture}%
endgroup
}
newcommand{peter@diam}[2]{%
begingroup
peter@unitlength{#1}%
begin{picture}(1,1)
Line(0,0.5)(1,0.5)
end{picture}%
endgroup
}
begin{document}
$Xfullcircleupsemicircledownsemicircleupsemicirclediamdownsemicirclediamdiam$
$X_{fullcircleupsemicircledownsemicircleupsemicirclediamdownsemicirclediamdiam}$
$X_{X_{fullcircleupsemicircledownsemicircleupsemicirclediamdownsemicirclediamdiam}}$
end{document}
Picture mode!
documentclass{article}
usepackage{amsmath}
usepackage{pict2e}
DeclareRobustCommand{fullcircle}{%
mspace{2mu}mathord{
sbox{0}{$scriptstyle O$}%
setlength{unitlength}{ht0}%
begin{picture}(1,1)
put(0.5,0.5){arc{0.5}}
end{picture}
}mspace{2mu}
}
DeclareRobustCommand{upsemicircle}{%
mspace{2mu}mathord{
sbox{0}{$scriptstyle O$}%
setlength{unitlength}{ht0}%
begin{picture}(1,1)
put(0.5,0.5){arc[0,180]{0.5}}
end{picture}
}mspace{2mu}
}
DeclareRobustCommand{downsemicircle}{%
mspace{2mu}mathord{
sbox{0}{$scriptstyle O$}%
setlength{unitlength}{ht0}%
begin{picture}(1,1)
put(0.5,0.5){arc[180,360]{0.5}}
end{picture}
}mspace{2mu}
}
DeclareRobustCommand{upsemicirclediam}{%
mspace{2mu}mathord{
sbox{0}{$scriptstyle O$}%
setlength{unitlength}{ht0}%
begin{picture}(1,1)
moveto(0.5,0.5)
circlearc{0.5}{0.5}{0.5}{0}{180}
lineto(0.5,0.5)
strokepath
end{picture}
}mspace{2mu}
}
DeclareRobustCommand{downsemicirclediam}{%
mspace{2mu}mathord{
sbox{0}{$scriptstyle O$}%
setlength{unitlength}{ht0}%
begin{picture}(1,1)
moveto(0.5,0.5)
circlearc{0.5}{0.5}{0.5}{180}{360}
lineto(0.5,0.5)
strokepath
end{picture}
}mspace{2mu}
}
DeclareRobustCommand{diam}{%
mspace{2mu}mathord{
sbox{0}{$scriptstyle O$}%
setlength{unitlength}{ht0}%
begin{picture}(1,1)
Line(0,0.5)(1,0.5)
end{picture}
}mspace{2mu}
}
begin{document}
$X_{fullcircleupsemicircledownsemicircleupsemicirclediamdownsemicirclediamdiam}$
end{document}
An enhanced version that can cope with the symbols at every level.
documentclass{article}
usepackage{amsmath}
usepackage{pict2e}
makeatletter
DeclareRobustCommand{fullcircle}{peter@symbolpeter@fullcircle}
DeclareRobustCommand{upsemicircle}{peter@symbolpeter@upsemicircle}
DeclareRobustCommand{downsemicircle}{peter@symbolpeter@downsemicircle}
DeclareRobustCommand{upsemicirclediam}{peter@symbolpeter@upsemicirclediam}
DeclareRobustCommand{downsemicirclediam}{peter@symbolpeter@downsemicirclediam}
DeclareRobustCommand{diam}{peter@symbolpeter@diam}
newcommand{peter@symbol}[1]{mathord{mspace{2mu}mathpalette#1relaxmspace{2mu}}}
newcommand{peter@unitlength}[1]{%
settoheight{unitlength}{$m@th#1O$}%
linethickness{fontdimen 8
ifx#1displaystyletextfontelse
ifx#1textstyletextfontelse
ifx#1scriptstylescriptfontelse
scriptscriptfontfififi 3
}%
}
newcommand{peter@fullcircle}[2]{%
begingroup
peter@unitlength{#1}%
begin{picture}(1,1)
circlearc[1]{0.5}{0.5}{0.5}{0}{360}
strokepath
end{picture}%
endgroup
}
newcommand{peter@upsemicircle}[2]{%
begingroup
peter@unitlength{#1}%
begin{picture}(1,1)
circlearc[1]{0.5}{0.5}{0.5}{0}{180}
strokepath
end{picture}%
endgroup
}
newcommand{peter@downsemicircle}[2]{%
begingroup
peter@unitlength{#1}%
begin{picture}(1,1)
circlearc[1]{0.5}{0.5}{0.5}{180}{360}
strokepath
end{picture}%
endgroup
}
newcommand{peter@upsemicirclediam}[2]{%
begingroup
peter@unitlength{#1}%
begin{picture}(1,1)
moveto(0.5,0.5)
circlearc{0.5}{0.5}{0.5}{0}{180}
lineto(0.5,0.5)
strokepath
end{picture}%
endgroup
}
newcommand{peter@downsemicirclediam}[2]{%
begingroup
peter@unitlength{#1}%
begin{picture}(1,1)
moveto(0.5,0.5)
circlearc{0.5}{0.5}{0.5}{180}{360}
lineto(0.5,0.5)
strokepath
end{picture}%
endgroup
}
newcommand{peter@diam}[2]{%
begingroup
peter@unitlength{#1}%
begin{picture}(1,1)
Line(0,0.5)(1,0.5)
end{picture}%
endgroup
}
begin{document}
$Xfullcircleupsemicircledownsemicircleupsemicirclediamdownsemicirclediamdiam$
$X_{fullcircleupsemicircledownsemicircleupsemicirclediamdownsemicirclediamdiam}$
$X_{X_{fullcircleupsemicircledownsemicircleupsemicirclediamdownsemicirclediamdiam}}$
end{document}
edited Nov 21 at 10:20
answered Nov 20 at 15:06
egreg
702k8618703144
702k8618703144
add a comment |
add a comment |
up vote
7
down vote
TikZ in boxes! (Far inferior to picture mode unfortunately)
documentclass{article}
usepackage{tikz}
makeatletter
newcommandsetup@crazysubscripts[2]
{%
expandafternewsaveboxcsname crazysubscripts@#1endcsname
expandaftersboxcsname crazysubscripts@#1endcsname
{%
kern.1ex
begin{tikzpicture}
path[use as bounding box] circle[radius=.5ex];
#2%
end{tikzpicture}%
kern.1ex
}%
}
setup@crazysubscripts{fc}% fullcircle
{%
draw circle[radius=.5ex];%
}
setup@crazysubscripts{lo}% lower open
{%
draw (.5ex,0) arc[start angle=0, end angle=-180, radius=.5ex];%
}
setup@crazysubscripts{uo}% upper open
{%
draw (.5ex,0) arc[start angle=0, end angle=180, radius=.5ex];%
}
setup@crazysubscripts{lc}% lower closed
{%
draw (-.5ex,0) -- (.5ex,0) arc[start angle=0, end angle=-180, radius=.5ex]
--cycle;%
}
setup@crazysubscripts{uc}% upper closed
{%
draw (-.5ex,0) -- (.5ex,0) arc[start angle=0, end angle=180, radius=.5ex]
--cycle;%
}
setup@crazysubscripts{b}% boring line
{%
draw (-.5ex,0) -- (.5ex,0);%
}
newcommandcsubs[1]
{%
@ifundefined{crazysubscripts@#1}
{GenericError{}{Undefined crazysubscript `#1`}{}{}}%
{%
resizebox{.75ex}{!}
{expandafteruseboxcsname crazysubscripts@#1endcsname}%
}%
}
makeatother
begin{document}
$A_{csubs{fc}_{csubs{lo}_{csubs{lc}}}}$
csubs{fc}csubs{lo}csubs{uo}csubs{lc}csubs{uc}csubs{b}
end{document}
Could you elaborate how this is inferior to picture mode?
– Peter
Nov 20 at 15:34
@Peter because the other one is picture mode!
– Skillmon
Nov 20 at 15:43
2
@Peter no honestly, it's just a joke.
– Skillmon
Nov 20 at 15:44
add a comment |
up vote
7
down vote
TikZ in boxes! (Far inferior to picture mode unfortunately)
documentclass{article}
usepackage{tikz}
makeatletter
newcommandsetup@crazysubscripts[2]
{%
expandafternewsaveboxcsname crazysubscripts@#1endcsname
expandaftersboxcsname crazysubscripts@#1endcsname
{%
kern.1ex
begin{tikzpicture}
path[use as bounding box] circle[radius=.5ex];
#2%
end{tikzpicture}%
kern.1ex
}%
}
setup@crazysubscripts{fc}% fullcircle
{%
draw circle[radius=.5ex];%
}
setup@crazysubscripts{lo}% lower open
{%
draw (.5ex,0) arc[start angle=0, end angle=-180, radius=.5ex];%
}
setup@crazysubscripts{uo}% upper open
{%
draw (.5ex,0) arc[start angle=0, end angle=180, radius=.5ex];%
}
setup@crazysubscripts{lc}% lower closed
{%
draw (-.5ex,0) -- (.5ex,0) arc[start angle=0, end angle=-180, radius=.5ex]
--cycle;%
}
setup@crazysubscripts{uc}% upper closed
{%
draw (-.5ex,0) -- (.5ex,0) arc[start angle=0, end angle=180, radius=.5ex]
--cycle;%
}
setup@crazysubscripts{b}% boring line
{%
draw (-.5ex,0) -- (.5ex,0);%
}
newcommandcsubs[1]
{%
@ifundefined{crazysubscripts@#1}
{GenericError{}{Undefined crazysubscript `#1`}{}{}}%
{%
resizebox{.75ex}{!}
{expandafteruseboxcsname crazysubscripts@#1endcsname}%
}%
}
makeatother
begin{document}
$A_{csubs{fc}_{csubs{lo}_{csubs{lc}}}}$
csubs{fc}csubs{lo}csubs{uo}csubs{lc}csubs{uc}csubs{b}
end{document}
Could you elaborate how this is inferior to picture mode?
– Peter
Nov 20 at 15:34
@Peter because the other one is picture mode!
– Skillmon
Nov 20 at 15:43
2
@Peter no honestly, it's just a joke.
– Skillmon
Nov 20 at 15:44
add a comment |
up vote
7
down vote
up vote
7
down vote
TikZ in boxes! (Far inferior to picture mode unfortunately)
documentclass{article}
usepackage{tikz}
makeatletter
newcommandsetup@crazysubscripts[2]
{%
expandafternewsaveboxcsname crazysubscripts@#1endcsname
expandaftersboxcsname crazysubscripts@#1endcsname
{%
kern.1ex
begin{tikzpicture}
path[use as bounding box] circle[radius=.5ex];
#2%
end{tikzpicture}%
kern.1ex
}%
}
setup@crazysubscripts{fc}% fullcircle
{%
draw circle[radius=.5ex];%
}
setup@crazysubscripts{lo}% lower open
{%
draw (.5ex,0) arc[start angle=0, end angle=-180, radius=.5ex];%
}
setup@crazysubscripts{uo}% upper open
{%
draw (.5ex,0) arc[start angle=0, end angle=180, radius=.5ex];%
}
setup@crazysubscripts{lc}% lower closed
{%
draw (-.5ex,0) -- (.5ex,0) arc[start angle=0, end angle=-180, radius=.5ex]
--cycle;%
}
setup@crazysubscripts{uc}% upper closed
{%
draw (-.5ex,0) -- (.5ex,0) arc[start angle=0, end angle=180, radius=.5ex]
--cycle;%
}
setup@crazysubscripts{b}% boring line
{%
draw (-.5ex,0) -- (.5ex,0);%
}
newcommandcsubs[1]
{%
@ifundefined{crazysubscripts@#1}
{GenericError{}{Undefined crazysubscript `#1`}{}{}}%
{%
resizebox{.75ex}{!}
{expandafteruseboxcsname crazysubscripts@#1endcsname}%
}%
}
makeatother
begin{document}
$A_{csubs{fc}_{csubs{lo}_{csubs{lc}}}}$
csubs{fc}csubs{lo}csubs{uo}csubs{lc}csubs{uc}csubs{b}
end{document}
TikZ in boxes! (Far inferior to picture mode unfortunately)
documentclass{article}
usepackage{tikz}
makeatletter
newcommandsetup@crazysubscripts[2]
{%
expandafternewsaveboxcsname crazysubscripts@#1endcsname
expandaftersboxcsname crazysubscripts@#1endcsname
{%
kern.1ex
begin{tikzpicture}
path[use as bounding box] circle[radius=.5ex];
#2%
end{tikzpicture}%
kern.1ex
}%
}
setup@crazysubscripts{fc}% fullcircle
{%
draw circle[radius=.5ex];%
}
setup@crazysubscripts{lo}% lower open
{%
draw (.5ex,0) arc[start angle=0, end angle=-180, radius=.5ex];%
}
setup@crazysubscripts{uo}% upper open
{%
draw (.5ex,0) arc[start angle=0, end angle=180, radius=.5ex];%
}
setup@crazysubscripts{lc}% lower closed
{%
draw (-.5ex,0) -- (.5ex,0) arc[start angle=0, end angle=-180, radius=.5ex]
--cycle;%
}
setup@crazysubscripts{uc}% upper closed
{%
draw (-.5ex,0) -- (.5ex,0) arc[start angle=0, end angle=180, radius=.5ex]
--cycle;%
}
setup@crazysubscripts{b}% boring line
{%
draw (-.5ex,0) -- (.5ex,0);%
}
newcommandcsubs[1]
{%
@ifundefined{crazysubscripts@#1}
{GenericError{}{Undefined crazysubscript `#1`}{}{}}%
{%
resizebox{.75ex}{!}
{expandafteruseboxcsname crazysubscripts@#1endcsname}%
}%
}
makeatother
begin{document}
$A_{csubs{fc}_{csubs{lo}_{csubs{lc}}}}$
csubs{fc}csubs{lo}csubs{uo}csubs{lc}csubs{uc}csubs{b}
end{document}
edited Nov 20 at 15:16
answered Nov 20 at 15:10
Skillmon
20.6k11941
20.6k11941
Could you elaborate how this is inferior to picture mode?
– Peter
Nov 20 at 15:34
@Peter because the other one is picture mode!
– Skillmon
Nov 20 at 15:43
2
@Peter no honestly, it's just a joke.
– Skillmon
Nov 20 at 15:44
add a comment |
Could you elaborate how this is inferior to picture mode?
– Peter
Nov 20 at 15:34
@Peter because the other one is picture mode!
– Skillmon
Nov 20 at 15:43
2
@Peter no honestly, it's just a joke.
– Skillmon
Nov 20 at 15:44
Could you elaborate how this is inferior to picture mode?
– Peter
Nov 20 at 15:34
Could you elaborate how this is inferior to picture mode?
– Peter
Nov 20 at 15:34
@Peter because the other one is picture mode!
– Skillmon
Nov 20 at 15:43
@Peter because the other one is picture mode!
– Skillmon
Nov 20 at 15:43
2
2
@Peter no honestly, it's just a joke.
– Skillmon
Nov 20 at 15:44
@Peter no honestly, it's just a joke.
– Skillmon
Nov 20 at 15:44
add a comment |
up vote
3
down vote
Just a template.
documentclass[preview,border=12pt,varwidth,12pt]{standalone}
usepackage{tikz}
defalex{tikz draw (0,0) circle (2pt);}
defbobby{tikz draw (0,0) -- (3pt,0) -- (3pt,2pt) -- cycle;}
begin{document}
This is an equation $F_{alex}^{bobby}+1$.
end{document}
add a comment |
up vote
3
down vote
Just a template.
documentclass[preview,border=12pt,varwidth,12pt]{standalone}
usepackage{tikz}
defalex{tikz draw (0,0) circle (2pt);}
defbobby{tikz draw (0,0) -- (3pt,0) -- (3pt,2pt) -- cycle;}
begin{document}
This is an equation $F_{alex}^{bobby}+1$.
end{document}
add a comment |
up vote
3
down vote
up vote
3
down vote
Just a template.
documentclass[preview,border=12pt,varwidth,12pt]{standalone}
usepackage{tikz}
defalex{tikz draw (0,0) circle (2pt);}
defbobby{tikz draw (0,0) -- (3pt,0) -- (3pt,2pt) -- cycle;}
begin{document}
This is an equation $F_{alex}^{bobby}+1$.
end{document}
Just a template.
documentclass[preview,border=12pt,varwidth,12pt]{standalone}
usepackage{tikz}
defalex{tikz draw (0,0) circle (2pt);}
defbobby{tikz draw (0,0) -- (3pt,0) -- (3pt,2pt) -- cycle;}
begin{document}
This is an equation $F_{alex}^{bobby}+1$.
end{document}
answered Nov 20 at 14:48
Artificial Stupidity
4,31611037
4,31611037
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%2f460959%2fa-macro-that-draws-a-half-disk-for-use-in-mathmode%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
Maybe you find some here: ctan.org/pkg/wasysym or www.ctan.org/pkg/stix
– Sigur
Nov 20 at 14:44
Thanks! That package has the commands Leftcircle and Rightcircle, I'll try to figure out how to rotate those. Still missing the ones with just the arc, though.
– Peter
Nov 20 at 14:46
1
Check here also: mirrors.ctan.org/info/symbols/comprehensive/symbols-a4.pdf
– Sigur
Nov 20 at 14:50
Also, if using
unicode-math
: mirrors.ctan.org/macros/latex/contrib/unicode-math/…– Davislor
Nov 21 at 3:34
1
A few of those symbols are in Unicode, ◯ is U+25EF, ◠ is U+25E0 and ◡ is U+25E1.
unicode-math
and some other packages give these the aliaseslgwhtcircle
,topsemicircle
andbotsemicircle
, respectively. There are several horizontal dashes. The other two symbols do not seem to be.– Davislor
Nov 21 at 3:43