[Tex/LaTex] Why does \big\setminus not work

bigdelimmath-mode

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?

Best Answer

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.