Symbols for symmetric difference

I've shifted the dot down relative to \dot{-}. You may adjust the value of .2\LMex to suit.

EDITED to make it more robust and to achieve a more uniform vertical spacing at the smaller math styles.

\documentclass{article}
\usepackage{stackengine}
\usepackage{scalerel}% IF YOU NEED IT FOR SCRIPTSTYLE MATH
\newcommand\symdif{\ThisStyle{\mathrel{\ensurestackMath{%
  \stackengine{.2\LMex}{\SavedStyle-}{\SavedStyle\dot{}}{U}{c}{F}{F}{L}}}}}
\begin{document}
\( A \symdif B \)
\(\scriptstyle A \symdif B \)
\(\scriptscriptstyle A \symdif B \)
\end{document}

enter image description here


The main problem is that the minus sign has usually the same height as the plus sign. With \ooalign one can avoid this problem:

\documentclass{article}
\providecommand{\dotminus}{\mathbin{\mathpalette\xdotminus\relax}}
\newcommand{\xdotminus}[2]{%
  \ooalign{\hidewidth$\vcenter{\hbox{$#1\dot{}$}}$\hidewidth\cr$#1-$\cr}%
}

\begin{document}
$A\dotminus B$
\end{document}

I use \providecommand because at least one package (MnSymbol) defines it; but it's not advisable to load the package, that changes all math symbols.

enter image description here

Tags:

Symbols