在数学模式下,排版类似于\uplus
(不相交集合并集的符号,由嵌入在并集符号内的加号组成)的符号的最简单方法是什么,仅用“乘号”符号代替加号?
答案1
\uplus
似乎具有状态mathbin
,而\biguplus
似乎具有状态mathop
。以下\utimes
和的定义\bigutimes
保留了这些设置。
\documentclass{article}
\usepackage{amsmath} %for "\boldsymbol" macro
\newcommand\utimes{\mathbin{\ooalign{$\cup$\cr%
\hfil\raise0.42ex\hbox{$\scriptscriptstyle\times$}\hfil\cr}}}
\newcommand\bigutimes{\mathop{\ooalign{$\bigcup$\cr%
\hfil\raise0.36ex\hbox{$\scriptscriptstyle\boldsymbol{\times}$}\hfil\cr}}}
\begin{document}
$a\uplus a$ $a\biguplus a$
$a\utimes a$ $a\bigutimes a$
$\uplus\utimes$
${\biguplus}{\bigutimes}$
\end{document}
参数\raise
0.42ex 和 0.36ex 分别被选择用于使\uplus
和\utimes
布局尽可能相似,以适应 Computer Modern 数学字体系列——这是大多数 TeX 发行版中的默认字体系列(包括上面显示的屏幕截图)。对于其他数学字体系列,\raise
可能必须考虑 的其他参数。
答案2
适应\times
很\cup
麻烦;在这里我使用picture
模式来添加符号。
\documentclass{article}
\usepackage{amsmath,pict2e}
\makeatletter
\DeclareRobustCommand{\utimes}{\mathbin{\mathpalette\u@times\relax}}
\newcommand\u@times[2]{%
\begingroup
\ifx#1\displaystyle\@tempswatrue\else
\ifx#1\textstyle\@tempswatrue\else
\@tempswafalse
\fi\fi
\sbox\z@{$\m@th#1{\cup}$}%
\setlength{\unitlength}{\wd\z@}%
\begin{picture}(0,0)
\roundcap
\linethickness{\variable@rule{#1}}
\put(0,0){\box\z@}
\if@tempswa
\Line(0.3,0.25)(0.7,0.65)
\Line(0.7,0.25)(0.3,0.65)
\else
\Line(0.3,0.2)(0.7,0.6)
\Line(0.3,0.6)(0.7,0.2)
\fi
\end{picture}%
\phantom{\cup}%
\endgroup
}
\DeclareRobustCommand{\bigutimes}{\DOTSB\mathop{\mathpalette\bigu@times\relax}\slimits@}
\newcommand{\bigu@times}[2]{%
\begingroup
\sbox\z@{$\m@th#1{\bigcup}$}%
\setlength{\unitlength}{\wd\z@}%
\begin{picture}(0,0)
\roundcap
\ifx#1\displaystyle
\linethickness{2\variable@rule{#1}}
\else
\linethickness{1.5\variable@rule{#1}}
\fi
\put(0,0){\box\z@}
\ifx#1\displaystyle
\Line(0.25,0.0)(0.75,0.5)
\Line(0.25,0.5)(0.75,0.0)
\else
\Line(0.3,0.1)(0.7,0.5)
\Line(0.3,0.5)(0.7,0.1)
\fi
\end{picture}%
\phantom{\bigcup}%
\endgroup
}
\newcommand{\variable@rule}[1]{%
\fontdimen8
\ifx#1\displaystyle\textfont3\else
\ifx#1\textstyle\textfont3\else
\ifx#1\scriptstyle\scriptfont3\else
\scriptscriptfont3\relax
\fi\fi\fi
}
\makeatother
\begin{document}
$a\uplus b\utimes c_{\uplus\utimes}$
$\displaystyle\biguplus\bigutimes
\textstyle\biguplus\bigutimes
\scriptstyle\biguplus\bigutimes$
$\displaystyle\biguplus_{i=1}^n\bigutimes_{i=1}^n$
\end{document}
答案3
常规字体\cup
太窄,无法容纳\times
字符,因此我选择了替代字体。使用正确的字距调整后,该符号也\bigcup
可用于“等”。\scriptstyle
因为它应该是一个操作员,所以\DeclareMathOperator
似乎是一个正确的选择。
\documentclass{article}
\usepackage{amsmath}
\DeclareMathOperator{\utimes}{\bigcup\utimeskern\times}
\newcommand{\utimeskern}{%
\mkern-17.5mu
\mathchoice{}{}{\mkern0.2mu}{\mkern0.5mu}%
}
\begin{document}
See $\utimes A$
\end{document}
答案4
根据我的回答将两个符号组合成一个完全可扩展的符号,我提供\cuptimes
和\bigcuptimes
。
\documentclass[a4paper,10pt]{article}
\usepackage{stackengine,scalerel}
\newcommand{\bigcuptimes}{\mathop{\ThisStyle{%
\ensurestackMath{\stackinset{c}{0pt}{c}{.25\LMex}{\times}{\SavedStyle\bigcup}}}}}
\newcommand{\cuptimes}{\mathop{\ThisStyle{%
\ensurestackMath{\stackinset{c}{.3\LMpt}{c}{0\LMpt}{\SavedStyle^\times}{\SavedStyle\cup}}}}}
\begin{document}
$\displaystyle\bigcup_{i\in I}S_i$\hspace{40pt}
$\bigcup_{i\in I}S_i$\hspace{40pt}
$S_1\cup S_2$
\vspace{20pt}
$\displaystyle\bigcuptimes_{i\in I}S_i$\hspace{40pt}
$\bigcuptimes_{i\in I}S_i$\hspace{40pt}
$S_1\cuptimes S_2$
\vspace{20pt}
$\scriptstyle\bigcuptimes_{i\in I}S_i$\hspace{40pt}
$\scriptscriptstyle\bigcuptimes_{i\in I}S_i$
\vspace{20pt}
$\scriptstyle S_1\cuptimes S_2$\hspace{40pt}
$\scriptscriptstyle S_1\cuptimes S_2$
\end{document}