这目的是创建一个新符号 \ineq
. 的外观\ineq
将是\in
就像\subseteq
是 一样\subset
。
尝试中出现的问题按重要性递减的顺序排列。(1)的下划线
\ineq
是矩形的,而不是像\subseteq
、\leq
、\leqslant
等那样带有圆边=
。(2)下划线和之间的距离应稍微增加,以匹配和\in
中的下划线间距。\subseteq
\leq
梅威瑟:
\documentclass[12pt]{book}
\usepackage[LGR,T1]{fontenc}
\usepackage{amsmath}
\usepackage{amssymb}
%%%% my attempt
\newcommand{\ineq}{\mathrel{ \raisebox{0.3ex}{\mbox{$\underline{\mkern-1.8mu\in\mkern-1.53mu}$}} }}
%%%%
\begin{document}
\( A \ineq B \subseteq C \leq D \leqslant E = F \)
\end{document}
答案1
编辑
文森特很好的答案让我想起了\dabar@
,我完全忘记了它的存在。这允许我建立一个比我原来的答案略好的版本(见下文)
\documentclass[12pt]{book}
\usepackage{amssymb}
\makeatletter
\newcommand*{\ineq}{\mathrel{\mathpalette\in@eq\relax}}
\newcommand*{\in@eq}[2]{%
\setbox\z@=\hbox{\m@th$#1\in$}%
\setbox\tw@=\hb@xt@\wd\z@{\m@th$#1\dabar@$\hss$#1\dabar@$}%
\vcenter{%
\offinterlineskip
\box\z@
\vskip-.1\ht\tw@
\copy\tw@
\vskip-.5\ht\tw@
}%
}
\makeatother
\begin{document}
$A \ineq \supseteq B$
$\scriptstyle A \ineq \supseteq B$
$\scriptscriptstyle A \ineq \supseteq B$
\end{document}
原始答案
不太美观,但大致可行。主要思想是使用减号,但比 稍大\in
,因此我作弊使用\subset
。
\documentclass[12pt]{book}
\usepackage{amssymb}
\makeatletter
\newcommand*{\ineq}{\mathrel{\mathpalette\in@eq\relax}}
\newcommand*{\in@eq}[2]{%
\setbox\z@=\hbox{\m@th$#1-$}%
\vcenter{%
\m@th
\offinterlineskip
\ialign{##\cr
$#1\subset$\llap{\copy\z@}\cr
\noalign{\kern-.5\ht\z@\kern\dp\z@}%
\copy\z@\cr
\noalign{\kern-.5\ht\z@}%
}%
}%
}
\makeatother
\begin{document}
$A \ineq B \subseteq C \leq D \leqslant E = F$
$\scriptstyle A \ineq B \subseteq C \leq D \leqslant E = F$
$\scriptscriptstyle A \ineq B \subseteq C \leq D \leqslant E = F$
\end{document}
答案2
这将产生几乎相同的高度和深度\subseteq
:
\documentclass{article}
\usepackage{amsmath,pict2e}
\makeatletter
\DeclareRobustCommand{\ineq}{\mathrel{\mathpalette\ineq@\relax}}
\newcommand{\ineq@}[2]{%
\vcenter{%
\sbox\z@{$\m@th#1\in$}%
\setlength{\unitlength}{0.9\wd\z@}%
\setlength{\dimen@}{%
\ifx#1\displaystyle 1.1\fontdimen8\textfont3 \else
\ifx#1\textstyle 1.1\fontdimen8\textfont3 \else
\ifx#1\scriptstyle 1\fontdimen8\scriptfont3 \else
1.1\fontdimen8\scriptscriptfont3 \fi\fi\fi}%
\offinterlineskip\m@th
\ialign{%
\hfil##\cr % right alignment
$#1\in$\cr % \in
\noalign{
\vspace{0.28625\unitlength}
\ifx#1\scriptscriptstyle\vspace{-0.05\unitlength}\fi
}
\begin{picture}(0.75,0)
\roundcap
\linethickness{\dimen@}
\Line(0,0)(0.75,0)
\end{picture}\hspace{0.175\unitlength}\cr
\noalign{\vspace{0.5\dimen@}}
}%
}%
}
\makeatother
\begin{document}
$A\ineq \subseteq B$
$\scriptstyle A\ineq \subseteq B$
$\scriptscriptstyle A\ineq \subseteq B$
\fboxsep=0pt\fbox{$\ineq$}\fbox{$\subseteq$}
\end{document}
\sbox0{$\ineq$}\the\ht0--\the\dp0
\sbox0{$\subseteq$}\the\ht0--\the\dp0
\sbox0{$\scriptstyle\ineq$}\the\ht0--\the\dp0
\sbox0{$\scriptstyle\subseteq$}\the\ht0--\the\dp0
\sbox0{\large$\ineq$}\the\ht0--\the\dp0
\sbox0{\large$\subseteq$}\the\ht0--\the\dp0
\sbox0{\large$\scriptstyle\ineq$}\the\ht0--\the\dp0
\sbox0{\large$\scriptstyle\subseteq$}\the\ht0--\the\dp0
\sbox0{\Large$\ineq$}\the\ht0--\the\dp0
\sbox0{\Large$\subseteq$}\the\ht0--\the\dp0
\sbox0{\Large$\scriptstyle\ineq$}\the\ht0--\the\dp0
\sbox0{\Large$\scriptstyle\subseteq$}\the\ht0--\the\dp0
\end{document}
删除第一个\end{document}
,查看不同尺寸下高度和深度的比较。在 10pt 尺寸下,我们得到
所以您会发现差异最多为 0.01pt。
答案3
这是一个可能的解决方案(仅适用于\displaystyle
和\textstyle
,但可以根据需要进行调整)。
\documentclass{article}
\usepackage{amsmath}
\usepackage{amssymb}
\makeatletter
\newcommand*{\shortminus}{%
\dabar@\hspace*{-3.3pt}\dabar@%
}
\makeatother
\newcommand*{\ineq}{\mathrel{%
\ooalign{%
\raisebox{1pt}{$\in$}\cr%
\raisebox{-3.6pt}{$\shortminus$}%
}%
}}
\makeatother
\begin{document}
\(A \in B \subset C \quad A \ineq B \subseteq C\)
\end{document}