Math Saturation Symbol
I'm searching for a math symbol that shows saturation. It looks like a slash with a horizontal line at each end.
I found a question about drawing it in a node: Saturation block
But I want to use it as a subscript in math mode.
math-mode symbols
New contributor
add a comment |
I'm searching for a math symbol that shows saturation. It looks like a slash with a horizontal line at each end.
I found a question about drawing it in a node: Saturation block
But I want to use it as a subscript in math mode.
math-mode symbols
New contributor
add a comment |
I'm searching for a math symbol that shows saturation. It looks like a slash with a horizontal line at each end.
I found a question about drawing it in a node: Saturation block
But I want to use it as a subscript in math mode.
math-mode symbols
New contributor
I'm searching for a math symbol that shows saturation. It looks like a slash with a horizontal line at each end.
I found a question about drawing it in a node: Saturation block
But I want to use it as a subscript in math mode.
math-mode symbols
math-mode symbols
New contributor
New contributor
New contributor
asked 6 hours ago
KanieeKaniee
182
182
New contributor
New contributor
add a comment |
add a comment |
3 Answers
3
active
oldest
votes
I'm not sure if this is what you want, but you can design your own symbol without tikz
. Use mathchoice
to allow for use as a subscript or subsubscript.
Here is the code:
documentclass{article}
usepackage{calc} % needed to subtract from hght
newlength{wdth}
newlength{hght}
newlength{dpth}
newcommand{sat}{mathchoice%
{settowidth{wdth}{/}settoheight{hght}{/}settodepth{dpth}{/}%
rule[-dpth]{.25em}{.09ex}hspace{-.13wdth}/%
hspace{-.15wdth}rule[hght-.09ex]{.25em}{.09ex}}
{settowidth{wdth}{/}settoheight{hght}{/}settodepth{dpth}{/}%
rule[-dpth]{.25em}{.09ex}hspace{-.15wdth}/%
hspace{-.15wdth}rule[hght-.09ex]{.25em}{.09ex}}
{settowidth{wdth}{$scriptstyle /$}settoheight{hght}{$scriptstyle /$}settodepth{dpth}{$scriptstyle /$}%
rule[-dpth]{.2em}{.08ex}hspace{-.17wdth}scriptstyle /%
hspace{-.17wdth}rule[hght-.08ex]{.2em}{.08ex}}
{settowidth{wdth}{$scriptstyle /$}settoheight{hght}{$scriptscriptstyle /$}settodepth{dpth}{$scriptscriptstyle /$}%
rule[-dpth]{.15em}{.07ex}hspace{-.19wdth}scriptscriptstyle /%
hspace{-.19wdth}rule[hght-.07ex]{.15em}{.07ex}}
}
begin{document}
$Asat B_{Asat B_{Asat B}}$
end{document}
If you want longer or shorter tails you can adjust the lengths in the rule
parameters. The .25em
(or .2em
for subscript, .18em
for subsubscript) controls the length.
Thanks, yes that is exactly what I was looking for!
– Kaniee
5 hours ago
add a comment |
First create a standalone
version of your icon, here in saturation.tex
:
documentclass[border=0mm]{standalone}
usepackage{tikz}
usetikzlibrary{positioning}
makeatletter
pgfdeclareshape{record}{
inheritsavedanchors[from={rectangle}]
inheritbackgroundpath[from={rectangle}]
inheritanchorborder[from={rectangle}]
foreach x in {center,north east,north west,north,south,south east,south west}{
inheritanchor[from={rectangle}]{x}
}
foregroundpath{
pgfpointdiff{northeast}{southwest}
pgf@xa=pgf@x pgf@ya=pgf@y
northeast
pgfpathmoveto{pgfpoint{0}{0.33pgf@ya}}
pgfpathlineto{pgfpoint{0}{-0.33pgf@ya}}
pgfpathmoveto{pgfpoint{0.33pgf@xa}{0}}
pgfpathlineto{pgfpoint{-0.33pgf@xa}{0}}
pgfpathmoveto{pgfpointadd{southwest}{pgfpoint{-0.33pgf@xa}{-0.6pgf@ya}}}
pgfpathlineto{pgfpointadd{southwest}{pgfpoint{-0.5pgf@xa}{-0.6pgf@ya}}}
pgfpathlineto{pgfpointadd{northeast}{pgfpoint{-0.5pgf@xa}{-0.6pgf@ya}}}
pgfpathlineto{pgfpointadd{northeast}{pgfpoint{-0.33pgf@xa}{-0.6pgf@ya}}}
}
}
makeatother
begin{document}
begin{tikzpicture}
node[record,minimum size=1cm,fill=blue!30,draw] (a) {};
end{tikzpicture}
end{document}
Then, use this code to include it as the height of the local value of 1ex
, with a little horizontal gap on each side. This code will adjust to the current font size (so no problem if you go Huge
) as well as to the current math style (scriptstyle
and scriptscriptstyle
):
documentclass{article}
usepackage{scalerel,graphicx}
newcommandsat{ThisStyle{%
kern.5LMptincludegraphics[height=1LMex]{saturation}kern.5LMpt}}
begin{document}
centering
Here is sat.
In math, $A_{sat}$
[
A_{sat_{sat}}
]
end{document}
Obviously, you can change the size by adjusting 1LMex
to something different. You can adjust the gap by adjusting the .5LMpt
to something different, and you can change the color and line thickness in the original tikz
code.
For example, by changing the color at saturation.tex
to gray!5
and adding a thick
specification to the draw, one gets this:
That carries over directly into the main document, where I have changed the height specification to 1.3LMex
, to arrive at:
SUPPLEMENT
To help the OP with a follow up request to eliminate the border and axes, replace saturation.tex
with this:
documentclass[border=0mm]{standalone}
usepackage{tikz}
begin{document}
begin{tikzpicture}
coordinate (A) at (-.5,-.4);
coordinate (B) at (-.3,-.4);
coordinate (C) at (+.3,+.4);
coordinate (D) at (+.5,+.4);
draw [black, thick] (A)--(B)--(C)--(D);
end{tikzpicture}
end{document}
Then, with the document code definition that
newcommandsat{ThisStyle{%
kern.5LMptincludegraphics[height=1.3LMex]{saturation}kern.5LMpt}}
we arrive at
documentclass{article}
usepackage{scalerel,graphicx}
newcommandsat{ThisStyle{%
kern.5LMptincludegraphics[height=1.3LMex]{saturation}kern.5LMpt}}
begin{document}
centering
Here is sat.
In math, $A_{sat}$
[
A_{sat_{sat}}
]
Huge
[
A_{sat_{sat}}
]
end{document}
Thank you for your answer, that is awesome. This is almost what I was looking for, except that I don't need the frame and the axes. Only the diagonal line with the two horizontal lines. I don't have much experience with tikz, what do I need to change for that? Is there really no math symbol for that?
– Kaniee
5 hours ago
@Kaniee See my supplement code.
– Steven B. Segletes
5 hours ago
add a comment |
With picture
mode:
documentclass{article}
usepackage{amsmath}
usepackage{pict2e}
makeatletter
DeclareRobustCommand{saturation}{%
mathrel{%
mkern1munonscriptmkern-1mu
mathpalettesatur@tionrelax
mkern1munonscriptmkern-1mu
}%
}
newcommand{satur@tion}[2]{%
vcenter{hbox{%
sboxz@{$m@th#1|$}%
setlength{unitlength}{dimexprhtz@+dpz@}%
saturation@linethickness{#1}%
begin{picture}(0.6,1)
roundcap
polyline(0,0)(0.2,0)(0.4,1)(0.6,1)
end{picture}%
}}%
}
newcommand{saturation@linethickness}[1]{%
linethickness{%
1.25fontdimen8
ifx#1displaystyletextfontelse
ifx#1textstyletextfontelse
ifx#1scriptstylescriptfontelse
scriptscriptfontfififi 3
}%
}
makeatother
begin{document}
$Asaturation B_{Asaturation B_{Asaturation B}}$
end{document}
The command saturation@linethickess
is an old trick of mine, see https://tex.stackexchange.com/a/412159/4427
I chose to make the symbol the same vertical size as |
; the width is 60% of the height and the three parts have equal width. Feel free to change the proportions. You can get it wider with
newcommand{satur@tion}[2]{%
vcenter{hbox{%
sboxz@{$m@th#1|$}%
setlength{unitlength}{dimexprhtz@+dpz@}%
saturation@linethickness{#1}%
begin{picture}(0.8,1)
roundcap
polyline(0,0)(0.2,0)(0.6,1)(0.8,1)
end{picture}%
}}%
}
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
});
}
});
Kaniee is a new contributor. Be nice, and check out our Code of Conduct.
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%2f477182%2fmath-saturation-symbol%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
I'm not sure if this is what you want, but you can design your own symbol without tikz
. Use mathchoice
to allow for use as a subscript or subsubscript.
Here is the code:
documentclass{article}
usepackage{calc} % needed to subtract from hght
newlength{wdth}
newlength{hght}
newlength{dpth}
newcommand{sat}{mathchoice%
{settowidth{wdth}{/}settoheight{hght}{/}settodepth{dpth}{/}%
rule[-dpth]{.25em}{.09ex}hspace{-.13wdth}/%
hspace{-.15wdth}rule[hght-.09ex]{.25em}{.09ex}}
{settowidth{wdth}{/}settoheight{hght}{/}settodepth{dpth}{/}%
rule[-dpth]{.25em}{.09ex}hspace{-.15wdth}/%
hspace{-.15wdth}rule[hght-.09ex]{.25em}{.09ex}}
{settowidth{wdth}{$scriptstyle /$}settoheight{hght}{$scriptstyle /$}settodepth{dpth}{$scriptstyle /$}%
rule[-dpth]{.2em}{.08ex}hspace{-.17wdth}scriptstyle /%
hspace{-.17wdth}rule[hght-.08ex]{.2em}{.08ex}}
{settowidth{wdth}{$scriptstyle /$}settoheight{hght}{$scriptscriptstyle /$}settodepth{dpth}{$scriptscriptstyle /$}%
rule[-dpth]{.15em}{.07ex}hspace{-.19wdth}scriptscriptstyle /%
hspace{-.19wdth}rule[hght-.07ex]{.15em}{.07ex}}
}
begin{document}
$Asat B_{Asat B_{Asat B}}$
end{document}
If you want longer or shorter tails you can adjust the lengths in the rule
parameters. The .25em
(or .2em
for subscript, .18em
for subsubscript) controls the length.
Thanks, yes that is exactly what I was looking for!
– Kaniee
5 hours ago
add a comment |
I'm not sure if this is what you want, but you can design your own symbol without tikz
. Use mathchoice
to allow for use as a subscript or subsubscript.
Here is the code:
documentclass{article}
usepackage{calc} % needed to subtract from hght
newlength{wdth}
newlength{hght}
newlength{dpth}
newcommand{sat}{mathchoice%
{settowidth{wdth}{/}settoheight{hght}{/}settodepth{dpth}{/}%
rule[-dpth]{.25em}{.09ex}hspace{-.13wdth}/%
hspace{-.15wdth}rule[hght-.09ex]{.25em}{.09ex}}
{settowidth{wdth}{/}settoheight{hght}{/}settodepth{dpth}{/}%
rule[-dpth]{.25em}{.09ex}hspace{-.15wdth}/%
hspace{-.15wdth}rule[hght-.09ex]{.25em}{.09ex}}
{settowidth{wdth}{$scriptstyle /$}settoheight{hght}{$scriptstyle /$}settodepth{dpth}{$scriptstyle /$}%
rule[-dpth]{.2em}{.08ex}hspace{-.17wdth}scriptstyle /%
hspace{-.17wdth}rule[hght-.08ex]{.2em}{.08ex}}
{settowidth{wdth}{$scriptstyle /$}settoheight{hght}{$scriptscriptstyle /$}settodepth{dpth}{$scriptscriptstyle /$}%
rule[-dpth]{.15em}{.07ex}hspace{-.19wdth}scriptscriptstyle /%
hspace{-.19wdth}rule[hght-.07ex]{.15em}{.07ex}}
}
begin{document}
$Asat B_{Asat B_{Asat B}}$
end{document}
If you want longer or shorter tails you can adjust the lengths in the rule
parameters. The .25em
(or .2em
for subscript, .18em
for subsubscript) controls the length.
Thanks, yes that is exactly what I was looking for!
– Kaniee
5 hours ago
add a comment |
I'm not sure if this is what you want, but you can design your own symbol without tikz
. Use mathchoice
to allow for use as a subscript or subsubscript.
Here is the code:
documentclass{article}
usepackage{calc} % needed to subtract from hght
newlength{wdth}
newlength{hght}
newlength{dpth}
newcommand{sat}{mathchoice%
{settowidth{wdth}{/}settoheight{hght}{/}settodepth{dpth}{/}%
rule[-dpth]{.25em}{.09ex}hspace{-.13wdth}/%
hspace{-.15wdth}rule[hght-.09ex]{.25em}{.09ex}}
{settowidth{wdth}{/}settoheight{hght}{/}settodepth{dpth}{/}%
rule[-dpth]{.25em}{.09ex}hspace{-.15wdth}/%
hspace{-.15wdth}rule[hght-.09ex]{.25em}{.09ex}}
{settowidth{wdth}{$scriptstyle /$}settoheight{hght}{$scriptstyle /$}settodepth{dpth}{$scriptstyle /$}%
rule[-dpth]{.2em}{.08ex}hspace{-.17wdth}scriptstyle /%
hspace{-.17wdth}rule[hght-.08ex]{.2em}{.08ex}}
{settowidth{wdth}{$scriptstyle /$}settoheight{hght}{$scriptscriptstyle /$}settodepth{dpth}{$scriptscriptstyle /$}%
rule[-dpth]{.15em}{.07ex}hspace{-.19wdth}scriptscriptstyle /%
hspace{-.19wdth}rule[hght-.07ex]{.15em}{.07ex}}
}
begin{document}
$Asat B_{Asat B_{Asat B}}$
end{document}
If you want longer or shorter tails you can adjust the lengths in the rule
parameters. The .25em
(or .2em
for subscript, .18em
for subsubscript) controls the length.
I'm not sure if this is what you want, but you can design your own symbol without tikz
. Use mathchoice
to allow for use as a subscript or subsubscript.
Here is the code:
documentclass{article}
usepackage{calc} % needed to subtract from hght
newlength{wdth}
newlength{hght}
newlength{dpth}
newcommand{sat}{mathchoice%
{settowidth{wdth}{/}settoheight{hght}{/}settodepth{dpth}{/}%
rule[-dpth]{.25em}{.09ex}hspace{-.13wdth}/%
hspace{-.15wdth}rule[hght-.09ex]{.25em}{.09ex}}
{settowidth{wdth}{/}settoheight{hght}{/}settodepth{dpth}{/}%
rule[-dpth]{.25em}{.09ex}hspace{-.15wdth}/%
hspace{-.15wdth}rule[hght-.09ex]{.25em}{.09ex}}
{settowidth{wdth}{$scriptstyle /$}settoheight{hght}{$scriptstyle /$}settodepth{dpth}{$scriptstyle /$}%
rule[-dpth]{.2em}{.08ex}hspace{-.17wdth}scriptstyle /%
hspace{-.17wdth}rule[hght-.08ex]{.2em}{.08ex}}
{settowidth{wdth}{$scriptstyle /$}settoheight{hght}{$scriptscriptstyle /$}settodepth{dpth}{$scriptscriptstyle /$}%
rule[-dpth]{.15em}{.07ex}hspace{-.19wdth}scriptscriptstyle /%
hspace{-.19wdth}rule[hght-.07ex]{.15em}{.07ex}}
}
begin{document}
$Asat B_{Asat B_{Asat B}}$
end{document}
If you want longer or shorter tails you can adjust the lengths in the rule
parameters. The .25em
(or .2em
for subscript, .18em
for subsubscript) controls the length.
answered 5 hours ago
Sandy GSandy G
2,5621321
2,5621321
Thanks, yes that is exactly what I was looking for!
– Kaniee
5 hours ago
add a comment |
Thanks, yes that is exactly what I was looking for!
– Kaniee
5 hours ago
Thanks, yes that is exactly what I was looking for!
– Kaniee
5 hours ago
Thanks, yes that is exactly what I was looking for!
– Kaniee
5 hours ago
add a comment |
First create a standalone
version of your icon, here in saturation.tex
:
documentclass[border=0mm]{standalone}
usepackage{tikz}
usetikzlibrary{positioning}
makeatletter
pgfdeclareshape{record}{
inheritsavedanchors[from={rectangle}]
inheritbackgroundpath[from={rectangle}]
inheritanchorborder[from={rectangle}]
foreach x in {center,north east,north west,north,south,south east,south west}{
inheritanchor[from={rectangle}]{x}
}
foregroundpath{
pgfpointdiff{northeast}{southwest}
pgf@xa=pgf@x pgf@ya=pgf@y
northeast
pgfpathmoveto{pgfpoint{0}{0.33pgf@ya}}
pgfpathlineto{pgfpoint{0}{-0.33pgf@ya}}
pgfpathmoveto{pgfpoint{0.33pgf@xa}{0}}
pgfpathlineto{pgfpoint{-0.33pgf@xa}{0}}
pgfpathmoveto{pgfpointadd{southwest}{pgfpoint{-0.33pgf@xa}{-0.6pgf@ya}}}
pgfpathlineto{pgfpointadd{southwest}{pgfpoint{-0.5pgf@xa}{-0.6pgf@ya}}}
pgfpathlineto{pgfpointadd{northeast}{pgfpoint{-0.5pgf@xa}{-0.6pgf@ya}}}
pgfpathlineto{pgfpointadd{northeast}{pgfpoint{-0.33pgf@xa}{-0.6pgf@ya}}}
}
}
makeatother
begin{document}
begin{tikzpicture}
node[record,minimum size=1cm,fill=blue!30,draw] (a) {};
end{tikzpicture}
end{document}
Then, use this code to include it as the height of the local value of 1ex
, with a little horizontal gap on each side. This code will adjust to the current font size (so no problem if you go Huge
) as well as to the current math style (scriptstyle
and scriptscriptstyle
):
documentclass{article}
usepackage{scalerel,graphicx}
newcommandsat{ThisStyle{%
kern.5LMptincludegraphics[height=1LMex]{saturation}kern.5LMpt}}
begin{document}
centering
Here is sat.
In math, $A_{sat}$
[
A_{sat_{sat}}
]
end{document}
Obviously, you can change the size by adjusting 1LMex
to something different. You can adjust the gap by adjusting the .5LMpt
to something different, and you can change the color and line thickness in the original tikz
code.
For example, by changing the color at saturation.tex
to gray!5
and adding a thick
specification to the draw, one gets this:
That carries over directly into the main document, where I have changed the height specification to 1.3LMex
, to arrive at:
SUPPLEMENT
To help the OP with a follow up request to eliminate the border and axes, replace saturation.tex
with this:
documentclass[border=0mm]{standalone}
usepackage{tikz}
begin{document}
begin{tikzpicture}
coordinate (A) at (-.5,-.4);
coordinate (B) at (-.3,-.4);
coordinate (C) at (+.3,+.4);
coordinate (D) at (+.5,+.4);
draw [black, thick] (A)--(B)--(C)--(D);
end{tikzpicture}
end{document}
Then, with the document code definition that
newcommandsat{ThisStyle{%
kern.5LMptincludegraphics[height=1.3LMex]{saturation}kern.5LMpt}}
we arrive at
documentclass{article}
usepackage{scalerel,graphicx}
newcommandsat{ThisStyle{%
kern.5LMptincludegraphics[height=1.3LMex]{saturation}kern.5LMpt}}
begin{document}
centering
Here is sat.
In math, $A_{sat}$
[
A_{sat_{sat}}
]
Huge
[
A_{sat_{sat}}
]
end{document}
Thank you for your answer, that is awesome. This is almost what I was looking for, except that I don't need the frame and the axes. Only the diagonal line with the two horizontal lines. I don't have much experience with tikz, what do I need to change for that? Is there really no math symbol for that?
– Kaniee
5 hours ago
@Kaniee See my supplement code.
– Steven B. Segletes
5 hours ago
add a comment |
First create a standalone
version of your icon, here in saturation.tex
:
documentclass[border=0mm]{standalone}
usepackage{tikz}
usetikzlibrary{positioning}
makeatletter
pgfdeclareshape{record}{
inheritsavedanchors[from={rectangle}]
inheritbackgroundpath[from={rectangle}]
inheritanchorborder[from={rectangle}]
foreach x in {center,north east,north west,north,south,south east,south west}{
inheritanchor[from={rectangle}]{x}
}
foregroundpath{
pgfpointdiff{northeast}{southwest}
pgf@xa=pgf@x pgf@ya=pgf@y
northeast
pgfpathmoveto{pgfpoint{0}{0.33pgf@ya}}
pgfpathlineto{pgfpoint{0}{-0.33pgf@ya}}
pgfpathmoveto{pgfpoint{0.33pgf@xa}{0}}
pgfpathlineto{pgfpoint{-0.33pgf@xa}{0}}
pgfpathmoveto{pgfpointadd{southwest}{pgfpoint{-0.33pgf@xa}{-0.6pgf@ya}}}
pgfpathlineto{pgfpointadd{southwest}{pgfpoint{-0.5pgf@xa}{-0.6pgf@ya}}}
pgfpathlineto{pgfpointadd{northeast}{pgfpoint{-0.5pgf@xa}{-0.6pgf@ya}}}
pgfpathlineto{pgfpointadd{northeast}{pgfpoint{-0.33pgf@xa}{-0.6pgf@ya}}}
}
}
makeatother
begin{document}
begin{tikzpicture}
node[record,minimum size=1cm,fill=blue!30,draw] (a) {};
end{tikzpicture}
end{document}
Then, use this code to include it as the height of the local value of 1ex
, with a little horizontal gap on each side. This code will adjust to the current font size (so no problem if you go Huge
) as well as to the current math style (scriptstyle
and scriptscriptstyle
):
documentclass{article}
usepackage{scalerel,graphicx}
newcommandsat{ThisStyle{%
kern.5LMptincludegraphics[height=1LMex]{saturation}kern.5LMpt}}
begin{document}
centering
Here is sat.
In math, $A_{sat}$
[
A_{sat_{sat}}
]
end{document}
Obviously, you can change the size by adjusting 1LMex
to something different. You can adjust the gap by adjusting the .5LMpt
to something different, and you can change the color and line thickness in the original tikz
code.
For example, by changing the color at saturation.tex
to gray!5
and adding a thick
specification to the draw, one gets this:
That carries over directly into the main document, where I have changed the height specification to 1.3LMex
, to arrive at:
SUPPLEMENT
To help the OP with a follow up request to eliminate the border and axes, replace saturation.tex
with this:
documentclass[border=0mm]{standalone}
usepackage{tikz}
begin{document}
begin{tikzpicture}
coordinate (A) at (-.5,-.4);
coordinate (B) at (-.3,-.4);
coordinate (C) at (+.3,+.4);
coordinate (D) at (+.5,+.4);
draw [black, thick] (A)--(B)--(C)--(D);
end{tikzpicture}
end{document}
Then, with the document code definition that
newcommandsat{ThisStyle{%
kern.5LMptincludegraphics[height=1.3LMex]{saturation}kern.5LMpt}}
we arrive at
documentclass{article}
usepackage{scalerel,graphicx}
newcommandsat{ThisStyle{%
kern.5LMptincludegraphics[height=1.3LMex]{saturation}kern.5LMpt}}
begin{document}
centering
Here is sat.
In math, $A_{sat}$
[
A_{sat_{sat}}
]
Huge
[
A_{sat_{sat}}
]
end{document}
Thank you for your answer, that is awesome. This is almost what I was looking for, except that I don't need the frame and the axes. Only the diagonal line with the two horizontal lines. I don't have much experience with tikz, what do I need to change for that? Is there really no math symbol for that?
– Kaniee
5 hours ago
@Kaniee See my supplement code.
– Steven B. Segletes
5 hours ago
add a comment |
First create a standalone
version of your icon, here in saturation.tex
:
documentclass[border=0mm]{standalone}
usepackage{tikz}
usetikzlibrary{positioning}
makeatletter
pgfdeclareshape{record}{
inheritsavedanchors[from={rectangle}]
inheritbackgroundpath[from={rectangle}]
inheritanchorborder[from={rectangle}]
foreach x in {center,north east,north west,north,south,south east,south west}{
inheritanchor[from={rectangle}]{x}
}
foregroundpath{
pgfpointdiff{northeast}{southwest}
pgf@xa=pgf@x pgf@ya=pgf@y
northeast
pgfpathmoveto{pgfpoint{0}{0.33pgf@ya}}
pgfpathlineto{pgfpoint{0}{-0.33pgf@ya}}
pgfpathmoveto{pgfpoint{0.33pgf@xa}{0}}
pgfpathlineto{pgfpoint{-0.33pgf@xa}{0}}
pgfpathmoveto{pgfpointadd{southwest}{pgfpoint{-0.33pgf@xa}{-0.6pgf@ya}}}
pgfpathlineto{pgfpointadd{southwest}{pgfpoint{-0.5pgf@xa}{-0.6pgf@ya}}}
pgfpathlineto{pgfpointadd{northeast}{pgfpoint{-0.5pgf@xa}{-0.6pgf@ya}}}
pgfpathlineto{pgfpointadd{northeast}{pgfpoint{-0.33pgf@xa}{-0.6pgf@ya}}}
}
}
makeatother
begin{document}
begin{tikzpicture}
node[record,minimum size=1cm,fill=blue!30,draw] (a) {};
end{tikzpicture}
end{document}
Then, use this code to include it as the height of the local value of 1ex
, with a little horizontal gap on each side. This code will adjust to the current font size (so no problem if you go Huge
) as well as to the current math style (scriptstyle
and scriptscriptstyle
):
documentclass{article}
usepackage{scalerel,graphicx}
newcommandsat{ThisStyle{%
kern.5LMptincludegraphics[height=1LMex]{saturation}kern.5LMpt}}
begin{document}
centering
Here is sat.
In math, $A_{sat}$
[
A_{sat_{sat}}
]
end{document}
Obviously, you can change the size by adjusting 1LMex
to something different. You can adjust the gap by adjusting the .5LMpt
to something different, and you can change the color and line thickness in the original tikz
code.
For example, by changing the color at saturation.tex
to gray!5
and adding a thick
specification to the draw, one gets this:
That carries over directly into the main document, where I have changed the height specification to 1.3LMex
, to arrive at:
SUPPLEMENT
To help the OP with a follow up request to eliminate the border and axes, replace saturation.tex
with this:
documentclass[border=0mm]{standalone}
usepackage{tikz}
begin{document}
begin{tikzpicture}
coordinate (A) at (-.5,-.4);
coordinate (B) at (-.3,-.4);
coordinate (C) at (+.3,+.4);
coordinate (D) at (+.5,+.4);
draw [black, thick] (A)--(B)--(C)--(D);
end{tikzpicture}
end{document}
Then, with the document code definition that
newcommandsat{ThisStyle{%
kern.5LMptincludegraphics[height=1.3LMex]{saturation}kern.5LMpt}}
we arrive at
documentclass{article}
usepackage{scalerel,graphicx}
newcommandsat{ThisStyle{%
kern.5LMptincludegraphics[height=1.3LMex]{saturation}kern.5LMpt}}
begin{document}
centering
Here is sat.
In math, $A_{sat}$
[
A_{sat_{sat}}
]
Huge
[
A_{sat_{sat}}
]
end{document}
First create a standalone
version of your icon, here in saturation.tex
:
documentclass[border=0mm]{standalone}
usepackage{tikz}
usetikzlibrary{positioning}
makeatletter
pgfdeclareshape{record}{
inheritsavedanchors[from={rectangle}]
inheritbackgroundpath[from={rectangle}]
inheritanchorborder[from={rectangle}]
foreach x in {center,north east,north west,north,south,south east,south west}{
inheritanchor[from={rectangle}]{x}
}
foregroundpath{
pgfpointdiff{northeast}{southwest}
pgf@xa=pgf@x pgf@ya=pgf@y
northeast
pgfpathmoveto{pgfpoint{0}{0.33pgf@ya}}
pgfpathlineto{pgfpoint{0}{-0.33pgf@ya}}
pgfpathmoveto{pgfpoint{0.33pgf@xa}{0}}
pgfpathlineto{pgfpoint{-0.33pgf@xa}{0}}
pgfpathmoveto{pgfpointadd{southwest}{pgfpoint{-0.33pgf@xa}{-0.6pgf@ya}}}
pgfpathlineto{pgfpointadd{southwest}{pgfpoint{-0.5pgf@xa}{-0.6pgf@ya}}}
pgfpathlineto{pgfpointadd{northeast}{pgfpoint{-0.5pgf@xa}{-0.6pgf@ya}}}
pgfpathlineto{pgfpointadd{northeast}{pgfpoint{-0.33pgf@xa}{-0.6pgf@ya}}}
}
}
makeatother
begin{document}
begin{tikzpicture}
node[record,minimum size=1cm,fill=blue!30,draw] (a) {};
end{tikzpicture}
end{document}
Then, use this code to include it as the height of the local value of 1ex
, with a little horizontal gap on each side. This code will adjust to the current font size (so no problem if you go Huge
) as well as to the current math style (scriptstyle
and scriptscriptstyle
):
documentclass{article}
usepackage{scalerel,graphicx}
newcommandsat{ThisStyle{%
kern.5LMptincludegraphics[height=1LMex]{saturation}kern.5LMpt}}
begin{document}
centering
Here is sat.
In math, $A_{sat}$
[
A_{sat_{sat}}
]
end{document}
Obviously, you can change the size by adjusting 1LMex
to something different. You can adjust the gap by adjusting the .5LMpt
to something different, and you can change the color and line thickness in the original tikz
code.
For example, by changing the color at saturation.tex
to gray!5
and adding a thick
specification to the draw, one gets this:
That carries over directly into the main document, where I have changed the height specification to 1.3LMex
, to arrive at:
SUPPLEMENT
To help the OP with a follow up request to eliminate the border and axes, replace saturation.tex
with this:
documentclass[border=0mm]{standalone}
usepackage{tikz}
begin{document}
begin{tikzpicture}
coordinate (A) at (-.5,-.4);
coordinate (B) at (-.3,-.4);
coordinate (C) at (+.3,+.4);
coordinate (D) at (+.5,+.4);
draw [black, thick] (A)--(B)--(C)--(D);
end{tikzpicture}
end{document}
Then, with the document code definition that
newcommandsat{ThisStyle{%
kern.5LMptincludegraphics[height=1.3LMex]{saturation}kern.5LMpt}}
we arrive at
documentclass{article}
usepackage{scalerel,graphicx}
newcommandsat{ThisStyle{%
kern.5LMptincludegraphics[height=1.3LMex]{saturation}kern.5LMpt}}
begin{document}
centering
Here is sat.
In math, $A_{sat}$
[
A_{sat_{sat}}
]
Huge
[
A_{sat_{sat}}
]
end{document}
edited 5 hours ago
answered 5 hours ago
Steven B. SegletesSteven B. Segletes
157k9202411
157k9202411
Thank you for your answer, that is awesome. This is almost what I was looking for, except that I don't need the frame and the axes. Only the diagonal line with the two horizontal lines. I don't have much experience with tikz, what do I need to change for that? Is there really no math symbol for that?
– Kaniee
5 hours ago
@Kaniee See my supplement code.
– Steven B. Segletes
5 hours ago
add a comment |
Thank you for your answer, that is awesome. This is almost what I was looking for, except that I don't need the frame and the axes. Only the diagonal line with the two horizontal lines. I don't have much experience with tikz, what do I need to change for that? Is there really no math symbol for that?
– Kaniee
5 hours ago
@Kaniee See my supplement code.
– Steven B. Segletes
5 hours ago
Thank you for your answer, that is awesome. This is almost what I was looking for, except that I don't need the frame and the axes. Only the diagonal line with the two horizontal lines. I don't have much experience with tikz, what do I need to change for that? Is there really no math symbol for that?
– Kaniee
5 hours ago
Thank you for your answer, that is awesome. This is almost what I was looking for, except that I don't need the frame and the axes. Only the diagonal line with the two horizontal lines. I don't have much experience with tikz, what do I need to change for that? Is there really no math symbol for that?
– Kaniee
5 hours ago
@Kaniee See my supplement code.
– Steven B. Segletes
5 hours ago
@Kaniee See my supplement code.
– Steven B. Segletes
5 hours ago
add a comment |
With picture
mode:
documentclass{article}
usepackage{amsmath}
usepackage{pict2e}
makeatletter
DeclareRobustCommand{saturation}{%
mathrel{%
mkern1munonscriptmkern-1mu
mathpalettesatur@tionrelax
mkern1munonscriptmkern-1mu
}%
}
newcommand{satur@tion}[2]{%
vcenter{hbox{%
sboxz@{$m@th#1|$}%
setlength{unitlength}{dimexprhtz@+dpz@}%
saturation@linethickness{#1}%
begin{picture}(0.6,1)
roundcap
polyline(0,0)(0.2,0)(0.4,1)(0.6,1)
end{picture}%
}}%
}
newcommand{saturation@linethickness}[1]{%
linethickness{%
1.25fontdimen8
ifx#1displaystyletextfontelse
ifx#1textstyletextfontelse
ifx#1scriptstylescriptfontelse
scriptscriptfontfififi 3
}%
}
makeatother
begin{document}
$Asaturation B_{Asaturation B_{Asaturation B}}$
end{document}
The command saturation@linethickess
is an old trick of mine, see https://tex.stackexchange.com/a/412159/4427
I chose to make the symbol the same vertical size as |
; the width is 60% of the height and the three parts have equal width. Feel free to change the proportions. You can get it wider with
newcommand{satur@tion}[2]{%
vcenter{hbox{%
sboxz@{$m@th#1|$}%
setlength{unitlength}{dimexprhtz@+dpz@}%
saturation@linethickness{#1}%
begin{picture}(0.8,1)
roundcap
polyline(0,0)(0.2,0)(0.6,1)(0.8,1)
end{picture}%
}}%
}
add a comment |
With picture
mode:
documentclass{article}
usepackage{amsmath}
usepackage{pict2e}
makeatletter
DeclareRobustCommand{saturation}{%
mathrel{%
mkern1munonscriptmkern-1mu
mathpalettesatur@tionrelax
mkern1munonscriptmkern-1mu
}%
}
newcommand{satur@tion}[2]{%
vcenter{hbox{%
sboxz@{$m@th#1|$}%
setlength{unitlength}{dimexprhtz@+dpz@}%
saturation@linethickness{#1}%
begin{picture}(0.6,1)
roundcap
polyline(0,0)(0.2,0)(0.4,1)(0.6,1)
end{picture}%
}}%
}
newcommand{saturation@linethickness}[1]{%
linethickness{%
1.25fontdimen8
ifx#1displaystyletextfontelse
ifx#1textstyletextfontelse
ifx#1scriptstylescriptfontelse
scriptscriptfontfififi 3
}%
}
makeatother
begin{document}
$Asaturation B_{Asaturation B_{Asaturation B}}$
end{document}
The command saturation@linethickess
is an old trick of mine, see https://tex.stackexchange.com/a/412159/4427
I chose to make the symbol the same vertical size as |
; the width is 60% of the height and the three parts have equal width. Feel free to change the proportions. You can get it wider with
newcommand{satur@tion}[2]{%
vcenter{hbox{%
sboxz@{$m@th#1|$}%
setlength{unitlength}{dimexprhtz@+dpz@}%
saturation@linethickness{#1}%
begin{picture}(0.8,1)
roundcap
polyline(0,0)(0.2,0)(0.6,1)(0.8,1)
end{picture}%
}}%
}
add a comment |
With picture
mode:
documentclass{article}
usepackage{amsmath}
usepackage{pict2e}
makeatletter
DeclareRobustCommand{saturation}{%
mathrel{%
mkern1munonscriptmkern-1mu
mathpalettesatur@tionrelax
mkern1munonscriptmkern-1mu
}%
}
newcommand{satur@tion}[2]{%
vcenter{hbox{%
sboxz@{$m@th#1|$}%
setlength{unitlength}{dimexprhtz@+dpz@}%
saturation@linethickness{#1}%
begin{picture}(0.6,1)
roundcap
polyline(0,0)(0.2,0)(0.4,1)(0.6,1)
end{picture}%
}}%
}
newcommand{saturation@linethickness}[1]{%
linethickness{%
1.25fontdimen8
ifx#1displaystyletextfontelse
ifx#1textstyletextfontelse
ifx#1scriptstylescriptfontelse
scriptscriptfontfififi 3
}%
}
makeatother
begin{document}
$Asaturation B_{Asaturation B_{Asaturation B}}$
end{document}
The command saturation@linethickess
is an old trick of mine, see https://tex.stackexchange.com/a/412159/4427
I chose to make the symbol the same vertical size as |
; the width is 60% of the height and the three parts have equal width. Feel free to change the proportions. You can get it wider with
newcommand{satur@tion}[2]{%
vcenter{hbox{%
sboxz@{$m@th#1|$}%
setlength{unitlength}{dimexprhtz@+dpz@}%
saturation@linethickness{#1}%
begin{picture}(0.8,1)
roundcap
polyline(0,0)(0.2,0)(0.6,1)(0.8,1)
end{picture}%
}}%
}
With picture
mode:
documentclass{article}
usepackage{amsmath}
usepackage{pict2e}
makeatletter
DeclareRobustCommand{saturation}{%
mathrel{%
mkern1munonscriptmkern-1mu
mathpalettesatur@tionrelax
mkern1munonscriptmkern-1mu
}%
}
newcommand{satur@tion}[2]{%
vcenter{hbox{%
sboxz@{$m@th#1|$}%
setlength{unitlength}{dimexprhtz@+dpz@}%
saturation@linethickness{#1}%
begin{picture}(0.6,1)
roundcap
polyline(0,0)(0.2,0)(0.4,1)(0.6,1)
end{picture}%
}}%
}
newcommand{saturation@linethickness}[1]{%
linethickness{%
1.25fontdimen8
ifx#1displaystyletextfontelse
ifx#1textstyletextfontelse
ifx#1scriptstylescriptfontelse
scriptscriptfontfififi 3
}%
}
makeatother
begin{document}
$Asaturation B_{Asaturation B_{Asaturation B}}$
end{document}
The command saturation@linethickess
is an old trick of mine, see https://tex.stackexchange.com/a/412159/4427
I chose to make the symbol the same vertical size as |
; the width is 60% of the height and the three parts have equal width. Feel free to change the proportions. You can get it wider with
newcommand{satur@tion}[2]{%
vcenter{hbox{%
sboxz@{$m@th#1|$}%
setlength{unitlength}{dimexprhtz@+dpz@}%
saturation@linethickness{#1}%
begin{picture}(0.8,1)
roundcap
polyline(0,0)(0.2,0)(0.6,1)(0.8,1)
end{picture}%
}}%
}
answered 4 hours ago
egregegreg
723k8719163219
723k8719163219
add a comment |
add a comment |
Kaniee is a new contributor. Be nice, and check out our Code of Conduct.
Kaniee is a new contributor. Be nice, and check out our Code of Conduct.
Kaniee is a new contributor. Be nice, and check out our Code of Conduct.
Kaniee is a new contributor. Be nice, and check out our Code of Conduct.
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.
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%2f477182%2fmath-saturation-symbol%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