
如何構造下列符號?
答案1
這是一個放大的嘗試:
這是產生它的程式碼。箭頭巨集的工作原理是直接從LaTeX 符號字體( lasy
)。要了解更多信息\ooalign
和朋友的信息,請參閱\subseteq + \circ 作為單一符號(「開放子集」)。
\documentclass{article}
\makeatletter
\newcommand{\rightarrowhead}{\mathrel{%
\hbox{\let\f@size\sf@size\usefont{U}{lasy}{m}{n}\symbol{41}}}}
\newcommand{\leftarrowhead}{\mathrel{%
\hbox{\let\f@size\sf@size\usefont{U}{lasy}{m}{n}\symbol{40}}}}
\makeatother
\newcommand\specialsubset{\mathrel{\ooalign{$\subset$\cr%
\hidewidth\raise.800ex\hbox{$\rightarrowhead\mkern1mu$}\cr%
\hidewidth\raise.800ex\hbox{$\rightarrowhead\mkern4mu$}\cr%
\hidewidth\raise-0.440ex\hbox{$\leftarrowhead\mkern2.75mu$}}}}
\begin{document}
$A \specialsubset B$
\end{document}
編輯:請注意,當字體大小改變時,箭頭的對齊方式會改變;這可能是由於\raise
和\mkern
參數上的 TeX 算術不精確造成的。我不知道。不過,如圖所示,此程式碼在預設字體大小下運作良好。即便如此,只有當您放大 fontsize 時,這種不對齊才會變得明顯\Huge
。
答案2
強制性鈦kZ 解。
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{arrows.meta}
\usepackage{scalerel}
\makeatletter
\begingroup
\setbox\@tempboxa=\hbox{$\subset$}
\@tempdima=\dp\@tempboxa
\newbox\@sarabox
\global\setbox\@sarabox=\hbox{%
\begin{tikzpicture} [baseline=0pt, line cap=round]
\node (subset) at (0,-\@tempdima) [above left, inner sep=0pt, outer sep=0pt] {$\subset$};
\begin{pgfinterruptboundingbox}
\draw (-2.5pt,5.2pt) edge [arrows={-[length=1pt]>[sep]>}] +(1.5pt,0pt)
(-3pt,-.2pt) edge [arrows={[length=1pt]<-}] +(1.5pt,0pt);
\end{pgfinterruptboundingbox}
\end{tikzpicture}%
}
\global\ht\@sarabox=\ht\@tempboxa
\endgroup
\newcommand*\sara{\mathrel{\scalerel*{\usebox\@sarabox}{\subset}}}
\makeatother
\begin{document}
\(A \subset B\),
\(X_{A \subset B}\)
\(A \sara B\),
\(X_{A \sara B}\)
\end{document}
這樣做的優點是適應性很強。如果您想更改箭頭提示的大小或使符號更長(如範例影像中所示),您只需調整一些數字即可。 (儘管為了正確縮放,需要注意邊界框。)