I’m using \oplus
and \ominus
in a manuscript and I need an “\oplusminus
”, that is, a ±
in a big circle. Whatever I use will probably end up being published (though maybe only four times in the whole book), so I’m anxious for it to look elegant and natural, not hacked or unclear.
Stealing some code from egreg and Alain Matthes I've come up with the code below. It's fairly similar in proportions to \oplus
and \ominus
, but the match could be a bit better: I've had to shrink the \pm
sign to footnotesize and then stick it into a \raisebox
, yet the thickness doesn’t quite match that of \oplus
and \ominus
.
Does anyone have suggestions for improvement?
\documentclass[12pt]{report}
\usepackage{tikz}
\usetikzlibrary{arrows,matrix}
\usepackage{amssymb, amsmath, mathptmx}
\newcommand{\opm}{
\mathbin{
\mathchoice
{\buildcirclepm{\displaystyle}}
{\buildcirclepm{\textstyle}}
{\buildcirclepm{\scriptstyle}}
{\buildcirclepm{\scriptscriptstyle}}
}
}
\newcommand\buildcirclepm[1]{%
\begin{tikzpicture}[baseline=(X.base), inner sep=-.8, outer sep=-.65]
\node[draw,circle] (X) {\footnotesize\raisebox{.1ex}{$#1\pm$}};
\end{tikzpicture}%
}
\begin{document}
$\ominus \opm \oplus$
\end{document}
Best Answer
You just need to tweak more parameters, namely use
\scalebox
or similar, and fine-tune all the numbers for all four sizes: