16

I have the problem with a symbol for symmetric difference (see http://en.wikipedia.org/wiki/Symmetric_difference). In commonly used is

\triangle
\ominus

But in Polish tradition often is used:

\dot{-}

and I would like to ask if it is possible to make dot be a little bit down to (close to) line (here where is the red dot).

enter image description here

10

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

3
  • Why don’t you use a length register for \dysym, i.e. \newlength\dysym \setlength\dysym{-3pt}?
    – Tobi
    Aug 14 '13 at 19:03
  • @Tobi See revision with \scriptstyle. If length register were used, the dot-dash spacing would not shrink in the smaller math style. Aug 14 '13 at 19:20
  • @StevenB.Segletes -- well, i've tried out what i was suggesting, and you're correct -- it doesn't work. i retract (and have removed) my comment. (but i still feel there's a less complex way; i'll experiment.) Aug 14 '13 at 20:36
9

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.