%EB%A5%BC%20%EA%B5%AC%EC%84%B1%ED%95%98%EB%8A%94%20%EB%B0%A9%EB%B2%95%EC%9D%80%20%EB%AC%B4%EC%97%87%EC%9E%85%EB%8B%88%EA%B9%8C%3F.png)
다음 기호를 구성하는 방법은 무엇입니까?
답변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
및 매개변수 에 대한 TeX 연산의 부정확성 때문일 수 있습니다 \mkern
. 잘 모르겠습니다. 그러나 그림에서 볼 수 있듯이 이 코드는 기본 글꼴 크기에서 제대로 작동합니다. 그럼에도 불구하고 정렬 불량은 글꼴 크기를 확대할 때만 분명하게 드러납니다 \Huge
.
답변2
의무적인 Ti케이Z 솔루션.
\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}
적응력이 매우 좋다는 장점이 있습니다. 화살표 끝의 크기를 변경하거나 기호를 더 길게 만들려면(샘플 이미지에서처럼) 몇 가지 숫자만 조정하면 됩니다. (올바른 크기 조정을 위해서는 경계 상자에 약간의 주의가 필요합니다.)