13

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?

Evan Aad
  • 11,066
  • Some fonts provide \utimes, but that does not look like you want to have it –  Mar 01 '18 at 09:54
  • @ChristianHupfer: Which fonts? If it already exists, I'd like to use it. – Evan Aad Mar 01 '18 at 10:05
  • @Mico: mathdesign gives me an Undefined control sequence error 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:10
  • @EvanAad: That's what I said before -- they look different –  Mar 01 '18 at 10:11
  • @ChristianHupfer: I don't understand why, but I did as you requested. – Evan Aad Mar 01 '18 at 12:42
  • 1
    If a dot instead of a times is acceptable, ⊍ (multiset multiplication) is U+228D. You can use it directly with unicode-math, which also defines it as \cupdot. – Davislor Mar 01 '18 at 13:25
  • @EvanAad: As you see, my answer has no chance compared to other answers ;-) –  Mar 01 '18 at 15:18
  • 1
    what's the meaning of this symbol? should it be added to unicode? if so, a (published) example in context will be needed. – barbara beeton Mar 01 '18 at 16:52
  • @barbarabeeton: I don't know if there's a published example. I employ it for my personal use in the following sense. Given two families of sets, S and T, the expression S \utimes T denotes the family of sets consisting of all the sets of the form s union t, where (s,t) is a member of the cartesian product of S and T. – Evan Aad Mar 01 '18 at 20:04

4 Answers4

20

\uplus appears to have status mathbin, whereas \biguplus appears to have status mathop. The following definitions of \utimes and \bigutimes preserve these settings.

enter image description here

\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.

Mico
  • 506,678
8

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}

enter image description here

egreg
  • 1,121,712
7

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}

enter image description here

7

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}

enter image description here