11

The two macros \setminus and \backslash both produce a backslash in mathmode that is customarily used to denote, well, set differences: $A\setminus B$, $A\backslash B$.

For \backslash there are also a \bigger versions, e.g., \big\backslash, whereas \big\setminus creates an error.

Why is that so? Should we not consider this a bug in \setminus?

  • 3
    No operation symbol grows with \big; why should \setminus behave differently? – egreg Dec 8 '15 at 15:45
  • @egreg How about \big/ or \Bigg/? – Steven B. Segletes Dec 8 '15 at 15:47
  • @StevenB.Segletes that's a delimiter (non zero delcode) – David Carlisle Dec 8 '15 at 15:52
  • 1
    OK, TeXnically, the question is answered. Typographically, is it a bad idea to let the set-difference operator scale up? – Sebastian Dec 8 '15 at 17:51
9

The difference is in their definition in fontmath.ltx:

\DeclareMathDelimiter{\backslash}    % for double coset G\backslash H
   {\mathord}{symbols}{"6E}{largesymbols}{"0F}

\DeclareMathSymbol{\setminus}{\mathbin}{symbols}{"6E}

or, in plain.tex,

\def\backslash{\delimiter"26E30F } % for double coset G\backslash H

\mathchardef\setminus="226E % for set difference A\setminus B

Note that if you do texdef -t latex backslash and texdef -t latex setminus you get

\backslash:
macro:->\delimiter "026E30F 

\setminus:
\mathchar"226E

so there's no real difference between the two cases.

There's a substantial definition between a delimiter and a mathchar. The former type will honor \big and friends or \left and \right, the latter won't.

Note that \backslash is defined to be class 0 (ordinary symbol) when used alone, whereas \setminus has class 2 (binary operation symbol); this will affect spacing.

If you need a “bigger \setminus” you can do

\mathbin{\big\backslash}

but \big\setminus would be like \big+ that's not going to work, because \big needs a delimiter after it, that is, either a character with a nonzero \delcode or a macro expanding to \delimiter<27 bit number>.

The usage of \setminus is very different from / that, traditionally, has no space on either side and so TeX treats it as an ordinary symbol, also assigning it a nonzero \delcode

\DeclareMathDelimiter{/}{\mathord}{operators}{"2F}{largesymbols}{"0E}
\DeclareMathSymbol{/}{\mathord}{letters}{"3D}

in LaTeX, and

\mathcode`\/="013D
\delcode`\/="02F30E

in plain TeX.

|improve this answer|||||
  • 1
    +1 for the workaround, \mathbin{\big\backslash} – Steven B. Segletes Dec 8 '15 at 15:58

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.