答案1
答案2
为此,我们需要完全可扩展的字体,因此fix-cm
如果文档采用的是标准 Computer Modern 字体,则无需选择其他字体。
\RequirePackage{fix-cm}
\documentclass{article}
\usepackage{amsmath}
\makeatletter
\DeclareRobustCommand{\vcup}[1]{%
\mathbin{\vphantom{\cup}\mathpalette\vcup@{#1}}%
}
\newcommand{\vcup@}[2]{%
\ooalign{%
$\m@th#1\cup$\cr
\hidewidth
\raisebox{%
\dimexpr\depth+\demote@{#1}\dimexpr1.5pt\relax\relax
}{\fontsize{\demote@{#1}\dimexpr\f@size pt}{\z@}\selectfont\check@mathfonts
$\m@th#2$}%
\hidewidth\cr
}%
}
\newcommand{\demote@}[1]{%
\ifx#1\displaystyle 0.7
\else\ifx#1\textstyle 0.7
\else\ifx#1\scriptstyle 0.5
\else 0.4\fi\fi\fi
}
\makeatother
\begin{document}
$A\vcup{k}B^{\vcup{k}}$
$\uplus\scriptstyle\uplus\scriptscriptstyle\uplus$
$\vcup{k}\scriptstyle\vcup{k}\scriptscriptstyle\vcup{k}$
$\vcup{y}\scriptstyle\vcup{y}\scriptscriptstyle\vcup{y}$
$\vcup{g}\scriptstyle\vcup{g}\scriptscriptstyle\vcup{g}$
\end{document}