答案1
可选参数允许\stackunder
指定间隙。
经过编辑以实现 2 个目标,并增加了包的使用scalerel
:1)重新调整符号以占据与字母“A”相同的垂直空间(根据 OP 的要求);2)使其适用于各种数学风格。
\documentclass{article}
\usepackage{amsmath,stackengine,scalerel}
\def\newsym{\mathrel{\scalerel*{\ensurestackMath{\stackunder[1pt]{\triangleleft}{%
\scriptscriptstyle\mkern1mu\sim}}}{A}}}
\begin{document}
$A \newsym B \quad\scriptstyle
A \newsym B \quad\scriptscriptstyle
A \newsym B$
\end{document}
原始解决方案
\documentclass{article}
\usepackage{amsmath,stackengine}
\def\newsym{\mathrel{\ensurestackMath{\stackunder[1pt]{\triangleleft}{%
\scriptscriptstyle\mkern1mu\sim}}}}
\begin{document}
$A \newsym B$
\end{document}
答案2
您可能想要使用较小的\sim
符号:
\documentclass{article}
\usepackage{amsmath,amssymb}
\DeclareFontFamily{OMS}{smallcmsy}{\skewchar\font48 }
\DeclareFontShape{OMS}{smallcmsy}{m}{n}{%
<-5.5> s*[.65] cmsy5
<5.5-6.5> s*[.65] cmsy6
<6.5-7.5> s*[.65] cmsy7
<7.5-8.5> s*[.65] cmsy8
<8.5-9.5> s*[.65] cmsy9
<9.5-> s*[.65] cmsy10
}{}
\DeclareFontShape{OMS}{smallcmsy}{b}{n}{%
<-5.5> s*[.65] cmbsy5
<5.5-6.5> s*[.65] cmbsy6
<6.5-7.5> s*[.65] cmbsy7
<7.5-8.5> s*[.65] cmbsy8
<8.5-9.5> s*[.65] cmbsy9
<9.5-> s*[.65] cmbsy10
}{}
\DeclareSymbolFont{smallsymbols}{OMS}{smallcmsy}{m}{n}
\SetSymbolFont{smallsymbols}{bold}{OMS}{smallcmsy}{b}{n}
\DeclareMathSymbol{\smallsim}{\mathrel}{smallsymbols}{"18}
\makeatletter
\newcommand{\ansg}{\mathrel{\lyndsay@ansg}}
\newcommand{\lyndsay@ansg}{\mathpalette\lyndsay@@ansg\relax}
\newcommand{\lyndsay@@ansg}[2]{%
\vbox{
\m@th\offinterlineskip
\halign{\hfil##\hfil\cr
$#1\triangleleft$\cr
\noalign{\kern.5pt}
$#1\smallsim$\cr
\noalign{\kern-.5pt}
}
}%
}
\makeatother
\begin{document}
$A\ansg B_{C\ansg D}$
\end{document}
答案3
按照此处的建议添加\raisebox
:在数学模式下垂直移动符号,对于 Steven 的原始解决方案:
\documentclass{article}
\usepackage{amsmath,stackengine}
\def\newsym{\mathbin{\ensurestackMath{\stackunder[1pt]{\triangleleft}{%
\scriptscriptstyle\mkern1mu\sim}}}}
\def\newsymraised{\mathrel{\raisebox{2pt}{$\mathbin{\ensurestackMath{\stackunder[1pt]{\triangleleft}{%
\scriptscriptstyle\mkern1mu\sim}}}$}}}
\begin{document}
Steven's original solution:
$A \newsym B$ \\
With raisebox:
$A \mathrel{\raisebox{2pt}{$\newsym$}} B$ \\
Creating a newcommand with raisebox:
$A \newsymraised B$%
\end{document}