重ね合わせたグリフと上付き/下付き文字

重ね合わせたグリフと上付き/下付き文字

私はstackengineと を使用して\cup\^{}右端に矢印の先端があるカップを作成しています。 これは通常のサイズでは機能しますが、新しい記号を上付き/下付き文字として使用すると、新しい記号のサイズが縮小されないか、サーカムフレックスが揃いません ( を追加した場合\text)。

\documentclass{article}
\usepackage{amsmath}
\usepackage{stackengine}

\newcommand{\cupr}{\topinset{\^{}}{$\cup$}{-0.7pt}{2.55pt}}
\newcommand{\cuprr}{\text{\topinset{\^{}}{$\cup$}{-0.7pt}{2.55pt}}}

\begin{document}

$$\cupr^{\cupr^{\cupr}} \qquad   \cup^{\cup^{\cup}} \qquad \cuprr^{\cuprr^{\cuprr}}  $$

\end{document}

これをどうすれば修正できますか?

答え1

ここでのパラメータは Computer Modern フォントに適しています。他のフォントの場合は、目で見て調整してください。

\documentclass{article}
\usepackage{amsmath}

\makeatletter
\newcommand{\cupr@tip}{\text{\raisebox{-0.1ex}{$\m@th\hat{}$}}}
\newcommand{\cupr}{\mathbin{\cup\cupr@}}

\newcommand{\cupr@}{%
  \mathchoice
  {\mkern-1.35mu\cupr@tip}
  {\mkern-1.35mu\cupr@tip}
  {\mkern-1.55mu\cupr@tip}
  {\mkern-1.875mu\cupr@tip}
}
\makeatother

\begin{document}

$A\cup B$

$A\cupr B$

$A\cupr B_{A\cupr B_{A\cupr B}}$

\end{document}

ここに画像の説明を入力してください

関連情報