I'd like to generate a command, \dblsetminus, that will print, in math mode, an operator similar to \setminus, but double. I've been able to approximate my desired operator with the following code:


The problem with this is that the spacing following my version of \dblsetminus doesn't behave like the spacing following \setminus. For instance, in an expression like A\dblsetminus B the spacing after the operator is not the same as the spacing before the operator.

How can I get the surrounding spacing to behave like an operator's spacing should?

1 Answer 1


Moving left the second \setminus should not be done with \hspace{-1ex}, but with \mspace. The whole symbol should be made into a \mathbin.


Full example:




$A\dblsetminus B$


enter image description here

Adjust the spacing to suit. Exercise: why {\setminus}?

  • Right: why {\setminus}?
    – GuM
    Commented Mar 20, 2018 at 13:49
  • @GuM Better safe than sorry
    – egreg
    Commented Mar 20, 2018 at 16:06
  • So the answer to the exercise is "Should anybody want to try this with three slashes…”.
    – GuM
    Commented Mar 20, 2018 at 18:37
  • @GuM Bingo! :-)
    – egreg
    Commented Mar 20, 2018 at 18:43

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .