자동으로 크기가 조정되는 변수 위에 사용자 정의 기호가 있습니까?

자동으로 크기가 조정되는 변수 위에 사용자 정의 기호가 있습니까?

변수 위에 사용자 정의 기호를 추가하고 싶습니다. 문제는 변수 크기가 변경되면 기호 크기가 항상 동일하게 유지된다는 것입니다. 분수 등이 포함된 좀 더 정교한 공식에서는 끔찍해 보입니다.

여기에 예가 있습니다. 수직 공간을 줄이기 위해 다음의 코드를 사용했습니다.\stackrel의 세로 간격을 어떻게 축소(또는 확장)할 수 있나요?.

\documentclass{minimal}
\usepackage{amsmath}
\usepackage{tikz}

\newcommand{\defeq}{%
  \mathrel{\vbox{\offinterlineskip\ialign{%
    \hfil##\hfil\cr
    $\text{\tikz{\draw[-, line width=0.2ex] (1.6ex,0.5ex) -- (1.6ex,-0.5ex); \begin{scope}[xshift=0ex] \draw[-, line width=0.2ex] (0,0) -- (1.4ex,0); \fill[black] (1.5ex,0) -- (1ex,0.5ex) -- (1ex,-0.5ex) -- cycle; \end{scope} }}$\cr
\noalign{\kern-0.4ex}
}}}}

\begin{document}
\begin{equation}
  B_{\overset{\defeq}{AB}} \overset{\defeq}{AB}
\end{equation}
\end{document}

답변1

boxing은 아래 첨자에서 크기 변경을 중지하므로 \mathchoice다른 크기를 선택하는 데 사용할 수 있지만 여기서는 vbox를 제거하면 되고 \ialign행이 하나뿐이므로 아무것도 정렬되지 않을 수 있습니다.

여기에 이미지 설명을 입력하세요

\documentclass{article}
\usepackage{amsmath}
\usepackage{tikz}

\newcommand{\defeq}{%
  \mathrel{\text{\tikz{\draw[-, line width=0.2ex] (1.6ex,0.5ex) -- (1.6ex,-0.5ex); \begin{scope}[xshift=0ex] \draw[-, line width=0.2ex] (0,0) -- (1.4ex,0); \fill[black] (1.5ex,0) -- (1ex,0.5ex) -- (1ex,-0.5ex) -- cycle; \end{scope}}}}}

\begin{document}
\begin{equation}
  B_{\overset{\defeq}{AB}} \overset{\defeq}{AB}
\end{equation}
\end{document}

또는 더 가까이:

\newcommand{\defeq}{%
  \mathrel{\text{%
\raisebox{-.4ex}[0pt][0pt]{\tikz{\draw[-, line width=0.2ex] (1.6ex,0.5ex) -- (1.6ex,-0.5ex); \begin{scope}[xshift=0ex] \draw[-, line width=0.2ex] (0,0) -- (1.4ex,0); \fill[black] (1.5ex,0) -- (1ex,0.5ex) -- (1ex,-0.5ex) -- cycle; \end{scope}}}}}}

관련 정보