如何使用 sim 符號建立子集

如何使用 sim 符號建立子集

我一直在嘗試將符號 ⫇ (\subset在頂部 a \sim)排版為運算符,但以下解決方案沒有幫助

  • ⫇似乎沒有在symbols-a4.pdf中列出,所以detexify沒有找到它。
  • \limits並將\underset波形符(或\sim)與 分開\subset
  • 使用起來\undertilde很難看。

還有其他方法可以獲得此符號嗎?

答案1

適應埃格格的解決方案:

\documentclass{article}
\usepackage{graphicx}

\newcommand\subsetsim{\mathrel{%
  \ooalign{\raise0.2ex\hbox{$\subset$}\cr\hidewidth\raise-0.8ex\hbox{\scalebox{0.9}{$\sim$}}\hidewidth\cr}}}
\begin{document}
\[
  A \subsetsim B
\]
\end{document}

樣本輸出

依照您的喜好調整參數。

答案2

\substack這是使用from 的直接方法amsmath:

在此輸入影像描述

\documentclass{article}
\usepackage{amsmath}% http://ctan.org/pkg/amsmath
\newcommand\subsetsim{\mathrel{\substack{
  \textstyle\subset\\[-0.2ex]\textstyle\sim}}}
\begin{document}
\[ f(x) \subset g(x) \subseteq h(x) \subsetsim i(x) \sim j(x) \]
\end{document}

該定義也可以更新以適應子/上標的使用。

答案3

您已經注意到該符號在 Unicode 中為 ⫇ (U+2AC7),因此如果您使用 xetex 或 luatex 和 unicode-math,它就可以工作。它也在 STIX 字體中,現在有一個測試版,支援經典 TeX:http://www.stixfonts.org/

答案4

窮人的解決辦法

\sim下面的範例透過在下面加上 來建構符號 ⫇ \subset。如果目前數學樣式是or ,則設定\sim為較小的字體,如果目前數學樣式是or then用於。由於在後一種情況下字體並不較小,因此該解決方案適用於、和。\displaystyle\textstyle\scriptstyle\sim\scriptstyle\scriptscriptstyle\scriptscriptstyle\sim\displaystyle\textstyle\scriptstyle

\documentclass{article}  

\makeatletter
\newcommand*{\subsetsim}{%
  \mathrel{%
    \mathchoice
    {\@subsetsim\displaystyle\scriptstyle}%
    {\@subsetsim\textstyle\scriptstyle}%
    {\@subsetsim\scriptstyle\scriptscriptstyle}%
    {\@subsetsim\scriptscriptstyle\scriptscriptstyle}%
  }%
}   
\newcommand*{\@subsetsim}[2]{%
  \sbox0{$\m@th#1\subset$}%
  \sbox2{$\m@th#2\sim$}%
  \sbox4{$\m@th#2$}%
  \raisebox{.5\dimexpr\ht2-\ht4\relax}{% 
    \oalign{\copy0 \cr\hidewidth\copy2\hidewidth}%
  }%
}

\begin{document}

\[ a \subset a \sim a \subsetsim a - a_{b \subsetsim b_{c \subsetsim c}} \]

\end{document}

結果

評論:

  • 減號顯示數學軸。
  • 在最新的情況下 (c ⫇ c) 有點\sim太大了,因為表達式設定在 中\scriptscriptstyle,請參閱上文。

相關內容