What is the easiest way to typeset - in math mode - a symbol similar to \uplus (the symbol for disjoint set union, consisting of a plus embedded inside a union symbol), only with a "times" symbol substituting for the plus?
- 11,066
4 Answers
\uplus appears to have status mathbin, whereas \biguplus appears to have status mathop. The following definitions of \utimes and \bigutimes preserve these settings.
\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}
The arguments of \raise -- 0.42ex and 0.36ex, resp. -- were chosen to make \uplus and \utimes as similar in layout as possible, for the Computer Modern math font family -- which is the default font family in most TeX distributions (including the screenshot shown above). For other math font families, other arguments of \raise will probably have to be considered.
- 506,678
Fitting \times into \cup is a pain; here I use picture mode for adding the symbol.
\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}
- 1,121,712
-
i think the
\timesin the example between b and c is just a little too low. otherwise good. – barbara beeton Mar 01 '18 at 16:49 -
-
-
1
The regular \cup is too narrow in order to allow the \times character inside it, so I chose \bigcup as an alternative. With the correct kerning, the symbol allows for usage in \scriptstyle etc. as well.
Since it is supposed to be an operator, \DeclareMathOperator seems to be a correct choice.
\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}
Based on my answer at Combine two symbols to one fully scalable, I provide \cuptimes and \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}
- 237,551




\utimes, but that does not look like you want to have it – Mar 01 '18 at 09:54mathdesigngives me anUndefined control sequenceerror message. As for the other two packages you mentioned - no, this is not the symbol I'm looking for. – Evan Aad Mar 01 '18 at 10:10unicode-math, which also defines it as\cupdot. – Davislor Mar 01 '18 at 13:25