I once proposed the following definitions
\newcommand\varpm{\mathbin{\vcenter{\hbox{%
\oalign{\hfil$\scriptstyle+$\hfil\cr
\noalign{\kern-.3ex}
$\scriptscriptstyle({-})$\cr}%
}}}}
\newcommand\varmp{\mathbin{\vcenter{\hbox{%
\oalign{$\scriptstyle({+})$\cr
\noalign{\kern-.3ex}
\hfil$\scriptscriptstyle-$\hfil\cr}%
}}}}
Example
\documentclass{article}
\newcommand\varpm{\mathbin{\vcenter{\hbox{%
\oalign{\hfil$\scriptstyle+$\hfil\cr
\noalign{\kern-.3ex}
$\scriptscriptstyle({-})$\cr}%
}}}}
\newcommand\varmp{\mathbin{\vcenter{\hbox{%
\oalign{$\scriptstyle({+})$\cr
\noalign{\kern-.3ex}
\hfil$\scriptscriptstyle-$\hfil\cr}%
}}}}
\begin{document}
$a\varpm b\varmp c$
\end{document}
Here's an alternative that uses TikZ. With the amsmath
and tikz
packages loaded, put the following in your preamble
\newcommand\constructosum[3]{%
\begin{tikzpicture}[baseline=(char.base), inner sep=0, outer sep=0]
\draw (#1,0) circle (#2);
\node (char) at (0,0) {$#3\sum$}; % Want to define a second symbol for inline...
\end{tikzpicture}%
}
\newcommand{\modtwosum}{\mathop{\mathchoice
{\constructosum{-0.3ex}{0.1}{\displaystyle}}
{\constructosum{-0.3ex}{0.06}{\textstyle}}
{\constructosum{-0.2ex}{0.04}{\scriptstyle}}
{\constructosum{-0.15ex}{0.03}{\scriptscriptstyle}}
}\displaylimits
}
This defines four operators corresponding to display style math environments, inline math, script size math and script script size math in that order. Each has a coordinate for the loop which may be adjusted, and a size for the loop. For example the display style version has
\constructosum{-0.3ex}{0.1}{\displaystyle}
which places the loop at -0.3ex
(moves it horizontally backwards a bit) with a radius of 0.1cm. To use it, simply use the new operator \modtwosum
inside any math environment. e.g.
\[
G=\modtwosum_a^b H
\]
A demo of this operator in each of the four situations that may occur:
Thanks goes to egreg for pointing out that I could reduce the original version of this with a helper \newcommand
to contain the TikZ code.
Best Answer
It comes from the
marvosym
package. Note: Detexify correctly identifies this symbol.